-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from Agoric/ta/packages
upgrade to Yarn 4 and clean up some deps
- Loading branch information
Showing
11 changed files
with
16,569 additions
and
12,896 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,35 +3,38 @@ | |
"version": "0.1.0", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"useWorkspaces": true, | ||
"workspaces": [ | ||
"contract", | ||
"ui" | ||
], | ||
"resolutions-note": "work-around for https://github.com/Agoric/agoric-sdk/issues/8621", | ||
"resolutions": { | ||
"ses": "1.3.0", | ||
"@endo/bundle-source": "2.5.2-upstream-rollup", | ||
"@endo/captp": "3.1.1", | ||
"@endo/compartment-mapper": "0.8.4", | ||
"@endo/far": "0.2.18", | ||
"@endo/init": "0.5.56", | ||
"@endo/marshal": "0.8.5", | ||
"@endo/nat": "4.1.27", | ||
"@endo/promise-kit": "0.2.56", | ||
"@endo/lockdown": "0.1.28", | ||
"@endo/import-bundle": "0.3.4", | ||
"@endo/base64": "0.2.31", | ||
"@endo/zip": "0.2.31", | ||
"@endo/eventual-send": "0.17.2", | ||
"@endo/patterns": "0.2.2", | ||
"@endo/stream": "0.3.25", | ||
"@endo/exo": "0.2.2", | ||
"@endo/pass-style": "0.1.3", | ||
"@endo/check-bundle": "0.2.18", | ||
"@endo/ses-ava": "0.2.40", | ||
"@endo/netstring": "0.3.26", | ||
"@endo/stream-node": "0.2.26", | ||
"agoric": "^0.22.0-u16.2", | ||
"ses": "1.8.0", | ||
"@agoric/notifier": "^0.7.0-u16.1", | ||
"@endo/bundle-source": "^3.4.0", | ||
"@endo/captp": "^4.3.0", | ||
"@endo/compartment-mapper": "^1.2.2", | ||
"@endo/far": "^1.1.5", | ||
"@endo/init": "^1.1.4", | ||
"@endo/marshal": "^1.5.3", | ||
"@endo/nat": "^5.0.10", | ||
"@endo/promise-kit": "^1.1.5", | ||
"@endo/lockdown": "^1.0.10", | ||
"@endo/import-bundle": "^1.2.2", | ||
"@endo/base64": "^1.0.7", | ||
"@endo/zip": "^1.0.7", | ||
"@endo/eventual-send": "^1.2.5", | ||
"@endo/patterns": "^1.4.3", | ||
"@endo/stream": "^1.2.5", | ||
"@endo/exo": "^1.5.3", | ||
"@endo/pass-style": "^1.4.3", | ||
"@endo/check-bundle": "^1.0.9", | ||
"@endo/ses-ava": "^1.2.5", | ||
"@endo/netstring": "^1.0.10", | ||
"@endo/stream-node": "^1.1.5", | ||
"@babel/code-frame": "7.18.6", | ||
"@babel/highlight": "7.22.5" | ||
}, | ||
|
@@ -43,12 +46,15 @@ | |
"make:help": "make -C contract list", | ||
"start:contract": "cd contract && yarn start", | ||
"start:ui": "cd ui && yarn dev", | ||
"lint": "yarn workspaces run lint", | ||
"test": "yarn workspaces run test", | ||
"lint": "yarn workspaces foreach --all run lint", | ||
"test": "yarn workspaces foreach --all run test", | ||
"test:e2e": "yarn workspace offer-up-ui test:e2e", | ||
"build": "yarn workspaces run build", | ||
"build": "yarn workspaces foreach --all run build", | ||
"runWaitForBlocks": "cd contract && yarn make:waitForBlocks" | ||
}, | ||
"dependencies": { | ||
"eslint": "^8.57.0" | ||
}, | ||
"devDependencies": { | ||
"@agoric/synpress": "^3.8.1", | ||
"eslint-config-turbo": "^1.13.0", | ||
|
@@ -57,6 +63,5 @@ | |
"eslint-plugin-testing-library": "^6.2.0", | ||
"eslint-plugin-ui-testing": "^2.0.1", | ||
"serve": "^14.2.1" | ||
}, | ||
"dependencies": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/usr/bin/env node | ||
/** @file Utility to update dependencies through the repo to a specified tag | ||
* | ||
* Agoric and Endo repos each release in one go, but with their packages all at different versions. | ||
* To find what packages all work together (that were in CI together at the same time) you | ||
* can set all your deps to a particular NPM dist tag. | ||
* | ||
* e.g. `scripts/update-dependencies.js agoric agoric-upgrade-16` | ||
* | ||
* Endo doesn't have any dist tags other than the default, `latest`, which should should suffice. | ||
*/ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const glob = require("glob"); | ||
const { execSync } = require("child_process"); | ||
|
||
// Get the arguments: package name regex and npm tag | ||
const [packageNameRegex, npmTag] = process.argv.slice(2); | ||
if (!packageNameRegex || !npmTag) { | ||
console.error( | ||
'Usage: node update-dependencies.js "<package-regex>" <npm-tag>' | ||
); | ||
process.exit(1); | ||
} | ||
|
||
// Function to get the latest version of a package with the specified tag | ||
const getLatestVersion = (packageName, tag) => { | ||
try { | ||
const result = execSync(`npm info ${packageName} dist-tags.${tag}`, { | ||
encoding: "utf-8", | ||
}); | ||
return result.trim(); | ||
} catch (error) { | ||
console.error( | ||
`Error fetching version for ${packageName} with tag ${tag}:`, | ||
error.message | ||
); | ||
return null; | ||
} | ||
}; | ||
|
||
// Function to update dependencies in the package.json section | ||
const updateDependencies = (dependencies, tag) => { | ||
if (!dependencies) return; | ||
|
||
for (const [packageName, currentVersion] of Object.entries(dependencies)) { | ||
if (new RegExp(packageNameRegex).test(packageName)) { | ||
const latestVersion = getLatestVersion(packageName, tag); | ||
if (latestVersion) { | ||
console.log( | ||
`Updating ${packageName} from ${currentVersion} to ${latestVersion}` | ||
); | ||
dependencies[packageName] = `^${latestVersion}`; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
// Find all package.json files in the workspace | ||
glob("**/package.json", { ignore: "**/node_modules/**" }, (err, files) => { | ||
if (err) { | ||
console.error("Error finding package.json files:", err); | ||
process.exit(1); | ||
} | ||
|
||
files.forEach((file) => { | ||
const packageJsonPath = path.resolve(file); | ||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")); | ||
|
||
// Update dependencies, devDependencies, and resolutions | ||
updateDependencies(packageJson.dependencies, npmTag); | ||
updateDependencies(packageJson.devDependencies, npmTag); | ||
updateDependencies(packageJson.resolutions, npmTag); | ||
|
||
// Write the updated package.json back to the file, ensuring newline at the end | ||
fs.writeFileSync( | ||
packageJsonPath, | ||
JSON.stringify(packageJson, null, 2) + "\n", | ||
"utf-8" | ||
); | ||
console.log(`Updated dependencies in ${packageJsonPath}`); | ||
}); | ||
|
||
console.log("Dependency update complete."); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.