Skip to content

Migrated npm package to Typescript.#242

Merged
azchohfi merged 1 commit intomainfrom
alzollin/typescript
Jan 21, 2026
Merged

Migrated npm package to Typescript.#242
azchohfi merged 1 commit intomainfrom
alzollin/typescript

Conversation

@azchohfi
Copy link
Copy Markdown
Collaborator

Fixes #240 and #239

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 pull request migrates the npm package from JavaScript to TypeScript, adding comprehensive type safety and modern development tooling. The migration involves converting all JavaScript modules to TypeScript, setting up TypeScript compilation, and adding ESLint and Prettier for code quality.

Changes:

  • Converted all JavaScript source files to TypeScript with proper type annotations
  • Added TypeScript configuration with strict type checking enabled
  • Integrated ESLint with TypeScript plugin and Prettier for code formatting
  • Updated package.json with new build pipeline and tooling scripts

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.json TypeScript compiler configuration with strict mode and source maps
src/winapp-cli-utils.ts Converted CLI utilities with typed interfaces for options and results
src/msix-utils.ts Converted MSIX utilities with proper type definitions
src/utils.ts Converted project root utility with type safety
src/winapp-path-utils.ts Converted path utilities with typed functions
src/dependency-utils.ts Converted dependency installation utilities with typed functions
src/cpp-addon-utils.ts Converted C++ addon generator with typed options and results
src/cs-addon-utils.ts Converted C# addon generator with typed options and results
src/cli.ts Converted CLI entry point with typed argument parsing
src/buildtools-utils.ts Converted build tools utilities with proper type annotations
src/index.ts New typed main entry point with proper exports
package.json Updated with TypeScript dependencies and new build scripts
eslint.config.mjs ESLint configuration for TypeScript with recommended rules
.prettierrc Prettier formatting configuration
scripts/package-npm.ps1 Updated packaging script to compile TypeScript
Files not reviewed (1)
  • src/winapp-npm/package-lock.json: Language not supported
Comments suppressed due to low confidence (4)

src/winapp-npm/src/cpp-addon-utils.ts:112

  • The template directory path needs to be adjusted for the TypeScript compilation structure. Since TypeScript files are compiled from src/ to dist/, the template directory should be ../addon-template (going up from dist/ to the package root), not ./addon-template.
    src/winapp-npm/src/cs-addon-utils.ts:200
  • The template directory path needs to be adjusted for the TypeScript compilation structure. Since TypeScript files are compiled from src/ to dist/, the template directory should be ../cs-addon-template (going up from dist/ to the package root), not ./cs-addon-template.
    src/winapp-npm/src/cli.ts:85
  • The package.json path resolution uses require.resolve('../package.json') which may not work correctly with the new TypeScript compilation structure. When the code is compiled to dist/, the relative path should still be ../package.json to reach the root package.json, but this might fail if Node's module resolution doesn't find it. Consider using a more explicit path like path.join(__dirname, '../package.json') or verify this works in the compiled output.
    src/winapp-npm/src/cs-addon-utils.ts:297
  • This use of variable 'verbose' always evaluates to false.

Comment thread src/winapp-npm/package.json
@azchohfi
Copy link
Copy Markdown
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 21, 2026

@azchohfi I've opened a new pull request, #243, to work on those changes. Once the pull request is ready, I'll request review from you.

@azchohfi azchohfi merged commit b495edf into main Jan 21, 2026
13 checks passed
@azchohfi azchohfi deleted the alzollin/typescript branch January 21, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to typescript for npm package

4 participants