Skip to content

Commit 81001cb

Browse files
authored
chore(nuxt): Support TS6 and migrate to tsdown (#8192)
1 parent 75100e2 commit 81001cb

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

packages/nuxt/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"dist"
5959
],
6060
"scripts": {
61-
"build": "tsup",
62-
"dev": "tsup --watch",
61+
"build": "tsdown",
62+
"dev": "tsdown --watch",
6363
"dev:pub": "pnpm dev -- --env.publish",
6464
"format": "node ../../scripts/format-package.mjs",
6565
"format:check": "node ../../scripts/format-package.mjs --check",

packages/nuxt/src/runtime/components/uiComponents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ const wrapComponentWithRouting = <T extends Component>(baseComponent: T, compone
5757
};
5858

5959
const _UserProfile = wrapComponentWithRouting(BaseUserProfile, 'UserProfile');
60-
export const UserProfile = Object.assign(_UserProfile, {
60+
export const UserProfile: typeof BaseUserProfile = Object.assign(_UserProfile, {
6161
Page: BaseUserProfile.Page,
6262
Link: BaseUserProfile.Link,
6363
});
6464

6565
const _OrganizationProfile = wrapComponentWithRouting(BaseOrganizationProfile, 'OrganizationProfile');
66-
export const OrganizationProfile = Object.assign(_OrganizationProfile, {
66+
export const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(_OrganizationProfile, {
6767
Page: BaseOrganizationProfile.Page,
6868
Link: BaseOrganizationProfile.Link,
6969
});

packages/nuxt/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"noUnusedLocals": true,
1010
"noEmit": true,
1111
"allowSyntheticDefaultImports": true,
12-
"esModuleInterop": false,
1312
"skipLibCheck": true
1413
},
1514
"include": ["src"]
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { defineConfig } from 'tsup';
1+
import { defineConfig } from 'tsdown';
22

3-
import { name, version } from './package.json';
3+
import pkgJson from './package.json' with { type: 'json' };
44

55
export default defineConfig(overrideOptions => {
66
const shouldPublish = !!overrideOptions.env?.publish;
@@ -21,15 +21,15 @@ export default defineConfig(overrideOptions => {
2121
format: ['esm'],
2222
// Make sure to not bundle the imports
2323
// or else the Nuxt module will not be able to resolve them
24-
bundle: false,
24+
unbundle: true,
2525
sourcemap: true,
2626
minify: false,
2727
dts: true,
2828
onSuccess: shouldPublish ? 'pkglab pub --ping' : undefined,
2929
define: {
30-
PACKAGE_NAME: `"${name}"`,
31-
PACKAGE_VERSION: `"${version}"`,
30+
PACKAGE_NAME: `"${pkgJson.name}"`,
31+
PACKAGE_VERSION: `"${pkgJson.version}"`,
3232
},
33-
external: ['#imports'],
33+
external: ['#imports', 'nuxt/app'],
3434
};
3535
});

0 commit comments

Comments
 (0)