@silgi/module-builder 0.6.0 → 0.6.2
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/build.mjs
CHANGED
@@ -15,7 +15,7 @@ import { pkgDir } from 'silgi/runtime/meta';
|
|
15
15
|
import { parse } from 'tsconfck';
|
16
16
|
import { convertCompilerOptionsFromJson } from 'typescript';
|
17
17
|
import { scanExports } from 'unimport';
|
18
|
-
import { v as version, n as name } from '../shared/silgi-module-builder.
|
18
|
+
import { v as version, n as name } from '../shared/silgi-module-builder.CGCv6bjh.mjs';
|
19
19
|
|
20
20
|
const srcDir = fileURLToPath(new URL("src", import.meta.url));
|
21
21
|
const subpaths = [
|
@@ -267,14 +267,7 @@ async function writeTypes(options, _moduleMeta) {
|
|
267
267
|
moduleReExports.push(i);
|
268
268
|
}
|
269
269
|
const moduleImports = [];
|
270
|
-
const schemaImports = [];
|
271
|
-
const moduleExports = [];
|
272
270
|
const hasTypeExport = (name2) => moduleReExports.find((exp) => exp.names?.includes(name2));
|
273
|
-
if (!hasTypeExport("ModuleOptions")) {
|
274
|
-
schemaImports.push("SilgiModule");
|
275
|
-
moduleImports.push("default as Module");
|
276
|
-
moduleExports.push(`export type ModuleOptions = typeof Module extends SilgiModule<infer O> ? Partial<O> : Record<string, any>`);
|
277
|
-
}
|
278
271
|
if (hasTypeExport("ModuleOptions")) {
|
279
272
|
moduleImports.push("ModuleOptions");
|
280
273
|
}
|
@@ -303,16 +296,10 @@ async function writeTypes(options, _moduleMeta) {
|
|
303
296
|
moduleImports.push("ModuleRuntimeMethods");
|
304
297
|
}
|
305
298
|
const dtsContents = `${`
|
306
|
-
${schemaImports.length ? `import type { ${schemaImports.join(", ")} } from 'silgi/types'` : ""}
|
307
|
-
|
308
299
|
${moduleImports.length ? `import type { ${moduleImports.join(", ")} } from './module.mjs'` : ""}
|
309
300
|
|
310
|
-
${
|
311
|
-
${
|
312
|
-
${moduleReExports.filter((e) => e.type === "named" || e.type === "default").map((e) => `
|
313
|
-
export { ${e.names.map((n) => (n === "default" ? "" : "type ") + n).join(", ")} } from '${e.specifier || "./module.mjs"}'`).join("\n")}
|
314
|
-
${moduleReExports.filter((e) => e.type === "star").map((e) => `
|
315
|
-
export * from '${e.specifier || "./module.mjs"}'`).join("\n")}
|
301
|
+
${moduleImports.length ? `
|
302
|
+
export type { ${moduleImports.join(", ")} }` : ""}
|
316
303
|
`.trim().replace(/[\n\r]{3,}/g, "\n\n")}
|
317
304
|
`;
|
318
305
|
await promises.writeFile(dtsFile, dtsContents, "utf8");
|
package/dist/cli.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import { defineCommand, runMain } from 'citty';
|
3
3
|
import { consola } from 'consola';
|
4
|
-
import { v as version, d as description, n as name } from './shared/silgi-module-builder.
|
4
|
+
import { v as version, d as description, n as name } from './shared/silgi-module-builder.CGCv6bjh.mjs';
|
5
5
|
|
6
6
|
const _rDefault = (r) => r && typeof r === "object" && "default" in r ? r.default : r;
|
7
7
|
const main = defineCommand({
|
package/dist/index.mjs
CHANGED