Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up some of the scripts
  • Loading branch information
Mrtenz committed Feb 21, 2024
commit d48ba567a017526c7152fd4dc8e1ce8d1657a36c
23 changes: 0 additions & 23 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,6 @@ jobs:
exit 1
fi

post-build:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed all post-tsc scripts for simplicity.

name: Post-build
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn --immutable --immutable-cache
- name: Restore build files
uses: actions/cache@v3
with:
path: |
packages/*/dist
key: build-source-${{ runner.os }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Post-build
run: yarn build:post-tsc:ci

build-simulator:
name: Build "@metamask/snaps-simulator"
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .yarn/plugins/local/plugin-workspaces-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ module.exports = {
validator: isString,
});

noPrivate = Option.Boolean(`--no-private`, false, {
description: `Exclude private workspaces`,
validator: isBoolean,
});

/**
* Run the given command on the workspaces.
*
Expand Down Expand Up @@ -205,6 +210,8 @@ module.exports = {
(!this.exclude ||
!minimatch(workspace.relativeCwd, this.exclude))
);
}).filter((workspace) => {
return !this.noPrivate || !workspace.manifest.private;
});

return await this.run(filteredWorkspaces, this.commandName, this.args);
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"packages/*"
],
"scripts": {
"setup": "yarn install",
"postinstall": "simple-git-hooks",
"lint:eslint": "eslint . --cache --ext js,jsx,ts,tsx",
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' '**/*.html'",
Expand All @@ -21,13 +20,11 @@
"lint:fix": "yarn workspaces foreach --parallel run lint:eslint --fix && yarn lint:misc --write && yarn lint:tsconfig && yarn constraints --fix",
"lint:ci": "yarn lint:eslint && yarn lint:misc --check && yarn lint:tsconfig && yarn constraints && yarn lint:dependencies",
"build": "yarn build:source && yarn build:types && yarn build:post-tsc",
"build:ci": "yarn workspaces foreach --parallel --verbose --exclude root run build:ci",
"build:ci": "yarn workspaces filter --include \"packages/*\" --parallel --topological --no-private run build:ci",
"build:clean": "yarn clean && yarn build",
"build:source": "yarn workspaces foreach --parallel --topological --topological-dev --verbose --exclude root --exclude \"@metamask/example-snaps\" --exclude \"@metamask/invoke-snap-example-snap\" run build",
"build:types": "tsc --build tsconfig.build.json",
"build:examples": "yarn workspace @metamask/example-snaps build",
"build:post-tsc": "yarn workspaces foreach --parallel --topological --topological-dev --verbose run build:post-tsc",
"build:post-tsc:ci": "yarn workspaces foreach --parallel --topological --topological-dev --verbose --exclude root --exclude \"@metamask/snaps-simulator\" --exclude \"@metamask/snaps-execution-environments\" --exclude \"@metamask/snaps-jest\" --exclude \"@metamask/example-snaps\" --exclude \"@metamask/test-snaps\" run build:post-tsc",
"clean": "yarn workspaces foreach --parallel --verbose run clean",
"test": "yarn workspaces foreach --parallel --verbose run test",
"test:browser": "yarn workspaces foreach --verbose run test:browser",
Expand Down
1 change: 0 additions & 1 deletion packages/examples/packages/invoke-snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"scripts": {
"build": "yarn workspaces foreach --parallel --verbose run build",
"build:clean": "yarn clean && yarn build",
"build:post-tsc": "yarn build",
"clean": "yarn workspaces foreach --parallel --verbose run clean",
"start": "yarn workspaces foreach --parallel --verbose --interlaced --jobs unlimited run start",
"test": "yarn workspaces foreach --parallel --verbose --interlaced run test",
Expand Down
3 changes: 1 addition & 2 deletions packages/snaps-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
"dist"
],
"scripts": {
"build": "tsup --clean && yarn build:types",
"build": "tsup --clean && yarn build:types && yarn build:chmod && yarn build:readme",
"build:types": "tsc --project tsconfig.build.json",
"build:post-tsc": "yarn build:chmod && yarn build:readme",
"build:chmod": "chmod +x ./dist/main.mjs && chmod +x ./dist/main.js",
"build:readme": "node ./scripts/updateReadme.js",
"build:watch": "tsc-watch --onSuccess 'yarn build:chmod'",
Expand Down
1 change: 0 additions & 1 deletion packages/snaps-execution-environments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"clean": "rimraf '*.tsbuildinfo' 'dist' 'src/__GENERATED__/' 'coverage/*' '__test__/*'",
"build": "tsup --clean && yarn build:types",
"build:types": "tsc --project tsconfig.build.json",
"build:post-tsc": "yarn build:lavamoat",
"build:lavamoat": "lavamoat scripts/build.js --policy lavamoat/build-system/policy.json --policyOverride lavamoat/build-system/policy-override.json",
"build:lavamoat:policy": "yarn build:lavamoat --writeAutoPolicy && node scripts/build.js --writeAutoPolicy",
"auto-changelog-init": "auto-changelog init",
Expand Down
31 changes: 2 additions & 29 deletions packages/snaps-simulator/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
{
"name": "@metamask/snaps-simulator",
"version": "2.4.3",
"private": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I added private: true here. We previously published this to NPM for snaps-jest, but we no longer use it.

"description": "A simulator for MetaMask Snaps, to be used for testing and development",
"homepage": "https://github.com/MetaMask/snaps#readme",
"bugs": {
"url": "https://github.com/MetaMask/snaps/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/snaps.git"
},
"sideEffects": false,
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/types/index.d.ts"
},
"./package.json": "./package.json"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/types/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup --clean && yarn build:types && yarn build:webpack",
"build:types": "tsc --project tsconfig.build.json",
"build": "yarn build:vendor && yarn build:webpack",
"build:webpack": "yarn webpack --config-name main --config-name test --mode production --progress",
"build:vendor": "webpack --config-name vendor --mode production --progress",
"build:post-tsc": "yarn build:vendor && yarn build:webpack",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn lint:dependencies",
"lint:changelog": "../../scripts/validate-changelog.sh @metamask/snaps-simulator",
"lint:eslint": "eslint . --cache --ext js,ts,jsx,tsx",
Expand Down Expand Up @@ -150,10 +128,5 @@
"engines": {
"node": "^18.16 || >=20"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"build:types": "tsc --project tsconfig.build.json",
"packageManager": "[email protected]"
}
1 change: 0 additions & 1 deletion packages/test-snaps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"start:test": "cross-env NODE_ENV=development webpack serve",
"build": "cross-env NODE_ENV=production webpack",
"build:clean": "yarn clean && yarn build",
"build:post-tsc": "yarn build",
"clean": "rimraf 'dist'",
"lint:eslint": "eslint . --cache --ext js,ts,jsx,tsx",
"lint:misc": "prettier --no-error-on-unmatched-pattern --loglevel warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" --ignore-path ../../.gitignore",
Expand Down