mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
chore: switch to berry (#50)
This commit is contained in:
parent
5d5183ee82
commit
ef2f9993cb
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -25,21 +25,17 @@ jobs:
|
|||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
id: yarn-cache
|
id: yarn-cache
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: .yarn/cache
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-berry-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: yarn --frozen-lockfile --non-interactive
|
run: yarn --immutable
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: yarn lint
|
run: yarn lint
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,6 +14,9 @@ package-lock.json
|
|||||||
.tmp
|
.tmp
|
||||||
.cache
|
.cache
|
||||||
|
|
||||||
|
# Yarn
|
||||||
|
.yarn
|
||||||
|
|
||||||
# Generated dirs
|
# Generated dirs
|
||||||
dist
|
dist
|
||||||
.nuxt*
|
.nuxt*
|
||||||
|
55
.yarn/releases/yarn-berry.cjs
vendored
Executable file
55
.yarn/releases/yarn-berry.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
2
.yarnrc.yml
Normal file
2
.yarnrc.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
yarnPath: ".yarn/releases/yarn-berry.cjs"
|
||||||
|
nodeLinker: node-modules
|
16
package.json
16
package.json
@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxt-framework",
|
"name": "nuxt-framework",
|
||||||
"private": "true",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"link": "lerna link",
|
"link": "lerna link",
|
||||||
"build": "yarn -s workspaces run build",
|
"build": "jiti ./scripts/build-all",
|
||||||
"stub": "yarn -s build --stub",
|
"stub": "yarn build --stub",
|
||||||
"gentypes": "yarn -s --cwd packages/kit gentypes",
|
"gentypes": "yarn workspace @nuxt/kit jiti ./scripts/gentypes",
|
||||||
"play": "yarn -s nu dev playground",
|
"nu": "./node_modules/.bin/nu",
|
||||||
"lint": "yarn -s gentypes && eslint --ext .vue,.ts,.js .",
|
"play": "yarn run nu dev playground",
|
||||||
"test": "yarn -s lint",
|
"lint": "yarn gentypes && eslint --ext .vue,.ts,.js .",
|
||||||
"postinstall": "yarn -s stub"
|
"test": "yarn lint",
|
||||||
|
"postinstall": "yarn stub"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxtjs/eslint-config": "^6.0.0",
|
"@nuxtjs/eslint-config": "^6.0.0",
|
||||||
|
@ -9,10 +9,6 @@
|
|||||||
"dist",
|
"dist",
|
||||||
"meta.js"
|
"meta.js"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"prepublishOnly": "yarn build"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vueuse/head": "^0.5.1",
|
"@vueuse/head": "^0.5.1",
|
||||||
"hookable": "^4.4.1",
|
"hookable": "^4.4.1",
|
||||||
|
@ -8,11 +8,6 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"gentypes": "jiti ./scripts/gentypes",
|
|
||||||
"prepublishOnly": "yarn build && yarn gentypes"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"consola": "^2.15.3",
|
"consola": "^2.15.3",
|
||||||
"create-require": "^1.1.1",
|
"create-require": "^1.1.1",
|
||||||
@ -29,7 +24,7 @@
|
|||||||
"upath": "^2.0.1"
|
"upath": "^2.0.1"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"prebuild": "yarn -s gentypes",
|
"prebuild": "jiti ./scripts/gentypes",
|
||||||
"entries": {
|
"entries": {
|
||||||
"index": {
|
"index": {
|
||||||
"format": "cjs"
|
"format": "cjs"
|
||||||
|
@ -7,10 +7,6 @@
|
|||||||
"dist",
|
"dist",
|
||||||
"compat.js"
|
"compat.js"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"prepublishOnly": "yarn build"
|
|
||||||
},
|
|
||||||
"build": {
|
"build": {
|
||||||
"externals": [
|
"externals": [
|
||||||
"@nuxt/kit"
|
"@nuxt/kit"
|
||||||
@ -33,7 +29,8 @@
|
|||||||
"ora",
|
"ora",
|
||||||
"vue-bundle-renderer",
|
"vue-bundle-renderer",
|
||||||
"vue-server-renderer",
|
"vue-server-renderer",
|
||||||
"@vue/server-renderer"
|
"@vue/server-renderer",
|
||||||
|
"vue"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -85,6 +82,7 @@
|
|||||||
"table": "^6.0.9",
|
"table": "^6.0.9",
|
||||||
"ufo": "^0.6.10",
|
"ufo": "^0.6.10",
|
||||||
"upath": "^2.0.1",
|
"upath": "^2.0.1",
|
||||||
|
"vue": "3.0.11",
|
||||||
"vue-bundle-renderer": "^0.2.3",
|
"vue-bundle-renderer": "^0.2.3",
|
||||||
"vue-server-renderer": "^2.6.12"
|
"vue-server-renderer": "^2.6.12"
|
||||||
}
|
}
|
||||||
|
@ -4,23 +4,19 @@
|
|||||||
"repository": "nuxt/framework",
|
"repository": "nuxt/framework",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"bin": {
|
"bin": "./bin/nu.js",
|
||||||
"nu": "./bin/nu.js"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bin",
|
"bin",
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"prepublishOnly": "yarn build"
|
|
||||||
},
|
|
||||||
"build": {
|
"build": {
|
||||||
"externals": [
|
"externals": [
|
||||||
"nuxt3"
|
"nuxt3"
|
||||||
],
|
],
|
||||||
"entries": {
|
"entries": {
|
||||||
"index": { "format": "cjs" }
|
"index": {
|
||||||
|
"format": "cjs"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,11 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"prepublishOnly": "yarn build"
|
|
||||||
},
|
|
||||||
"build": {
|
"build": {
|
||||||
"entries": {
|
"entries": {
|
||||||
"index": { "format": "cjs" }
|
"index": {
|
||||||
|
"format": "cjs"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"@nuxt/app",
|
"@nuxt/app",
|
||||||
@ -22,11 +20,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/kit": "^0.1.0",
|
|
||||||
"@nuxt/app": "^0.1.0",
|
"@nuxt/app": "^0.1.0",
|
||||||
|
"@nuxt/kit": "^0.1.0",
|
||||||
|
"@nuxt/nitro": "^0.1.11",
|
||||||
"@nuxt/vite-builder": "^0.1.0",
|
"@nuxt/vite-builder": "^0.1.0",
|
||||||
"@nuxt/webpack-builder": "^0.1.0",
|
"@nuxt/webpack-builder": "^0.1.0",
|
||||||
"@nuxt/nitro": "^0.1.11",
|
|
||||||
"chokidar": "^3.5.1",
|
"chokidar": "^3.5.1",
|
||||||
"consola": "^2.15.3",
|
"consola": "^2.15.3",
|
||||||
"defu": "^3.2.2",
|
"defu": "^3.2.2",
|
||||||
@ -38,7 +36,5 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"scule": "^0.1.1",
|
"scule": "^0.1.1",
|
||||||
"ufo": "^0.6.10"
|
"ufo": "^0.6.10"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ export async function loadNuxt (loadOpts: LoadNuxtOptions = {}): Promise<Nuxt> {
|
|||||||
const { appDir } = await import('@nuxt/app/meta')
|
const { appDir } = await import('@nuxt/app/meta')
|
||||||
options.appDir = appDir
|
options.appDir = appDir
|
||||||
options._majorVersion = 3
|
options._majorVersion = 3
|
||||||
|
options.alias.vue = require.resolve('vue/dist/vue.esm-bundler.js')
|
||||||
|
|
||||||
const nuxt = createNuxt(options)
|
const nuxt = createNuxt(options)
|
||||||
|
|
||||||
|
@ -7,10 +7,6 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"prepublishOnly": "yarn build"
|
|
||||||
},
|
|
||||||
"build": {
|
"build": {
|
||||||
"entries": {
|
"entries": {
|
||||||
"index": {
|
"index": {
|
||||||
@ -18,14 +14,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"@nuxt/kit"
|
"@nuxt/kit",
|
||||||
|
"@vue/compiler-sfc",
|
||||||
|
"vue"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/kit": "^0.1.0",
|
"@nuxt/kit": "^0.1.0",
|
||||||
"@vitejs/plugin-vue": "^1.2.1",
|
"@vitejs/plugin-vue": "^1.2.1",
|
||||||
|
"@vue/compiler-sfc": "^3.0.11",
|
||||||
"consola": "^2.15.3",
|
"consola": "^2.15.3",
|
||||||
"fs-extra": "^9.1.0",
|
"fs-extra": "^9.1.0",
|
||||||
"vite": "^2.1.5"
|
"vite": "^2.1.5",
|
||||||
|
"vue": "3.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,6 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
|
||||||
"build": "jiti ../../scripts/build .",
|
|
||||||
"prepublishOnly": "yarn build"
|
|
||||||
},
|
|
||||||
"build": {
|
"build": {
|
||||||
"entries": {
|
"entries": {
|
||||||
"index": {
|
"index": {
|
||||||
@ -30,10 +26,13 @@
|
|||||||
"file-loader",
|
"file-loader",
|
||||||
"style-resources-loader",
|
"style-resources-loader",
|
||||||
"url-loader",
|
"url-loader",
|
||||||
"vue-style-loader"
|
"vue-style-loader",
|
||||||
|
"@babel/core",
|
||||||
|
"vue"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/core": "^7.13.14",
|
||||||
"@nuxt/friendly-errors-webpack-plugin": "^2.5.0",
|
"@nuxt/friendly-errors-webpack-plugin": "^2.5.0",
|
||||||
"@nuxt/kit": "^0.1.0",
|
"@nuxt/kit": "^0.1.0",
|
||||||
"@vue/babel-preset-jsx": "^1.2.4",
|
"@vue/babel-preset-jsx": "^1.2.4",
|
||||||
@ -58,6 +57,7 @@
|
|||||||
"time-fix-plugin": "^2.0.7",
|
"time-fix-plugin": "^2.0.7",
|
||||||
"ufo": "^0.6.10",
|
"ufo": "^0.6.10",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
|
"vue": "3.0.11",
|
||||||
"vue-loader": "^16.2.0",
|
"vue-loader": "^16.2.0",
|
||||||
"vue-style-loader": "^4.1.3",
|
"vue-style-loader": "^4.1.3",
|
||||||
"webpack": "^5.30.0",
|
"webpack": "^5.30.0",
|
||||||
|
18
scripts/build-all.ts
Normal file
18
scripts/build-all.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { readdir } from 'fs/promises'
|
||||||
|
import { resolve } from 'upath'
|
||||||
|
import { build } from './build'
|
||||||
|
|
||||||
|
async function main () {
|
||||||
|
const pkgsDir = resolve(__dirname, '../packages')
|
||||||
|
const pkgs = await readdir(pkgsDir)
|
||||||
|
|
||||||
|
const stub = process.argv.includes('--stub')
|
||||||
|
|
||||||
|
for (const pkg of pkgs) {
|
||||||
|
const rootDir = resolve(pkgsDir, pkg)
|
||||||
|
process.chdir(rootDir)
|
||||||
|
await build(rootDir, stub)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch(console.error)
|
@ -31,11 +31,9 @@ interface BuildContext {
|
|||||||
externals: string[]
|
externals: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main () {
|
export async function build (rootDir: string, stub: boolean) {
|
||||||
const args = process.argv.splice(2)
|
|
||||||
|
|
||||||
const ctx: BuildContext = {
|
const ctx: BuildContext = {
|
||||||
rootDir: resolve(args.shift() || '.'),
|
rootDir,
|
||||||
entries: [],
|
entries: [],
|
||||||
externals: [...Module.builtinModules]
|
externals: [...Module.builtinModules]
|
||||||
}
|
}
|
||||||
@ -64,7 +62,7 @@ async function main () {
|
|||||||
await execa(cmd, args)
|
await execa(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.includes('--stub')) {
|
if (stub) {
|
||||||
const stubbed: string[] = []
|
const stubbed: string[] = []
|
||||||
for (const entry of ctx.entries) {
|
for (const entry of ctx.entries) {
|
||||||
if (entry.bundle) {
|
if (entry.bundle) {
|
||||||
@ -258,8 +256,3 @@ function getRollupOptions (ctx: BuildContext): RollupOptions | null {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch((err) => {
|
|
||||||
consola.error(err)
|
|
||||||
process.exit(1)
|
|
||||||
})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user