mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +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
|
||||
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
|
||||
id: yarn-cache
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
path: .yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
${{ runner.os }}-yarn-berry-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: yarn --frozen-lockfile --non-interactive
|
||||
run: yarn --immutable
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,6 +14,9 @@ package-lock.json
|
||||
.tmp
|
||||
.cache
|
||||
|
||||
# Yarn
|
||||
.yarn
|
||||
|
||||
# Generated dirs
|
||||
dist
|
||||
.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",
|
||||
"private": "true",
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"link": "lerna link",
|
||||
"build": "yarn -s workspaces run build",
|
||||
"stub": "yarn -s build --stub",
|
||||
"gentypes": "yarn -s --cwd packages/kit gentypes",
|
||||
"play": "yarn -s nu dev playground",
|
||||
"lint": "yarn -s gentypes && eslint --ext .vue,.ts,.js .",
|
||||
"test": "yarn -s lint",
|
||||
"postinstall": "yarn -s stub"
|
||||
"build": "jiti ./scripts/build-all",
|
||||
"stub": "yarn build --stub",
|
||||
"gentypes": "yarn workspace @nuxt/kit jiti ./scripts/gentypes",
|
||||
"nu": "./node_modules/.bin/nu",
|
||||
"play": "yarn run nu dev playground",
|
||||
"lint": "yarn gentypes && eslint --ext .vue,.ts,.js .",
|
||||
"test": "yarn lint",
|
||||
"postinstall": "yarn stub"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxtjs/eslint-config": "^6.0.0",
|
||||
|
@ -9,10 +9,6 @@
|
||||
"dist",
|
||||
"meta.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vueuse/head": "^0.5.1",
|
||||
"hookable": "^4.4.1",
|
||||
|
@ -8,11 +8,6 @@
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"gentypes": "jiti ./scripts/gentypes",
|
||||
"prepublishOnly": "yarn build && yarn gentypes"
|
||||
},
|
||||
"dependencies": {
|
||||
"consola": "^2.15.3",
|
||||
"create-require": "^1.1.1",
|
||||
@ -29,7 +24,7 @@
|
||||
"upath": "^2.0.1"
|
||||
},
|
||||
"build": {
|
||||
"prebuild": "yarn -s gentypes",
|
||||
"prebuild": "jiti ./scripts/gentypes",
|
||||
"entries": {
|
||||
"index": {
|
||||
"format": "cjs"
|
||||
|
@ -7,10 +7,6 @@
|
||||
"dist",
|
||||
"compat.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"build": {
|
||||
"externals": [
|
||||
"@nuxt/kit"
|
||||
@ -33,7 +29,8 @@
|
||||
"ora",
|
||||
"vue-bundle-renderer",
|
||||
"vue-server-renderer",
|
||||
"@vue/server-renderer"
|
||||
"@vue/server-renderer",
|
||||
"vue"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
@ -85,6 +82,7 @@
|
||||
"table": "^6.0.9",
|
||||
"ufo": "^0.6.10",
|
||||
"upath": "^2.0.1",
|
||||
"vue": "3.0.11",
|
||||
"vue-bundle-renderer": "^0.2.3",
|
||||
"vue-server-renderer": "^2.6.12"
|
||||
}
|
||||
|
@ -4,23 +4,19 @@
|
||||
"repository": "nuxt/framework",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"bin": {
|
||||
"nu": "./bin/nu.js"
|
||||
},
|
||||
"bin": "./bin/nu.js",
|
||||
"files": [
|
||||
"bin",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"build": {
|
||||
"externals": [
|
||||
"nuxt3"
|
||||
],
|
||||
"entries": {
|
||||
"index": { "format": "cjs" }
|
||||
"index": {
|
||||
"format": "cjs"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,11 @@
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"build": {
|
||||
"entries": {
|
||||
"index": { "format": "cjs" }
|
||||
"index": {
|
||||
"format": "cjs"
|
||||
}
|
||||
},
|
||||
"dependencies": [
|
||||
"@nuxt/app",
|
||||
@ -22,11 +20,11 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "^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/webpack-builder": "^0.1.0",
|
||||
"@nuxt/nitro": "^0.1.11",
|
||||
"chokidar": "^3.5.1",
|
||||
"consola": "^2.15.3",
|
||||
"defu": "^3.2.2",
|
||||
@ -38,7 +36,5 @@
|
||||
"lodash": "^4.17.21",
|
||||
"scule": "^0.1.1",
|
||||
"ufo": "^0.6.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ export async function loadNuxt (loadOpts: LoadNuxtOptions = {}): Promise<Nuxt> {
|
||||
const { appDir } = await import('@nuxt/app/meta')
|
||||
options.appDir = appDir
|
||||
options._majorVersion = 3
|
||||
options.alias.vue = require.resolve('vue/dist/vue.esm-bundler.js')
|
||||
|
||||
const nuxt = createNuxt(options)
|
||||
|
||||
|
@ -7,10 +7,6 @@
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"build": {
|
||||
"entries": {
|
||||
"index": {
|
||||
@ -18,14 +14,18 @@
|
||||
}
|
||||
},
|
||||
"dependencies": [
|
||||
"@nuxt/kit"
|
||||
"@nuxt/kit",
|
||||
"@vue/compiler-sfc",
|
||||
"vue"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "^0.1.0",
|
||||
"@vitejs/plugin-vue": "^1.2.1",
|
||||
"@vue/compiler-sfc": "^3.0.11",
|
||||
"consola": "^2.15.3",
|
||||
"fs-extra": "^9.1.0",
|
||||
"vite": "^2.1.5"
|
||||
"vite": "^2.1.5",
|
||||
"vue": "3.0.11"
|
||||
}
|
||||
}
|
||||
|
@ -7,10 +7,6 @@
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"build": {
|
||||
"entries": {
|
||||
"index": {
|
||||
@ -30,10 +26,13 @@
|
||||
"file-loader",
|
||||
"style-resources-loader",
|
||||
"url-loader",
|
||||
"vue-style-loader"
|
||||
"vue-style-loader",
|
||||
"@babel/core",
|
||||
"vue"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.14",
|
||||
"@nuxt/friendly-errors-webpack-plugin": "^2.5.0",
|
||||
"@nuxt/kit": "^0.1.0",
|
||||
"@vue/babel-preset-jsx": "^1.2.4",
|
||||
@ -58,6 +57,7 @@
|
||||
"time-fix-plugin": "^2.0.7",
|
||||
"ufo": "^0.6.10",
|
||||
"url-loader": "^4.1.1",
|
||||
"vue": "3.0.11",
|
||||
"vue-loader": "^16.2.0",
|
||||
"vue-style-loader": "^4.1.3",
|
||||
"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[]
|
||||
}
|
||||
|
||||
async function main () {
|
||||
const args = process.argv.splice(2)
|
||||
|
||||
export async function build (rootDir: string, stub: boolean) {
|
||||
const ctx: BuildContext = {
|
||||
rootDir: resolve(args.shift() || '.'),
|
||||
rootDir,
|
||||
entries: [],
|
||||
externals: [...Module.builtinModules]
|
||||
}
|
||||
@ -64,7 +62,7 @@ async function main () {
|
||||
await execa(cmd, args)
|
||||
}
|
||||
|
||||
if (args.includes('--stub')) {
|
||||
if (stub) {
|
||||
const stubbed: string[] = []
|
||||
for (const entry of ctx.entries) {
|
||||
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