diff --git a/packages/Samples/package.json b/packages/Samples/package.json index 5ad2850ee72..ae33a5c1d1e 100644 --- a/packages/Samples/package.json +++ b/packages/Samples/package.json @@ -12,5 +12,10 @@ "license": "MIT", "devDependencies": { "@cspell/cspell-tools": "workspace:*" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/Samples" } } diff --git a/packages/cspell-bundled-dicts/package.json b/packages/cspell-bundled-dicts/package.json index ef6e5fccaaf..6f2d048718f 100644 --- a/packages/cspell-bundled-dicts/package.json +++ b/packages/cspell-bundled-dicts/package.json @@ -30,7 +30,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-bundled-dicts" }, "keywords": [ "spell", diff --git a/packages/cspell-code-snippets/package.json b/packages/cspell-code-snippets/package.json index 50a09ddebb9..6c24e0d16fb 100644 --- a/packages/cspell-code-snippets/package.json +++ b/packages/cspell-code-snippets/package.json @@ -15,7 +15,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-code-snippets" }, "keywords": [ "cspell" diff --git a/packages/cspell-config-lib/package.json b/packages/cspell-config-lib/package.json index 158aedcaf66..2308160b378 100644 --- a/packages/cspell-config-lib/package.json +++ b/packages/cspell-config-lib/package.json @@ -37,7 +37,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-config-lib" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-config" diff --git a/packages/cspell-dictionary/package.json b/packages/cspell-dictionary/package.json index ca81dc2f6b5..76c6ed5b72c 100644 --- a/packages/cspell-dictionary/package.json +++ b/packages/cspell-dictionary/package.json @@ -31,7 +31,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-dictionary" }, "keywords": [ "cspell" diff --git a/packages/cspell-eslint-plugin/package.json b/packages/cspell-eslint-plugin/package.json index 2a50adaae7e..6f2289bb2d1 100644 --- a/packages/cspell-eslint-plugin/package.json +++ b/packages/cspell-eslint-plugin/package.json @@ -63,7 +63,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-eslint-plugin" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-gitignore" diff --git a/packages/cspell-gitignore/package.json b/packages/cspell-gitignore/package.json index 10a08bea7a9..3938d0e3804 100644 --- a/packages/cspell-gitignore/package.json +++ b/packages/cspell-gitignore/package.json @@ -43,7 +43,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-gitignore" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-gitignore" diff --git a/packages/cspell-glob/package.json b/packages/cspell-glob/package.json index d8fabd60408..327d49fbbec 100644 --- a/packages/cspell-glob/package.json +++ b/packages/cspell-glob/package.json @@ -40,7 +40,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-glob" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-glob" diff --git a/packages/cspell-grammar/package.json b/packages/cspell-grammar/package.json index c3749632a57..b9028f4a881 100644 --- a/packages/cspell-grammar/package.json +++ b/packages/cspell-grammar/package.json @@ -71,7 +71,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-grammar" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-grammar" diff --git a/packages/cspell-io/package.json b/packages/cspell-io/package.json index f037dd08341..0cd5543115e 100644 --- a/packages/cspell-io/package.json +++ b/packages/cspell-io/package.json @@ -32,7 +32,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-io" }, "keywords": [ "cspell" diff --git a/packages/cspell-json-reporter/package.json b/packages/cspell-json-reporter/package.json index 27b92cdf2ac..bcbf7bbc1b6 100644 --- a/packages/cspell-json-reporter/package.json +++ b/packages/cspell-json-reporter/package.json @@ -31,7 +31,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-json-reporter" }, "scripts": { "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"", diff --git a/packages/cspell-lib/package.json b/packages/cspell-lib/package.json index 7ad213ec77c..7273c4fb974 100644 --- a/packages/cspell-lib/package.json +++ b/packages/cspell-lib/package.json @@ -38,7 +38,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-lib" }, "keywords": [ "spell", diff --git a/packages/cspell-pipe/package.json b/packages/cspell-pipe/package.json index d5ea5ff993a..8918caadccb 100644 --- a/packages/cspell-pipe/package.json +++ b/packages/cspell-pipe/package.json @@ -105,7 +105,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-pipe" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-pipe" diff --git a/packages/cspell-resolver/package.json b/packages/cspell-resolver/package.json index 729f25800f0..dabc9beacca 100644 --- a/packages/cspell-resolver/package.json +++ b/packages/cspell-resolver/package.json @@ -40,7 +40,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-resolver" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/issues" diff --git a/packages/cspell-service-bus/package.json b/packages/cspell-service-bus/package.json index 31f045e0a0c..0b75e346797 100644 --- a/packages/cspell-service-bus/package.json +++ b/packages/cspell-service-bus/package.json @@ -43,7 +43,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-service-bus" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-service-bus" diff --git a/packages/cspell-strong-weak-map/package.json b/packages/cspell-strong-weak-map/package.json index ff279e86a87..29b165b8e09 100644 --- a/packages/cspell-strong-weak-map/package.json +++ b/packages/cspell-strong-weak-map/package.json @@ -46,7 +46,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-strong-weak-map" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell" diff --git a/packages/cspell-tools/package.json b/packages/cspell-tools/package.json index b3bb4b950fe..eed85835abc 100644 --- a/packages/cspell-tools/package.json +++ b/packages/cspell-tools/package.json @@ -24,7 +24,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-tools" }, "keywords": [ "cSpell", diff --git a/packages/cspell-trie-lib/package.json b/packages/cspell-trie-lib/package.json index e9af372f33e..4d9e3a9cbd9 100644 --- a/packages/cspell-trie-lib/package.json +++ b/packages/cspell-trie-lib/package.json @@ -34,7 +34,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-trie-lib" }, "keywords": [ "trie", diff --git a/packages/cspell-trie/package.json b/packages/cspell-trie/package.json index 9b179e3b3f9..3a17a3f54f1 100644 --- a/packages/cspell-trie/package.json +++ b/packages/cspell-trie/package.json @@ -27,7 +27,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-trie" }, "keywords": [ "trie", diff --git a/packages/cspell-types/package.json b/packages/cspell-types/package.json index 5722a71b83f..ba3f0e978de 100644 --- a/packages/cspell-types/package.json +++ b/packages/cspell-types/package.json @@ -62,7 +62,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell-types" }, "files": [ "dist", diff --git a/packages/cspell/package.json b/packages/cspell/package.json index 829a3bcdb5f..e1a1eb2247a 100644 --- a/packages/cspell/package.json +++ b/packages/cspell/package.json @@ -61,7 +61,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/cspell" }, "keywords": [ "spell", diff --git a/packages/dynamic-import/package.json b/packages/dynamic-import/package.json index 992473c7645..2d7b814b23f 100644 --- a/packages/dynamic-import/package.json +++ b/packages/dynamic-import/package.json @@ -48,7 +48,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/dynamic-import" }, "bugs": { "url": "https://github.com/streetsidesoftware/cspell/labels/cspell-pipe" diff --git a/packages/hunspell-reader/package.json b/packages/hunspell-reader/package.json index 906556af798..95a8ca389b2 100644 --- a/packages/hunspell-reader/package.json +++ b/packages/hunspell-reader/package.json @@ -31,7 +31,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/streetsidesoftware/cspell.git" + "url": "git+https://github.com/streetsidesoftware/cspell.git", + "directory": "packages/hunspell-reader" }, "keywords": [ "Hunspell" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dcdbbf55835..17545b5b908 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -801,6 +801,9 @@ importers: scripts: dependencies: + globby: + specifier: ^14.0.1 + version: 14.0.1 safe-stable-stringify: specifier: ^2.4.3 version: 2.4.3 @@ -5270,7 +5273,6 @@ packages: /@sindresorhus/merge-streams@2.3.0: resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} engines: {node: '>=18'} - dev: true /@sinonjs/commons@3.0.1: resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} @@ -9655,7 +9657,6 @@ packages: path-type: 5.0.0 slash: 5.1.0 unicorn-magic: 0.1.0 - dev: true /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} @@ -13118,7 +13119,6 @@ packages: /path-type@5.0.0: resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} engines: {node: '>=12'} - dev: true /pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -14722,7 +14722,6 @@ packages: /slash@5.1.0: resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} engines: {node: '>=14.16'} - dev: true /slice-ansi@4.0.0: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} @@ -15633,7 +15632,6 @@ packages: /unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - dev: true /unified@11.0.4: resolution: {integrity: sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==} diff --git a/scripts/package.json b/scripts/package.json index 2eb414ff38c..cdf45175e4b 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -5,7 +5,8 @@ "description": "Tools and Scripts", "bin": { "update-release-please": "./update-release-please.mjs", - "build-cspell-schema": "./build-cspell-schema.mjs" + "build-cspell-schema": "./build-cspell-schema.mjs", + "update-package-json": "./update-package-json.mjs" }, "scripts": { "#build:ts-json-schema-generator": "pnpm esbuild ../../../code/clones/ts-json-schema-generator/dist/index.js --bundle --outfile=lib/ts-json-schema-generator.cjs --platform=node --external:typescript", @@ -21,6 +22,7 @@ "esbuild": "^0.20.1" }, "dependencies": { + "globby": "^14.0.1", "safe-stable-stringify": "^2.4.3", "ts-json-schema-generator": "^1.5.0" } diff --git a/scripts/update-package-json.mjs b/scripts/update-package-json.mjs new file mode 100755 index 00000000000..a3ac5bf2236 --- /dev/null +++ b/scripts/update-package-json.mjs @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +import fs from 'node:fs/promises'; +import { globby } from 'globby'; + +const rootUrl = new URL('../', import.meta.url); + +async function updatePackageJson(pkgFile) { + const directory = pkgFile.split(/[/\\]/g).slice(-3, -1).join('/'); + console.log(directory); + + const pkg = JSON.parse(await fs.readFile(pkgFile, 'utf-8')); + + const repository = { + type: 'git', + url: 'git+https://github.com/streetsidesoftware/cspell.git', + directory, + }; + + pkg.repository = repository; + + await fs.writeFile(pkgFile, JSON.stringify(pkg, null, 2) + '\n'); +} + +async function run() { + console.log('Updating package.json files...\n'); + + const files = await globby('packages/*/package.json', { cwd: rootUrl, absolute: true }); + + await Promise.all(files.map(updatePackageJson)); + console.log('\nDone.'); +} + +run();