Skip to content

npm package files: follow best practices, include only distributable source#541

Merged
pethers merged 4 commits intomainfrom
copilot/update-to-es2025-config
Apr 1, 2026
Merged

npm package files: follow best practices, include only distributable source#541
pethers merged 4 commits intomainfrom
copilot/update-to-es2025-config

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

The files field was shipping everything—test files, dev configs, nonexistent LICENSE—instead of just the distributable source, types, and modules.

Changes

  • Scoped source globs with explicit test exclusions:
    "files": [
      "src/**/*.ts",
      "src/**/*.tsx",
      "src/**/*.css",
      "src/**/*.d.ts",
      "!src/**/*.test.ts",
      "!src/**/*.test.tsx",
      "!src/test/",
      "public/",
      "index.html",
      "tsconfig.json",
      "tsconfig.app.json",
      "tsconfig.node.json",
      "vite.config.ts",
      "README.md"
    ]
  • Removed dev-only configs from package: vitest.config.ts, eslint.config.js, typedoc.json, tsconfig.test.json
  • Removed nonexistent LICENSE entry flagged in review
  • Kept consumer-needed build configs: tsconfig solution/app/node + vite.config.ts (game template, not a library)

Package: 33 files (201 kB) → 17 files (102 kB).

- Update target/lib from ES2024 to ES2025 in all tsconfig files
- Update ESLint ecmaVersion from 2020 to 2025
- Add "files" field to package.json for npm package inclusion
- Install typedoc and create typedoc.json with ISMS/security references
- Add docs:api script for API documentation generation
- Add docs/api to .gitignore (generated output)
- Update README.md features and quick start section

Agent-Logs-Url: https://github.com/Hack23/game/sessions/866452d1-299e-4b13-9ff6-04a3d57ac1cd

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added documentation Documentation updates dependencies Dependency updates infrastructure CI/CD and build infrastructure config Configuration changes testing Testing improvements e2e End-to-end testing labels Mar 31, 2026
Copilot AI changed the title [WIP] Update project to ES2025 configuration and documentation Update to ES2025, add TypeDoc API docs, improve npm package files Mar 31, 2026
Copilot AI requested a review from pethers March 31, 2026 23:34
@pethers pethers marked this pull request as ready for review March 31, 2026 23:42
@pethers pethers requested a review from Copilot March 31, 2026 23:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project’s TypeScript/ESLint compilation targets to ES2025 and introduces TypeDoc-based API documentation generation, along with expanding the npm package “files” whitelist to include the intended source/config artifacts.

Changes:

  • Bump TypeScript target/lib across tsconfig variants from ES2024 → ES2025 and update ESLint ecmaVersion to 2025.
  • Add TypeDoc configuration (typedoc.json) and a docs:api script, and document it in the README.
  • Add docs/api to .gitignore and expand package.json files whitelist.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
typedoc.json Adds TypeDoc configuration for generating API docs into docs/api with ISMS-related links/documents.
tsconfig.json Updates base TS target/lib to ES2025.
tsconfig.app.json Updates app TS target/lib to ES2025.
tsconfig.node.json Updates node/build TS target/lib to ES2025.
tsconfig.test.json Updates test TS target/lib to ES2025.
cypress/tsconfig.json Updates Cypress TS target/lib to ES2025.
eslint.config.js Updates ESLint parsing target to ecmaVersion: 2025.
README.md Notes ES2025 targeting and documents npm run docs:api; adds TypeDoc to feature list.
package.json Adds docs:api script, adds TypeDoc devDependency, and introduces an npm files whitelist.
package-lock.json Locks TypeDoc and its transitive dependencies.
.gitignore Ignores generated TypeDoc output directory docs/api.

