Skip to content

develop#67

Merged
ienaga merged 2 commits into
mainfrom
develop
Apr 2, 2026
Merged

develop#67
ienaga merged 2 commits into
mainfrom
develop

Conversation

@ienaga

@ienaga ienaga commented Apr 2, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown

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 migrates the CLI codebase to native ESM, aligning TypeScript output and runtime behavior with modern Node.js module semantics.

Changes:

  • Switch src/index.ts from CommonJS require usage to ESM import, including JSON import attributes and ESM-safe module resolution (createRequire).
  • Update package.json to mark the package as ESM ("type": "module") and move type packages into devDependencies.
  • Adjust tsconfig.json to include Node.js ambient types.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
tsconfig.json Adds Node ambient types to improve TS type checking for Node globals/APIs.
src/index.ts Converts module loading to ESM imports and removes require usage in favor of ESM-compatible patterns.
package.json Declares ESM package type and reorganizes @types/* dependencies under devDependencies.
package-lock.json Mirrors dependency reclassification and adds the newly declared @types/* dev dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts
console.log();
console.log(`Installing template: ${pc.green(template)}`);

const requireFromRoot = createRequire(`${root}/package.json`);

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

createRequire is being called with a path built via string concatenation (${root}/package.json). Since root comes from path.resolve() and may contain platform-specific separators (notably on Windows), using path.join(root, "package.json") (or a file URL via pathToFileURL) would make this more robust and consistent with the other path handling in this function.

Suggested change
const requireFromRoot = createRequire(`${root}/package.json`);
const requireFromRoot = createRequire(path.join(root, "package.json"));

Copilot uses AI. Check for mistakes.
@ienaga ienaga merged commit da43180 into main Apr 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants