From bca75ab6490dfc444e3b6766ba5c47572622e2d3 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 28 Jun 2024 12:36:41 +0200 Subject: [PATCH] feat(module): install module peer dependencies (#442) Co-authored-by: gangan <44604921+shinGangan@users.noreply.github.com> --- package.json | 6 +++--- pnpm-lock.yaml | 19 ++++++++++--------- src/commands/module/add.ts | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 297458ec..82fce807 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "magicast": "^0.3.4", "mlly": "^1.7.1", "nuxt": "^3.12.2", - "nypm": "^0.3.8", + "nypm": "^0.3.9", "ofetch": "^1.3.4", "pathe": "^1.1.2", "perfect-debounce": "^1.0.0", @@ -81,9 +81,9 @@ "fsevents": "~2.3.3" }, "resolutions": { + "h3": "^1.12.0", "nitropack": "npm:nitropack-nightly", - "nuxt": "^3.12.2", - "h3": "^1.12.0" + "nuxt": "^3.12.2" }, "packageManager": "pnpm@9.4.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a986c66..15cf060c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -99,8 +99,8 @@ importers: specifier: ^3.12.2 version: 3.12.2(@opentelemetry/api@1.8.0)(@parcel/watcher@2.4.1)(@types/node@20.14.9)(@unocss/reset@0.58.9)(encoding@0.1.13)(eslint@9.5.0)(floating-vue@5.2.2(@nuxt/kit@3.12.2(magicast@0.3.4)(rollup@3.29.4))(vue@3.4.29(typescript@5.4.2)))(fuse.js@7.0.0)(ioredis@5.4.1)(magicast@0.3.4)(optionator@0.9.3)(rollup@3.29.4)(terser@5.29.2)(typescript@5.4.2)(unocss@0.58.9(postcss@8.4.37)(rollup@3.29.4)(vite@5.3.1(@types/node@20.14.9)(terser@5.29.2)))(vite@5.3.1(@types/node@20.14.9)(terser@5.29.2))(vue-tsc@2.0.22(typescript@5.4.2)) nypm: - specifier: ^0.3.8 - version: 0.3.8 + specifier: ^0.3.9 + version: 0.3.9 ofetch: specifier: ^1.3.4 version: 1.3.4 @@ -3533,8 +3533,8 @@ packages: '@types/node': optional: true - nypm@0.3.8: - resolution: {integrity: sha512-IGWlC6So2xv6V4cIDmoV0SwwWx7zLG086gyqkyumteH2fIgCAM4nDVFB2iDRszDvmdSVW9xb1N+2KjQ6C7d4og==} + nypm@0.3.9: + resolution: {integrity: sha512-BI2SdqqTHg2d4wJh8P9A1W+bslg33vOE9IZDY6eR2QC+Pu1iNBVZUqczrd43rJb+fMzHU7ltAYKsEFY/kHMFcw==} engines: {node: ^14.16.0 || >=16.10.0} hasBin: true @@ -5915,7 +5915,7 @@ snapshots: local-pkg: 0.5.0 magicast: 0.3.4 nuxt: 3.12.2(@opentelemetry/api@1.8.0)(@parcel/watcher@2.4.1)(@types/node@20.14.9)(@unocss/reset@0.58.9)(encoding@0.1.13)(eslint@9.5.0)(floating-vue@5.2.2(@nuxt/kit@3.12.2(magicast@0.3.4)(rollup@3.29.4))(vue@3.4.29(typescript@5.4.2)))(fuse.js@7.0.0)(ioredis@5.4.1)(magicast@0.3.4)(optionator@0.9.3)(rollup@3.29.4)(terser@5.29.2)(typescript@5.4.2)(unocss@0.58.9(postcss@8.4.37)(rollup@3.29.4)(vite@5.3.1(@types/node@20.14.9)(terser@5.29.2)))(vite@5.3.1(@types/node@20.14.9)(terser@5.29.2))(vue-tsc@2.0.22(typescript@5.4.2)) - nypm: 0.3.8 + nypm: 0.3.9 ohash: 1.1.3 pacote: 18.0.6 pathe: 1.1.2 @@ -8301,7 +8301,7 @@ snapshots: consola: 3.2.3 defu: 6.1.4 node-fetch-native: 1.6.4 - nypm: 0.3.8 + nypm: 0.3.9 ohash: 1.1.3 pathe: 1.1.2 tar: 6.2.0 @@ -9174,7 +9174,7 @@ snapshots: mlly: 1.7.1 nitropack: nitropack-nightly@2.10.0-28656653.33fb776f(@opentelemetry/api@1.8.0)(encoding@0.1.13) nuxi: 3.12.0 - nypm: 0.3.8 + nypm: 0.3.9 ofetch: 1.3.4 ohash: 1.1.3 pathe: 1.1.2 @@ -9259,13 +9259,14 @@ snapshots: - vue-tsc - xml2js - nypm@0.3.8: + nypm@0.3.9: dependencies: citty: 0.1.6 consola: 3.2.3 execa: 8.0.1 pathe: 1.1.2 - ufo: 1.5.2 + pkg-types: 1.1.1 + ufo: 1.5.3 object-assign@4.1.1: {} diff --git a/src/commands/module/add.ts b/src/commands/module/add.ts index bf375f8f..440487d1 100644 --- a/src/commands/module/add.ts +++ b/src/commands/module/add.ts @@ -64,7 +64,7 @@ export default defineCommand({ consola.info( `Installing \`${r.pkg}\`${isDev ? ' development' : ''} dependency`, ) - const res = await addDependency(r.pkg, { cwd, dev: isDev }).catch( + const res = await addDependency(r.pkg, { cwd, dev: isDev, installPeerDependencies: true }).catch( (error) => { consola.error(error) return consola.prompt(