@nuxt/kit 4.0.0-alpha.3 → 4.0.0-rc.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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +173 -76
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1066,6 +1066,11 @@ function addTypeTemplate(_template, context) {
|
|
|
1066
1066
|
nodeReferences.push({ path: template.dst });
|
|
1067
1067
|
});
|
|
1068
1068
|
}
|
|
1069
|
+
if (context?.shared) {
|
|
1070
|
+
nuxt.hook("prepare:types", ({ sharedReferences }) => {
|
|
1071
|
+
sharedReferences.push({ path: template.dst });
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1069
1074
|
if (context?.nitro) {
|
|
1070
1075
|
nuxt.hook("nitro:prepare:types", ({ references }) => {
|
|
1071
1076
|
references.push({ path: template.dst });
|
|
@@ -1106,25 +1111,42 @@ function normalizeTemplate(template, buildDir) {
|
|
|
1106
1111
|
async function updateTemplates(options) {
|
|
1107
1112
|
return await tryUseNuxt()?.hooks.callHook("builder:generateApp", options);
|
|
1108
1113
|
}
|
|
1109
|
-
function resolveLayerPaths(buildDir, rootDir, srcDir) {
|
|
1114
|
+
function resolveLayerPaths(dir, buildDir, rootDir, srcDir) {
|
|
1110
1115
|
const relativeRootDir = relativeWithDot(buildDir, rootDir);
|
|
1116
|
+
const relativeSrcDir = relativeWithDot(buildDir, srcDir);
|
|
1117
|
+
const relativeModulesDir = relativeWithDot(buildDir, resolve(rootDir, dir.modules || "modules"));
|
|
1118
|
+
const relativeSharedDir = relativeWithDot(buildDir, resolve(rootDir, dir.shared || "shared"));
|
|
1111
1119
|
return {
|
|
1112
1120
|
nuxt: [
|
|
1113
|
-
join(
|
|
1114
|
-
join(
|
|
1115
|
-
join(relativeRootDir,
|
|
1121
|
+
join(relativeSrcDir, "**/*"),
|
|
1122
|
+
join(relativeModulesDir, `*/runtime/**/*`),
|
|
1123
|
+
join(relativeRootDir, `layers/*/modules/*/runtime/**/*`)
|
|
1116
1124
|
],
|
|
1117
1125
|
nitro: [
|
|
1118
|
-
join(
|
|
1119
|
-
join(relativeRootDir,
|
|
1126
|
+
join(relativeModulesDir, `*/runtime/server/**/*`),
|
|
1127
|
+
join(relativeRootDir, `layers/*/modules/*/runtime/server/**/*`)
|
|
1120
1128
|
],
|
|
1121
1129
|
node: [
|
|
1122
|
-
join(
|
|
1123
|
-
join(relativeRootDir,
|
|
1124
|
-
join(relativeRootDir,
|
|
1125
|
-
join(relativeRootDir,
|
|
1126
|
-
join(relativeRootDir,
|
|
1127
|
-
join(relativeRootDir,
|
|
1130
|
+
join(relativeModulesDir, `*.*`),
|
|
1131
|
+
join(relativeRootDir, `nuxt.config.*`),
|
|
1132
|
+
join(relativeRootDir, `.config/nuxt.*`),
|
|
1133
|
+
join(relativeRootDir, `layers/*/nuxt.config.*`),
|
|
1134
|
+
join(relativeRootDir, `layers/*/.config/nuxt.*`),
|
|
1135
|
+
join(relativeRootDir, `layers/*/modules/**/*`)
|
|
1136
|
+
],
|
|
1137
|
+
shared: [
|
|
1138
|
+
join(relativeSharedDir, `**/*`),
|
|
1139
|
+
join(relativeModulesDir, `*/shared/**/*`),
|
|
1140
|
+
join(relativeRootDir, `layers/*/shared/**/*`)
|
|
1141
|
+
],
|
|
1142
|
+
sharedDeclarations: [
|
|
1143
|
+
join(relativeSharedDir, `**/*.d.ts`),
|
|
1144
|
+
join(relativeModulesDir, `*/shared/**/*.d.ts`),
|
|
1145
|
+
join(relativeRootDir, `layers/*/shared/**/*.d.ts`)
|
|
1146
|
+
],
|
|
1147
|
+
globalDeclarations: [
|
|
1148
|
+
join(relativeRootDir, `*.d.ts`),
|
|
1149
|
+
join(relativeRootDir, `layers/*/*.d.ts`)
|
|
1128
1150
|
]
|
|
1129
1151
|
};
|
|
1130
1152
|
}
|
|
@@ -1133,9 +1155,11 @@ const excludedAlias = [/^@vue\/.*$/, /^#internal\/nuxt/];
|
|
|
1133
1155
|
async function _generateTypes(nuxt) {
|
|
1134
1156
|
const include = /* @__PURE__ */ new Set(["./nuxt.d.ts"]);
|
|
1135
1157
|
const nodeInclude = /* @__PURE__ */ new Set(["./nuxt.node.d.ts"]);
|
|
1136
|
-
const
|
|
1158
|
+
const sharedInclude = /* @__PURE__ */ new Set(["./nuxt.shared.d.ts"]);
|
|
1159
|
+
const legacyInclude = /* @__PURE__ */ new Set([...include, ...nodeInclude]);
|
|
1137
1160
|
const exclude = /* @__PURE__ */ new Set();
|
|
1138
1161
|
const nodeExclude = /* @__PURE__ */ new Set();
|
|
1162
|
+
const sharedExclude = /* @__PURE__ */ new Set();
|
|
1139
1163
|
const legacyExclude = /* @__PURE__ */ new Set();
|
|
1140
1164
|
if (nuxt.options.typescript.includeWorkspace && nuxt.options.workspaceDir !== nuxt.options.srcDir) {
|
|
1141
1165
|
include.add(join(relative(nuxt.options.buildDir, nuxt.options.workspaceDir), "**/*"));
|
|
@@ -1154,9 +1178,9 @@ async function _generateTypes(nuxt) {
|
|
|
1154
1178
|
const rootDirWithSlash = withTrailingSlash(nuxt.options.rootDir);
|
|
1155
1179
|
for (const layer of nuxt.options._layers) {
|
|
1156
1180
|
const srcOrCwd = withTrailingSlash(layer.config.srcDir ?? layer.cwd);
|
|
1157
|
-
if (!srcOrCwd.startsWith(rootDirWithSlash) ||
|
|
1181
|
+
if (!srcOrCwd.startsWith(rootDirWithSlash) || layer.cwd === nuxt.options.rootDir || srcOrCwd.includes("node_modules")) {
|
|
1158
1182
|
const rootGlob = join(relativeWithDot(nuxt.options.buildDir, layer.cwd), "**/*");
|
|
1159
|
-
const paths = resolveLayerPaths(nuxt.options.buildDir, layer.cwd, layer.config.srcDir);
|
|
1183
|
+
const paths = resolveLayerPaths(defu(layer.config.dir, nuxt.options.dir), nuxt.options.buildDir, layer.cwd, layer.config.srcDir);
|
|
1160
1184
|
for (const path of paths.nuxt) {
|
|
1161
1185
|
include.add(path);
|
|
1162
1186
|
legacyInclude.add(path);
|
|
@@ -1174,6 +1198,18 @@ async function _generateTypes(nuxt) {
|
|
|
1174
1198
|
legacyInclude.add(path);
|
|
1175
1199
|
exclude.add(path);
|
|
1176
1200
|
}
|
|
1201
|
+
for (const path of paths.shared) {
|
|
1202
|
+
legacyInclude.add(path);
|
|
1203
|
+
sharedInclude.add(path);
|
|
1204
|
+
}
|
|
1205
|
+
for (const path of paths.sharedDeclarations) {
|
|
1206
|
+
include.add(path);
|
|
1207
|
+
}
|
|
1208
|
+
for (const path of paths.globalDeclarations) {
|
|
1209
|
+
include.add(path);
|
|
1210
|
+
legacyInclude.add(path);
|
|
1211
|
+
sharedInclude.add(path);
|
|
1212
|
+
}
|
|
1177
1213
|
}
|
|
1178
1214
|
}
|
|
1179
1215
|
const moduleEntryPaths = [];
|
|
@@ -1185,14 +1221,18 @@ async function _generateTypes(nuxt) {
|
|
|
1185
1221
|
const modulePaths = await resolveNuxtModule(rootDirWithSlash, moduleEntryPaths);
|
|
1186
1222
|
for (const path of modulePaths) {
|
|
1187
1223
|
const relative2 = relativeWithDot(nuxt.options.buildDir, path);
|
|
1188
|
-
|
|
1189
|
-
|
|
1224
|
+
if (!path.includes("node_modules")) {
|
|
1225
|
+
include.add(join(relative2, "runtime"));
|
|
1226
|
+
include.add(join(relative2, "dist/runtime"));
|
|
1227
|
+
nodeInclude.add(join(relative2, "*.*"));
|
|
1228
|
+
}
|
|
1190
1229
|
legacyInclude.add(join(relative2, "runtime"));
|
|
1191
1230
|
legacyInclude.add(join(relative2, "dist/runtime"));
|
|
1192
1231
|
nodeExclude.add(join(relative2, "runtime"));
|
|
1193
1232
|
nodeExclude.add(join(relative2, "dist/runtime"));
|
|
1194
1233
|
exclude.add(join(relative2, "runtime/server"));
|
|
1195
1234
|
exclude.add(join(relative2, "dist/runtime/server"));
|
|
1235
|
+
exclude.add(join(relative2, "*.*"));
|
|
1196
1236
|
legacyExclude.add(join(relative2, "runtime/server"));
|
|
1197
1237
|
legacyExclude.add(join(relative2, "dist/runtime/server"));
|
|
1198
1238
|
}
|
|
@@ -1209,41 +1249,6 @@ async function _generateTypes(nuxt) {
|
|
|
1209
1249
|
}
|
|
1210
1250
|
hasTypescriptVersionWithModulePreserve ??= true;
|
|
1211
1251
|
const useDecorators = Boolean(nuxt.options.experimental?.decorators);
|
|
1212
|
-
const nodeReferences = [];
|
|
1213
|
-
const nodeTsConfig = defu(nuxt.options.typescript?.nodeTsConfig, {
|
|
1214
|
-
compilerOptions: {
|
|
1215
|
-
/* Base options: */
|
|
1216
|
-
esModuleInterop: true,
|
|
1217
|
-
skipLibCheck: true,
|
|
1218
|
-
target: "ESNext",
|
|
1219
|
-
allowJs: true,
|
|
1220
|
-
resolveJsonModule: true,
|
|
1221
|
-
moduleDetection: "force",
|
|
1222
|
-
isolatedModules: true,
|
|
1223
|
-
verbatimModuleSyntax: true,
|
|
1224
|
-
/* Strictness */
|
|
1225
|
-
strict: nuxt.options.typescript?.strict ?? true,
|
|
1226
|
-
noUncheckedIndexedAccess: true,
|
|
1227
|
-
forceConsistentCasingInFileNames: true,
|
|
1228
|
-
noImplicitOverride: true,
|
|
1229
|
-
/* If NOT transpiling with TypeScript: */
|
|
1230
|
-
module: hasTypescriptVersionWithModulePreserve ? "preserve" : "ESNext",
|
|
1231
|
-
noEmit: true,
|
|
1232
|
-
/* remove auto-scanning for types */
|
|
1233
|
-
types: [],
|
|
1234
|
-
/* add paths object for filling-in later */
|
|
1235
|
-
paths: {},
|
|
1236
|
-
/* Possibly consider removing the following in future */
|
|
1237
|
-
moduleResolution: hasTypescriptVersionWithModulePreserve ? void 0 : "Bundler",
|
|
1238
|
-
useDefineForClassFields: true,
|
|
1239
|
-
/* implied by target: es2022+ */
|
|
1240
|
-
noImplicitThis: true,
|
|
1241
|
-
/* enabled with `strict` */
|
|
1242
|
-
allowSyntheticDefaultImports: true
|
|
1243
|
-
},
|
|
1244
|
-
include: [...nodeInclude],
|
|
1245
|
-
exclude: [...nodeExclude]
|
|
1246
|
-
});
|
|
1247
1252
|
const tsConfig = defu(nuxt.options.typescript?.tsConfig, {
|
|
1248
1253
|
compilerOptions: {
|
|
1249
1254
|
/* Base options: */
|
|
@@ -1294,6 +1299,70 @@ async function _generateTypes(nuxt) {
|
|
|
1294
1299
|
include: [...include],
|
|
1295
1300
|
exclude: [...exclude]
|
|
1296
1301
|
});
|
|
1302
|
+
const nodeTsConfig = defu(nuxt.options.typescript?.nodeTsConfig, {
|
|
1303
|
+
compilerOptions: {
|
|
1304
|
+
/* Base options: */
|
|
1305
|
+
esModuleInterop: tsConfig.compilerOptions?.esModuleInterop,
|
|
1306
|
+
skipLibCheck: tsConfig.compilerOptions?.skipLibCheck,
|
|
1307
|
+
target: tsConfig.compilerOptions?.target,
|
|
1308
|
+
allowJs: tsConfig.compilerOptions?.allowJs,
|
|
1309
|
+
resolveJsonModule: tsConfig.compilerOptions?.resolveJsonModule,
|
|
1310
|
+
moduleDetection: tsConfig.compilerOptions?.moduleDetection,
|
|
1311
|
+
isolatedModules: tsConfig.compilerOptions?.isolatedModules,
|
|
1312
|
+
verbatimModuleSyntax: tsConfig.compilerOptions?.verbatimModuleSyntax,
|
|
1313
|
+
/* Strictness */
|
|
1314
|
+
strict: tsConfig.compilerOptions?.strict,
|
|
1315
|
+
noUncheckedIndexedAccess: tsConfig.compilerOptions?.noUncheckedIndexedAccess,
|
|
1316
|
+
forceConsistentCasingInFileNames: tsConfig.compilerOptions?.forceConsistentCasingInFileNames,
|
|
1317
|
+
noImplicitOverride: tsConfig.compilerOptions?.noImplicitOverride,
|
|
1318
|
+
/* If NOT transpiling with TypeScript: */
|
|
1319
|
+
module: tsConfig.compilerOptions?.module,
|
|
1320
|
+
noEmit: true,
|
|
1321
|
+
/* remove auto-scanning for types */
|
|
1322
|
+
types: [],
|
|
1323
|
+
/* add paths object for filling-in later */
|
|
1324
|
+
paths: {},
|
|
1325
|
+
/* Possibly consider removing the following in future */
|
|
1326
|
+
moduleResolution: tsConfig.compilerOptions?.moduleResolution,
|
|
1327
|
+
useDefineForClassFields: tsConfig.compilerOptions?.useDefineForClassFields,
|
|
1328
|
+
noImplicitThis: tsConfig.compilerOptions?.noImplicitThis,
|
|
1329
|
+
allowSyntheticDefaultImports: tsConfig.compilerOptions?.allowSyntheticDefaultImports
|
|
1330
|
+
},
|
|
1331
|
+
include: [...nodeInclude],
|
|
1332
|
+
exclude: [...nodeExclude]
|
|
1333
|
+
});
|
|
1334
|
+
const sharedTsConfig = defu(nuxt.options.typescript?.sharedTsConfig, {
|
|
1335
|
+
compilerOptions: {
|
|
1336
|
+
/* Base options: */
|
|
1337
|
+
esModuleInterop: tsConfig.compilerOptions?.esModuleInterop,
|
|
1338
|
+
skipLibCheck: tsConfig.compilerOptions?.skipLibCheck,
|
|
1339
|
+
target: tsConfig.compilerOptions?.target,
|
|
1340
|
+
allowJs: tsConfig.compilerOptions?.allowJs,
|
|
1341
|
+
resolveJsonModule: tsConfig.compilerOptions?.resolveJsonModule,
|
|
1342
|
+
moduleDetection: tsConfig.compilerOptions?.moduleDetection,
|
|
1343
|
+
isolatedModules: tsConfig.compilerOptions?.isolatedModules,
|
|
1344
|
+
verbatimModuleSyntax: tsConfig.compilerOptions?.verbatimModuleSyntax,
|
|
1345
|
+
/* Strictness */
|
|
1346
|
+
strict: tsConfig.compilerOptions?.strict,
|
|
1347
|
+
noUncheckedIndexedAccess: tsConfig.compilerOptions?.noUncheckedIndexedAccess,
|
|
1348
|
+
forceConsistentCasingInFileNames: tsConfig.compilerOptions?.forceConsistentCasingInFileNames,
|
|
1349
|
+
noImplicitOverride: tsConfig.compilerOptions?.noImplicitOverride,
|
|
1350
|
+
/* If NOT transpiling with TypeScript: */
|
|
1351
|
+
module: tsConfig.compilerOptions?.module,
|
|
1352
|
+
noEmit: true,
|
|
1353
|
+
/* remove auto-scanning for types */
|
|
1354
|
+
types: [],
|
|
1355
|
+
/* add paths object for filling-in later */
|
|
1356
|
+
paths: {},
|
|
1357
|
+
/* Possibly consider removing the following in future */
|
|
1358
|
+
moduleResolution: tsConfig.compilerOptions?.moduleResolution,
|
|
1359
|
+
useDefineForClassFields: tsConfig.compilerOptions?.useDefineForClassFields,
|
|
1360
|
+
noImplicitThis: tsConfig.compilerOptions?.noImplicitThis,
|
|
1361
|
+
allowSyntheticDefaultImports: tsConfig.compilerOptions?.allowSyntheticDefaultImports
|
|
1362
|
+
},
|
|
1363
|
+
include: [...sharedInclude],
|
|
1364
|
+
exclude: [...sharedExclude]
|
|
1365
|
+
});
|
|
1297
1366
|
const aliases = nuxt.options.alias;
|
|
1298
1367
|
const basePath = tsConfig.compilerOptions.baseUrl ? resolve(nuxt.options.buildDir, tsConfig.compilerOptions.baseUrl) : nuxt.options.buildDir;
|
|
1299
1368
|
tsConfig.compilerOptions ||= {};
|
|
@@ -1330,6 +1399,8 @@ async function _generateTypes(nuxt) {
|
|
|
1330
1399
|
}
|
|
1331
1400
|
}
|
|
1332
1401
|
const references = [];
|
|
1402
|
+
const nodeReferences = [];
|
|
1403
|
+
const sharedReferences = [];
|
|
1333
1404
|
await Promise.all([...nuxt.options.modules, ...nuxt.options._modules].map(async (id) => {
|
|
1334
1405
|
if (typeof id !== "string") {
|
|
1335
1406
|
return;
|
|
@@ -1337,30 +1408,43 @@ async function _generateTypes(nuxt) {
|
|
|
1337
1408
|
for (const parent of nestedModulesDirs) {
|
|
1338
1409
|
const pkg = await readPackageJSON(id, { parent }).catch(() => null);
|
|
1339
1410
|
if (pkg) {
|
|
1340
|
-
|
|
1411
|
+
nodeReferences.push({ types: pkg.name ?? id });
|
|
1341
1412
|
return;
|
|
1342
1413
|
}
|
|
1343
1414
|
}
|
|
1344
|
-
|
|
1415
|
+
nodeReferences.push({ types: id });
|
|
1345
1416
|
}));
|
|
1346
1417
|
const declarations = [];
|
|
1347
|
-
await nuxt.callHook("prepare:types", { references, declarations, tsConfig, nodeTsConfig, nodeReferences });
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
tsConfig.
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1418
|
+
await nuxt.callHook("prepare:types", { references, declarations, tsConfig, nodeTsConfig, nodeReferences, sharedTsConfig, sharedReferences });
|
|
1419
|
+
const legacyTsConfig = defu({}, {
|
|
1420
|
+
...tsConfig,
|
|
1421
|
+
include: [...tsConfig.include, ...legacyInclude],
|
|
1422
|
+
exclude: [...legacyExclude]
|
|
1423
|
+
});
|
|
1424
|
+
async function resolveConfig(tsConfig2) {
|
|
1425
|
+
for (const alias in tsConfig2.compilerOptions.paths) {
|
|
1426
|
+
const paths = tsConfig2.compilerOptions.paths[alias];
|
|
1427
|
+
tsConfig2.compilerOptions.paths[alias] = [...new Set(await Promise.all(paths.map(async (path) => {
|
|
1428
|
+
if (!isAbsolute(path)) {
|
|
1429
|
+
return path;
|
|
1430
|
+
}
|
|
1431
|
+
const stats = await promises.stat(path).catch(
|
|
1432
|
+
() => null
|
|
1433
|
+
/* file does not exist */
|
|
1434
|
+
);
|
|
1435
|
+
return relativeWithDot(nuxt.options.buildDir, stats?.isFile() ? path.replace(EXTENSION_RE, "") : path);
|
|
1436
|
+
})))];
|
|
1437
|
+
}
|
|
1438
|
+
sortTsPaths(tsConfig2.compilerOptions.paths);
|
|
1439
|
+
tsConfig2.include = [...new Set(tsConfig2.include.map((p) => isAbsolute(p) ? relativeWithDot(nuxt.options.buildDir, p) : p))];
|
|
1440
|
+
tsConfig2.exclude = [...new Set(tsConfig2.exclude.map((p) => isAbsolute(p) ? relativeWithDot(nuxt.options.buildDir, p) : p))];
|
|
1360
1441
|
}
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1442
|
+
await Promise.all([
|
|
1443
|
+
resolveConfig(tsConfig),
|
|
1444
|
+
resolveConfig(nodeTsConfig),
|
|
1445
|
+
resolveConfig(sharedTsConfig),
|
|
1446
|
+
resolveConfig(legacyTsConfig)
|
|
1447
|
+
]);
|
|
1364
1448
|
const declaration = [
|
|
1365
1449
|
...references.map((ref) => {
|
|
1366
1450
|
if ("path" in ref && isAbsolute(ref.path)) {
|
|
@@ -1384,12 +1468,21 @@ async function _generateTypes(nuxt) {
|
|
|
1384
1468
|
"export {}",
|
|
1385
1469
|
""
|
|
1386
1470
|
].join("\n");
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1471
|
+
const sharedDeclaration = [
|
|
1472
|
+
...sharedReferences.map((ref) => {
|
|
1473
|
+
if ("path" in ref && isAbsolute(ref.path)) {
|
|
1474
|
+
ref.path = relative(nuxt.options.buildDir, ref.path);
|
|
1475
|
+
}
|
|
1476
|
+
return `/// <reference ${renderAttrs(ref)} />`;
|
|
1477
|
+
}),
|
|
1478
|
+
"",
|
|
1479
|
+
"export {}",
|
|
1480
|
+
""
|
|
1481
|
+
].join("\n");
|
|
1391
1482
|
return {
|
|
1392
1483
|
declaration,
|
|
1484
|
+
sharedTsConfig,
|
|
1485
|
+
sharedDeclaration,
|
|
1393
1486
|
nodeTsConfig,
|
|
1394
1487
|
nodeDeclaration,
|
|
1395
1488
|
tsConfig,
|
|
@@ -1397,19 +1490,23 @@ async function _generateTypes(nuxt) {
|
|
|
1397
1490
|
};
|
|
1398
1491
|
}
|
|
1399
1492
|
async function writeTypes(nuxt) {
|
|
1400
|
-
const { tsConfig, nodeTsConfig, nodeDeclaration, declaration, legacyTsConfig } = await _generateTypes(nuxt);
|
|
1493
|
+
const { tsConfig, nodeTsConfig, nodeDeclaration, declaration, legacyTsConfig, sharedDeclaration, sharedTsConfig } = await _generateTypes(nuxt);
|
|
1401
1494
|
const appTsConfigPath = resolve(nuxt.options.buildDir, "tsconfig.app.json");
|
|
1402
1495
|
const legacyTsConfigPath = resolve(nuxt.options.buildDir, "tsconfig.json");
|
|
1403
1496
|
const nodeTsConfigPath = resolve(nuxt.options.buildDir, "tsconfig.node.json");
|
|
1497
|
+
const sharedTsConfigPath = resolve(nuxt.options.buildDir, "tsconfig.shared.json");
|
|
1404
1498
|
const declarationPath = resolve(nuxt.options.buildDir, "nuxt.d.ts");
|
|
1405
1499
|
const nodeDeclarationPath = resolve(nuxt.options.buildDir, "nuxt.node.d.ts");
|
|
1500
|
+
const sharedDeclarationPath = resolve(nuxt.options.buildDir, "nuxt.shared.d.ts");
|
|
1406
1501
|
await promises.mkdir(nuxt.options.buildDir, { recursive: true });
|
|
1407
1502
|
await Promise.all([
|
|
1408
1503
|
promises.writeFile(appTsConfigPath, JSON.stringify(tsConfig, null, 2)),
|
|
1409
1504
|
promises.writeFile(legacyTsConfigPath, JSON.stringify(legacyTsConfig, null, 2)),
|
|
1410
1505
|
promises.writeFile(nodeTsConfigPath, JSON.stringify(nodeTsConfig, null, 2)),
|
|
1506
|
+
promises.writeFile(sharedTsConfigPath, JSON.stringify(sharedTsConfig, null, 2)),
|
|
1411
1507
|
promises.writeFile(declarationPath, declaration),
|
|
1412
|
-
promises.writeFile(nodeDeclarationPath, nodeDeclaration)
|
|
1508
|
+
promises.writeFile(nodeDeclarationPath, nodeDeclaration),
|
|
1509
|
+
promises.writeFile(sharedDeclarationPath, sharedDeclaration)
|
|
1413
1510
|
]);
|
|
1414
1511
|
}
|
|
1415
1512
|
function sortTsPaths(paths) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/kit",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
"mlly": "^1.7.4",
|
|
36
36
|
"ohash": "^2.0.11",
|
|
37
37
|
"pathe": "^2.0.3",
|
|
38
|
-
"pkg-types": "^2.
|
|
38
|
+
"pkg-types": "^2.2.0",
|
|
39
39
|
"scule": "^1.3.0",
|
|
40
40
|
"semver": "^7.7.2",
|
|
41
41
|
"std-env": "^3.9.0",
|
|
42
42
|
"tinyglobby": "^0.2.14",
|
|
43
43
|
"ufo": "^1.6.1",
|
|
44
44
|
"unctx": "^2.4.1",
|
|
45
|
-
"unimport": "^5.0
|
|
45
|
+
"unimport": "^5.1.0",
|
|
46
46
|
"untyped": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@rspack/core": "1.
|
|
49
|
+
"@rspack/core": "1.4.4",
|
|
50
50
|
"@types/semver": "7.7.0",
|
|
51
51
|
"hookable": "5.5.3",
|
|
52
52
|
"nitropack": "2.11.13",
|
|
53
53
|
"unbuild": "3.5.0",
|
|
54
|
-
"vite": "7.0.
|
|
54
|
+
"vite": "7.0.2",
|
|
55
55
|
"vitest": "3.2.4",
|
|
56
56
|
"webpack": "5.99.9",
|
|
57
|
-
"@nuxt/schema": "4.0.0-
|
|
57
|
+
"@nuxt/schema": "4.0.0-rc.0"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=18.12.0"
|