-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to Yarn 4 and clean up some deps #99
Changes from all commits
3f40d51
4a93b98
30ec6ed
058bbfc
9303402
99e6f1c
4d95ee5
018e1aa
36f0194
4e9d976
4ca3762
ab4d697
d799664
72502b0
6abcfbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,10 @@ export const meta = { | |
{ maxItems: M.bigint() }, | ||
), | ||
}; | ||
harden(meta); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this enforced by this change? if so, cool! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by the updated Endo lint config |
||
// compatibility with an earlier contract metadata API | ||
export const customTermsShape = meta.customTermsShape; | ||
harden(customTermsShape); | ||
|
||
/** | ||
* Start a contract that | ||
|
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", | ||
Comment on lines
13
to
-15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 excellent! Get rid of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this looked like the resolutions are gone, but they're just updated. I hope to obviate them eventually but didn't manage yet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops. reading too fast. |
||
"@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": {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/usr/bin/env node | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Help me understand the workflow around this? How do I know when I should use it? In general, if I want to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add a note. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An entry in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for now it's a "if you know you know" kind of tool. I think we need some design discussion around the UX to solve this problem consistently across repos. It should be something you can run with the |
||
/** @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."); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't have to maintain
_agstate
like this. Marking this one as tech debt: