Skip to content

Commit b476e7e

Browse files
authored
chore: update build system (#2424)
1 parent 5f8b9ce commit b476e7e

File tree

126 files changed

+12093
-9572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+12093
-9572
lines changed

.changeset/tidy-bikes-warn.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@substrate/connect": minor
3+
---
4+
5+
update build system to tshy
6+
worker is now exported under "browser" conditional export instead of node. "node" conditional export removed.

.changeset/violet-islands-tickle.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@substrate/light-client-extension-helpers": minor
3+
"@substrate/smoldot-discovery-connector": minor
4+
"@substrate/connect-extension-protocol": minor
5+
"@substrate/connect-known-chains": minor
6+
"@substrate/connect-discovery": minor
7+
"@substrate/smoldot-discovery": minor
8+
"@substrate/wallet-template": minor
9+
"@substrate/discovery": minor
10+
"@substrate/extension": minor
11+
---
12+
13+
update build system to tshy

.eslintrc.js .eslintrc.cjs

File renamed without changes.

.github/actions/turbo-build/action.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ inputs:
33
node-version:
44
description: Node version
55
required: true
6-
default: 18.x
6+
default: 20.x
77
runs:
88
using: composite
99
steps:
@@ -15,8 +15,6 @@ runs:
1515
restore-keys: |
1616
${{ runner.os }}-turbo-${{ inputs.node-version }}-build-
1717
- uses: pnpm/action-setup@v2
18-
with:
19-
version: 8
2018
- name: Use Node.js ${{ inputs.node-version }}
2119
uses: actions/setup-node@v4
2220
with:

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ init.sh
2020
.vscode
2121
packages/connect/src/connector/specs/js
2222
substrate-connect_*-source-code.zip
23+
24+
.tshy
25+
.tshy-build

examples/light-client-dapp/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
},
1212
"dependencies": {
1313
"@picocss/pico": "^2.0.6",
14-
"polkadot-api": "^1.0.0",
1514
"@polkadot-api/metadata-builders": "~0.5.0",
1615
"@polkadot-api/observable-client": "~0.5.1",
1716
"@polkadot-api/substrate-bindings": "~0.6.3",
@@ -22,6 +21,7 @@
2221
"@zag-js/react": "^0.48.0",
2322
"@zag-js/select": "^0.48.0",
2423
"@zag-js/toast": "^0.48.0",
24+
"polkadot-api": "^1.0.0",
2525
"react": "^18.3.1",
2626
"react-dom": "^18.2.0",
2727
"rxjs": "^7.8.1",
@@ -37,6 +37,7 @@
3737
"eslint": "^8.57.0",
3838
"eslint-plugin-react-hooks": "^4.6.2",
3939
"eslint-plugin-react-refresh": "^0.4.6",
40-
"vite": "^5.3.4"
40+
"vite": "^5.3.4",
41+
"vitest": "^2.0.5"
4142
}
4243
}

examples/light-client-dapp/src/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "@picocss/pico"
22
import React from "react"
33
import ReactDOM from "react-dom/client"
4-
import { App } from "./App.tsx"
4+
import { App } from "./App"
55

66
ReactDOM.createRoot(document.getElementById("root")!).render(
77
<React.StrictMode>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "@total-typescript/tsconfig/bundler/dom/app",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"jsx": "preserve",
6+
"verbatimModuleSyntax": false,
7+
"paths": {
8+
"@/*": ["./src/*"]
9+
}
10+
},
11+
"include": ["src"]
12+
}
+9-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2020",
4-
"useDefineForClassFields": true,
5-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6-
"module": "ESNext",
7-
"skipLibCheck": true,
8-
9-
/* Bundler mode */
10-
"moduleResolution": "bundler",
11-
"allowImportingTsExtensions": true,
12-
"resolveJsonModule": true,
13-
"isolatedModules": true,
14-
"noEmit": true,
15-
"jsx": "react-jsx",
16-
17-
/* Linting */
18-
"strict": true,
19-
"noUnusedLocals": true,
20-
"noUnusedParameters": true,
21-
"noFallthroughCasesInSwitch": true
22-
},
23-
"include": ["src"],
24-
"references": [{ "path": "./tsconfig.node.json" }]
2+
"files": [],
3+
"references": [
4+
{
5+
"path": "./tsconfig.app.json"
6+
},
7+
{
8+
"path": "./tsconfig.node.json"
9+
}
10+
]
2511
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"compilerOptions": {
33
"composite": true,
4+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
45
"skipLibCheck": true,
56
"module": "ESNext",
67
"moduleResolution": "bundler",
78
"allowSyntheticDefaultImports": true,
8-
"strict": true
9+
"strict": true,
10+
"noEmit": true
911
},
1012
"include": ["vite.config.ts"]
1113
}

