-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit aligns this repo more closely with our module template. - Add `packageManager` to `package.json` - Add `allow-scripts` Yarn plugin - Add Yarn constraints (but modified to suit this package, whose build pipeline is not fully standardized with the module template) - Remove `setup` script (since `allow-scripts` gets called automatically now) - Replace `prepublishOnly` script with `prepack` - Update GitHub workflow to install Yarn via Corepack - Update Yarn-specific section of `.gitignore` - Update installation instructions in README - Upgrade `eslint-plugin-jsdoc` as the version we were using was previously not compatible with the version of Node we are using, but Yarn v1 did not pick this up. Fix lint violations to match.
- Loading branch information
Showing
12 changed files
with
6,666 additions
and
4,396 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
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,9 @@ | ||
/* eslint-disable */ | ||
//prettier-ignore | ||
module.exports = { | ||
name: "@yarnpkg/plugin-allow-scripts", | ||
factory: function (require) { | ||
var plugin=(()=>{var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var u=(t,o)=>{for(var e in o)l(t,e,{get:o[e],enumerable:!0})},f=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of a(o))!c.call(t,i)&&i!==e&&l(t,i,{get:()=>o[i],enumerable:!(r=s(o,i))||r.enumerable});return t};var m=t=>f(l({},"__esModule",{value:!0}),t);var g={};u(g,{default:()=>d});var n=p("@yarnpkg/shell"),x={hooks:{afterAllInstalled:async()=>{let t=await(0,n.execute)("yarn run allow-scripts");t!==0&&process.exit(t)}}},d=x;return m(g);})(); | ||
return plugin; | ||
} | ||
}; |
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,17 @@ | ||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
enableScripts: false | ||
|
||
enableTelemetry: 0 | ||
|
||
logFilters: | ||
- code: YN0004 | ||
level: discard | ||
|
||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs | ||
spec: 'https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js' |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@metamask/eth-block-tracker", | ||
"version": "11.0.3", | ||
"description": "A block tracker for the Ethereum blockchain. Keeps track of the latest block.", | ||
"description": "A block tracker for the Ethereum blockchain. Keeps track of the latest block", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/MetaMask/eth-block-tracker.git" | ||
|
@@ -15,12 +15,12 @@ | |
"scripts": { | ||
"build": "tsc --project tsconfig.build.json", | ||
"build:clean": "rimraf dist && yarn build", | ||
"lint": "yarn lint:eslint && yarn lint:misc --check", | ||
"lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check", | ||
"lint:constraints": "yarn constraints", | ||
"lint:eslint": "eslint . --cache --ext js,ts", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write", | ||
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", | ||
"prepublishOnly": "yarn build:clean && yarn lint && yarn test", | ||
"setup": "yarn install && yarn allow-scripts", | ||
"prepack": "./scripts/prepack.sh", | ||
"test": "jest", | ||
"test:watch": "jest --watch" | ||
}, | ||
|
@@ -45,12 +45,13 @@ | |
"@types/pify": "^5.0.1", | ||
"@typescript-eslint/eslint-plugin": "^5.61.0", | ||
"@typescript-eslint/parser": "^5.61.0", | ||
"@yarnpkg/types": "^4.0.0", | ||
"eslint": "^8.21.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-import-resolver-typescript": "^2.7.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^27.1.5", | ||
"eslint-plugin-jsdoc": "^39.9.1", | ||
"eslint-plugin-jsdoc": "^41.0.0", | ||
"eslint-plugin-n": "^15.7.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
|
@@ -62,6 +63,7 @@ | |
"ts-node": "^10.7.0", | ||
"typescript": "~4.8.4" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": "^18.16 || ^20 || >=22" | ||
}, | ||
|
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
if [[ -n $SKIP_PREPACK ]]; then | ||
echo "Notice: skipping prepack." | ||
exit 0 | ||
fi | ||
|
||
yarn build |
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.