Skip to content

Commit

Permalink
refactor: migrate to citty (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Jul 5, 2023
1 parent 914b3db commit 8c0fc95
Show file tree
Hide file tree
Showing 37 changed files with 1,253 additions and 1,285 deletions.
8 changes: 7 additions & 1 deletion bin/nuxi.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
#!/usr/bin/env node
import('../dist/cli-wrapper.mjs')

import { runMain } from 'citty'
import { main } from '../dist/index.mjs'

process._startTime = Date.now()

runMain(main)
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineBuildConfig({
exportConditions: ['production', 'node'] as any,
},
},
entries: ['src/cli', 'src/cli-run', 'src/cli-wrapper', 'src/index'],
entries: ['src/index'],
externals: [
'@nuxt/kit',
'@nuxt/schema',
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.mjs",
"./cli": "./bin/nuxi.mjs"
".": "./dist/index.mjs"
},
"types": "./dist/index.d.ts",
"bin": {
Expand All @@ -22,32 +21,34 @@
"scripts": {
"build": "unbuild",
"build:stub": "unbuild --stub",
"nuxi-ng": "JITI_ESM_RESOLVE=1 jiti ./src/cli-run.ts",
"dev": "pnpm run nuxi-ng dev ./playground",
"dev": "node ./scripts/nuxi.mjs dev ./playground",
"lint": "eslint . && prettier --check src",
"lint:fix": "eslint --fix . && prettier --write src",
"nuxi": "node ./scripts/nuxi.mjs",
"nuxi-ng": "node ./scripts/nuxi.mjs",
"prepack": "unbuild",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm build && pnpm test:dist",
"test:dist": "node ./bin/nuxi.mjs info"
"test:dist": "node ./bin/nuxi.mjs info ./playground"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"@nuxt/kit": "^3.6.1",
"@nuxt/schema": "^3.6.1",
"@nuxt/kit": "^3.6.2",
"@nuxt/schema": "^3.6.2",
"@types/clear": "^0.1.2",
"@types/flat": "^5.0.2",
"@types/http-proxy": "^1.17.11",
"@types/mri": "^1.1.1",
"@types/node": "^20.3.3",
"@types/node": "^20.4.0",
"@types/semver": "^7.5.0",
"c12": "^1.4.2",
"changelogen": "^0.5.3",
"changelogen": "^0.5.4",
"chokidar": "^3.5.3",
"citty": "^0.1.2",
"clear": "^0.1.0",
"clipboardy": "^3.0.0",
"colorette": "^2.0.20",
"consola": "^3.2.2",
"consola": "^3.2.3",
"deep-object-diff": "^1.1.9",
"destr": "^2.0.0",
"eslint": "^8.44.0",
Expand All @@ -58,12 +59,12 @@
"giget": "^1.1.2",
"h3": "^1.7.1",
"http-proxy": "^1.18.1",
"jiti": "^1.18.2",
"jiti": "^1.19.1",
"listhen": "^1.0.4",
"magicast": "^0.2.9",
"mlly": "^1.4.0",
"mri": "^1.2.0",
"nuxt": "^3.6.1",
"nuxt": "^3.6.2",
"nypm": "^0.2.2",
"ofetch": "^1.1.1",
"pathe": "^1.1.1",
Expand Down
Loading

0 comments on commit 8c0fc95

Please sign in to comment.