Skip to content

Commit

Permalink
Adjust tsconfig usage (w/ latest dev) (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored May 18, 2023
1 parent 3317f7a commit 124de8d
Show file tree
Hide file tree
Showing 31 changed files with 315 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
node-version: 'lts/*'
- name: ${{ matrix.step }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn install --immutable
yarn ${{ matrix.step }}
2 changes: 1 addition & 1 deletion .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
GH_RELEASE_FILES: master-build.zip,master-src.zip
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn install --immutable
yarn ${{ matrix.step }}
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ enableImmutableInstalls: false

enableProgressBars: false

logFilters:
# Discard any "cannot be found in cache" messages
- code: YN0013
level: discard

nodeLinker: node-modules

plugins:
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
],
"scripts": {
"build": "polkadot-dev-build-ts && yarn build:zip && yarn build:rollup",
"build:before": "yarn build:i18n && yarn build:ui",
"build:before": "yarn build:i18n",
"build:i18n": "i18next-scanner --config i18next-scanner.config.js",
"build:release": "polkadot-ci-ghact-build",
"build:rollup": "polkadot-exec-rollup --config",
"build:ui": "cd packages/extension && NODE_ENV=production yarn polkadot-exec-webpack --config webpack.extension.cjs --mode production",
"build:zip": "yarn build:zip:dst && yarn build:zip:src",
"build:zip:dst": "rm -rf ./master-build.zip && cd packages/extension/build && zip -r -FS ../../../master-build.zip .",
"build:zip:src": "rm -rf ./master-src.zip && zip -r -x '*build/*' -x '*node_modules*' -FS ./master-src.zip packages .editorconfig .eslintignore .eslintrc.js babel.config.cjs CHANGELOG.md CONTRIBUTING.md i18next-scanner.config.js LICENSE package.json README.md tsconfig.json yarn.lock",
Expand All @@ -40,8 +39,8 @@
"watch": "cd packages/extension && yarn polkadot-exec-webpack --config webpack.watch.cjs --mode development --watch"
},
"devDependencies": {
"@polkadot/dev": "^0.73.17",
"@types/node": "^20.1.3",
"@polkadot/dev": "^0.74.1",
"@types/node": "^20.2.0",
"i18next-scanner": "^4.2.0",
"sinon-chrome": "^3.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@polkadot/util-crypto": "^12.2.1",
"eventemitter3": "^5.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
},
"devDependencies": {
"@polkadot/extension-mocks": "0.46.3"
Expand Down
14 changes: 6 additions & 8 deletions packages/extension-base/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-chains/tsconfig.build.json"
},
{ "path": "../extension-dapp/tsconfig.build.json"
},
{ "path": "../extension-inject/tsconfig.build.json"
},
{ "path": "../extension-mocks/tsconfig.build.json"
}
{ "path": "../extension-chains/tsconfig.build.json" },
{ "path": "../extension-dapp/tsconfig.build.json" },
{ "path": "../extension-inject/tsconfig.build.json" }
]
}
18 changes: 18 additions & 0 deletions packages/extension-base/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-base/tsconfig.build.json" },
{ "path": "../extension-inject/tsconfig.build.json" },
{ "path": "../extension-mocks/tsconfig.build.json" }
]
}
2 changes: 1 addition & 1 deletion packages/extension-chains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@polkadot/networks": "^12.2.1",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
},
"peerDependencies": {
"@polkadot/api": "*",
Expand Down
3 changes: 1 addition & 2 deletions packages/extension-chains/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"rootDir": "./src"
},
"references": [
{ "path": "../extension-inject/tsconfig.build.json"
}
{ "path": "../extension-inject/tsconfig.build.json" }
]
}
3 changes: 2 additions & 1 deletion packages/extension-compat-metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
"@polkadot/extension-inject": "0.46.3",
"@polkadot/types": "^10.7.1",
"@polkadot/util": "^12.2.1",
"tslib": "^2.5.0",
"tslib": "^2.5.1",
"web3": "^1.10.0"
},
"peerDependencies": {
"@polkadot/api": "*",
"@polkadot/util": "*"
}
}
3 changes: 1 addition & 2 deletions packages/extension-compat-metamask/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"rootDir": "./src"
},
"references": [
{ "path": "../extension-inject/tsconfig.build.json"
}
{ "path": "../extension-inject/tsconfig.build.json" }
]
}
2 changes: 1 addition & 1 deletion packages/extension-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@polkadot/extension-inject": "0.46.3",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
},
"peerDependencies": {
"@polkadot/api": "*",
Expand Down
6 changes: 4 additions & 2 deletions packages/extension-dapp/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-inject/tsconfig.build.json"
}
{ "path": "../extension-inject/tsconfig.build.json" }
]
}
16 changes: 16 additions & 0 deletions packages/extension-dapp/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-dapp/tsconfig.build.json" }
]
}
8 changes: 5 additions & 3 deletions packages/extension-inject/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
"version": "0.46.3",
"main": "index.js",
"dependencies": {
"@polkadot/api": "^10.7.1",
"@polkadot/rpc-provider": "^10.7.1",
"@polkadot/types": "^10.7.1",
"@polkadot/util": "^12.2.1",
"@polkadot/util-crypto": "^12.2.1",
"@polkadot/x-global": "^12.2.1",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
},
"devDependencies": {
"@types/chrome": "^0.0.235",
"@types/chrome": "^0.0.236",
"@types/firefox-webext-browser": "^111.0.1"
},
"peerDependencies": {
"@polkadot/api": "*"
"@polkadot/api": "*",
"@polkadot/util": "*"
}
}
3 changes: 3 additions & 0 deletions packages/extension-inject/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts"
],
"references": []
}
16 changes: 16 additions & 0 deletions packages/extension-inject/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-inject/tsconfig.build.json" }
]
}
2 changes: 1 addition & 1 deletion packages/extension-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"main": "index.js",
"dependencies": {
"sinon-chrome": "^3.0.1",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
}
}
9 changes: 8 additions & 1 deletion packages/extension-mocks/src/loader-empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import path from 'node:path';
import process from 'node:process';
import { pathToFileURL } from 'node:url';