examples/light-client-extension-helpers-dapp/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"@picocss/pico": "^2.0.6",
1414
"@polkadot-api/observable-client": "~0.5.1",
1515
"@polkadot-api/substrate-client": "~0.2.1",
16-
"@substrate/light-client-extension-helpers": "workspace:*",
1716
"@substrate/connect-known-chains": "workspace:*",
17+
"@substrate/light-client-extension-helpers": "workspace:*",
1818
"react": "^18.3.1",
1919
"react-dom": "^18.2.0",
2020
"rxjs": "^7.8.1"
@@ -28,6 +28,7 @@
2828
"eslint": "^8.57.0",
2929
"eslint-plugin-react-hooks": "^4.6.2",
3030
"eslint-plugin-react-refresh": "^0.4.6",
31-
"vite": "^5.3.4"
31+
"vite": "^5.3.4",
32+
"vitest": "^2.0.5"
3233
}
3334
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "@total-typescript/tsconfig/bundler/dom/app",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"jsx": "preserve",
6+
"verbatimModuleSyntax": false,
7+
"paths": {
8+
"@/*": ["./src/*"]
9+
}
10+
},
11+
"include": ["src"]
12+
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2020",
4-
"useDefineForClassFields": true,
5-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6-
"module": "ESNext",
7-
"skipLibCheck": true,
8-
9-
/* Bundler mode */
10-
"moduleResolution": "bundler",
11-
"allowImportingTsExtensions": true,
12-
"resolveJsonModule": true,
13-
"isolatedModules": true,
14-
"noEmit": true,
15-
"jsx": "react-jsx",
16-
17-
/* Linting */
18-
"strict": true,
19-
"noUnusedLocals": true,
20-
"noUnusedParameters": true,
21-
"noFallthroughCasesInSwitch": true
22-
},
23-
"include": ["src"],
24-
"references": [{ "path": "./tsconfig.node.json" }]
2+
"files": [],
3+
"references": [
4+
{
5+
"path": "./tsconfig.app.json"
6+
},
7+
{
8+
"path": "./tsconfig.node.json"
9+
}
10+
]
2511
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"compilerOptions": {
33
"composite": true,
4+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
45
"skipLibCheck": true,
56
"module": "ESNext",
67
"moduleResolution": "bundler",
7-
"allowSyntheticDefaultImports": true
8+
"allowSyntheticDefaultImports": true,
9+
"strict": true,
10+
"noEmit": true
811
},
912
"include": ["vite.config.ts"]
1013
}

examples/light-client-extension-helpers-extension/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"@types/chrome": "^0.0.270",
2525
"@types/node": "^20.14.10",
2626
"concurrently": "^8.2.2",
27+
"tsup": "^8.0.2",
28+
"vitest": "^2.0.5",
2729
"web-ext": "^8.2.0"
2830
}
2931
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"extends": "../../tsconfig.base",
3-
"include": ["src", "tests"],
2+
"extends": "@total-typescript/tsconfig/bundler/dom/app",
43
"compilerOptions": {
5-
"moduleResolution": "Bundler",
6-
"baseUrl": "src",
4+
"baseUrl": ".",
5+
"jsx": "preserve",
6+
"verbatimModuleSyntax": false,
77
"paths": {
8-
"@/*": ["*"]
9-
},
10-
"outDir": "dist/js"
11-
}
8+
"@/*": ["./src/*"]
9+
}
10+
},
11+
"include": ["src", "tests"]
1212
}

examples/smoldot-discovery-example/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@substrate/smoldot-discovery": "workspace:^",
1413
"@hookform/resolvers": "^3.9.0",
1514
"@radix-ui/react-accordion": "^1.2.0",
1615
"@radix-ui/react-alert-dialog": "^1.1.1",
@@ -40,6 +39,7 @@
4039
"@radix-ui/react-toggle-group": "^1.1.0",
4140
"@radix-ui/react-tooltip": "^1.1.2",
4241
"@substrate/discovery": "^0.0.2",
42+
"@substrate/smoldot-discovery": "workspace:^",
4343
"class-variance-authority": "^0.7.0",
4444
"clsx": "^2.1.1",
4545
"cmdk": "^1.0.0",
@@ -74,6 +74,7 @@
7474
"postcss": "^8.4.40",
7575
"tailwindcss": "^3.4.10",
7676
"typescript": "^5.5.4",
77-
"vite": "^5.3.2"
77+
"vite": "^5.3.2",
78+
"vitest": "^2.0.5"
7879
}
7980
}

examples/smoldot-discovery-example/src/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22
import ReactDOM from "react-dom/client"
3-
import App from "./App.tsx"
3+
import App from "./App"
44

55
ReactDOM.createRoot(document.getElementById("root")!).render(
66
<React.StrictMode>

examples/smoldot-discovery-example/tsconfig.app.json

+4-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
11
{
2+
"extends": "@total-typescript/tsconfig/bundler/dom/app",
23
"compilerOptions": {
3-
"composite": true,
4-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5-
"target": "ES2020",
6-
"useDefineForClassFields": true,
7-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
8-
"module": "ESNext",
9-
"skipLibCheck": true,
10-
11-
/* Bundler mode */
12-
"moduleResolution": "bundler",
13-
"allowImportingTsExtensions": true,
14-
"resolveJsonModule": true,
15-
"isolatedModules": true,
16-
"moduleDetection": "force",
17-
"noEmit": true,
18-
"jsx": "react-jsx",
19-
20-
/* Linting */
21-
"strict": true,
22-
"noUnusedLocals": true,
23-
"noUnusedParameters": true,
24-
"noFallthroughCasesInSwitch": true,
25-
264
"baseUrl": ".",
5+
"jsx": "preserve",
6+
"verbatimModuleSyntax": false,
7+
"noUncheckedIndexedAccess": false,
278
"paths": {
289
"@/*": ["./src/*"]
2910
}

package.json

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "substrate-connect",
33
"version": "0.1.0",
4+
"type": "module",
45
"description": "A collection of libraries and tools needed to run Substrate Wasm light clients directly in the browser",
56
"repository": "https://github.com/paritytech/substrate-connect.git",
67
"author": "Parity Team <admin@parity.io>",
@@ -18,9 +19,9 @@
1819
"downloadSpecs": "node bin/downloadSpecs.js",
1920
"api-docs": "typedoc",
2021
"deep-clean": "pnpm -r deep-clean && rm -rf node_modules",
21-
"clean": " pnpm -r run clean",
22+
"clean": "turbo run clean",
23+
"build": "turbo run build",
2224
"lint": "prettier --check .",
23-
"build": "pnpm -r build",
2425
"test": "pnpm -r test",
2526
"dev:api-docs": "concurrently -n typedoc,http-server 'nodemon -e ts --watch ./packages/connect --watch ./packages/connect-extension-protocol --exec typedoc' 'http-server _site/api'",
2627
"dev:burnr": "pnpm --filter @substrate/burnr dev",
@@ -34,6 +35,7 @@
3435
},
3536
"devDependencies": {
3637
"@changesets/cli": "^2.27.7",
38+
"@total-typescript/tsconfig": "^1.0.4",
3739
"@types/chrome": "^0.0.270",
3840
"@types/node": "^20.14.10",
3941
"@types/qrcode.react": "^1.0.5",
@@ -46,18 +48,23 @@
4648
"eslint-config-prettier": "^9.1.0",
4749
"eslint-config-react-app": "^7.0.1",
4850
"eslint-plugin-import": "^2.29.0",
51+
"globals": "^15.9.0",
4952
"http-server": "^14.1.1",
5053
"husky": "^9.0.11",
54+
"jsdom": "^24.0.0",
5155
"lint-staged": "^15.2.7",
5256
"nodemon": "^3.1.4",
5357
"prettier": "^3.3.3",
58+
"rimraf": "^6.0.1",
59+
"tshy": "^3.0.2",
5460
"tslib": "^2.6.2",
55-
"tsup": "^8.0.2",
56-
"turbo": "^1.13.2",
61+
"turbo": "^2.1.1",
5762
"typedoc": "^0.25.13",
58-
"typescript": "^5.5.4"
63+
"typescript": "^5.5.4",
64+
"vite-tsconfig-paths": "^5.0.1",
65+
"vitest": "^2.0.5"
5966
},
60-
"packageManager": "pnpm@8.14.0",
67+
"packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1",
6168
"pnpm": {
6269
"overrides": {
6370
"@substrate/connect": "workspace:^",

0 commit comments

Comments
 (0)