From 4728a43b19a2a373055aa91c258a46458e463829 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 13 Nov 2024 21:18:12 +0100 Subject: [PATCH] fix(cli): execution with npx Npx fails because of the postinstall of didyoumean2. We now use the separate @clerk/* packages instead of the clerk package, this removes the indirect dependency to didyoumean2. --- .changeset/brave-flies-rule.md | 6 ++ packages/cli/package.json | 5 +- packages/cli/src/index.ts | 5 +- packages/content-collections/package.json | 5 +- packages/content-collections/src/index.ts | 5 +- pnpm-lock.yaml | 108 +++++----------------- 6 files changed, 46 insertions(+), 88 deletions(-) create mode 100644 .changeset/brave-flies-rule.md diff --git a/.changeset/brave-flies-rule.md b/.changeset/brave-flies-rule.md new file mode 100644 index 00000000..14fc4b06 --- /dev/null +++ b/.changeset/brave-flies-rule.md @@ -0,0 +1,6 @@ +--- +"content-collections": patch +"@content-collections/cli": patch +--- + +Fix cli execution with npx diff --git a/packages/cli/package.json b/packages/cli/package.json index 841539fc..c723b1e1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -17,7 +17,10 @@ }, "dependencies": { "@content-collections/integrations": "workspace:*", - "clerc": "^0.44.0" + "@clerc/core": "^0.44.0", + "@clerc/plugin-completions": "^0.44.0", + "@clerc/plugin-help": "^0.44.0", + "@clerc/plugin-version": "^0.44.0" }, "devDependencies": { "@content-collections/core": "workspace:*", diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 8389cb40..d8d043eb 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,5 +1,8 @@ #!/usr/bin/env node -import { Clerc, completionsPlugin, helpPlugin, versionPlugin } from "clerc"; +import { Clerc } from "@clerc/core"; +import { completionsPlugin } from "@clerc/plugin-completions"; +import { helpPlugin } from "@clerc/plugin-help"; +import { versionPlugin } from "@clerc/plugin-version"; import build from "./commands/build.js"; import watch from "./commands/watch.js"; diff --git a/packages/content-collections/package.json b/packages/content-collections/package.json index 2d9835df..dc562766 100644 --- a/packages/content-collections/package.json +++ b/packages/content-collections/package.json @@ -23,10 +23,13 @@ "build": "tsc" }, "dependencies": { + "@clerc/core": "^0.44.0", + "@clerc/plugin-completions": "^0.44.0", + "@clerc/plugin-help": "^0.44.0", + "@clerc/plugin-version": "^0.44.0", "@content-collections/installer": "workspace:^", "@inquirer/prompts": "^7.0.0", "chalk": "^5.3.0", - "clerc": "^0.44.0", "listr2": "^8.2.5", "zod": "^3.23.8" }, diff --git a/packages/content-collections/src/index.ts b/packages/content-collections/src/index.ts index ca13f28c..775701b9 100644 --- a/packages/content-collections/src/index.ts +++ b/packages/content-collections/src/index.ts @@ -1,6 +1,9 @@ #!/usr/bin/env node -import { Clerc, completionsPlugin, helpPlugin, versionPlugin } from "clerc"; +import { Clerc } from "@clerc/core"; +import { completionsPlugin } from "@clerc/plugin-completions"; +import { helpPlugin } from "@clerc/plugin-help"; +import { versionPlugin } from "@clerc/plugin-version"; import install from "./commands/install.js"; import { createRequire } from "node:module"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d6b18a92..84f199d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,12 +35,21 @@ importers: packages/cli: dependencies: + '@clerc/core': + specifier: ^0.44.0 + version: 0.44.0 + '@clerc/plugin-completions': + specifier: ^0.44.0 + version: 0.44.0(@clerc/core@0.44.0) + '@clerc/plugin-help': + specifier: ^0.44.0 + version: 0.44.0(@clerc/core@0.44.0) + '@clerc/plugin-version': + specifier: ^0.44.0 + version: 0.44.0(@clerc/core@0.44.0) '@content-collections/integrations': specifier: workspace:* version: link:../integrations - clerc: - specifier: ^0.44.0 - version: 0.44.0 devDependencies: '@content-collections/core': specifier: workspace:* @@ -57,6 +66,18 @@ importers: packages/content-collections: dependencies: + '@clerc/core': + specifier: ^0.44.0 + version: 0.44.0 + '@clerc/plugin-completions': + specifier: ^0.44.0 + version: 0.44.0(@clerc/core@0.44.0) + '@clerc/plugin-help': + specifier: ^0.44.0 + version: 0.44.0(@clerc/core@0.44.0) + '@clerc/plugin-version': + specifier: ^0.44.0 + version: 0.44.0(@clerc/core@0.44.0) '@content-collections/installer': specifier: workspace:^ version: link:../installer @@ -66,9 +87,6 @@ importers: chalk: specifier: ^5.3.0 version: 5.3.0 - clerc: - specifier: ^0.44.0 - version: 0.44.0 listr2: specifier: ^8.2.5 version: 8.2.5 @@ -1884,15 +1902,6 @@ packages: '@clerc/utils': 0.44.0(@clerc/core@0.44.0) dev: false - /@clerc/plugin-friendly-error@0.44.0(@clerc/core@0.44.0): - resolution: {integrity: sha512-hbGp+T+fl9Dz+Ln1LGoijbNL7N+RfBqhSRWtT55QdFPs86O7Mi5oqiqIrUS9wDpaHzJGn+ETFPIOUyDRdrD8ag==} - peerDependencies: - '@clerc/core': '*' - dependencies: - '@clerc/core': 0.44.0 - kons: 0.7.1 - dev: false - /@clerc/plugin-help@0.44.0(@clerc/core@0.44.0): resolution: {integrity: sha512-QIH+Lrk6WZtXKNxEAA4gOk7dwseS7U0jTZ0TbJfcyOoNA3fF2p48UV8c7hmKk7OhfPS5009eJRW5CVQEgBB8Ng==} peerDependencies: @@ -1906,25 +1915,6 @@ packages: yoctocolors: 1.0.0 dev: false - /@clerc/plugin-not-found@0.44.0(@clerc/core@0.44.0): - resolution: {integrity: sha512-8GIxDv/V2qaKRJKy+jjHAmlCEbTabLYPIeklqY231skiNOYCDQ3wJS3isP7EQgARfhm0otMDRXPPC2aNfSJjRw==} - peerDependencies: - '@clerc/core': '*' - dependencies: - '@clerc/core': 0.44.0 - '@clerc/utils': 0.44.0(@clerc/core@0.44.0) - didyoumean2: 6.0.1 - yoctocolors: 1.0.0 - dev: false - - /@clerc/plugin-strict-flags@0.44.0(@clerc/core@0.44.0): - resolution: {integrity: sha512-8ztQrn4pfCj6b/sDN1mU0MVlfSqp3qHohW59v6k6nS3UUnYytJDU5wZQZmQ+7t3DZqjw+Xle6ZzEIWQatAdZ9A==} - peerDependencies: - '@clerc/core': '*' - dependencies: - '@clerc/core': 0.44.0 - dev: false - /@clerc/plugin-version@0.44.0(@clerc/core@0.44.0): resolution: {integrity: sha512-YETH54A0sO32oJcLABpb4P5FyhEkhIhe5oe3IXyeUj9/LMcInvKCm6x/gDMIUjTQuh0a5l4iton0A1RscAANhw==} peerDependencies: @@ -8123,18 +8113,6 @@ packages: engines: {node: '>=6'} dev: true - /clerc@0.44.0: - resolution: {integrity: sha512-fy7JcE7qW3hi5hvPeaEXKdgzeOz3WwE8Nd1SCfOpOSyWxoFJsLuHwUhwFggvJqEJIQ6kLTLZ7yWguwoTcMXO5w==} - dependencies: - '@clerc/core': 0.44.0 - '@clerc/plugin-completions': 0.44.0(@clerc/core@0.44.0) - '@clerc/plugin-friendly-error': 0.44.0(@clerc/core@0.44.0) - '@clerc/plugin-help': 0.44.0(@clerc/core@0.44.0) - '@clerc/plugin-not-found': 0.44.0(@clerc/core@0.44.0) - '@clerc/plugin-strict-flags': 0.44.0(@clerc/core@0.44.0) - '@clerc/plugin-version': 0.44.0(@clerc/core@0.44.0) - dev: false - /cli-boxes@3.0.0: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} @@ -8871,15 +8849,6 @@ packages: dependencies: dequal: 2.0.3 - /didyoumean2@6.0.1: - resolution: {integrity: sha512-PSy0zQwMg5O+LjT5Mz7vnKC8I7DfWLPF6M7oepqW7WP5mn2CY3hz46xZOa1GJY+KVfyXhdmz6+tdgXwrHlZc5g==} - engines: {node: ^16.14.0 || >=18.12.0} - dependencies: - '@babel/runtime': 7.25.6 - fastest-levenshtein: 1.0.16 - lodash.deburr: 4.1.0 - dev: false - /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -10078,11 +10047,6 @@ packages: resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==} dev: true - /fastest-levenshtein@1.0.16: - resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} - engines: {node: '>= 4.9.1'} - dev: false - /fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: @@ -10107,14 +10071,6 @@ packages: dependencies: picomatch: 4.0.2 - /figures@5.0.0: - resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==} - engines: {node: '>=14'} - dependencies: - escape-string-regexp: 5.0.0 - is-unicode-supported: 1.3.0 - dev: false - /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -11541,11 +11497,6 @@ packages: engines: {node: '>=10'} dev: true - /is-unicode-supported@1.3.0: - resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} - engines: {node: '>=12'} - dev: false - /is-weakmap@2.0.2: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} @@ -11803,13 +11754,6 @@ packages: resolution: {integrity: sha512-oHnmiBUVHz1V+URE77PNot2lv3QiYU2zQf1JjOVkMt3YDKGbu8NAFr+c4mcNOhdsGrB/VpVbRwPwhiXrPhxQbw==} dev: false - /kons@0.7.1: - resolution: {integrity: sha512-mW1CkTgrLeIQjiBYd1n0U73T/2W7Vdzxx8rpta5Q4cSDAlr8hXw+ZctxGZlGgdUAmlcDlpkh0vUX8AOW+y1dog==} - dependencies: - figures: 5.0.0 - picocolors: 1.1.0 - dev: false - /language-subtag-registry@0.3.22: resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} dev: true @@ -11952,10 +11896,6 @@ packages: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} dev: true - /lodash.deburr@4.1.0: - resolution: {integrity: sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==} - dev: false - /lodash.defaults@4.2.0: resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} dev: false