silgi 0.11.2 → 0.11.4
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/_chunks/index.mjs +1 -1
- package/dist/cli/dev.mjs +0 -1
- package/dist/cli/prepare.mjs +0 -1
- package/dist/cli/writeTypesAndFiles.mjs +54 -38
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/dev.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -4,13 +4,12 @@ import consola$1, { consola } from 'consola';
|
|
|
4
4
|
import { createHooks, createDebugger } from 'hookable';
|
|
5
5
|
import { join, resolve, isAbsolute, relative, dirname, basename, extname } from 'pathe';
|
|
6
6
|
import { useSilgiCLI, silgiCLICtx } from 'silgi/core';
|
|
7
|
-
import { relativeWithDot, resolveAlias, resolvePath, writeFile,
|
|
7
|
+
import { relativeWithDot, hash, resolveAlias, resolvePath, writeFile, normalizeTemplate, useLogger, addTemplate, applyEnv, hasError as hasError$1, isDirectory } from 'silgi/kit';
|
|
8
8
|
import { runtimeDir } from 'silgi/runtime/meta';
|
|
9
9
|
import { autoImportTypes } from 'silgi/types';
|
|
10
10
|
import { scanExports, createUnimport, toExports } from 'unimport';
|
|
11
11
|
import { p as prepareEnv } from './env.mjs';
|
|
12
12
|
import { resolveModuleExportNames, resolve as resolve$1, resolvePath as resolvePath$1, parseNodeModulePath, lookupNodeModuleSubpath } from 'mlly';
|
|
13
|
-
import { pascalCase } from 'scule';
|
|
14
13
|
import { createJiti } from 'dev-jiti';
|
|
15
14
|
import { a as hasInstalledModule, h as hasError } from './compatibility.mjs';
|
|
16
15
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
@@ -117,7 +116,11 @@ async function nitroFramework(silgi, skip = false) {
|
|
|
117
116
|
silgi.hook("prepare:schema.ts", (data) => {
|
|
118
117
|
data.importItems.nitropack = {
|
|
119
118
|
import: [
|
|
120
|
-
{
|
|
119
|
+
{
|
|
120
|
+
name: "NitroApp",
|
|
121
|
+
type: true,
|
|
122
|
+
key: "NitroApp"
|
|
123
|
+
}
|
|
121
124
|
],
|
|
122
125
|
from: "nitropack/types"
|
|
123
126
|
};
|
|
@@ -132,7 +135,11 @@ async function nitroFramework(silgi, skip = false) {
|
|
|
132
135
|
silgi.hook("prepare:createDTSFramework", (data) => {
|
|
133
136
|
data.importItems["nitropack/types"] = {
|
|
134
137
|
import: [
|
|
135
|
-
{
|
|
138
|
+
{
|
|
139
|
+
name: "NitroRuntimeConfig",
|
|
140
|
+
type: true,
|
|
141
|
+
key: "NitroRuntimeConfig"
|
|
142
|
+
}
|
|
136
143
|
],
|
|
137
144
|
from: "nitropack/types"
|
|
138
145
|
};
|
|
@@ -229,74 +236,83 @@ async function registerModuleExportScan(silgi) {
|
|
|
229
236
|
};
|
|
230
237
|
const exportedTypes = exports.filter((exp) => exp.type).map((exp) => exp.name);
|
|
231
238
|
if (exportedTypes.includes("ModuleOptions")) {
|
|
232
|
-
const importName =
|
|
239
|
+
const importName = `_${hash(`${configKey}ModuleOptions`)}`;
|
|
233
240
|
options.importItems[configKey].import.push({
|
|
234
241
|
name: `ModuleOptions as ${importName}`,
|
|
235
|
-
type: true
|
|
242
|
+
type: true,
|
|
243
|
+
key: importName
|
|
236
244
|
});
|
|
237
245
|
options.options.push({ key: configKey, value: importName });
|
|
238
246
|
}
|
|
239
|
-
if (exportedTypes.includes("
|
|
240
|
-
const importName =
|
|
247
|
+
if (exportedTypes.includes("ModuleRuntimeOptions")) {
|
|
248
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeOptions`)}`;
|
|
241
249
|
options.importItems[configKey].import.push({
|
|
242
|
-
name: `
|
|
243
|
-
type: true
|
|
250
|
+
name: `ModuleRuntimeOptions as ${importName}`,
|
|
251
|
+
type: true,
|
|
252
|
+
key: importName
|
|
244
253
|
});
|
|
245
254
|
options.runtimeOptions.push({ key: configKey, value: importName });
|
|
246
255
|
}
|
|
247
|
-
if (exportedTypes.includes("
|
|
248
|
-
const importName =
|
|
256
|
+
if (exportedTypes.includes("ModuleRuntimeShareds")) {
|
|
257
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeShareds`)}`;
|
|
249
258
|
options.importItems[configKey].import.push({
|
|
250
|
-
name: `
|
|
251
|
-
type: true
|
|
259
|
+
name: `ModuleRuntimeShareds as ${importName}`,
|
|
260
|
+
type: true,
|
|
261
|
+
key: importName
|
|
252
262
|
});
|
|
253
|
-
options.
|
|
263
|
+
options.shareds.push({ key: configKey, value: importName });
|
|
254
264
|
}
|
|
255
|
-
if (exportedTypes.includes("
|
|
256
|
-
const importName =
|
|
265
|
+
if (exportedTypes.includes("ModuleEvents")) {
|
|
266
|
+
const importName = `_${hash(`${configKey}ModuleEvents`)}`;
|
|
257
267
|
options.importItems[configKey].import.push({
|
|
258
|
-
name: `
|
|
259
|
-
type: true
|
|
268
|
+
name: `ModuleEvents as ${importName}`,
|
|
269
|
+
type: true,
|
|
270
|
+
key: importName
|
|
260
271
|
});
|
|
261
|
-
options.
|
|
272
|
+
options.events.push({ key: configKey, value: importName });
|
|
262
273
|
}
|
|
263
|
-
if (exportedTypes.includes("
|
|
264
|
-
const importName =
|
|
274
|
+
if (exportedTypes.includes("ModuleRuntimeContexts")) {
|
|
275
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeContexts`)}`;
|
|
265
276
|
options.importItems[configKey].import.push({
|
|
266
|
-
name: `
|
|
267
|
-
type: true
|
|
277
|
+
name: `ModuleRuntimeContexts as ${importName}`,
|
|
278
|
+
type: true,
|
|
279
|
+
key: importName
|
|
268
280
|
});
|
|
269
|
-
options.
|
|
281
|
+
options.contexts.push({ key: configKey, value: importName });
|
|
270
282
|
}
|
|
271
283
|
if (exportedTypes.includes("ModuleHooks")) {
|
|
272
|
-
const importName =
|
|
284
|
+
const importName = `_${hash(`${configKey}ModuleHooks`)}`;
|
|
273
285
|
options.importItems[configKey].import.push({
|
|
274
286
|
name: `ModuleHooks as ${importName}`,
|
|
275
|
-
type: true
|
|
287
|
+
type: true,
|
|
288
|
+
key: importName
|
|
276
289
|
});
|
|
277
290
|
options.hooks.push({ key: configKey, value: importName });
|
|
278
291
|
}
|
|
279
292
|
if (exportedTypes.includes("ModuleRuntimeHooks")) {
|
|
280
|
-
const importName =
|
|
293
|
+
const importName = `_${hash(`${configKey}RuntimeHooks`)}`;
|
|
281
294
|
options.importItems[configKey].import.push({
|
|
282
295
|
name: `ModuleRuntimeHooks as ${importName}`,
|
|
283
|
-
type: true
|
|
296
|
+
type: true,
|
|
297
|
+
key: importName
|
|
284
298
|
});
|
|
285
299
|
options.runtimeHooks.push({ key: configKey, value: importName });
|
|
286
300
|
}
|
|
287
|
-
if (exportedTypes.includes("
|
|
288
|
-
const importName =
|
|
301
|
+
if (exportedTypes.includes("ModuleRuntimeActions")) {
|
|
302
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeActions`)}`;
|
|
289
303
|
options.importItems[configKey].import.push({
|
|
290
|
-
name: `
|
|
291
|
-
type: true
|
|
304
|
+
name: `ModuleRuntimeActions as ${importName}`,
|
|
305
|
+
type: true,
|
|
306
|
+
key: importName
|
|
292
307
|
});
|
|
293
|
-
options.
|
|
308
|
+
options.actions.push({ key: configKey, value: importName });
|
|
294
309
|
}
|
|
295
|
-
if (exportedTypes.includes("
|
|
296
|
-
const importName =
|
|
310
|
+
if (exportedTypes.includes("ModuleRuntimeMethods")) {
|
|
311
|
+
const importName = `_${hash(`${configKey}ModuleRuntimeMethods`)}`;
|
|
297
312
|
options.importItems[configKey].import.push({
|
|
298
|
-
name: `
|
|
299
|
-
type: true
|
|
313
|
+
name: `ModuleRuntimeMethods as ${importName}`,
|
|
314
|
+
type: true,
|
|
315
|
+
key: importName
|
|
300
316
|
});
|
|
301
317
|
options.methods.push({ key: configKey, value: importName });
|
|
302
318
|
}
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED