npm package files: follow best practices, include only distributable source#541
npm package files: follow best practices, include only distributable source#541
Conversation
- 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>
There was a problem hiding this comment.
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/libacross tsconfig variants from ES2024 → ES2025 and update ESLintecmaVersionto 2025. - Add TypeDoc configuration (
typedoc.json) and adocs:apiscript, and document it in the README. - Add
docs/apito.gitignoreand expandpackage.jsonfileswhitelist.
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. |
| "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": { |
There was a problem hiding this comment.
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.
| "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": { |
| "files": [ | ||
| "src/**/*.ts", | ||
| "src/**/*.tsx", | ||
| "src/**/*.css", | ||
| "src/**/*.d.ts", | ||
| "public/", | ||
| "index.html", | ||
| "tsconfig.json", | ||
| "tsconfig.app.json", | ||
| "tsconfig.node.json", | ||
| "vite.config.ts", |
There was a problem hiding this comment.
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 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>
Fixed in e56df58. The |
- 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>
|
Updated in 4b80202. The Included (17 files, 102 kB):
Excluded:
|
The
filesfield was shipping everything—test files, dev configs, nonexistent LICENSE—instead of just the distributable source, types, and modules.Changes
vitest.config.ts,eslint.config.js,typedoc.json,tsconfig.test.jsonLICENSEentry flagged in reviewPackage: 33 files (201 kB) → 17 files (102 kB).