Skip to content

Commit

Permalink
refactor: rename nuxt-cli to nuxi (nuxt#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Aug 10, 2021
1 parent cbce777 commit 084b4e2
Show file tree
Hide file tree
Showing 38 changed files with 57 additions and 55 deletions.
4 changes: 2 additions & 2 deletions examples/async-data-setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/async-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server"
}
}
4 changes: 2 additions & 2 deletions examples/pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-layouts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
4 changes: 2 additions & 2 deletions examples/with-vue-content-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"vue-content-loader": "^2.0.0"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"build": "FORCE_COLOR=1 lerna run prepack --stream --no-prefix",
"stub": "lerna run prepack -- --stub",
"release": "yarn && yarn lint && FORCE_COLOR=1 lerna publish -m \"chore: release\" && yarn stub",
"docs": "yarn nu dev docs",
"nu": "./node_modules/.bin/nu",
"play": "yarn run nu dev playground",
"docs": "yarn nuxt dev docs",
"nuxi": "./node_modules/.bin/nuxi",
"nu": "./node_modules/.bin/nuxi",
"nuxt": "./node_modules/.bin/nuxi",
"play": "yarn run nuxt dev playground",
"example": "yarn workspace example-$0 dev",
"example:build": "yarn workspace example-$0 build",
"lint": "eslint --ext .vue,.ts,.js .",
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/types/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface NuxtHooks {
'config': (options: NuxtConfig) => HookResult
'run:before': (options: { argv: string[], cmd: { name: string, usage: string, description: string, options: Record<string, any> }, rootDir: string }) => HookResult

// nuxt-cli
// nuxi
'prepare:types': (options: { references: TSReference[], declarations: string[] }) => HookResult

// @nuxt/core
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions packages/cli/package.json → packages/nuxi/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "nuxt-cli",
"name": "nuxi",
"version": "0.3.8",
"repository": "nuxt/framework",
"license": "MIT",
"main": "./dist/index.js",
"bin": {
"nu": "./bin/nuxt.js",
"nuxt": "./bin/nuxt.js",
"nuxt-cli": "./bin/nuxt.js"
"nu": "./bin/nuxi.js",
"nuxi": "./bin/nuxi.js",
"nuxt": "./bin/nuxi.js"
},
"scripts": {
"prepack": "unbuild"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { defineNuxtCommand } from './index'
export default defineNuxtCommand({
meta: {
name: 'build',
usage: 'nu build [rootDir]',
usage: 'npx nuxi build [rootDir]',
description: 'Build nuxt for production deployment'
},
async invoke (args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { defineNuxtCommand } from './index'
export default defineNuxtCommand({
meta: {
name: 'dev',
usage: 'nu dev [rootDir] [--clipboard] [--open, -o]',
usage: 'npx nuxi dev [rootDir] [--clipboard] [--open, -o]',
description: 'Run nuxt development server'
},
async invoke (args) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { defineNuxtCommand } from './index'
export default defineNuxtCommand({
meta: {
name: 'prepare',
usage: 'nu prepare',
usage: 'npx nuxi prepare',
description: 'Prepare nuxt for development/build'
},
async invoke (args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { commands, defineNuxtCommand } from './index'
export default defineNuxtCommand({
meta: {
name: 'help',
usage: 'nu help',
usage: 'nuxt help',
description: 'Show help'
},
invoke (_args) {
const sections: string[] = []

sections.push(`Usage: ${cyan(`nu ${Object.keys(commands).join('|')} [args]`)}`)
sections.push(`Usage: ${cyan(`npx nuxi ${Object.keys(commands).join('|')} [args]`)}`)

console.log(sections.join('\n\n') + '\n')
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts → packages/nuxi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function _main () {
}

if (command === 'usage') {
console.log(`\nUsage: ${cyan(`nu ${Object.keys(commands).join('|')} [args]`)}\n`)
console.log(`\nUsage: ${cyan(`npx nuxi ${Object.keys(commands).join('|')} [args]`)}\n`)
process.exit(1)
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function showHelp (meta?) {
sections.push(magenta('⋮ ') + meta.description)
}

sections.push(`Use ${cyan('nu [command] --help')} to see help for each command`)
sections.push(`Use ${cyan('npx nuxi [command] --help')} to see help for each command`)

console.log(sections.join('\n\n') + '\n')
}
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/nuxt3/bin/nuxi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('nuxi/bin/nuxi')
2 changes: 0 additions & 2 deletions packages/nuxt3/bin/nuxt.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/nuxt3/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default defineBuildConfig({
'@nuxt/app',
'@nuxt/vite-builder',
'@nuxt/webpack-builder',
'nuxt-cli'
'nuxi'
]
})
8 changes: 4 additions & 4 deletions packages/nuxt3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"license": "MIT",
"main": "./dist/index.js",
"bin": {
"nu": "./bin/nuxt.js",
"nuxt": "./bin/nuxt.js",
"nuxt-cli": "./bin/nuxt.js"
"nu": "./bin/nuxi.js",
"nuxi": "./bin/nuxi.js",
"nuxt": "./bin/nuxi.js"
},
"files": [
"bin",
Expand Down Expand Up @@ -37,7 +37,7 @@
"hookable": "^4.4.1",
"ignore": "^5.1.8",
"lodash": "^4.17.21",
"nuxt-cli": "^0.3.8",
"nuxi": "^0.3.8",
"scule": "^0.2.1",
"ufo": "^0.7.7",
"upath": "^2.0.1",
Expand Down
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"nuxt3": "latest"
},
"scripts": {
"dev": "nu dev",
"build": "nu build",
"dev": "nuxt dev",
"build": "nuxt build",
"start": "node .output/server/index.mjs"
}
}
2 changes: 1 addition & 1 deletion scripts/nu
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env node
require('../packages/cli/bin/nuxt')
require('../packages/nuxi/bin/nuxi')
2 changes: 1 addition & 1 deletion test/fixtures/compat/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ __metadata:
upath: ^2.0.1
wrap-ansi: ^7.0.0
bin:
nuxt-cli: bin/nuxt-cli.js
nuxi: bin/nuxi.js
checksum: 0ce9114dd4887d629afe35712bd90e83092715453db53f3704f561a2e888b423cd60c25ef72a409c37f27d1c8ec242bc971ea7c4fc7c286246771fdfb5bea0b5
languageName: node
linkType: hard
Expand Down
2 changes: 1 addition & 1 deletion test/presets/_tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function setupTest (preset) {
it('nitro build', async () => {
const nuxtCLI = isCompat
? resolve(ctx.rootDir, 'node_modules/nuxt/bin/nuxt.js')
: resolveWorkspace('packages/cli/bin/nuxt.js')
: resolveWorkspace('packages/nuxi/bin/nuxi.js')

await execa('node', [nuxtCLI, 'build', ctx.rootDir], {
env: {
Expand Down
2 changes: 1 addition & 1 deletion test/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function fixtureDir (name) {
}

export async function execNuxtCLI (args, opts) {
const nuxtCLI = resolveWorkspace('packages/cli/bin/nuxt.js')
const nuxtCLI = resolveWorkspace('packages/nuxi/bin/nuxi.js')
await execa('node', [nuxtCLI, ...args], opts)
}

Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8691,9 +8691,9 @@ fsevents@~2.3.2:
languageName: node
linkType: hard

"nuxt-cli@^0.3.8, nuxt-cli@workspace:packages/cli":
"nuxi@^0.3.8, nuxi@workspace:packages/nuxi":
version: 0.0.0-use.local
resolution: "nuxt-cli@workspace:packages/cli"
resolution: "nuxi@workspace:packages/nuxi"
dependencies:
"@nuxt/design": 0.0.5
"@nuxt/kit": ^0.6.4
Expand All @@ -8716,9 +8716,9 @@ fsevents@~2.3.2:
fsevents:
optional: true
bin:
nu: ./bin/nuxt.js
nuxt: ./bin/nuxt.js
nuxt-cli: ./bin/nuxt.js
nu: ./bin/nuxi.js
nuxi: ./bin/nuxi.js
nuxt: ./bin/nuxi.js
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -8785,16 +8785,16 @@ fsevents@~2.3.2:
hookable: ^4.4.1
ignore: ^5.1.8
lodash: ^4.17.21
nuxt-cli: ^0.3.8
nuxi: ^0.3.8
scule: ^0.2.1
ufo: ^0.7.7
unbuild: ^0.4.2
upath: ^2.0.1
vue: 3.2.1
bin:
nu: ./bin/nuxt.js
nuxt: ./bin/nuxt.js
nuxt-cli: ./bin/nuxt.js
nu: ./bin/nuxi.js
nuxi: ./bin/nuxi.js
nuxt: ./bin/nuxi.js
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 084b4e2

Please sign in to comment.