Comment thread package.json
Comment on lines +22 to 36
"files": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.css",
"src/**/*.d.ts",
"public/",
"index.html",
"tsconfig.json",
"tsconfig.app.json",
"tsconfig.node.json",
"vite.config.ts",
"README.md",
"LICENSE"
],
"dependencies": {
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The npm files whitelist includes LICENSE, but this repository currently has no LICENSE (or LICENSE.md) file. That means npm pack/publish won’t include a license file as intended; either add the license file to the repo (and keep it in files) or remove/rename the entry to match the actual filename.

Suggested change
"files": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.css",
"src/**/*.d.ts",
"public/",
"index.html",
"tsconfig.json",
"tsconfig.app.json",
"tsconfig.node.json",
"vite.config.ts",
"README.md",
"LICENSE"
],
"dependencies": {
"files": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.css",
"src/**/*.d.ts",
"public/",
"index.html",
"tsconfig.json",
"tsconfig.app.json",
"tsconfig.node.json",
"vite.config.ts",
"README.md"
],
"dependencies": {

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines +22 to +32
"files": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.css",
"src/**/*.d.ts",
"public/",
"index.html",
"tsconfig.json",
"tsconfig.app.json",
"tsconfig.node.json",
"vite.config.ts",
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says the npm package includes the “tsconfig files”, but the files whitelist only includes tsconfig.json/app/node (and not tsconfig.test.json or cypress/tsconfig.json). Either add the missing tsconfig files to the whitelist or adjust the description/intent so consumers aren’t surprised.

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Mar 31, 2026

@copilot apply changes based on the comments in this thread analyse. wanted npm package to contain all types, code and modules following npm package best practices.

…ent LICENSE

- Use src/ directory glob to include all types, code, tests, assets, and CSS
- Add missing tsconfig.test.json, vitest.config.ts, eslint.config.js, typedoc.json
- Remove LICENSE entry (file does not exist in repo)
- Verified with npm pack --dry-run: 33 files included

Agent-Logs-Url: https://github.com/Hack23/game/sessions/52bbe110-8422-481f-bdd5-62dd2d88b203

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot apply changes based on the comments in this thread analyse. wanted npm package to contain all types, co...

Fixed in e56df58. The files field now uses src/ directory glob to include all types, code, tests, assets, and CSS. Added missing configs (tsconfig.test.json, vitest.config.ts, eslint.config.js, typedoc.json) and removed the nonexistent LICENSE entry. Verified with npm pack --dry-run — 33 files included covering all source modules and configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated no new comments.

- Use specific globs (src/**/*.ts, src/**/*.tsx, src/**/*.css, src/**/*.d.ts)
- Exclude test files (!src/**/*.test.ts, !src/**/*.test.tsx, !src/test/)
- Include only consumer-needed build configs (tsconfig.json/app/node, vite.config.ts)
- Remove dev-only configs (vitest.config.ts, eslint.config.js, typedoc.json, tsconfig.test.json)
- Remove non-existent LICENSE entry
- Package reduced from 33 to 17 files (102.2 kB unpacked)

Agent-Logs-Url: https://github.com/Hack23/game/sessions/6a4b0030-2b5a-4a0d-b2d0-fcf116b22497

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 1, 2026

Updated in 4b80202. The files field now follows npm best practices:

Included (17 files, 102 kB):

  • Source code: src/**/*.ts, src/**/*.tsx (with !src/**/*.test.ts, !src/**/*.test.tsx, !src/test/ exclusions)
  • Type declarations: src/**/*.d.ts
  • CSS modules: src/**/*.css
  • Public assets: public/
  • Entry: index.html
  • Build configs: tsconfig.json, tsconfig.app.json, tsconfig.node.json, vite.config.ts
  • Documentation: README.md

Excluded:

  • Test files (*.test.ts, *.test.tsx, src/test/)
  • Dev-only configs (vitest.config.ts, eslint.config.js, typedoc.json, tsconfig.test.json)
  • Non-existent LICENSE

Copilot AI changed the title Update to ES2025, add TypeDoc API docs, improve npm package files npm package files: follow best practices, include only distributable source Apr 1, 2026
@pethers pethers merged commit ca95411 into main Apr 1, 2026
12 checks passed
@pethers pethers deleted the copilot/update-to-es2025-config branch April 1, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration changes dependencies Dependency updates documentation Documentation updates e2e End-to-end testing infrastructure CI/CD and build infrastructure testing Testing improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants