Commit 5b13bad9 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

cleanup: rm more js (#11260)

* deps: pull js together

Puts all js in the single package where it is used

* deps: move linting config

* nx: remove config

* changesets: remove

* npmignore: remove

* npmrc: remove workspace

* ci: cleanup

* check-changed: remove nx dep

* build: attempt fix

* ci: cleanup
parent d837696f
...@@ -206,7 +206,7 @@ jobs: ...@@ -206,7 +206,7 @@ jobs:
- "node_modules" - "node_modules"
- run: - run:
name: Install dependencies name: Install dependencies
command: pnpm install:ci:offline command: pnpm install
- run: - run:
name: print forge version name: print forge version
command: forge --version command: forge --version
...@@ -579,7 +579,8 @@ jobs: ...@@ -579,7 +579,8 @@ jobs:
# populate node modules from the cache # populate node modules from the cache
- run: - run:
name: Install dependencies name: Install dependencies
command: pnpm install:ci command: pnpm install
working_directory: packages/contracts-bedrock
- run: - run:
name: forge version name: forge version
command: forge --version command: forge --version
...@@ -687,7 +688,7 @@ jobs: ...@@ -687,7 +688,7 @@ jobs:
- attach_workspace: { at: "." } - attach_workspace: { at: "." }
- run: - run:
name: Install dependencies name: Install dependencies
command: pnpm install:ci command: pnpm install
- check-changed: - check-changed:
patterns: contracts-bedrock patterns: contracts-bedrock
- run: - run:
...@@ -695,40 +696,6 @@ jobs: ...@@ -695,40 +696,6 @@ jobs:
command: pnpm validate-spacers command: pnpm validate-spacers
working_directory: packages/contracts-bedrock working_directory: packages/contracts-bedrock
js-lint-test:
parameters:
package_name:
description: Package name
type: string
dependencies:
description: Regex matching dependent packages
type: string
default: this-package-does-not-exist
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: large
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore PNPM Package Cache
keys:
- pnpm-packages-v2-{{ checksum "pnpm-lock.yaml" }}
- check-changed:
patterns: <<parameters.package_name>>,<<parameters.dependencies>>
# populate node modules from the cache
- run:
name: Install dependencies
command: pnpm install:ci
- run:
name: Lint
command: pnpm lint && git diff --exit-code
working_directory: packages/<<parameters.package_name>>
- run:
name: Test
command: pnpm test
working_directory: packages/<<parameters.package_name>>
todo-issues: todo-issues:
machine: machine:
image: <<pipeline.parameters.base_image>> image: <<pipeline.parameters.base_image>>
......
module.exports = {
root: true,
env: {
browser: true,
es6: true,
},
ignorePatterns: ['dist', 'coverage'],
extends: ['plugin:prettier/recommended'],
parser: '@babel/eslint-parser',
parserOptions: {
es6: true,
ecmaVersion: 6,
sourceType: 'module',
requireConfigFile: false,
},
plugins: [
'eslint-plugin-import',
'eslint-plugin-jsdoc',
'eslint-plugin-prefer-arrow',
'@typescript-eslint',
],
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './packages/**/tsconfig.json',
sourceType: 'module',
allowAutomaticSingleRunInference: true,
},
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/member-delimiter-style': [
'off',
{
multiline: {
delimiter: 'none',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-shadow': [
'error',
{
hoist: 'all',
},
],
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/semi': ['off', null],
'@typescript-eslint/triple-slash-reference': [
'error',
{
path: 'always',
types: 'prefer-import',
lib: 'always',
},
],
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/no-unused-vars': 'error',
},
},
],
rules: {
'prettier/prettier': 'warn',
'arrow-parens': ['off', 'always'],
'brace-style': ['off', 'off'],
'comma-dangle': 'off',
complexity: 'off',
'constructor-super': 'error',
curly: 'error',
'dot-notation': 'off',
'eol-last': 'off',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'id-blacklist': 'off',
'id-match': 'off',
'import/no-extraneous-dependencies': ['error'],
'import/no-internal-modules': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
'newlines-between': 'always',
},
],
indent: 'off',
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
'linebreak-style': 'off',
'max-classes-per-file': 'off',
'max-len': 'off',
'new-parens': 'off',
'newline-per-chained-call': 'off',
'no-bitwise': 'off',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'off',
'no-debugger': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-extra-semi': 'off',
'no-fallthrough': 'off',
'no-invalid-this': 'off',
'no-irregular-whitespace': 'off',
'no-multiple-empty-lines': 'off',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-redeclare': 'error',
'no-return-await': 'error',
'no-sequences': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'off',
'no-undef-init': 'error',
'no-underscore-dangle': 'off',
'no-unsafe-finally': 'error',
'no-unused-expressions': 'off',
'no-unused-labels': 'error',
'no-use-before-define': 'off',
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'padded-blocks': [
'off',
{
blocks: 'never',
},
{
allowSingleLineBlocks: true,
},
],
'prefer-arrow/prefer-arrow-functions': 'error',
'prefer-const': 'error',
'prefer-object-spread': 'error',
'quote-props': 'off',
quotes: 'off',
radix: 'error',
'react/jsx-curly-spacing': 'off',
'react/jsx-equals-spacing': 'off',
'react/jsx-tag-spacing': [
'off',
{
afterOpening: 'allow',
closingSlash: 'allow',
},
],
'react/jsx-wrap-multilines': 'off',
semi: 'off',
'space-before-blocks': 'error',
'space-before-function-paren': 'off',
'space-in-parens': ['off', 'never'],
'unicorn/prefer-ternary': 'off',
'use-isnan': 'error',
'valid-typeof': 'off',
},
}
...@@ -3,7 +3,6 @@ node_modules ...@@ -3,7 +3,6 @@ node_modules
results results
temp temp
coverage.json coverage.json
*.tsbuildinfo
**/lcov.info **/lcov.info
yarn-error.log yarn-error.log
......
...@@ -2,4 +2,3 @@ ...@@ -2,4 +2,3 @@
# npm and yarn support this as a default pnpm defaults to false # npm and yarn support this as a default pnpm defaults to false
enable-pre-post-scripts=true enable-pre-post-scripts=true
lockfile=true lockfile=true
prefer-workspace-packages=true
// This function does not modify the lockfile. It asserts that packages do not use SSH
// when specifying git repository
function afterAllResolved(lockfile, context) {
const pkgs = lockfile['packages'];
for (const [pkg, entry] of Object.entries(pkgs)) {
const repo = entry.resolution['repo'];
if (repo !== undefined) {
if (repo.startsWith('git@github.com')) {
throw new Error(`Invalid git ssh specification found for package ${pkg}. Ensure sure that the dependencies do not reference SSH-based git repos before running installing them`);
}
}
}
return lockfile
}
module.exports = {
hooks: {
afterAllResolved
}
}
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"defaultBase": "develop",
"neverConnectToCloud": true,
"affected": {
"defaultBase": "develop"
},
"implicitDependencies": {
"nx.json": "*",
"tsconfig.json": "*",
".foundryrc": "*",
"pnpm.lock.yaml": "*",
".npmrc": "*",
".nvmrc": "*"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"accessToken": "MDdkNmQwZWEtOGYwNy00ZjhkLWI5NGMtNjBiNGExY2Q5MzI2fHJlYWQ=",
"cacheableOperations": [
"lint",
"build",
"test",
"build:contracts",
"autogen:artifacts"
]
}
}
},
"namedInputs": {
"configsWorkspace": [
"{workspaceRoot}/package.json",
"{workspaceRoot}/tsconfig.json"
],
"configsProject": [
"{projectRoot}/foundry.toml",
"{projectRoot}/tsconfig.json",
"{projectRoot}/package.json"
],
"default": ["{projectRoot}/**/*", "configsWorkspace"],
"srcGenerated": [
"{projectRoot}/src/contract-artifacts.ts",
"{projectRoot}/src/contract-deployed-artifacts.ts"
],
"productionSrc": [
"{projectRoot}/src/**/*",
"!{projectRoot}/src/**/*.spec.ts"
],
"productionContracts": ["{projectRoot}/contracts/**/*"],
"production": ["productionSrc", "productionContracts"],
"testing": ["configsWorkspace", "default"]
},
"targetDefaults": {
"lint": {
"inputs": ["default"]
},
"test": {
"inputs": ["default", "testing", "^production"],
"dependsOn": ["^build"]
},
"generate": {
"dependsOn": ["^build"]
},
"build:contracts": {
"inputs": [
"configsProject",
"productionContracts",
"^productionContracts"
],
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/artifacts", "{projectRoot}/forge-artifacts"]
},
"build": {
"inputs": [
"configsWorkspace",
"configsProject",
"production",
"^production"
],
"dependsOn": ["^build", "build:contracts"],
"outputs": ["{projectRoot}/dist"]
}
}
}
...@@ -13,9 +13,6 @@ REBUILD_ALL_PATTERNS = [ ...@@ -13,9 +13,6 @@ REBUILD_ALL_PATTERNS = [
r'^package\.json', r'^package\.json',
r'ops/check-changed/.*', r'ops/check-changed/.*',
] ]
with open("../../nx.json") as file:
nx_json_data = json.load(file)
REBUILD_ALL_PATTERNS += nx_json_data["implicitDependencies"].keys()
GO_PATTERNS = [ GO_PATTERNS = [
r'^go\.mod', r'^go\.mod',
......
{ {
"name": "optimism", "name": "optimism",
"version": "1.0.0", "version": "1.0.0",
"author": "Optimism PBC", "author": "OP Labs PBC",
"license": "MIT", "license": "MIT",
"private": true,
"engines": {
"node": ">=16",
"pnpm": ">=9"
},
"scripts": { "scripts": {
"clean": "pnpm recursive run clean; rm -rf node_modules packages/*/node_modules && echo 'Finished cleaning. Run `pnpm install && pnpm build` from root of repo to rebuild the repo.'", "clean": "rm -rf node_modules packages/**/node_modules",
"bindings": "nx bindings @eth-optimism/contracts-bedrock", "build": "cd packages/contracts-bedrock && pnpm build",
"build": "npx nx run-many --target=build", "test": "cd packages/contracts-bedrock && pnpm test",
"test": "npx nx run-many --target=test",
"issues": "./ops/scripts/todo-checker.sh", "issues": "./ops/scripts/todo-checker.sh",
"install:ci": "pnpm install --ignore-scripts --frozen-lockfile && pnpm rebuild nx",
"install:ci:offline": "pnpm install --ignore-scripts --offline --frozen-lockfile && pnpm rebuild nx",
"lint": "npx nx run-many --target=lint",
"lint:ts:check": "npx nx run-many --target=lint:ts:check",
"lint:check": "npx nx run-many --target=lint:check",
"lint:fix": "npx nx run-many --target=lint:fix",
"lint:shellcheck": "find . -type f -name '*.sh' -not -path '*/node_modules/*' -not -path './packages/contracts-bedrock/lib/*' -not -path './packages/contracts-bedrock/kout*/*' -exec sh -c 'echo \"Checking $1\"; shellcheck \"$1\"' _ {} \\;", "lint:shellcheck": "find . -type f -name '*.sh' -not -path '*/node_modules/*' -not -path './packages/contracts-bedrock/lib/*' -not -path './packages/contracts-bedrock/kout*/*' -exec sh -c 'echo \"Checking $1\"; shellcheck \"$1\"' _ {} \\;",
"preinstall": "npx only-allow pnpm",
"ready": "pnpm lint && pnpm test",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry", "install:foundry": "curl -L https://foundry.paradigm.xyz | bash && pnpm update:foundry",
"update:foundry": "bash ./ops/scripts/install-foundry.sh", "update:foundry": "bash ./ops/scripts/install-foundry.sh",
"check:foundry": "bash ./packages/contracts-bedrock/scripts/checks/check-foundry-install.sh", "check:foundry": "bash ./packages/contracts-bedrock/scripts/checks/check-foundry-install.sh",
...@@ -36,25 +22,5 @@ ...@@ -36,25 +22,5 @@
"print:slither": "slither --version", "print:slither": "slither --version",
"check:slither": "[[ $(pnpm -s print:slither) = $(jq -r .slither < versions.json) ]] && echo '✓ slither versions match' || (echo '✗ slither version mismatch. Run `pnpm upgrade:slither` to upgrade.' && exit 1)", "check:slither": "[[ $(pnpm -s print:slither) = $(jq -r .slither < versions.json) ]] && echo '✓ slither versions match' || (echo '✗ slither version mismatch. Run `pnpm upgrade:slither` to upgrade.' && exit 1)",
"upgrade:slither": "jq '.slither = $v' --arg v $(pnpm -s print:slither) <<<$(cat versions.json) > versions.json" "upgrade:slither": "jq '.slither = $v' --arg v $(pnpm -s print:slither) <<<$(cat versions.json) > versions.json"
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.10",
"@types/node": "^20.14.12",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"doctoc": "^2.2.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.8.3",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^4.0.0",
"nx": "18.2.2",
"nx-cloud": "latest",
"prettier": "^2.8.0",
"typescript": "^5.5.4"
},
"dependencies": {
} }
} }
module.exports = { module.exports = {
extends: '../../.eslintrc.js', root: true,
ignorePatterns: ['src/contract-artifacts.ts'], env: {
browser: true,
es6: true,
},
ignorePatterns: ['dist', 'coverage'],
extends: ['plugin:prettier/recommended'],
parser: '@babel/eslint-parser',
parserOptions: {
es6: true,
ecmaVersion: 6,
sourceType: 'module',
requireConfigFile: false,
},
plugins: [
'eslint-plugin-import',
'eslint-plugin-jsdoc',
'eslint-plugin-prefer-arrow',
'@typescript-eslint',
],
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './packages/**/tsconfig.json',
sourceType: 'module',
allowAutomaticSingleRunInference: true,
},
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/member-delimiter-style': [
'off',
{
multiline: {
delimiter: 'none',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-shadow': [
'error',
{
hoist: 'all',
},
],
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/semi': ['off', null],
'@typescript-eslint/triple-slash-reference': [
'error',
{
path: 'always',
types: 'prefer-import',
lib: 'always',
},
],
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/no-unused-vars': 'error',
},
},
],
rules: {
'prettier/prettier': 'warn',
'arrow-parens': ['off', 'always'],
'brace-style': ['off', 'off'],
'comma-dangle': 'off',
complexity: 'off',
'constructor-super': 'error',
curly: 'error',
'dot-notation': 'off',
'eol-last': 'off',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'id-blacklist': 'off',
'id-match': 'off',
'import/no-extraneous-dependencies': ['error'],
'import/no-internal-modules': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
'newlines-between': 'always',
},
],
indent: 'off',
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
'linebreak-style': 'off',
'max-classes-per-file': 'off',
'max-len': 'off',
'new-parens': 'off',
'newline-per-chained-call': 'off',
'no-bitwise': 'off',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'off',
'no-debugger': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-extra-semi': 'off',
'no-fallthrough': 'off',
'no-invalid-this': 'off',
'no-irregular-whitespace': 'off',
'no-multiple-empty-lines': 'off',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-redeclare': 'error',
'no-return-await': 'error',
'no-sequences': 'error',
'no-sparse-arrays': 'error',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'off',
'no-undef-init': 'error',
'no-underscore-dangle': 'off',
'no-unsafe-finally': 'error',
'no-unused-expressions': 'off',
'no-unused-labels': 'error',
'no-use-before-define': 'off',
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'padded-blocks': [
'off',
{
blocks: 'never',
},
{
allowSingleLineBlocks: true,
},
],
'prefer-arrow/prefer-arrow-functions': 'error',
'prefer-const': 'error',
'prefer-object-spread': 'error',
'quote-props': 'off',
quotes: 'off',
radix: 'error',
'react/jsx-curly-spacing': 'off',
'react/jsx-equals-spacing': 'off',
'react/jsx-tag-spacing': [
'off',
{
afterOpening: 'allow',
closingSlash: 'allow',
},
],
'react/jsx-wrap-multilines': 'off',
semi: 'off',
'space-before-blocks': 'error',
'space-before-function-paren': 'off',
'space-in-parens': ['off', 'never'],
'unicorn/prefer-ternary': 'off',
'use-isnan': 'error',
'valid-typeof': 'off',
},
} }
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
"version": "0.17.3", "version": "0.17.3",
"description": "Contracts for Optimism Specs", "description": "Contracts for Optimism Specs",
"license": "MIT", "license": "MIT",
"engines": {
"node": ">=16",
"pnpm": ">=9"
},
"files": [ "files": [
"forge-artifacts/**/*.json", "forge-artifacts/**/*.json",
"!forge-artifacts/**/*.t.sol/*.json", "!forge-artifacts/**/*.t.sol/*.json",
...@@ -45,8 +49,19 @@ ...@@ -45,8 +49,19 @@
"lint": "pnpm lint:fix && pnpm lint:check" "lint": "pnpm lint:fix && pnpm lint:check"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.23.10",
"@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0", "@typescript-eslint/parser": "^6.21.0",
"@types/node": "^20.14.12",
"doctoc": "^2.2.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.8.3",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.8.0",
"tsx": "^4.16.2", "tsx": "^4.16.2",
"typescript": "^5.5.4" "typescript": "^5.5.4"
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
packages:
- 'packages/*'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment