From 434dcfa365259d8c8ec4cd7dbe012f1f1407598e Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 22 Aug 2024 10:52:39 -0700 Subject: [PATCH 1/8] ci: rm unused check-dependencies --- package.json | 1 - scripts/check-mismatched-dependencies.cjs | 34 ----------------------- 2 files changed, 35 deletions(-) delete mode 100644 scripts/check-mismatched-dependencies.cjs diff --git a/package.json b/package.json index 4cd023df65e..0853adc9eb1 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ }, "scripts": { "clean": "yarn lerna run --no-bail clean", - "check-dependencies": "node ./scripts/check-mismatched-dependencies.cjs", "docs": "run-s docs:build docs:update-functions-path", "docs:build": "typedoc --tsconfig tsconfig.build.json", "docs:markdown-for-agoric-documentation-repo": "run-s docs:markdown-build 'docs:update-functions-path md'", diff --git a/scripts/check-mismatched-dependencies.cjs b/scripts/check-mismatched-dependencies.cjs deleted file mode 100644 index c9bfec8a57b..00000000000 --- a/scripts/check-mismatched-dependencies.cjs +++ /dev/null @@ -1,34 +0,0 @@ -#! /usr/bin/env node - -const { spawnSync } = require('child_process'); -console.log( - `running 'yarn workspaces info' to check for mismatched dependencies`, -); -const s = spawnSync('yarn', ['--silent', 'workspaces', 'info'], { - stdio: ['ignore', 'pipe', 'inherit'], -}); -if (s.status !== 0) { - console.log(`error running 'yarn workspaces info':`); - console.log(s.status); - console.log(s.signal); - console.log(s.error); - console.log(s.stdout); - console.log(s.stderr); - process.exit(1); -} - -let good = true; -const d = JSON.parse(s.stdout); -for (const pkgname of Object.getOwnPropertyNames(d)) { - const md = d[pkgname].mismatchedWorkspaceDependencies; - if (md.length) { - console.log(`package '${pkgname}' has mismatched dependencies on: ${md}`); - good = false; - } -} -if (good) { - console.log('looks good'); - process.exit(0); -} else { - process.exit(1); -} From 3a00dc18e10cadb00791681980d752378a3c71f4 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 17 Feb 2025 07:45:54 -0800 Subject: [PATCH 2/8] build: rm redundant packageManager --- golang/cosmos/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/golang/cosmos/package.json b/golang/cosmos/package.json index 5b6e2b60146..dbd6faace08 100644 --- a/golang/cosmos/package.json +++ b/golang/cosmos/package.json @@ -9,7 +9,6 @@ "engines": { "node": "^18.12 || ^20.9" }, - "packageManager": "yarn@1.22.22", "scripts": { "test": "exit 0", "build:all": "make", From 06fef836823f47cd9814ee8e7399a1b09176394b Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 23 Aug 2024 08:48:22 -0700 Subject: [PATCH 3/8] build: scripts chmod+x --- scripts/run-deployment-integration.sh | 0 scripts/update-typedoc-functions-path.cjs | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/run-deployment-integration.sh mode change 100644 => 100755 scripts/update-typedoc-functions-path.cjs diff --git a/scripts/run-deployment-integration.sh b/scripts/run-deployment-integration.sh old mode 100644 new mode 100755 diff --git a/scripts/update-typedoc-functions-path.cjs b/scripts/update-typedoc-functions-path.cjs old mode 100644 new mode 100755 From 8619df787245877f67c4df908bee076f3e0f702c Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 22 Aug 2024 12:39:42 -0700 Subject: [PATCH 4/8] test: run without yarn --- packages/boot/tools/supports.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/boot/tools/supports.ts b/packages/boot/tools/supports.ts index a38932b5d6c..3261ec4de3b 100644 --- a/packages/boot/tools/supports.ts +++ b/packages/boot/tools/supports.ts @@ -58,6 +58,10 @@ import { icaMocks, protoMsgMockMap, protoMsgMocks } from './ibc/mocks.js'; const trace = makeTracer('BSTSupport', false); +const cliEntrypoint = new URL( + importMetaResolve('agoric/src/entrypoint.js', import.meta.url), +).pathname; + type ConsumeBootrapItem = ( name: N, ) => N extends keyof FastUSDCCorePowers['consume'] @@ -176,12 +180,8 @@ export const makeProposalExtractor = ({ childProcess, fs }: Powers) => { cliArgs: string[] = [], ) => { console.info('running package script:', scriptPath); - const out = childProcess.execFileSync('yarn', ['bin', 'agoric'], { - cwd: outputDir, - env, - }); return childProcess.execFileSync( - out.toString().trim(), + cliEntrypoint, ['run', scriptPath, ...cliArgs], { cwd: outputDir, From 917fb8ad779242f00e0fa509417403818a9fc2e9 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 17 Feb 2025 07:50:31 -0800 Subject: [PATCH 5/8] build: run without yarn --- a3p-integration/scripts/build-submission.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a3p-integration/scripts/build-submission.sh b/a3p-integration/scripts/build-submission.sh index b2cc95baf6f..206a4b14246 100755 --- a/a3p-integration/scripts/build-submission.sh +++ b/a3p-integration/scripts/build-submission.sh @@ -16,7 +16,7 @@ shift || true sdkroot=$(git rev-parse --show-toplevel) ( cd "$sdkroot" - yarn agoric run --verbose "packages/builders/scripts/$builderScript" "$@" + npm exec agoric run -- --verbose "packages/builders/scripts/$builderScript" "$@" ) # Create and populate the submission directory. From 7aef92920a80939d47a6677a3c5438045ed63122 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 23 Aug 2024 08:43:31 -0700 Subject: [PATCH 6/8] test: helpers lib --- packages/agoric-cli/test/helpers.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/agoric-cli/test/helpers.test.js diff --git a/packages/agoric-cli/test/helpers.test.js b/packages/agoric-cli/test/helpers.test.js new file mode 100644 index 00000000000..cc625dd8b4d --- /dev/null +++ b/packages/agoric-cli/test/helpers.test.js @@ -0,0 +1,18 @@ +/** @file the `helpers` module is exported to test its API */ + +import '@endo/init/debug.js'; + +import test from 'ava'; + +import { getSDKBinaries } from '../src/helpers.js'; + +test('getSDKBinaries', t => { + const binaries = getSDKBinaries(); + t.log(binaries); + t.is(typeof binaries.agSolo, 'string'); + t.is(typeof binaries.agSoloBuild, 'object'); + t.is(typeof binaries.cosmosChain, 'string'); + t.is(typeof binaries.cosmosChainBuild, 'object'); + t.is(typeof binaries.cosmosClientBuild, 'object'); + t.is(typeof binaries.cosmosHelper, 'string'); +}); From dd0f75d4304d421a7c83617dea21e00f7a2beb85 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 13 Dec 2023 15:52:49 -0800 Subject: [PATCH 7/8] feat: list workspaces without yarn --- .../scripts/get-sdk-package-names.js | 35 ++++++------------- packages/agoric-cli/src/install.js | 14 ++------ packages/agoric-cli/src/lib/packageManager.js | 22 ++++++++++++ scripts/check-untested-packages.mjs | 10 ++---- 4 files changed, 37 insertions(+), 44 deletions(-) create mode 100644 packages/agoric-cli/src/lib/packageManager.js diff --git a/packages/agoric-cli/scripts/get-sdk-package-names.js b/packages/agoric-cli/scripts/get-sdk-package-names.js index 68491b22f96..0eb9a4487e7 100755 --- a/packages/agoric-cli/scripts/get-sdk-package-names.js +++ b/packages/agoric-cli/scripts/get-sdk-package-names.js @@ -1,34 +1,19 @@ #! /usr/bin/env node +// @ts-check /* eslint-env node */ -import { spawn } from 'child_process'; +import { execFileSync } from 'child_process'; import { basename } from 'path'; +import { listWorkspaces } from '../src/lib/packageManager.js'; -const ps = spawn('yarn', ['workspaces', '--silent', 'info'], { - stdio: ['ignore', 'pipe', 'inherit'], - shell: true, -}); +const workspaces = listWorkspaces({ execFileSync }); -// Get Buffers of output. -const chunks = []; -ps.stdout.on('data', data => chunks.push(data)); +const packageNames = workspaces.map(w => w.name); -// Wait for the process to exit. -ps.on('close', code => { - if (code !== 0) { - throw Error(`yarn info exited with code ${code}`); - } - - // Get the output. - const json = Buffer.concat(chunks).toString('utf8'); - // process.stderr.write(json); - - // Write the module. - const workspaces = Object.keys(JSON.parse(json)).sort(); - process.stdout.write(`\ +// Write the module. +process.stdout.write(`\ // DO NOT EDIT - automatically generated by ${basename( - new URL(import.meta.url).pathname, - )} + new URL(import.meta.url).pathname, +)} // prettier-ignore -export default ${JSON.stringify(workspaces, null, 2)}; +export default ${JSON.stringify(packageNames.sort(), null, 2)}; `); -}); diff --git a/packages/agoric-cli/src/install.js b/packages/agoric-cli/src/install.js index 25c605991d2..f1c6d045821 100644 --- a/packages/agoric-cli/src/install.js +++ b/packages/agoric-cli/src/install.js @@ -1,8 +1,10 @@ /* eslint-env node */ import path from 'path'; import chalk from 'chalk'; +import { execFileSync } from 'child_process'; import { makePspawn } from './helpers.js'; import DEFAULT_SDK_PACKAGE_NAMES from './sdk-package-names.js'; +import { listWorkspaces } from './lib/packageManager.js'; const REQUIRED_AGORIC_START_PACKAGES = [ '@agoric/solo', @@ -30,17 +32,7 @@ export default async function installMain(progname, rawArgs, powers, opts) { const rimraf = file => pspawn('rm', ['-rf', file]); async function getWorktreePackagePaths(cwd = '.', map = new Map()) { - // run `yarn workspaces info` to get the list of directories to - // use, instead of a hard-coded list - const p = pspawn('yarn', ['workspaces', '--silent', 'info'], { - cwd, - stdio: ['inherit', 'pipe', 'inherit'], - }); - const stdout = []; - p.childProcess.stdout?.on('data', out => stdout.push(out)); - await p; - const d = JSON.parse(Buffer.concat(stdout).toString('utf-8')); - for (const [name, { location }] of Object.entries(d)) { + for (const { name, location } of listWorkspaces({ execFileSync })) { map.set(name, path.resolve(cwd, location)); } return map; diff --git a/packages/agoric-cli/src/lib/packageManager.js b/packages/agoric-cli/src/lib/packageManager.js new file mode 100644 index 00000000000..5ecb0ea9d92 --- /dev/null +++ b/packages/agoric-cli/src/lib/packageManager.js @@ -0,0 +1,22 @@ +// @ts-check + +/** + * @import { execFileSync } from 'child_process'; + */ + +/** + * Omits the root + * + * @param {{ execFileSync: execFileSync }} io + * @returns {Array<{ location: string, name: string }>} + */ +export const listWorkspaces = ({ execFileSync }) => { + const out = execFileSync('npm', ['query', '.workspace'], { + stdio: ['ignore', 'pipe', 'inherit'], + shell: true, + encoding: 'utf-8', + }); + /** @type {Array<{ location: string, name: string, description: string }>} */ + const result = JSON.parse(out); + return result.filter(({ location }) => location !== '.'); +}; diff --git a/scripts/check-untested-packages.mjs b/scripts/check-untested-packages.mjs index ac9fb848507..b97465426bc 100755 --- a/scripts/check-untested-packages.mjs +++ b/scripts/check-untested-packages.mjs @@ -3,15 +3,9 @@ import fs from 'fs'; import path from 'path'; import { execFileSync } from 'child_process'; +import { listWorkspaces } from '../packages/agoric-cli/src/lib/packageManager.js'; const parent = new URL('..', import.meta.url).pathname; -const yarnCmd = ['yarn', '--silent', 'workspaces', 'info']; -console.log('Getting', yarnCmd.join(' ')); -const workspacesInfo = execFileSync(yarnCmd[0], yarnCmd.slice(1), { - cwd: parent, - encoding: 'utf8', -}); -const workspacesInfoJson = JSON.parse(workspacesInfo); const testYaml = path.resolve( parent, @@ -22,7 +16,7 @@ const testYamlContent = fs.readFileSync(testYaml, 'utf-8'); console.log('Searching for "cd && yarn test"...'); let status = 0; -for (const [pkg, { location }] of Object.entries(workspacesInfoJson)) { +for (const { name: pkg, location } of listWorkspaces({ execFileSync })) { const cmd = `cd ${location} && yarn \${{ steps.vars.outputs.test }}`; if (!testYamlContent.includes(cmd)) { console.error(`Cannot find ${location} (${pkg})`); From a111596defe2b110cbb30b746392e5b01ce3f71f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 18 Feb 2025 11:52:11 -0800 Subject: [PATCH 8/8] chore(deps): bump typescript 5.8 to rc --- multichain-testing/package.json | 2 +- multichain-testing/yarn.lock | 18 +++++++++--------- package.json | 2 +- packages/cosmic-proto/package.json | 2 +- yarn.lock | 10 +++++----- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/multichain-testing/package.json b/multichain-testing/package.json index 1a95532bb54..81a7db66556 100644 --- a/multichain-testing/package.json +++ b/multichain-testing/package.json @@ -39,7 +39,7 @@ "patch-package": "^8.0.0", "starshipjs": "2.4.1", "ts-blank-space": "^0.4.4", - "typescript": "~5.8.0-beta" + "typescript": "~5.8.1-rc" }, "resolutions": { "axios": "1.6.7", diff --git a/multichain-testing/yarn.lock b/multichain-testing/yarn.lock index c1cb8767d2c..2b68120e075 100644 --- a/multichain-testing/yarn.lock +++ b/multichain-testing/yarn.lock @@ -4925,7 +4925,7 @@ __metadata: patch-package: "npm:^8.0.0" starshipjs: "npm:2.4.1" ts-blank-space: "npm:^0.4.4" - typescript: "npm:~5.8.0-beta" + typescript: "npm:~5.8.1-rc" languageName: unknown linkType: soft @@ -5468,13 +5468,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.8.0-beta": - version: 5.8.0-dev.20250130 - resolution: "typescript@npm:5.8.0-dev.20250130" +"typescript@npm:~5.8.1-rc": + version: 5.8.1-rc + resolution: "typescript@npm:5.8.1-rc" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/20852f1703f109576c925a6710d6d0001656ecc77d60fca4ea94ecd562290cef4aa529f919f45f6ab3c8334d3746a938ecca700ed7d2fd563d7cbc3dbf75f2bf + checksum: 10c0/7692b2584d0bddbab2b9a76457908276cb968935b9e1a89b7429939b1c02c7c47b5b23f1e989e18bf441fc545a311f02e143e7594a3914e240554637011a7d70 languageName: node linkType: hard @@ -5488,13 +5488,13 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~5.8.0-beta#optional!builtin": - version: 5.8.0-dev.20250130 - resolution: "typescript@patch:typescript@npm%3A5.8.0-dev.20250130#optional!builtin::version=5.8.0-dev.20250130&hash=5786d5" +"typescript@patch:typescript@npm%3A~5.8.1-rc#optional!builtin": + version: 5.8.1-rc + resolution: "typescript@patch:typescript@npm%3A5.8.1-rc#optional!builtin::version=5.8.1-rc&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/8cc5b8c72a84ff58ca8c2e3bdd25ea50e98aed8b6c079ddfa43f14744cd20d97529edd61ca930e99deb9c9d6321650fd69030169bbbd546187c426fcff83d360 + checksum: 10c0/45267f3c53240100da1d53ec8ebaa008f019055fe339c79baf596bab180aab2821751781bfc3202d5f6180fe01200aed9ebf45dec84490ef3a9d90359326c075 languageName: node linkType: hard diff --git a/package.json b/package.json index 0853adc9eb1..eda2f3ab68b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "type-coverage": "^2.27.1", "typedoc": "^0.26.7", "typedoc-plugin-markdown": "^4.2.1", - "typescript": "~5.8.0-beta", + "typescript": "~5.8.1-rc", "typescript-eslint": "^8.22.0" }, "resolutions": { diff --git a/packages/cosmic-proto/package.json b/packages/cosmic-proto/package.json index 3c4f8ba8361..f605deb0432 100644 --- a/packages/cosmic-proto/package.json +++ b/packages/cosmic-proto/package.json @@ -173,7 +173,7 @@ "ava": "^5.3.1", "rimraf": "^5.0.0", "tsd": "^0.31.1", - "typescript": "^5.8.0-beta" + "typescript": "~5.8.1-rc" }, "dependencies": { "@endo/base64": "^1.0.9", diff --git a/yarn.lock b/yarn.lock index c5a9771b84b..f6452b76673 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12032,16 +12032,16 @@ typescript-eslint@^7.3.1, typescript-eslint@^8.14.0, typescript-eslint@^8.22.0: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -typescript@^5.8.0-beta, typescript@~5.8.0-beta: - version "5.8.0-dev.20250130" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.0-dev.20250130.tgz#eede4cf5d813f9845c6ee2b508d2392d544cb76e" - integrity sha512-qeH56cqOnOE0NO4zUsuuc5kyIQlzOPurHcguomUpSTfUE2He5dABg+fBBUeYIf4MreflM6ArXyj/rIrcHQ5g0g== - typescript@~5.6.3: version "5.6.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== +typescript@~5.8.1-rc: + version "5.8.1-rc" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.1-rc.tgz#678b7586bf1d7fdec0dbf35708ab7bb39ce13c3d" + integrity sha512-D8IlSOUk1E08jpFdK81reYkA1a/4XtEdV6MElOGdbu/uOy1RpEDqNO/onWmqUaLkTyeHmmU/QlWvjcM9cqF85g== + uc.micro@^2.0.0, uc.micro@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee"