@tari-project/tarijs 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -67
- package/TODO.md +91 -3
- package/docusaurus/tari-docs/README.md +200 -17
- package/docusaurus/tari-docs/docs/api-reference.md +665 -0
- package/docusaurus/tari-docs/docs/contributing.md +619 -0
- package/docusaurus/tari-docs/docs/guides/getting-started-tutorial.md +965 -0
- package/docusaurus/tari-docs/docs/guides/production-deployment.md +977 -0
- package/docusaurus/tari-docs/docs/index.md +114 -11
- package/docusaurus/tari-docs/docs/installation.md +142 -1
- package/docusaurus/tari-docs/docs/signers/metamask.md +529 -0
- package/docusaurus/tari-docs/docs/troubleshooting.md +661 -0
- package/docusaurus/tari-docs/package.json +1 -1
- package/examples/vite-typescript-react/README.md +9 -0
- package/examples/vite-typescript-react/eslint.config.js +23 -0
- package/examples/vite-typescript-react/index.html +13 -0
- package/examples/vite-typescript-react/package.json +35 -0
- package/examples/vite-typescript-react/public/vite.svg +1 -0
- package/examples/vite-typescript-react/src/App.css +42 -0
- package/examples/vite-typescript-react/src/App.tsx +50 -0
- package/examples/vite-typescript-react/src/assets/react.svg +1 -0
- package/examples/vite-typescript-react/src/index.css +68 -0
- package/examples/vite-typescript-react/src/main.tsx +10 -0
- package/examples/vite-typescript-react/src/vite-env.d.ts +1 -0
- package/examples/vite-typescript-react/tsconfig.app.json +27 -0
- package/examples/vite-typescript-react/tsconfig.json +7 -0
- package/examples/vite-typescript-react/tsconfig.node.json +25 -0
- package/examples/vite-typescript-react/vite.config.ts +7 -0
- package/package.json +2 -2
- package/packages/builders/package.json +2 -2
- package/packages/builders/src/transaction/TransactionBuilder.ts +4 -12
- package/packages/indexer_provider/package.json +2 -2
- package/packages/indexer_provider/src/provider.ts +5 -5
- package/packages/indexer_provider/tsconfig.json +4 -2
- package/packages/metamask_signer/package.json +2 -2
- package/packages/metamask_signer/src/index.ts +2 -14
- package/packages/{tari_permissions → permissions}/package.json +2 -2
- package/packages/{tari_permissions → permissions}/src/helpers.ts +1 -1
- package/packages/permissions/src/index.ts +2 -0
- package/packages/{tari_permissions/src/tari_permissions.ts → permissions/src/permissions.ts} +56 -6
- package/packages/react-mui-connect-button/moon.yml +71 -0
- package/packages/react-mui-connect-button/package.json +40 -0
- package/packages/react-mui-connect-button/src/Logos.tsx +60 -0
- package/packages/react-mui-connect-button/src/TariConnectButton.tsx +51 -0
- package/packages/react-mui-connect-button/src/TariWalletSelectionDialog.tsx +116 -0
- package/packages/react-mui-connect-button/src/content/tari-logo-white.svg +18 -0
- package/packages/react-mui-connect-button/src/content/tari-logo.svg +18 -0
- package/packages/react-mui-connect-button/src/content/walletconnect-logo.svg +13 -0
- package/packages/react-mui-connect-button/src/defaultPermissions.ts +0 -0
- package/packages/react-mui-connect-button/src/index.ts +24 -0
- package/packages/react-mui-connect-button/tsconfig.json +31 -0
- package/packages/tari_provider/package.json +2 -2
- package/packages/tari_signer/package.json +2 -2
- package/packages/tari_universe/package.json +2 -2
- package/packages/tari_universe/tsconfig.json +4 -2
- package/packages/tarijs/package.json +2 -2
- package/packages/tarijs/tsconfig.json +4 -2
- package/packages/tarijs_types/package.json +2 -2
- package/packages/wallet_daemon/package.json +2 -2
- package/packages/wallet_daemon/src/provider.ts +8 -6
- package/packages/wallet_daemon/src/signer.ts +11 -6
- package/packages/wallet_daemon/tsconfig.json +1 -1
- package/packages/walletconnect/package.json +3 -2
- package/packages/walletconnect/src/index.ts +52 -26
- package/packages/walletconnect/tsconfig.json +3 -0
- package/pnpm-workspace.yaml +15 -7
- package/scripts/check_versions.sh +4 -0
- package/scripts/clean_everything.sh +38 -0
- package/tsconfig.json +6 -0
- package/packages/tari_permissions/src/index.ts +0 -2
- /package/packages/{tari_permissions → permissions}/moon.yml +0 -0
- /package/packages/{tari_permissions → permissions}/tsconfig.json +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { TariConnectButton, TariConnectButtonProps } from "./TariConnectButton";
|
|
2
|
+
export { TariWalletSelectionDialog, WalletSelectionProps } from "./TariWalletSelectionDialog";
|
|
3
|
+
import {
|
|
4
|
+
TariPermissionAccountInfo,
|
|
5
|
+
TariPermissionKeyList,
|
|
6
|
+
TariPermissions, TariPermissionSubstatesRead, TariPermissionTemplatesRead, TariPermissionTransactionSend,
|
|
7
|
+
TariPermissionTransactionsGet,
|
|
8
|
+
} from "@tari-project/tari-permissions";
|
|
9
|
+
|
|
10
|
+
export function defaultPermissions() {
|
|
11
|
+
// Minimal permissions for the example site
|
|
12
|
+
// But each application will have different permission needs
|
|
13
|
+
const walletDaemonPermissions = new TariPermissions();
|
|
14
|
+
walletDaemonPermissions
|
|
15
|
+
// Required for createFreeTestCoins
|
|
16
|
+
.addPermission("Admin")
|
|
17
|
+
.addPermission(new TariPermissionKeyList())
|
|
18
|
+
.addPermission(new TariPermissionAccountInfo())
|
|
19
|
+
.addPermission(new TariPermissionTransactionsGet())
|
|
20
|
+
.addPermission(new TariPermissionSubstatesRead())
|
|
21
|
+
.addPermission(new TariPermissionTemplatesRead())
|
|
22
|
+
.addPermission(new TariPermissionTransactionSend());
|
|
23
|
+
return walletDaemonPermissions;
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"target": "ESNext",
|
|
7
|
+
"moduleResolution": "Bundler",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"rootDir": "./src"
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*"
|
|
13
|
+
],
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "../permissions"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "../tari_provider"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "../tari_signer"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "../wallet_daemon"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "../walletconnect"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tari-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc -b"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
|
-
"author": "",
|
|
13
|
+
"author": "The Tari Community",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tari-project/typescript-bindings": "catalog:",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tari-signer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc -b"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
|
-
"author": "",
|
|
13
|
+
"author": "The Tari Community",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tari-project/tarijs-types": "workspace:^",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tari-universe-signer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc -b"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
|
-
"author": "",
|
|
13
|
+
"author": "The Tari Community",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tari-project/tari-permissions": "workspace:^",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tarijs-all",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"integration-tests": "vitest run integration-tests"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [],
|
|
15
|
-
"author": "",
|
|
15
|
+
"author": "The Tari Community",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@metamask/providers": "catalog:",
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
"outDir": "./dist",
|
|
8
8
|
"rootDir": "./src"
|
|
9
9
|
},
|
|
10
|
-
"include": [
|
|
10
|
+
"include": [
|
|
11
|
+
"src/**/*"
|
|
12
|
+
],
|
|
11
13
|
"references": [
|
|
12
14
|
{
|
|
13
15
|
"path": "../builders"
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
"path": "../metamask_signer"
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
|
-
"path": "../
|
|
24
|
+
"path": "../permissions"
|
|
23
25
|
},
|
|
24
26
|
{
|
|
25
27
|
"path": "../tari_provider"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tarijs-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc -b"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
|
-
"author": "",
|
|
13
|
+
"author": "The Tari Community",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tari-project/typescript-bindings": "catalog:"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/wallet-daemon-signer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc -b"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
|
-
"author": "",
|
|
13
|
+
"author": "The Tari Community",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tari-project/tari-permissions": "workspace:^",
|
|
@@ -76,15 +76,17 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
76
76
|
async getSubstate(req: GetSubstateRequest): Promise<Substate> {
|
|
77
77
|
// TODO: Substate address cannot be converted to SubstateId directly - Perhaps we need to change the provider interface
|
|
78
78
|
const {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
substate,
|
|
80
|
+
} = await this.client.substatesGet({ substate_id: req.substate_address });
|
|
81
|
+
if (!substate) {
|
|
82
|
+
throw new Error(`Substate not found for address: ${req.substate_address}`);
|
|
83
|
+
}
|
|
82
84
|
|
|
83
85
|
return {
|
|
84
|
-
value,
|
|
86
|
+
value: substate?.substate,
|
|
85
87
|
address: {
|
|
86
|
-
substate_id:
|
|
87
|
-
version:
|
|
88
|
+
substate_id: req.substate_address,
|
|
89
|
+
version: substate?.version || 0,
|
|
88
90
|
},
|
|
89
91
|
};
|
|
90
92
|
}
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
KeyBranch,
|
|
21
21
|
ListAccountNftRequest,
|
|
22
22
|
ListAccountNftResponse,
|
|
23
|
-
SubstateId,
|
|
24
23
|
substateIdToString,
|
|
25
24
|
SubstatesListRequest,
|
|
26
25
|
} from "@tari-project/typescript-bindings";
|
|
@@ -44,6 +43,7 @@ export interface WalletDaemonFetchParameters extends WalletDaemonBaseParameters
|
|
|
44
43
|
serverUrl: string;
|
|
45
44
|
}
|
|
46
45
|
|
|
46
|
+
|
|
47
47
|
export class WalletDaemonTariSigner implements TariSigner {
|
|
48
48
|
public signerName = "WalletDaemon";
|
|
49
49
|
params: WalletDaemonParameters;
|
|
@@ -158,13 +158,18 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
public async getSubstate(substateId: string): Promise<Substate> {
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
const {
|
|
162
|
+
substate,
|
|
163
|
+
} = await this.client.substatesGet({ substate_id: substateId });
|
|
164
|
+
if (!substate) {
|
|
165
|
+
throw new Error(`Substate not found for address: ${substateId}`);
|
|
166
|
+
}
|
|
167
|
+
|
|
163
168
|
return {
|
|
164
|
-
value,
|
|
169
|
+
value: substate?.substate,
|
|
165
170
|
address: {
|
|
166
|
-
substate_id:
|
|
167
|
-
version:
|
|
171
|
+
substate_id: substateId,
|
|
172
|
+
version: substate?.version || 0,
|
|
168
173
|
},
|
|
169
174
|
};
|
|
170
175
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/wallet-connect-signer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc -b"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [],
|
|
13
|
-
"author": "",
|
|
13
|
+
"author": "The Tari Community",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tari-project/tari-signer": "workspace:^",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@tari-project/tarijs-types": "workspace:^",
|
|
19
19
|
"@tari-project/typescript-bindings": "catalog:",
|
|
20
20
|
"@tari-project/wallet_jrpc_client": "catalog:",
|
|
21
|
+
"@tari-project/tari-permissions": "workspace:",
|
|
21
22
|
"@walletconnect/modal": "catalog:",
|
|
22
23
|
"@walletconnect/universal-provider": "catalog:"
|
|
23
24
|
},
|
|
@@ -21,9 +21,10 @@ import {
|
|
|
21
21
|
substateIdToString,
|
|
22
22
|
TransactionSubmitRequest,
|
|
23
23
|
} from "@tari-project/typescript-bindings";
|
|
24
|
+
import { TariPermission } from "@tari-project/tari-permissions";
|
|
24
25
|
|
|
25
26
|
const walletConnectParams = {
|
|
26
|
-
|
|
27
|
+
optionalNamespaces: {
|
|
27
28
|
tari: {
|
|
28
29
|
methods: [
|
|
29
30
|
"tari_getSubstate",
|
|
@@ -39,51 +40,76 @@ const walletConnectParams = {
|
|
|
39
40
|
"tari_getNftsList",
|
|
40
41
|
],
|
|
41
42
|
chains: ["tari:devnet"],
|
|
42
|
-
events: [
|
|
43
|
+
events: [],
|
|
44
|
+
// events: ["chainChanged", "accountsChanged"],
|
|
43
45
|
},
|
|
44
46
|
},
|
|
45
47
|
};
|
|
46
48
|
|
|
49
|
+
export interface WalletConnectParameters {
|
|
50
|
+
requiredPermissions?: TariPermission[];
|
|
51
|
+
optionalPermissions?: TariPermission[];
|
|
52
|
+
projectId: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
47
55
|
export class WalletConnectTariSigner implements TariSigner {
|
|
48
56
|
public signerName = "WalletConnect";
|
|
49
|
-
|
|
50
|
-
wcProvider: UniversalProvider |
|
|
57
|
+
params: WalletConnectParameters;
|
|
58
|
+
wcProvider: UniversalProvider | undefined;
|
|
51
59
|
wcSession: any | null;
|
|
52
60
|
|
|
53
|
-
constructor(
|
|
54
|
-
this.
|
|
55
|
-
this.wcProvider =
|
|
61
|
+
constructor(params: WalletConnectParameters) {
|
|
62
|
+
this.params = params;
|
|
63
|
+
this.wcProvider = undefined;
|
|
56
64
|
this.wcSession = null;
|
|
57
65
|
}
|
|
58
66
|
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
static init(params: WalletConnectParameters): WalletConnectTariSigner {
|
|
68
|
+
return new WalletConnectTariSigner(params);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async connect(): Promise<() => Promise<void>> {
|
|
72
|
+
if (this.wcProvider && this.wcSession) return async () => {
|
|
73
|
+
// No-op if already connected
|
|
74
|
+
};
|
|
61
75
|
|
|
62
76
|
// initialize WalletConnect
|
|
63
|
-
const projectId = this.projectId;
|
|
64
|
-
|
|
77
|
+
const projectId = this.params.projectId;
|
|
78
|
+
const provider = await UniversalProvider.init({
|
|
65
79
|
projectId,
|
|
66
80
|
// TODO: parameterize the relay URL
|
|
67
|
-
relayUrl: "wss://relay.walletconnect.com",
|
|
81
|
+
// relayUrl: "wss://relay.walletconnect.com",
|
|
68
82
|
});
|
|
69
83
|
|
|
84
|
+
const sessionProperties = {
|
|
85
|
+
"required_permissions": JSON.stringify(this.params.requiredPermissions) || "[]",
|
|
86
|
+
"optional_permissions": JSON.stringify(this.params.optionalPermissions) || "[]",
|
|
87
|
+
};
|
|
88
|
+
const connectParams = {
|
|
89
|
+
...walletConnectParams,
|
|
90
|
+
sessionProperties,
|
|
91
|
+
};
|
|
92
|
+
|
|
70
93
|
// open UI modal with the connection URI
|
|
71
|
-
const { uri, approval } = await
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
const { uri, approval } = await provider.client.connect(connectParams);
|
|
95
|
+
return async () => {
|
|
96
|
+
const walletConnectModal = new WalletConnectModal({
|
|
97
|
+
projectId,
|
|
98
|
+
});
|
|
99
|
+
if (uri) {
|
|
100
|
+
await walletConnectModal.openModal({ uri });
|
|
101
|
+
}
|
|
78
102
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
103
|
+
// wait for the wallet to approve the connection
|
|
104
|
+
console.log("waiting for session approval from the wallet app");
|
|
105
|
+
const session = await approval();
|
|
106
|
+
walletConnectModal.closeModal();
|
|
83
107
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
108
|
+
// at this point session is open
|
|
109
|
+
console.log("session approved by the wallet");
|
|
110
|
+
this.wcProvider = provider;
|
|
111
|
+
this.wcSession = session;
|
|
112
|
+
};
|
|
87
113
|
}
|
|
88
114
|
|
|
89
115
|
private async sendRequest(method: string, params: object): Promise<any> {
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -2,14 +2,22 @@ packages:
|
|
|
2
2
|
- packages/*
|
|
3
3
|
- apps/*
|
|
4
4
|
- docusaurus/*
|
|
5
|
-
-
|
|
5
|
+
- examples/*
|
|
6
|
+
- '!**/test/**'
|
|
7
|
+
|
|
6
8
|
catalog:
|
|
7
9
|
typescript: ^5.0.4
|
|
8
10
|
vitest: ^3.0.4
|
|
9
11
|
vite: ^6.1.0
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
'@types/node': ^22.13.1
|
|
13
|
+
'@tari-project/typescript-bindings': '>=1.13.0'
|
|
14
|
+
'@tari-project/wallet_jrpc_client': ^1.7.2
|
|
15
|
+
'@metamask/providers': ^18.2.0
|
|
16
|
+
'@walletconnect/universal-provider': ^2.13.3
|
|
17
|
+
'@walletconnect/modal': ^2.6.2
|
|
18
|
+
|
|
19
|
+
onlyBuiltDependencies:
|
|
20
|
+
- '@moonrepo/cli'
|
|
21
|
+
- core-js
|
|
22
|
+
- core-js-pure
|
|
23
|
+
- esbuild
|
|
@@ -6,6 +6,8 @@ echo "Finding all package.json files and extracting versions..."
|
|
|
6
6
|
|
|
7
7
|
declare -a versions
|
|
8
8
|
|
|
9
|
+
gitroot=$(git rev-parse --show-toplevel)
|
|
10
|
+
pushd "${gitroot}/packages" > /dev/null
|
|
9
11
|
# Find all package.json files, excluding node_modules, and extract the version
|
|
10
12
|
while IFS= read -r file; do
|
|
11
13
|
version=$(jq -r '.version' "$file")
|
|
@@ -40,3 +42,5 @@ if [ "$all_same" = false ]; then
|
|
|
40
42
|
else
|
|
41
43
|
echo "✅ All package.json versions are consistent: $reference_version"
|
|
42
44
|
fi
|
|
45
|
+
|
|
46
|
+
popd > /dev/null
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
# This script cleans up the dist and node_modules directories in all packages
|
|
6
|
+
|
|
7
|
+
gitroot=$(git rev-parse --show-toplevel)
|
|
8
|
+
pushd "${gitroot}" > /dev/null
|
|
9
|
+
echo "Cleaning up the root node_modules"
|
|
10
|
+
rm -fr node_modules
|
|
11
|
+
popd > /dev/null
|
|
12
|
+
|
|
13
|
+
pushd "${gitroot}/packages" > /dev/null
|
|
14
|
+
|
|
15
|
+
# Loop through all subdirectories
|
|
16
|
+
for dir in */; do
|
|
17
|
+
if [ -d "$dir" ]; then
|
|
18
|
+
echo "Cleaning up $dir"
|
|
19
|
+
# Remove dist directory if it exists
|
|
20
|
+
if [ -d "${dir}dist" ]; then
|
|
21
|
+
echo "Removing ${dir}dist"
|
|
22
|
+
rm -rf "${dir}dist"
|
|
23
|
+
fi
|
|
24
|
+
# Remove node_modules directory if it exists
|
|
25
|
+
if [ -d "${dir}node_modules" ]; then
|
|
26
|
+
echo "Removing ${dir}node_modules"
|
|
27
|
+
rm -rf "${dir}node_modules"
|
|
28
|
+
fi
|
|
29
|
+
# Remove tsconfig.tsbuildinfo file if it exists
|
|
30
|
+
if [ -f "${dir}tsconfig.tsbuildinfo" ]; then
|
|
31
|
+
echo "Removing ${dir}tsconfig.tsbuildinfo"
|
|
32
|
+
rm -f "${dir}tsconfig.tsbuildinfo"
|
|
33
|
+
fi
|
|
34
|
+
fi
|
|
35
|
+
done
|
|
36
|
+
|
|
37
|
+
echo "Cleanup complete."
|
|
38
|
+
popd > /dev/null
|
package/tsconfig.json
CHANGED
|
File without changes
|
|
File without changes
|