diff --git a/package.json b/package.json index 289ea817b..b503464cd 100644 --- a/package.json +++ b/package.json @@ -38,5 +38,10 @@ "@types/node": "^22.10.1", "eslint": "9.16.0", "prettier": "3.4.2" + }, + "pnpm": { + "patchedDependencies": { + "oclif@4.16.0": "patches/oclif@4.16.0.patch" + } } } diff --git a/packages/cli/package.json b/packages/cli/package.json index 702544dc5..995ccd560 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -22,7 +22,7 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json && oclif manifest && oclif readme && copyfiles -u 1 src/**/*.graphql dist/", - "oclif:pack": "npm pack && pnpm oclif pack tarballs --no-xz && node scripts/rename-tarballs.mjs", + "oclif:pack": "npm pack && pnpm oclif pack tarballs --no-xz", "test": "vitest run --bail=1", "test:add": "vitest run tests/cli/add.test.ts", "test:init": "vitest run tests/cli/init.test.ts", diff --git a/packages/cli/scripts/rename-tarballs.mjs b/packages/cli/scripts/rename-tarballs.mjs deleted file mode 100644 index 697fa4a80..000000000 --- a/packages/cli/scripts/rename-tarballs.mjs +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable */ -// eslint is just straight up wrong here - -import fs from 'fs/promises'; -import path from 'path'; -import { globIterate } from 'glob'; - -async function main() { - for await (const tarball of globIterate('dist/*.tar.gz')) { - // tarball is in format graph---.tar.gz - // for example: graph-v0.47.1-dcc9923-linux-arm.tar.gz - // in order to simplify the tarball names for easier installation, - // we remove the version and commit from the name since they'll be - // uploaded to the GH release notes assets anyway - const [graph, _version, _commit, ...target] = tarball.split('-'); - console.log(`Found ${tarball}`); - if (target.length) { - // only rename if target part exists (otherwise tarballs was already renamed) - const newTarball = [graph, ...target].join('-'); - console.log(`\tRenaming ${path.basename(tarball)} to ${path.basename(newTarball)}...`); - await fs.rename(tarball, newTarball); - } else { - console.log('\tSkipping rename...'); - } - } -} - -main() - .then(() => { - process.exit(0); - }) - .catch(err => { - console.error(err); - process.exit(1); - }); diff --git a/patches/oclif@4.16.0.patch b/patches/oclif@4.16.0.patch index 09ebcb18f..2e893235e 100644 --- a/patches/oclif@4.16.0.patch +++ b/patches/oclif@4.16.0.patch @@ -1,5 +1,5 @@ diff --git a/lib/tarballs/build.js b/lib/tarballs/build.js -index a7577a89c721bf4a52657f037fcc079e8fa9dca3..ebf5245840ac671064c8699f166102b2cc5d85c3 100644 +index a7577a89c721bf4a52657f037fcc079e8fa9dca3..51c33346763dee8c60a3b59b8c46b6789c496239 100644 --- a/lib/tarballs/build.js +++ b/lib/tarballs/build.js @@ -195,8 +195,10 @@ const addDependencies = async (c) => { @@ -15,3 +15,12 @@ index a7577a89c721bf4a52657f037fcc079e8fa9dca3..ebf5245840ac671064c8699f166102b2 await exec('npm install --production', { cwd: c.workspace() }); } }; +@@ -229,7 +231,7 @@ const buildTarget = async (target, c, options) => { + const { bin, version } = c.config; + const { gitSha: sha } = c; + const templateShortKeyCommonOptions = { arch, bin, platform, sha, version }; +- const [gzLocalKey, xzLocalKey] = ['.tar.gz', '.tar.xz'].map((ext) => (0, upload_util_1.templateShortKey)('versioned', { ...templateShortKeyCommonOptions, ext })); ++ const [gzLocalKey, xzLocalKey] = ['.tar.gz', '.tar.xz'].map((ext) => (0, upload_util_1.templateShortKey)('unversioned', { ...templateShortKeyCommonOptions, ext })); + const base = path.basename(gzLocalKey); + (0, log_1.log)(`building target ${base}`); + (0, log_1.log)('copying workspace', c.workspace(), workspace); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e419bec3..c42b877e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + oclif@4.16.0: + hash: ofxhflhoc4vkbbfnh6gtk4pfua + path: patches/oclif@4.16.0.patch + importers: .: @@ -324,7 +329,7 @@ importers: version: 2.4.1 oclif: specifier: 4.16.0 - version: 4.16.0(@types/node@22.10.1) + version: 4.16.0(patch_hash=ofxhflhoc4vkbbfnh6gtk4pfua)(@types/node@22.10.1) spawn-command: specifier: 1.0.0 version: 1.0.0 @@ -19424,7 +19429,7 @@ snapshots: obliterator@2.0.4: {} - oclif@4.16.0(@types/node@22.10.1): + oclif@4.16.0(patch_hash=ofxhflhoc4vkbbfnh6gtk4pfua)(@types/node@22.10.1): dependencies: '@aws-sdk/client-cloudfront': 3.699.0 '@aws-sdk/client-s3': 3.705.0