Skip to content

Commit

Permalink
chore: migrate down to yarn 1 (#374)
Browse files Browse the repository at this point in the history
* Downgrade to yarn 1

* Update the tasks

* Fix workspace referenecs

* Add support for lerna

* Fix regression

* Remove engine condition from pckg.json
  • Loading branch information
nazarhussain authored May 17, 2024
1 parent 8d4d8bc commit cf8f049
Show file tree
Hide file tree
Showing 12 changed files with 12,972 additions and 13,396 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml
- run: yarn workspaces foreach -v --exclude root --exclude simpleserialize.com --no-private npm publish --tolerate-republish --access public
- run: yarn lerna run -v --ignore root --ignore simpleserialize.com --no-private npm publish --tolerate-republish --access public
if: ${{ steps.release.outputs.releases_created }}


Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ jobs:
# Otherwise just doing `yarn test:spec` you can't tell which specific suite failed
# many of the suites have identical names for minimal and mainnet
- name: Spec tests general
run: yarn run -T mocha test/spec/generic/index.test.ts
run: yarn mocha test/spec/generic/index.test.ts
working-directory: packages/ssz
- name: Spec tests phase0-minimal
run: LODESTAR_PRESET=minimal LODESTAR_FORK=phase0 yarn run -T mocha test/spec/ssz_static.test.ts
run: LODESTAR_PRESET=minimal LODESTAR_FORK=phase0 yarn mocha test/spec/ssz_static.test.ts
working-directory: packages/ssz
- name: Spec tests phase0-mainnet
run: LODESTAR_PRESET=mainnet LODESTAR_FORK=phase0 yarn run -T mocha test/spec/ssz_static.test.ts
run: LODESTAR_PRESET=mainnet LODESTAR_FORK=phase0 yarn mocha test/spec/ssz_static.test.ts
working-directory: packages/ssz
- name: Spec tests altair-minimal
run: LODESTAR_PRESET=minimal LODESTAR_FORK=altair yarn run -T mocha test/spec/ssz_static.test.ts
run: LODESTAR_PRESET=minimal LODESTAR_FORK=altair yarn mocha test/spec/ssz_static.test.ts
working-directory: packages/ssz
- name: Spec tests altair-mainnet
run: LODESTAR_PRESET=mainnet LODESTAR_FORK=altair yarn run -T mocha test/spec/ssz_static.test.ts
run: LODESTAR_PRESET=mainnet LODESTAR_FORK=altair yarn mocha test/spec/ssz_static.test.ts
working-directory: packages/ssz
- name: Spec tests bellatrix-minimal
run: LODESTAR_PRESET=minimal LODESTAR_FORK=bellatrix yarn run -T mocha test/spec/ssz_static.test.ts
run: LODESTAR_PRESET=minimal LODESTAR_FORK=bellatrix yarn mocha test/spec/ssz_static.test.ts
working-directory: packages/ssz
- name: Spec tests bellatrix-mainnet
run: LODESTAR_PRESET=mainnet LODESTAR_FORK=bellatrix yarn run -T mocha test/spec/ssz_static.test.ts
run: LODESTAR_PRESET=mainnet LODESTAR_FORK=bellatrix yarn mocha test/spec/ssz_static.test.ts
working-directory: packages/ssz
9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-engines.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

15 changes: 15 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useNx": true,
"version": "1.18.1",
"stream": true,
"command": {
"version": {
"message": "chore(release): %s"
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"workspaces": [
"packages/*"
],
"packageManager": "yarn@3.2.3",
"packageManager": "yarn@1.22.22",
"scripts": {
"clean": "yarn workspaces foreach -vp run clean",
"generate": "yarn workspaces foreach -vp run generate",
"build": "yarn clean && yarn workspaces foreach -vp --topological run build",
"lint": "yarn workspaces foreach -vp run lint",
"check-types": "yarn workspaces foreach -vp run check-types",
"coverage": "yarn workspaces foreach -vp run coverage",
"test": "yarn workspaces foreach -vp run test",
"clean": "lerna run clean",
"generate": "lerna run generate",
"build": "yarn clean && lerna run build",
"lint": "lerna run lint",
"check-types": "lerna run check-types",
"coverage": "lerna run coverage",
"test": "lerna run test",
"benchmark:files": "NODE_OPTIONS=--max_old_space_size=4096 benchmark --config .benchrc.yaml",
"benchmark": "yarn benchmark:files 'packages/*/test/perf/**/*.test.ts'",
"benchmark:local": "yarn benchmark --local",
"check-readme": "yarn workspaces foreach -vp run check-readme"
"check-readme": "lerna run check-readme"
},
"devDependencies": {
"@babel/cli": "^7.14.6",
Expand Down Expand Up @@ -45,6 +45,7 @@
"karma-firefox-launcher": "^1.2.0",
"karma-mocha": "^1.3.0",
"karma-webpack": "^5.0.0",
"lerna": "^8.1.3",
"mocha": "^8.3.2",
"nyc": "^15.0.0",
"prettier": "^2.2.1",
Expand All @@ -56,6 +57,6 @@
"webpack-dev-server": "^3.11.2"
},
"resolutions": {
"@chainsafe/ssz": "workspace:^"
"@types/react": "^17.0"
}
}
11 changes: 7 additions & 4 deletions packages/as-sha256/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@
"build"
],
"scripts": {
"clean": "rm -rf ./dist",
"lint": "echo 'no linting for this package'",
"check-types": "echo 'no type check for this package'",
"generate": "rm -rf ./dist && node -r ts-node/register ./scripts/codegen.ts",
"build": "yarn asbuild:untouched && yarn asbuild:optimized && yarn build:lib",
"asbuild:untouched": "asc assembly/index.ts -o build/untouched.wasm -t build/untouched.wat --runtime minimal --target debug",
"asbuild:optimized": "asc assembly/index.ts -o build/optimized.wasm -t build/optimized.wat --runtime minimal --target release -O3z --noAssert",
"build:lib": "run -T tsc -p tsconfig.build.json",
"build:web": "run -T webpack --mode production --entry ./index.js --output ./dist/as-sha256.min.js",
"build:lib": "tsc -p tsconfig.build.json",
"build:web": "webpack --mode production --entry ./index.js --output ./dist/as-sha256.min.js",
"test": "yarn run test:unit",
"test:unit": "yarn run test:unit:node && yarn run test:unit:browser",
"test:unit:node": "run -T mocha -r ts-node/register test/unit/*.test.ts",
"test:unit:browser": "run -T karma start --single-run --browsers ChromeHeadless,FirefoxHeadless karma.config.js",
"test:unit:node": "mocha -r ts-node/register test/unit/*.test.ts",
"test:unit:browser": "karma start --single-run --browsers ChromeHeadless,FirefoxHeadless karma.config.js",
"benchmark": "node -r ts-node/register ./node_modules/.bin/benchmark 'test/perf/index.test.ts'",
"benchmark:local": "yarn benchmark --local",
"test:ci": "yarn test:as-ci"
Expand Down
10 changes: 5 additions & 5 deletions packages/persistent-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"lib"
],
"scripts": {
"check-types": "run -T tsc --noEmit",
"check-types": "tsc --noEmit",
"clean": "rm -rf lib",
"build": "run -T tsc",
"lint": "run -T eslint --color --ext .ts src/",
"build": "tsc",
"lint": "eslint --color --ext .ts src/",
"benchmark": "node --max-old-space-size=4096 --expose-gc -r ts-node/register ./node_modules/.bin/benchmark 'test/perf/*.perf.ts'",
"benchmark:local": "yarn benchmark --local",
"test": "run -T mocha -r ts-node/register 'test/unit/**/*.test.ts'"
"test": "mocha -r ts-node/register 'test/unit/**/*.test.ts'"
},
"pre-push": [
"lint"
Expand All @@ -44,7 +44,7 @@
},
"homepage": "https://github.com/ChainSafe/persistent-merkle-tree#readme",
"dependencies": {
"@chainsafe/as-sha256": "workspace:^",
"@chainsafe/as-sha256": "0.4.2",
"@noble/hashes": "^1.3.0"
}
}
9 changes: 5 additions & 4 deletions packages/persistent-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
],
"scripts": {
"clean": "rm -rf lib",
"build": "run -T tsc",
"lint": "run -T eslint --color --ext .ts src/",
"test:unit": "run -T mocha 'test/unit/**/*.test.ts'",
"test:perf": "run -T mocha 'test/perf/**/*.test.ts'"
"build": "tsc",
"lint": "eslint --color --ext .ts src/",
"check-types": "tsc --noEmit",
"test:unit": "mocha 'test/unit/**/*.test.ts'",
"test:perf": "mocha 'test/perf/**/*.test.ts'"
},
"repository": {
"type": "git",
Expand Down
17 changes: 9 additions & 8 deletions packages/simpleserialize.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
"author": "Chainsafe Systems",
"license": "MIT",
"scripts": {
"check-types": "run -T tsc",
"dev": "cross-env NODE_ENV=development run -T webpack serve --color --progress",
"build": "cross-env NODE_ENV=production run -T webpack --color --progress",
"start": "run -T serve dist",
"lint": "run -T eslint --ext .tsx src/",
"lint:fix": "run -T eslint --ext .tsx src/ --fix"
"clean": "rm -rf ./dist",
"check-types": "tsc",
"dev": "cross-env NODE_ENV=development webpack serve --color --progress",
"build": "cross-env NODE_ENV=production webpack --color --progress",
"start": "serve dist",
"lint": "eslint --ext .tsx src/",
"lint:fix": "eslint --ext .tsx src/ --fix"
},
"dependencies": {
"@babel/runtime": "^7.14.6",
"@babel/types": "^7.14.5",
"@chainsafe/ssz": "workspace:^",
"@chainsafe/ssz": "0.16.0",
"@lodestar/types": "^1.14.0",
"bn.js": "^5.2.0",
"bulma": "^0.9.3",
Expand All @@ -36,7 +37,7 @@
"@types/bn.js": "^5.1.0",
"@types/deep-equal": "^1.0.1",
"@types/file-saver": "^2.0.2",
"@types/react": "^17.0.13",
"@types/react": "^17.0.35",
"@types/react-alert": "^5.2.1",
"@types/react-dom": "^17.0.8",
"@types/react-loading-overlay": "^1.0.0",
Expand Down
24 changes: 12 additions & 12 deletions packages/ssz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
"lib/**/*.js.map"
],
"scripts": {
"build": "run -T tsc --project tsconfig.build.json",
"build-web": "run -T webpack --mode production --entry ./lib/web.js --output ./dist/ssz.min.js",
"build:docs": "run -T typedoc --exclude src/index.ts,src/web.ts --out docs src",
"build": "tsc --project tsconfig.build.json",
"build-web": "webpack --mode production --entry ./lib/web.js --output ./dist/ssz.min.js",
"build:docs": "typedoc --exclude src/index.ts,src/web.ts --out docs src",
"build:release": "yarn clean && yarn run build && yarn build-web && yarn run build:docs",
"check-types": "run -T tsc --noEmit",
"check-types": "tsc --noEmit",
"clean": "rm -rf lib && rm -rf dist && rm -f tsconfig.tsbuildinfo",
"lint": "run -T eslint --color --ext .ts src/ test/",
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"prepublishOnly": "yarn build",
"test": "yarn test:unit",
"benchmark": "node --max-old-space-size=4096 --expose-gc ../../node_modules/.bin/benchmark 'test/perf/*.test.ts'",
"benchmark:local": "yarn benchmark --local",
"test:perf": "run -T mocha \"test/perf/**/*.test.ts\"",
"test:unit": "run -T nyc mocha \"test/unit/**/*.test.ts\"",
"test:perf": "mocha \"test/perf/**/*.test.ts\"",
"test:unit": "nyc mocha \"test/unit/**/*.test.ts\"",
"test:spec": "yarn test:spec-generic && yarn test:spec-static",
"test:spec-generic": "run -T mocha \"test/spec/generic/**/*.test.ts\"",
"test:spec-generic": "mocha \"test/spec/generic/**/*.test.ts\"",
"test:spec-static": "yarn test:spec-static-minimal && yarn test:spec-static-mainnet",
"test:spec-static-minimal": "LODESTAR_PRESET=minimal run -T mocha test/spec/ssz_static.test.ts",
"test:spec-static-mainnet": "LODESTAR_PRESET=mainnet run -T mocha test/spec/ssz_static.test.ts",
"test:spec-static-minimal": "LODESTAR_PRESET=minimal mocha test/spec/ssz_static.test.ts",
"test:spec-static-mainnet": "LODESTAR_PRESET=mainnet mocha test/spec/ssz_static.test.ts",
"download-spec-tests": "node -r ts-node/register test/spec/downloadTests.ts"
},
"types": "lib/index.d.ts",
"dependencies": {
"@chainsafe/as-sha256": "workspace:^",
"@chainsafe/persistent-merkle-tree": "workspace:^"
"@chainsafe/as-sha256": "0.4.2",
"@chainsafe/persistent-merkle-tree": "0.7.2"
},
"devDependencies": {
"@types/js-yaml": "^4.0.5",
Expand Down
Loading

0 comments on commit cf8f049

Please sign in to comment.