mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-07 07:47:59 +01:00
chore(repo): config cleanups and improvements (TS, Nx...) (#11096)
* chore(repo): config cleanups and improvements (TS, Nx...) * fix connect e2e * chore: add eslin cache file to nx cache * chore: add stylelint cache file to nx * chore: add ts-node config for to base.tsconfig.json
This commit is contained in:
13
nx.json
13
nx.json
@@ -15,24 +15,24 @@
|
||||
"dependsOn": ["^build:lib"],
|
||||
"inputs": [
|
||||
"^prod",
|
||||
"{workspaceRoot}/tsconfig.json",
|
||||
"{workspaceRoot}/tsconfig.base.json",
|
||||
"{workspaceRoot}/tsconfig.lib.json"
|
||||
],
|
||||
"outputs": ["{projectRoot}/lib", "{projectRoot}/build"],
|
||||
"cache": true
|
||||
},
|
||||
"type-check": {
|
||||
"dependsOn": ["^build:lib", "^type-check"],
|
||||
"dependsOn": ["^build:lib", "^type-check", "build:lib"],
|
||||
"inputs": [
|
||||
"^prod",
|
||||
"{workspaceRoot}/tsconfig.json",
|
||||
"{workspaceRoot}/tsconfig.base.json",
|
||||
"{workspaceRoot}/tsconfig.lib.json"
|
||||
],
|
||||
"outputs": ["{projectRoot}/libDev"],
|
||||
"cache": true
|
||||
},
|
||||
"test:unit": {
|
||||
"dependsOn": ["^build:lib"],
|
||||
"dependsOn": ["^build:lib", "build:lib"],
|
||||
"inputs": [
|
||||
"^prod",
|
||||
"{workspaceRoot}/jest.config.base.js",
|
||||
@@ -42,13 +42,12 @@
|
||||
},
|
||||
"lint:js": {
|
||||
"inputs": ["default", "{workspaceRoot}/.eslintrc.js"],
|
||||
"outputs": ["{projectRoot}/.eslintcache"],
|
||||
"cache": true
|
||||
},
|
||||
"lint:styles": {
|
||||
"inputs": ["default"],
|
||||
"cache": true
|
||||
},
|
||||
"lint": {
|
||||
"outputs": ["{projectRoot}/.stylelintcache"],
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"nx:lint:styles": "yarn nx affected --target=lint:styles",
|
||||
"_______ Commands _______": "Useful commands and scripts.",
|
||||
"patch": "yarn patch-package",
|
||||
"update-project-references": "yarn tsx ./scripts/updateProjectReferences.js",
|
||||
"update-project-references": "yarn tsx ./scripts/updateProjectReferences.ts",
|
||||
"verify-project-references": "yarn update-project-references --test",
|
||||
"check-workspace-resolutions": "yarn tsx ./scripts/check-workspace-resolutions.ts",
|
||||
"generate-package": "yarn tsx ./scripts/generatePackage.js",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["src/**/*", "package.json"],
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../type-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "libDev",
|
||||
"lib": ["webworker"],
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"sideEffects": false,
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"lint": "eslint '**/*.{ts,js}'",
|
||||
"lint:js": "eslint '**/*.{ts,js}'",
|
||||
"test:unit": "jest --version && jest",
|
||||
"test:discovery": "tsx ./tests/tools/discovery-test.ts",
|
||||
"test:anonymity": "tsx ./tests/tools/anonymity-test.ts",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../blockchain-link" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@trezor/theme": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [{ "path": "../analytics" }]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": [{ "path": "../../connect" }]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": [{ "path": "../../connect" }]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": []
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": [{ "path": "../../connect" }]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./libDev",
|
||||
"types": ["web", "node"]
|
||||
@@ -8,10 +8,5 @@
|
||||
"references": [
|
||||
{ "path": "../connect-explorer" },
|
||||
{ "path": "../connect-web" }
|
||||
],
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"types": ["chrome"],
|
||||
"noImplicitAny": false,
|
||||
@@ -16,10 +16,5 @@
|
||||
{ "path": "../connect-webextension" },
|
||||
{ "path": "../protobuf" },
|
||||
{ "path": "../utils" }
|
||||
],
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./libDev",
|
||||
"types": ["web", "w3c-web-usb", "jest"]
|
||||
@@ -10,10 +10,5 @@
|
||||
{ "path": "../connect-analytics" },
|
||||
{ "path": "../connect-common" },
|
||||
{ "path": "../env-utils" }
|
||||
],
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": false,
|
||||
"outDir": "./libDev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": []
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./libDev",
|
||||
"types": ["web", "w3c-web-usb", "jest"]
|
||||
@@ -19,10 +19,5 @@
|
||||
{ "path": "../node-utils" },
|
||||
{ "path": "../trezor-user-env-link" },
|
||||
{ "path": "../utils" }
|
||||
],
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../components" },
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "libDev",
|
||||
"types": [
|
||||
"chrome",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"isolatedModules": false,
|
||||
"outDir": "./lib",
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
"version:patch": "tsx scripts/bump-version.ts patch",
|
||||
"version:minor": "tsx scripts/bump-version.ts minor",
|
||||
"version:major": "tsx scripts/bump-version.ts major",
|
||||
"test:e2e:web": "ts-node -O '{\"module\": \"commonjs\"}' ./e2e/run.ts web",
|
||||
"test:e2e:node": "ts-node -O '{\"module\": \"commonjs\"}' ./e2e/run.ts node",
|
||||
"test:e2e:web": "ts-node -O '{\"module\": \"commonjs\", \"moduleResolution\": \"node\"}' ./e2e/run.ts web",
|
||||
"test:e2e:node": "ts-node -O '{\"module\": \"commonjs\", \"moduleResolution\": \"node\"}' ./e2e/run.ts node",
|
||||
"prepublishOnly": "yarn tsx ../../scripts/prepublishNPM.js",
|
||||
"prepublish": "yarn tsx ../../scripts/prepublish.js"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "libDev",
|
||||
"composite": true
|
||||
"outDir": "libDev"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../blockchain-link" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [{ "path": "../connect" }]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"main": "src/index",
|
||||
"browser": "src/proxy",
|
||||
"scripts": {
|
||||
"lint": "eslint '**/*.{ts,tsx,js}'",
|
||||
"lint:js": "eslint '**/*.{ts,tsx,js}'",
|
||||
"test:unit": "jest -c ./jest.config.js",
|
||||
"type-check": "tsc --build"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": false,
|
||||
"outDir": "libDev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"include": ["src"],
|
||||
"references": [{ "path": "../schema-utils" }]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": []
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../type-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": false,
|
||||
"outDir": "libDev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": false,
|
||||
"outDir": "libDev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [{ "path": "../analytics" }]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "./libDev"
|
||||
},
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": ["."],
|
||||
"references": [
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"noImplicitAny": false,
|
||||
"outDir": "./libDev"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": false,
|
||||
"esModuleInterop": false,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"scripts": {
|
||||
"build:core": "rimraf dist && TS_NODE_PROJECT=\"tsconfig.json\" yarn webpack --config ./webpack/core.webpack.config.ts",
|
||||
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
|
||||
"type-check": "tsc --build tsconfig.json && tsc --build scripts/tsconfig.json",
|
||||
"type-check": "tsc --build tsconfig.json",
|
||||
"test:unit": "jest",
|
||||
"test:e2e": "yarn xvfb-maybe -- playwright test --config=./e2e/playwright.config.ts"
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
const { notarize } = require('@electron/notarize');
|
||||
|
||||
// @ts-expect-error cannot import AfterPackContext as type using require
|
||||
exports.default = context => {
|
||||
const { electronPlatformName, appOutDir } = context;
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"isolatedModules": false,
|
||||
"outDir": "../libDev/scripts"
|
||||
},
|
||||
"include": [""],
|
||||
"references": [
|
||||
{ "path": "../../suite-desktop" }
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"watch": false,
|
||||
"preserveWatchOutput": true,
|
||||
@@ -7,8 +7,6 @@
|
||||
"noEmit": false,
|
||||
"jsx": "preserve",
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"lib": [
|
||||
"dom",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "libDev"
|
||||
},
|
||||
"include": ["src", "e2e", "**/*.json"],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "libDev",
|
||||
"baseUrl": "../suite"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "./libDev"
|
||||
},
|
||||
"include": ["./src", "./e2e", "**/*.json"],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "./libDev" },
|
||||
"include": [".", "**/*.json"],
|
||||
"references": [{ "path": "../env-utils" }]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./libDev",
|
||||
"baseUrl": "../suite"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../node-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../react-native-usb" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./libDev",
|
||||
"types": ["w3c-web-usb", "jest", "node"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [{ "path": "../utils" }]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": false,
|
||||
"outDir": "./libDev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"skipLibCheck": false,
|
||||
"outDir": "./libDev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
"name": "@trezor/scripts",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"type-check": "tsc --build",
|
||||
"run:analytics": "tsx githubAnalytics.ts"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"include": [".", "**/*.json"],
|
||||
"references": []
|
||||
|
||||
@@ -9,23 +9,26 @@ import chalk from 'chalk';
|
||||
import { getWorkspacesList } from './utils/getWorkspacesList';
|
||||
import { getPrettierConfig } from './utils/getPrettierConfig';
|
||||
|
||||
const rootTsConfigLocation = path.join(__dirname, '..', 'tsconfig.json');
|
||||
|
||||
(async () => {
|
||||
const { argv } = yargs(hideBin(process.argv))
|
||||
.array('read-only')
|
||||
.array('ignore')
|
||||
.array('typings')
|
||||
.boolean('test');
|
||||
.boolean('test') as any;
|
||||
|
||||
const readOnlyGlobs = argv.readOnly || [];
|
||||
const ignoreGlobs = argv.ignore || [];
|
||||
const typingPaths = argv.typings || [];
|
||||
const isTesting = argv.test || false;
|
||||
|
||||
const nextRootReferences = [];
|
||||
const rootConfig = JSON.parse(fs.readFileSync(rootTsConfigLocation).toString());
|
||||
const nextRootReferences: { path: string }[] = [];
|
||||
|
||||
const prettierConfig = await getPrettierConfig();
|
||||
|
||||
const serializeConfig = config => {
|
||||
const serializeConfig = (config: any) => {
|
||||
try {
|
||||
return prettier.format(JSON.stringify(config).replace(/\\\\/g, '/'), prettierConfig);
|
||||
} catch (error) {
|
||||
@@ -42,7 +45,12 @@ import { getPrettierConfig } from './utils/getPrettierConfig';
|
||||
.forEach(async workspaceName => {
|
||||
const workspace = workspaces[workspaceName];
|
||||
|
||||
if (ignoreGlobs.some(path => minimatch(workspace.location, path))) {
|
||||
if (workspace.location === '.') {
|
||||
// Skip root workspace
|
||||
return;
|
||||
}
|
||||
|
||||
if (ignoreGlobs.some((path: string) => minimatch(workspace.location, path))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,7 +77,7 @@ import { getPrettierConfig } from './utils/getPrettierConfig';
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const nextWorkspaceReferences = typingPaths.map(typingPath => ({
|
||||
const nextWorkspaceReferences = typingPaths.map((typingPath: string) => ({
|
||||
path: path.relative(workspacePath, path.resolve(process.cwd(), typingPath)),
|
||||
}));
|
||||
|
||||
@@ -108,8 +116,28 @@ import { getPrettierConfig } from './utils/getPrettierConfig';
|
||||
|
||||
workspaceConfig.references = nextWorkspaceReferences;
|
||||
|
||||
if (!readOnlyGlobs.some(path => minimatch(workspace.location, path))) {
|
||||
if (!readOnlyGlobs.some((path: string) => minimatch(workspace.location, path))) {
|
||||
fs.writeFileSync(workspaceConfigPath, await serializeConfig(workspaceConfig));
|
||||
}
|
||||
});
|
||||
|
||||
if (isTesting) {
|
||||
if (
|
||||
(await serializeConfig(rootConfig.references)) !==
|
||||
(await serializeConfig(nextRootReferences))
|
||||
) {
|
||||
console.error(
|
||||
`TypeScript project references in root tsconfig.json are inconsistent.`,
|
||||
`Run "yarn update-project-references" to fix them.`,
|
||||
);
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
rootConfig.references = nextRootReferences;
|
||||
|
||||
fs.writeFileSync(rootTsConfigLocation, await serializeConfig(rootConfig));
|
||||
})();
|
||||
@@ -1,8 +1,6 @@
|
||||
import tsBelt from '@mobily/ts-belt';
|
||||
import { A, D, pipe } from '@mobily/ts-belt';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
const { A, D, pipe } = tsBelt;
|
||||
|
||||
type WorkspacePackageName = string;
|
||||
type WorkspaceItem = {
|
||||
location: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [{ "path": "../redux-utils" }]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [{ "path": "../wallet-config" }]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../redux-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../redux-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../suite-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../suite-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../fiat-services" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../wallet-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "libDev",
|
||||
"rootDir": "../../../"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../redux-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../redux-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../suite-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../suite-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../wallet-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../metadata-types" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../suite-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../redux-utils" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../intl-types" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "libDev",
|
||||
"noUncheckedIndexedAccess": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../wallet-config" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../intl-types" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": []
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../device-authenticity" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../intl-types" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"include": [".", "**/*.json"],
|
||||
"references": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": { "outDir": "libDev" },
|
||||
"references": [
|
||||
{ "path": "../../suite-common/icons" },
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user