// Adjusts the resolver to point to empty files for .svg
/**
* Adjusts the resolver to point to empty files for .svg
*
* @param {*} specifier
* @param {*} context
* @param {*} nextResolve
* @returns {*}
*/
export function resolve (specifier, context, nextResolve) {
if (/\.(png|svg)$/.test(specifier)) {
return {
Expand Down
3 changes: 1 addition & 2 deletions packages/extension-mocks/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"rootDir": "./src"
},
"references": [
{ "path": "../extension-inject/tsconfig.build.json"
}
{ "path": "../extension-inject/tsconfig.build.json" }
]
}
3 changes: 2 additions & 1 deletion packages/extension-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@polkadot/api": "^10.7.1",
"@polkadot/extension-base": "0.46.3",
"@polkadot/extension-chains": "0.46.3",
"@polkadot/extension-dapp": "0.46.3",
Expand All @@ -47,7 +48,7 @@
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"styled-components": "^5.3.10",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
},
"devDependencies": {
"@polkadot/extension-mocks": "0.46.3",
Expand Down
18 changes: 8 additions & 10 deletions packages/extension-ui/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-base/tsconfig.build.json"
},
{ "path": "../extension-chains/tsconfig.build.json"
},
{ "path": "../extension-dapp/tsconfig.build.json"
},
{ "path": "../extension-inject/tsconfig.build.json"
},
{ "path": "../extension-mocks/tsconfig.build.json"
}
{ "path": "../extension-base/tsconfig.build.json" },
{ "path": "../extension-chains/tsconfig.build.json" },
{ "path": "../extension-dapp/tsconfig.build.json" },
{ "path": "../extension-inject/tsconfig.build.json" },
{ "path": "../extension-mocks/tsconfig.build.json" }
]
}
16 changes: 16 additions & 0 deletions packages/extension-ui/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension-ui/tsconfig.build.json" }
]
}
9 changes: 7 additions & 2 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
"type": "module",
"version": "0.46.3",
"dependencies": {
"@polkadot/api": "^10.7.1",
"@polkadot/extension-base": "0.46.3",
"@polkadot/extension-inject": "0.46.3",
"@polkadot/extension-ui": "0.46.3",
"tslib": "^2.5.0"
"tslib": "^2.5.1"
},
"devDependencies": {
"@polkadot/dev": "^0.73.17",
"@polkadot/dev": "^0.74.1",
"browser-resolve": "^2.0.0",
"buffer": "^6.0.3",
"copy-webpack-plugin": "^11.0.0",
Expand All @@ -37,5 +38,9 @@
"ts-loader": "^9.4.2",
"url-loader": "^4.1.1",
"webpack-extension-manifest-plugin": "^0.8.0"
},
"peerDependencies": {
"typescript": "*",
"webpack": "*"
}
}
13 changes: 7 additions & 6 deletions packages/extension/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/build/*",
"webpack.*.cjs"
],
"references": [
{ "path": "../extension-base/tsconfig.build.json"
},
{ "path": "../extension-inject/tsconfig.build.json"
},
{ "path": "../extension-ui/tsconfig.build.json"
}
{ "path": "../extension-base/tsconfig.build.json" },
{ "path": "../extension-inject/tsconfig.build.json" },
{ "path": "../extension-ui/tsconfig.build.json" }
]
}
16 changes: 16 additions & 0 deletions packages/extension/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/*.spec.ts"
],
"references": [
{ "path": "../extension/tsconfig.build.json" }
]
}
1 change: 1 addition & 0 deletions packages/extension/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ const createConfig = require('./webpack.shared.cjs');
module.exports = createConfig({
background: './src/background.ts',
content: './src/content.ts',
extension: './src/extension.ts',
page: './src/page.ts'
});
Loading

0 comments on commit 124de8d

Please sign in to comment.