Skip to content

Commit

Permalink
Merge pull request #22 from withastro/fix/modernize-package
Browse files Browse the repository at this point in the history
fix: modernize package
  • Loading branch information
Princesseuh authored Sep 12, 2023
2 parents 16d5319 + fbb3922 commit 5c39179
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 65 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-icons-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/cli-kit": minor
---

Fix types not working properly under moduleResolution: 'node16'
79 changes: 39 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
{
"name": "@astrojs/cli-kit",
"type": "module",
"version": "0.2.5",
"license": "MIT",
"types": "./dist/index.d.ts",
"packageManager": "[email protected]",
"exports": {
".": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./utils": {
"default": "./dist/utils/index.js",
"types": "./dist/utils/index.d.ts"
}
"name": "@astrojs/cli-kit",
"type": "module",
"version": "0.2.5",
"license": "MIT",
"types": "./dist/index.d.ts",
"packageManager": "[email protected]",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"files": [
"dist",
"types.d.ts",
"utils.d.ts"
],
"repository": {
"type": "git",
"url": "https://github.com/withastro/cli-kit.git"
},
"scripts": {
"build": "tsc -p ."
},
"dependencies": {
"chalk": "^5.0.1",
"log-update": "^5.0.1",
"sisteransi": "^1.0.5"
},
"devDependencies": {
"@changesets/cli": "^2.24.4",
"@types/node": "^18.7.16",
"typescript": "^4.8.3"
},
"volta": {
"node": "18.9.0",
"npm": "8.19.1"
"./utils": {
"types": "./dist/utils/index.d.ts",
"default": "./dist/utils/index.js"
}
},
"files": [
"dist",
"types.d.ts",
"utils.d.ts"
],
"repository": {
"type": "git",
"url": "https://github.com/withastro/cli-kit.git"
},
"scripts": {
"build": "tsc -p ."
},
"dependencies": {
"chalk": "^5.0.1",
"log-update": "^5.0.1",
"sisteransi": "^1.0.5"
},
"devDependencies": {
"@changesets/cli": "^2.24.4",
"@types/node": "^18.7.16",
"typescript": "^5.2.2"
},
"engines": {
"node": ">=18.14.1"
}
}
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/prompt/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const prompts = {
multiselect: (args) => toPrompt("MultiselectPrompt", args),
};

/** @type {import('../../types').default} */
/** @type {import('../../types.js').default} */
export default async function prompt(
questions = [],
{ onSubmit = noop, onCancel = () => process.exit(0), stdin = process.stdin, stdout = process.stdout } = {}
Expand Down
28 changes: 10 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"include": ["src"],
"compilerOptions": {
"strict": true,
"outDir": "./dist",
"declaration": true,
"declarationDir": "./dist",
// Enable top-level await, and other modern ESM features.
"target": "ESNext",
"module": "ESNext",
// Enable node-style module resolution, for things like npm package imports.
"moduleResolution": "node",
// Enable JSON imports.
"resolveJsonModule": true,
// Enable stricter transpilation for better output.
"isolatedModules": true,
// Report an error when importing a file using a casing different from the casing on disk.
"forceConsistentCasingInFileNames": true,
// Properly support importing CJS modules in ESM
"strict": true,
"allowJs": true,
"moduleResolution": "Node16",
"target": "ES2022",
"module": "Node16",
"esModuleInterop": true,
"allowJs": true
},
"include": ["src"]
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"outDir": "dist"
}
}
2 changes: 1 addition & 1 deletion utils.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/utils/index'
export * from './dist/utils/index.d.js';

0 comments on commit 5c39179

Please sign in to comment.