Skip to content
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

Implement JavaScript-based constraints #220

Merged
merged 10 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .depcheckrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"@lavamoat/preinstall-always-fail",
"@metamask/auto-changelog",
"@types/*",
"@yarnpkg/types",
"prettier-plugin-packagejson",
"ts-node",
"typedoc"
Expand Down
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ module.exports = {
extends: ['@metamask/eslint-config-nodejs'],
},

{
files: ['yarn.config.cjs'],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2020,
mcmire marked this conversation as resolved.
Show resolved Hide resolved
},
settings: {
jsdoc: {
mode: 'typescript',
mcmire marked this conversation as resolved.
Show resolved Hide resolved
},
},
extends: ['@metamask/eslint-config-nodejs'],
},

{
files: ['*.test.ts', '*.test.js'],
extends: [
Expand Down
52 changes: 0 additions & 52 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

This file was deleted.

786 changes: 0 additions & 786 deletions .yarn/releases/yarn-3.2.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
compressionLevel: mixed
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for these new config options?

Copy link
Member Author

Choose a reason for hiding this comment

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

They were added by Yarn when updating the version. I haven't changed anything.


enableGlobalCache: false

enableScripts: false

enableTelemetry: 0
Expand All @@ -11,7 +15,5 @@ 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"
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
spec: "@yarnpkg/plugin-constraints"

yarnPath: .yarn/releases/yarn-3.2.1.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
mcmire marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ Follow these instructions when using this template.

## Installation

`yarn add @metamask/this-module`
`yarn add @metamask/metamask-module-template`

or

`npm install @metamask/this-module`
`npm install @metamask/metamask-module-template`

## Usage

Expand Down
99 changes: 0 additions & 99 deletions constraints.pro

This file was deleted.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@metamask/module-template",
"name": "@metamask/metamask-module-template",
"version": "0.0.0",
"description": "The MetaMask Node module template",
"homepage": "https://github.com/MetaMask/metamask-module-template#readme",
Expand All @@ -13,9 +13,9 @@
"sideEffects": false,
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/types/index.d.ts"
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
Expand All @@ -33,7 +33,7 @@
"lint:changelog": "auto-changelog validate --prettier",
"lint:constraints": "yarn constraints",
"lint:dependencies": "depcheck && yarn dedupe",
"lint:eslint": "eslint . --cache --ext js,ts",
"lint:eslint": "eslint . --cache --ext js,cjs,ts",
"lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog",
"lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
"prepack": "./scripts/prepack.sh",
Expand All @@ -52,6 +52,7 @@
"@types/node": "^16",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@yarnpkg/types": "^4.0.0-rc.52",
"depcheck": "^1.4.3",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
Expand All @@ -71,7 +72,7 @@
"typedoc": "^0.23.15",
"typescript": "~4.8.4"
},
"packageManager": "yarn@3.2.1",
"packageManager": "yarn@4.1.1",
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
Loading