Skip to content

Commit 9fcba7a

Browse files
authored
Update repository to match module template (February 2024) (#133)
* Update repository to match module template (February 2024) * Update coverage * Restore support for Node.js 16 * Bump @metamask/utils * Restore Node.js 16 in CI * Update Node version constraint
1 parent e009a7d commit 9fcba7a

20 files changed

+1394
-248
lines changed

.depcheckrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"@lavamoat/preinstall-always-fail",
55
"@metamask/auto-changelog",
66
"@types/*",
7+
"@yarnpkg/*",
8+
"clipanion",
79
"prettier-plugin-packagejson",
810
"ts-node",
911
"typedoc"

.eslintrc.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@ module.exports = {
1919

2020
{
2121
files: ['*.test.ts', '*.test.js'],
22-
extends: ['@metamask/eslint-config-jest'],
22+
extends: [
23+
'@metamask/eslint-config-jest',
24+
'@metamask/eslint-config-nodejs',
25+
],
2326
},
2427
],
2528

26-
ignorePatterns: ['!.eslintrc.js', '!.prettierrc.js', 'dist/', 'docs/'],
29+
ignorePatterns: [
30+
'!.eslintrc.js',
31+
'!.prettierrc.js',
32+
'dist/',
33+
'docs/',
34+
'.yarn/',
35+
],
2736
};

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Lines starting with '#' are comments.
22
# Each line is a file pattern followed by one or more owners.
33

4-
* @MetaMask/devs
4+
* @MetaMask/engineering

.github/workflows/build-lint-test.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ jobs:
2222
runs-on: ubuntu-latest
2323
needs:
2424
- prepare
25-
strategy:
26-
matrix:
27-
node-version: [16.x, 18.x, 20.x]
2825
steps:
2926
- uses: actions/checkout@v3
30-
- name: Use Node.js ${{ matrix.node-version }}
27+
- name: Use Node.js
3128
uses: actions/setup-node@v3
3229
with:
33-
node-version: ${{ matrix.node-version }}
30+
node-version-file: '.nvmrc'
3431
cache: 'yarn'
3532
- run: yarn --immutable --immutable-cache
3633
- run: yarn build
@@ -47,24 +44,21 @@ jobs:
4744
runs-on: ubuntu-latest
4845
needs:
4946
- prepare
50-
strategy:
51-
matrix:
52-
node-version: [16.x, 18.x, 20.x]
5347
steps:
5448
- uses: actions/checkout@v3
55-
- name: Use Node.js ${{ matrix.node-version }}
49+
- name: Use Node.js
5650
uses: actions/setup-node@v3
5751
with:
58-
node-version: ${{ matrix.node-version }}
52+
node-version-file: '.nvmrc'
5953
cache: 'yarn'
6054
- run: yarn --immutable --immutable-cache
6155
- run: yarn lint
6256
- name: Validate RC changelog
6357
if: ${{ startsWith(github.head_ref, 'release/') }}
64-
run: yarn auto-changelog validate --rc
58+
run: yarn lint:changelog --rc
6559
- name: Validate changelog
6660
if: ${{ !startsWith(github.head_ref, 'release/') }}
67-
run: yarn auto-changelog validate
61+
run: yarn lint:changelog
6862
- name: Require clean working directory
6963
shell: bash
7064
run: |
@@ -97,3 +91,29 @@ jobs:
9791
echo "Working tree dirty at end of job"
9892
exit 1
9993
fi
94+
95+
compatibility-test:
96+
name: Compatibility test
97+
runs-on: ubuntu-latest
98+
needs:
99+
- prepare
100+
strategy:
101+
matrix:
102+
node-version: [16.x, 18.x, 20.x]
103+
steps:
104+
- uses: actions/checkout@v3
105+
- name: Use Node.js ${{ matrix.node-version }}
106+
uses: actions/setup-node@v3
107+
with:
108+
node-version: ${{ matrix.node-version }}
109+
cache: 'yarn'
110+
- run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn
111+
- run: yarn test
112+
- name: Require clean working directory
113+
shell: bash
114+
run: |
115+
git restore yarn.lock
116+
if ! git diff --exit-code; then
117+
echo "Working tree dirty at end of job"
118+
exit 1
119+
fi

.github/workflows/create-release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: actions/setup-node@v3
3434
with:
3535
node-version-file: '.nvmrc'
36-
- uses: MetaMask/action-create-release-pr@v2
36+
- uses: MetaMask/action-create-release-pr@v3
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
with:

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16
1+
lts/*

.yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module.exports = {
44
name: "@yarnpkg/plugin-allow-scripts",
55
factory: function (require) {
6-
var plugin=(()=>{var a=Object.create,l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var u=e=>l(e,"__esModule",{value:!0});var f=e=>{if(typeof require!="undefined")return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')};var g=(e,o)=>{for(var r in o)l(e,r,{get:o[r],enumerable:!0})},m=(e,o,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of s(o))!c.call(e,t)&&t!=="default"&&l(e,t,{get:()=>o[t],enumerable:!(r=i(o,t))||r.enumerable});return e},x=e=>m(u(l(e!=null?a(p(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var k={};g(k,{default:()=>d});var n=x(f("@yarnpkg/shell")),y={hooks:{afterAllInstalled:async()=>{let e=await(0,n.execute)("yarn run allow-scripts");e!==0&&process.exit(e)}}},d=y;return k;})();
6+
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);})();
77
return plugin;
88
}
99
};

.yarn/plugins/@yarnpkg/plugin-constraints.cjs

Lines changed: 52 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.2.4.cjs

100644100755
File mode changed.

.yarnrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
enableScripts: false
22

3+
enableTelemetry: 0
4+
35
logFilters:
46
- code: YN0004
57
level: discard
@@ -9,5 +11,7 @@ nodeLinker: node-modules
911
plugins:
1012
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
1113
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
14+
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
15+
spec: "@yarnpkg/plugin-constraints"
1216

1317
yarnPath: .yarn/releases/yarn-3.2.4.cjs

0 commit comments

Comments
 (0)