Skip to content

Commit d936611

Browse files
authored
feat: upgrade to typescript 7 (#368)
# Description of change Please write a summary of your changes and why you made them. ## Links to any relevant issues Be sure to reference any related issues by adding `fixes #(issue)`. ## How the change has been tested Describe the tests that you ran to verify your changes. Make sure to provide instructions for the maintainer as well as any relevant configurations.
1 parent 68061f7 commit d936611

112 files changed

Lines changed: 2741 additions & 1747 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@iota/bcs': patch
3+
'@iota/iota-sdk': patch
4+
'@iota/dapp-kit': patch
5+
'@iota/isc-sdk': patch
6+
'@iota/iota-names-sdk': patch
7+
'@iota/kiosk': patch
8+
'@iota/signers': patch
9+
'@iota/graphql-transport': patch
10+
'@iota/create-dapp': patch
11+
'@iota/apps-ui-kit': patch
12+
'@iota/apps-ui-icons': patch
13+
'@iota/apps-backend-client': patch
14+
---
15+
16+
Build with TypeScript 7, declare every package the published type declarations import, ship the
17+
GraphQL schema introspection types, and update the create-dapp templates to TypeScript 7

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# IDE
22
**/.history/
3-
**/.vscode/
3+
**/.vscode/*
4+
!/.vscode/settings.json
5+
!/.vscode/extensions.json
46
**/.idea/
57

68
# OSX

‎.pnpmfile.cjs‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) 2026 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// TypeScript 7 ships no JavaScript compiler API, so tools that load `typescript` programmatically
5+
// get their own TypeScript 6 instead of resolving the workspace TypeScript 7 as a peer.
6+
const TYPESCRIPT_API_CONSUMERS = new Set([
7+
'@0no-co/graphqlsp',
8+
'@gql.tada/cli-utils',
9+
'@gql.tada/internal',
10+
'@joshwooding/vite-plugin-react-docgen-typescript',
11+
'react-docgen-typescript',
12+
'typedoc',
13+
]);
14+
15+
const TYPESCRIPT_API_VERSION = 'npm:typescript@^6.0.3';
16+
17+
function readPackage(pkg) {
18+
if (TYPESCRIPT_API_CONSUMERS.has(pkg.name)) {
19+
delete pkg.peerDependencies?.typescript;
20+
delete pkg.peerDependenciesMeta?.typescript;
21+
pkg.dependencies = { ...pkg.dependencies, typescript: TYPESCRIPT_API_VERSION };
22+
}
23+
return pkg;
24+
}
25+
26+
module.exports = { hooks: { readPackage } };

‎.vercelignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.pnpmfile.cjs

‎.vscode/extensions.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["TypeScriptTeam.native-preview"]
3+
}

‎.vscode/settings.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"js/ts.experimental.useTsgo": true,
3+
"js/ts.tsdk.path": "./node_modules/typescript"
4+
}

‎apps/apps-backend-client/package.json‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dist"
1313
],
1414
"scripts": {
15-
"build": "tsc && vite build"
15+
"build": "tsc --noEmit && tsdown"
1616
},
1717
"exports": {
1818
".": {
@@ -22,7 +22,6 @@
2222
}
2323
},
2424
"types": "./dist/index.d.ts",
25-
"dependencies": {},
2625
"peerDependencies": {
2726
"react": "^18 || ^19"
2827
},
@@ -33,10 +32,8 @@
3332
},
3433
"devDependencies": {
3534
"@types/react": "^18.3.3",
36-
"@vitejs/plugin-react-swc": "^4.3.0",
3735
"react": "^18.3.1",
38-
"typescript": "^5.5.3",
39-
"vite": "^8.0.1",
40-
"vite-plugin-dts": "^4.5.4"
36+
"tsdown": "^0.23.0",
37+
"typescript": "^7.0.2"
4138
}
4239
}

‎apps/apps-backend-client/tsconfig.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
"compilerOptions": {
33
"target": "es2020",
44
"module": "esnext",
5-
"moduleResolution": "node",
5+
"moduleResolution": "bundler",
66
"jsx": "react-jsx",
77
"strict": true,
88
"skipLibCheck": true,
99
"esModuleInterop": true,
1010
"isolatedModules": true,
1111
"declaration": true,
1212
"emitDeclarationOnly": true,
13-
"outDir": "dist"
13+
"outDir": "dist",
14+
"rootDir": "src"
1415
},
1516
"include": ["src"]
1617
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2026 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { defineConfig } from 'tsdown';
5+
6+
export default defineConfig({
7+
entry: { index: 'src/index.ts' },
8+
format: ['esm', 'umd'],
9+
platform: 'browser',
10+
globalName: '@iota/apps-backend-client',
11+
outputOptions: {
12+
globals: {
13+
react: 'React',
14+
'react/jsx-runtime': 'jsxRuntime',
15+
},
16+
},
17+
outExtensions: ({ format }) =>
18+
format === 'es' ? { js: '.es.js', dts: '.d.ts' } : { js: '.js' },
19+
dts: true,
20+
sourcemap: true,
21+
});

‎apps/apps-backend-client/vite.config.ts‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)