From 62647844b5160d34cc189dcca21302de602766bd Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Tue, 21 Sep 2021 18:49:36 +0200 Subject: [PATCH] chore: update to unbuild 0.5.x (#545) --- docs/package.json | 2 +- package.json | 7 +- packages/bridge/package.json | 2 +- packages/kit/package.json | 4 +- packages/nitro/package.json | 4 +- packages/nuxi/bin/{nuxi.js => nuxi.cjs} | 3 +- packages/nuxi/package.json | 10 +- packages/nuxt3/bin/nuxt.cjs | 2 + packages/nuxt3/bin/nuxt.js | 2 - packages/nuxt3/package.json | 6 +- packages/vite/package.json | 2 +- packages/webpack/package.json | 2 +- .../webpack/src/plugins/transform-setup.ts | 2 +- test/presets/_tests.mjs | 2 +- test/utils.mjs | 2 +- yarn.lock | 101 +++++++++--------- 16 files changed, 77 insertions(+), 76 deletions(-) rename packages/nuxi/bin/{nuxi.js => nuxi.cjs} (58%) create mode 100755 packages/nuxt3/bin/nuxt.cjs delete mode 100755 packages/nuxt3/bin/nuxt.js diff --git a/docs/package.json b/docs/package.json index a7352bc3eb..139eeaca9b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "@nuxt/kit": "link:../packages/kit", "@nuxt/typescript-build": "^2.1.0", "fs-extra": "^10.0.0", - "jiti": "^1.12.0", + "jiti": "^1.12.1", "mkdirp": "^1.0.4", "rimraf": "^3.0.2", "scule": "^0.2.1", diff --git a/package.json b/package.json index d0370f81c1..0a3065575f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "version": "yarn && git add yarn.lock" }, "resolutions": { - "nuxt3": "workspace:./packages/nuxt3" + "nuxt3": "workspace:./packages/nuxt3", + "unbuild": "^0.5.2" }, "devDependencies": { "@nuxtjs/eslint-config": "^6.0.1", @@ -41,13 +42,13 @@ "eslint-plugin-jsdoc": "^36.1.0", "execa": "^5.1.1", "globby": "^11.0.4", - "jiti": "^1.12.0", + "jiti": "^1.12.1", "jsdom": "^17.0.0", "lerna": "^4.0.0", "mocha": "^9.1.1", "object-hash": "^2.2.0", "typescript": "^4.4.3", - "unbuild": "^0.4.2", + "unbuild": "latest", "upath": "^2.0.1" }, "packageManager": "yarn@3.0.2" diff --git a/packages/bridge/package.json b/packages/bridge/package.json index a94c631a6f..5d30968e32 100644 --- a/packages/bridge/package.json +++ b/packages/bridge/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "repository": "nuxt/framework", "license": "MIT", - "main": "./dist/module.js", + "main": "./dist/module.cjs", "types": "./dist/index.d.ts", "files": [ "dist" diff --git a/packages/kit/package.json b/packages/kit/package.json index d9be98cf2e..32b6f459c5 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -3,7 +3,7 @@ "version": "0.10.0", "repository": "nuxt/framework", "license": "MIT", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "types": "./dist/index.d.ts", "files": [ "dist", @@ -23,7 +23,7 @@ "globby": "^11.0.4", "hash-sum": "^2.0.0", "hookable": "^5.0.0", - "jiti": "^1.12.0", + "jiti": "^1.12.1", "rc9": "^1.2.0", "scule": "^0.2.1", "std-env": "^2.3.0", diff --git a/packages/nitro/package.json b/packages/nitro/package.json index eff6e4fdde..93cc917556 100644 --- a/packages/nitro/package.json +++ b/packages/nitro/package.json @@ -2,7 +2,7 @@ "name": "@nuxt/nitro", "version": "0.10.0", "license": "MIT", - "main": "dist/index.js", + "main": "./dist/index.cjs", "types": "./types/index.d.ts", "files": [ "dist", @@ -48,7 +48,7 @@ "hookable": "^5.0.0", "http-proxy": "^1.18.1", "is-primitive": "^3.0.1", - "jiti": "^1.12.0", + "jiti": "^1.12.1", "listhen": "^0.2.4", "mime": "^2.5.2", "node-fetch": "^3.0.0", diff --git a/packages/nuxi/bin/nuxi.js b/packages/nuxi/bin/nuxi.cjs similarity index 58% rename from packages/nuxi/bin/nuxi.js rename to packages/nuxi/bin/nuxi.cjs index 73d8c64931..aed07f34ea 100755 --- a/packages/nuxi/bin/nuxi.js +++ b/packages/nuxi/bin/nuxi.cjs @@ -1,3 +1,4 @@ #!/usr/bin/env node process._startTime = Date.now() -require('../dist').main() + +require('../dist/index.cjs').main() diff --git a/packages/nuxi/package.json b/packages/nuxi/package.json index d1d4d1811e..03fa442454 100644 --- a/packages/nuxi/package.json +++ b/packages/nuxi/package.json @@ -3,10 +3,10 @@ "version": "0.10.0", "repository": "nuxt/framework", "license": "MIT", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "bin": { - "nu": "./bin/nuxi.js", - "nuxi": "./bin/nuxi.js" + "nu": "./bin/nuxi.cjs", + "nuxi": "./bin/nuxi.cjs" }, "scripts": { "prepack": "unbuild" @@ -32,11 +32,11 @@ "deep-object-diff": "^1.1.0", "destr": "^1.1.0", "flat": "^5.0.2", - "jiti": "^1.12.0", + "jiti": "^1.12.1", "listhen": "^0.2.4", "mri": "^1.2.0", "scule": "^0.2.1", - "unbuild": "^0.4.2", + "unbuild": "latest", "upath": "^2.0.1", "v8-compile-cache": "^2.3.0" } diff --git a/packages/nuxt3/bin/nuxt.cjs b/packages/nuxt3/bin/nuxt.cjs new file mode 100755 index 0000000000..d5ceb75321 --- /dev/null +++ b/packages/nuxt3/bin/nuxt.cjs @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('nuxi/bin/nuxi.cjs') diff --git a/packages/nuxt3/bin/nuxt.js b/packages/nuxt3/bin/nuxt.js deleted file mode 100755 index 2d0b2e2df8..0000000000 --- a/packages/nuxt3/bin/nuxt.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('nuxi/bin/nuxi') diff --git a/packages/nuxt3/package.json b/packages/nuxt3/package.json index d87eada389..72433de4d5 100644 --- a/packages/nuxt3/package.json +++ b/packages/nuxt3/package.json @@ -3,10 +3,10 @@ "version": "0.10.0", "repository": "nuxt/framework", "license": "MIT", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "types": "./types.d.ts", "bin": { - "nuxt": "./bin/nuxt.js" + "nuxt": "./bin/nuxt.cjs" }, "files": [ "bin", @@ -48,7 +48,7 @@ "@types/fs-extra": "^9.0.12", "@types/hash-sum": "^1.0.0", "@types/lodash": "^4.14.173", - "unbuild": "^0.4.2", + "unbuild": "latest", "vue-meta": "next" }, "peerDependencies": { diff --git a/packages/vite/package.json b/packages/vite/package.json index 28a80f64c6..47b11bdfcb 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -3,7 +3,7 @@ "version": "0.10.0", "repository": "nuxt/framework", "license": "MIT", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "files": [ "dist" ], diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 01576f5270..45814632a2 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -3,7 +3,7 @@ "version": "0.10.0", "repository": "nuxt/framework", "license": "MIT", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "files": [ "dist" ], diff --git a/packages/webpack/src/plugins/transform-setup.ts b/packages/webpack/src/plugins/transform-setup.ts index 93e8fbba1a..41be3d27aa 100644 --- a/packages/webpack/src/plugins/transform-setup.ts +++ b/packages/webpack/src/plugins/transform-setup.ts @@ -11,7 +11,7 @@ export default class NuxtSetupTransformerPlugin { enforce: 'post', use: [{ ident: 'NuxtSetupTransformerPlugin', - loader: normalize(require.resolve('@nuxt/webpack-builder/dist/nuxt-setup-loader')) + loader: normalize(require.resolve('@nuxt/webpack-builder/dist/nuxt-setup-loader.cjs')) }] }) } diff --git a/test/presets/_tests.mjs b/test/presets/_tests.mjs index 666acf0f40..6c86e32383 100644 --- a/test/presets/_tests.mjs +++ b/test/presets/_tests.mjs @@ -27,7 +27,7 @@ export function setupTest (preset) { it('nitro build', async () => { const nuxtCLI = isBridge ? resolve(ctx.rootDir, 'node_modules/nuxt/bin/nuxt.js') - : resolveWorkspace('packages/nuxi/bin/nuxi.js') + : resolveWorkspace('packages/nuxi/bin/nuxi.cjs') await execa('node', [nuxtCLI, 'build', ctx.rootDir], { env: { diff --git a/test/utils.mjs b/test/utils.mjs index 2a99068551..0b76b821e0 100644 --- a/test/utils.mjs +++ b/test/utils.mjs @@ -17,7 +17,7 @@ export function fixtureDir (name) { } export async function execNuxtCLI (args, opts) { - const nuxtCLI = resolveWorkspace('packages/nuxi/bin/nuxi.js') + const nuxtCLI = resolveWorkspace('packages/nuxi/bin/nuxi.cjs') await execa('node', [nuxtCLI, ...args], opts) } diff --git a/yarn.lock b/yarn.lock index ac98331250..314d5dc459 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,7 +14,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.14.5": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.14.5": version: 7.14.5 resolution: "@babel/code-frame@npm:7.14.5" dependencies: @@ -1466,7 +1466,7 @@ __metadata: globby: ^11.0.4 hash-sum: ^2.0.0 hookable: ^5.0.0 - jiti: ^1.12.0 + jiti: ^1.12.1 rc9: ^1.2.0 scule: ^0.2.1 std-env: ^2.3.0 @@ -1522,7 +1522,7 @@ __metadata: hookable: ^5.0.0 http-proxy: ^1.18.1 is-primitive: ^3.0.1 - jiti: ^1.12.0 + jiti: ^1.12.1 listhen: ^0.2.4 mime: ^2.5.2 node-fetch: ^3.0.0 @@ -1823,23 +1823,6 @@ __metadata: languageName: node linkType: hard -"@rollup/plugin-commonjs@npm:^19.0.1": - version: 19.0.2 - resolution: "@rollup/plugin-commonjs@npm:19.0.2" - dependencies: - "@rollup/pluginutils": ^3.1.0 - commondir: ^1.0.1 - estree-walker: ^2.0.1 - glob: ^7.1.6 - is-reference: ^1.2.1 - magic-string: ^0.25.7 - resolve: ^1.17.0 - peerDependencies: - rollup: ^2.38.3 - checksum: bf60da71b12c1c52fc2ca223272a1b5a4c27e47f707077024338f841b97f5656c352a3c2c11dd6a5fec0d63ae53407b9ceab72b87dda5701ddffdc09bba34513 - languageName: node - linkType: hard - "@rollup/plugin-commonjs@npm:^20.0.0": version: 20.0.0 resolution: "@rollup/plugin-commonjs@npm:20.0.0" @@ -6019,7 +6002,7 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.12.16, esbuild@npm:^0.12.17, esbuild@npm:^0.12.21, esbuild@npm:^0.12.28, esbuild@npm:^0.12.9": +"esbuild@npm:^0.12.17, esbuild@npm:^0.12.21, esbuild@npm:^0.12.28, esbuild@npm:^0.12.9": version: 0.12.28 resolution: "esbuild@npm:0.12.28" bin: @@ -8173,7 +8156,7 @@ fsevents@~2.3.2: languageName: node linkType: hard -"jiti@npm:^1.10.1, jiti@npm:^1.11.0, jiti@npm:^1.12.0": +"jiti@npm:^1.10.1, jiti@npm:^1.12.0": version: 1.12.0 resolution: "jiti@npm:1.12.0" bin: @@ -8182,6 +8165,15 @@ fsevents@~2.3.2: languageName: node linkType: hard +"jiti@npm:^1.12.1": + version: 1.12.1 + resolution: "jiti@npm:1.12.1" + bin: + jiti: bin/jiti.js + checksum: 173a018877ee43aba95aa7bc026ebed8dbef8a832206de30a35a1c6397cc75446ba42252b2ebfce05a88a5fbbe50ef8af60c399087b1a97ef85c87380e7b761b + languageName: node + linkType: hard + "joycon@npm:^3.0.1": version: 3.0.1 resolution: "joycon@npm:3.0.1" @@ -9754,19 +9746,19 @@ fsevents@~2.3.2: destr: ^1.1.0 flat: ^5.0.2 fsevents: ~2.3.2 - jiti: ^1.12.0 + jiti: ^1.12.1 listhen: ^0.2.4 mri: ^1.2.0 scule: ^0.2.1 - unbuild: ^0.4.2 + unbuild: latest upath: ^2.0.1 v8-compile-cache: ^2.3.0 dependenciesMeta: fsevents: optional: true bin: - nu: ./bin/nuxi.js - nuxi: ./bin/nuxi.js + nu: ./bin/nuxi.cjs + nuxi: ./bin/nuxi.cjs languageName: unknown linkType: soft @@ -9788,13 +9780,13 @@ fsevents@~2.3.2: eslint-plugin-jsdoc: ^36.1.0 execa: ^5.1.1 globby: ^11.0.4 - jiti: ^1.12.0 + jiti: ^1.12.1 jsdom: ^17.0.0 lerna: ^4.0.0 mocha: ^9.1.1 object-hash: ^2.2.0 typescript: ^4.4.3 - unbuild: ^0.4.2 + unbuild: latest upath: ^2.0.1 languageName: unknown linkType: soft @@ -9866,7 +9858,7 @@ fsevents@~2.3.2: ohmyfetch: ^0.3.1 scule: ^0.2.1 ufo: ^0.7.9 - unbuild: ^0.4.2 + unbuild: latest unplugin: ^0.2.11 upath: ^2.0.1 vue: ^3.2.12 @@ -9878,7 +9870,7 @@ fsevents@~2.3.2: "@vue/shared": 3.2.12 vue: 3.2.12 bin: - nuxt: ./bin/nuxt.js + nuxt: ./bin/nuxt.cjs languageName: unknown linkType: soft @@ -12027,19 +12019,19 @@ fsevents@~2.3.2: languageName: node linkType: hard -"rollup-plugin-dts@npm:^3.0.2": - version: 3.0.2 - resolution: "rollup-plugin-dts@npm:3.0.2" +"rollup-plugin-dts@npm:^4.0.0": + version: 4.0.0 + resolution: "rollup-plugin-dts@npm:4.0.0" dependencies: - "@babel/code-frame": ^7.12.13 + "@babel/code-frame": ^7.14.5 magic-string: ^0.25.7 peerDependencies: - rollup: ^2.48.0 - typescript: ^4.2.4 + rollup: ^2.56.3 + typescript: ^4.4.2 dependenciesMeta: "@babel/code-frame": optional: true - checksum: c37acf3744fd0a8b8b6fa9dd2be67b05412ad55f6133e98a1fdb5d44beda5a94a32582c622c35af70d0787713c85ecbbb2c06070845b0f93e4705c32289fc48a + checksum: b8c74e892d4131da769389549ea6591fd6e6fe4ee480806d01d3d8cd300b278983afa11dcfd93a7c9de5a08352a9a0d321d98e76b00b3b2fa2a3f369971629f1 languageName: node linkType: hard @@ -13369,7 +13361,7 @@ fsevents@~2.3.2: languageName: node linkType: hard -"typescript@^4.3.5, typescript@^4.4.3": +typescript@^4.4.3: version: 4.4.3 resolution: "typescript@npm:4.4.3" bin: @@ -13379,7 +13371,7 @@ fsevents@~2.3.2: languageName: node linkType: hard -"typescript@patch:typescript@^4.3.5#~builtin, typescript@patch:typescript@^4.4.3#~builtin": +"typescript@patch:typescript@^4.4.3#~builtin": version: 4.4.3 resolution: "typescript@patch:typescript@npm%3A4.4.3#~builtin::version=4.4.3&hash=32657b" bin: @@ -13431,34 +13423,34 @@ fsevents@~2.3.2: languageName: node linkType: hard -"unbuild@npm:^0.4.2": - version: 0.4.2 - resolution: "unbuild@npm:0.4.2" +"unbuild@npm:^0.5.2": + version: 0.5.2 + resolution: "unbuild@npm:0.5.2" dependencies: "@rollup/plugin-alias": ^3.1.4 - "@rollup/plugin-commonjs": ^19.0.1 + "@rollup/plugin-commonjs": ^20.0.0 "@rollup/plugin-json": ^4.1.0 "@rollup/plugin-node-resolve": ^13.0.2 chalk: ^4.1.1 consola: ^2.15.3 defu: ^5.0.0 - esbuild: ^0.12.16 - jiti: ^1.11.0 + esbuild: ^0.12.28 + jiti: ^1.12.0 mkdirp: ^1.0.4 mkdist: ^0.3.3 - mri: ^1.1.6 + mri: ^1.2.0 pretty-bytes: ^5.6.0 rimraf: ^3.0.2 rollup: ^2.55.0 - rollup-plugin-dts: ^3.0.2 + rollup-plugin-dts: ^4.0.0 rollup-plugin-esbuild: ^4.5.0 scule: ^0.2.1 - typescript: ^4.3.5 - untyped: ^0.2.8 + typescript: ^4.4.3 + untyped: ^0.2.9 upath: ^2.0.1 bin: - unbuild: bin/unbuild.js - checksum: c21e40225b73ded9ccd5893e4af9d7c5ce984d025b2732cbfd95a8c2969ae33a9e1a0351fd84d0e24fe1b4206bc0fbebab83b938afe90cafae0abf197f5250b4 + unbuild: bin/unbuild.cjs + checksum: f1fca31861c44c24bea1d6626842980550d94c34c2cf3c3e827ac5f8c2bde5227e1e68d4aaed6af11815ec04be44b5343f22a6581f33bb4fb139f9f86454ed41 languageName: node linkType: hard @@ -13592,6 +13584,13 @@ fsevents@~2.3.2: languageName: node linkType: hard +"untyped@npm:^0.2.9": + version: 0.2.9 + resolution: "untyped@npm:0.2.9" + checksum: 43a0312451644240bc4f1f4b7c8edd66edb62b34cec121017f33f1f27b8b088a43171d9d66563b74fa627feac9952862385d76a4cc15d6dad81ccec09d56f448 + languageName: node + linkType: hard + "upath@npm:^2.0.1": version: 2.0.1 resolution: "upath@npm:2.0.1"