fix(distributions): add bin to all distributions (#4336)

This commit is contained in:
Pooya Parsa 2018-11-16 00:18:30 +03:30 committed by GitHub
parent ae8dc96669
commit c9459e7aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 6 deletions

View File

@ -24,4 +24,4 @@ register({
] ]
}) })
require('@nuxt/cli/bin/nuxt.js') require('@nuxt/cli').run()

View File

@ -42,9 +42,7 @@
"files": [ "files": [
"bin" "bin"
], ],
"bin": { "bin": "bin/nuxt-legacy.js",
"nuxt-legacy": "bin/nuxt-legacy.js"
},
"dependencies": { "dependencies": {
"@babel/core": "^7.1.6", "@babel/core": "^7.1.6",
"@babel/polyfill": "^7.0.0", "@babel/polyfill": "^7.0.0",

View File

@ -0,0 +1,5 @@
#!/usr/bin/env node
const { name } = require('../package.json')
const isEdge = name.indexOf('-edge') !== -1
const cli = require(isEdge ? '@nuxt/cli-edge' : '@nuxt/cli')
cli.run()

View File

@ -40,9 +40,11 @@
} }
], ],
"files": [ "files": [
"bin",
"dist" "dist"
], ],
"main": "dist/nuxt-start.js", "main": "dist/nuxt-start.js",
"bin": "bin/nuxt-start.js",
"dependencies": { "dependencies": {
"@nuxt/cli": "^2.2.0", "@nuxt/cli": "^2.2.0",
"@nuxt/common": "^2.2.0", "@nuxt/common": "^2.2.0",

5
distributions/nuxt/bin/nuxt.js Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env node
const { name } = require('../package.json')
const isEdge = name.indexOf('-edge') !== -1
const cli = require(isEdge ? '@nuxt/cli-edge' : '@nuxt/cli')
cli.run()

View File

@ -39,9 +39,11 @@
} }
], ],
"files": [ "files": [
"bin",
"dist" "dist"
], ],
"main": "dist/nuxt.js", "main": "dist/nuxt.js",
"bin": "bin/nuxt.js",
"scripts": { "scripts": {
"postinstall": "opencollective || exit 0" "postinstall": "opencollective || exit 0"
}, },

View File

@ -9,7 +9,7 @@
], ],
"main": "dist/cli.js", "main": "dist/cli.js",
"bin": { "bin": {
"nuxt": "bin/nuxt.js" "nuxt-cli": "bin/nuxt-cli.js"
}, },
"dependencies": { "dependencies": {
"@nuxt/config": "^2.2.0", "@nuxt/config": "^2.2.0",

View File

@ -8,7 +8,7 @@ const rootDir = resolve(__dirname, '..', 'fixtures/cli')
const url = route => 'http://localhost:' + port + route const url = route => 'http://localhost:' + port + route
const nuxtBin = resolve(__dirname, '../../packages/cli/bin/nuxt.js') const nuxtBin = resolve(__dirname, '../../packages/cli/bin/nuxt-cli.js')
const spawnNuxt = (command, opts) => spawn(nuxtBin, [command, rootDir], opts) const spawnNuxt = (command, opts) => spawn(nuxtBin, [command, rootDir], opts)
const close = async (nuxtInt) => { const close = async (nuxtInt) => {