Skip to content

Commit 75100e2

Browse files
authored
chore(astro): TypeScript 6.0 compatibility (#8191)
1 parent c54142a commit 75100e2

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

packages/astro/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
"types.ts"
7878
],
7979
"scripts": {
80-
"build": "tsup --onSuccess \"pnpm build:dts\" && pnpm copy:components",
80+
"build": "tsdown --onSuccess \"pnpm build:dts\" && pnpm copy:components",
8181
"build:dts": "tsc --emitDeclarationOnly --declaration",
8282
"copy:components": "rm -rf ./components && mkdir -p ./components/ && cp -r ./src/astro-components/* ./components/ && cp ./src/types.ts ./",
83-
"dev": "tsup --watch",
83+
"dev": "tsdown --watch",
8484
"dev:pub": "pnpm dev -- --env.publish",
8585
"format": "node ../../scripts/format-package.mjs",
8686
"format:check": "node ../../scripts/format-package.mjs --check",
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { defineConfig } from 'tsup';
1+
import { defineConfig } from 'tsdown';
22

3-
// @ts-ignore
4-
import { name, version } from './package.json';
3+
import pkgJson from './package.json' with { type: 'json' };
54

65
export default defineConfig(overrideOptions => {
76
const shouldPublish = !!overrideOptions.env?.publish;
@@ -23,10 +22,9 @@ export default defineConfig(overrideOptions => {
2322
minify: false,
2423
onSuccess: shouldPublish ? 'pnpm build:dts && pkglab pub --ping' : 'pnpm build:dts',
2524
define: {
26-
PACKAGE_NAME: `"${name}"`,
27-
PACKAGE_VERSION: `"${version}"`,
25+
PACKAGE_NAME: `"${pkgJson.name}"`,
26+
PACKAGE_VERSION: `"${pkgJson.version}"`,
2827
},
29-
bundle: true,
3028
sourcemap: true,
3129
format: ['esm'],
3230
external: ['astro', 'react', 'react-dom', 'node:async_hooks', '#async-local-storage', 'astro:transitions/client'],

0 commit comments

Comments
 (0)