@silgi/module-builder 0.7.2 → 0.7.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/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.0J4PF1--.mjs';
|
19
19
|
|
20
20
|
const subpaths = [
|
21
21
|
"runtime",
|
@@ -105,7 +105,8 @@ const build = defineCommand({
|
|
105
105
|
if (isTypesFolder) {
|
106
106
|
entries.push({
|
107
107
|
input: "src/types/index.ts",
|
108
|
-
outDir: `${outDir}
|
108
|
+
outDir: `${outDir}`,
|
109
|
+
name: "types",
|
109
110
|
builder: "rollup"
|
110
111
|
});
|
111
112
|
}
|
@@ -263,9 +264,12 @@ const build = defineCommand({
|
|
263
264
|
}
|
264
265
|
});
|
265
266
|
async function writeTypes(options, _moduleMeta) {
|
266
|
-
|
267
|
+
if (!options.stub) {
|
268
|
+
return;
|
269
|
+
}
|
270
|
+
const dtsFile = resolve(options.outDir, "types.mts");
|
267
271
|
const moduleReExports = [];
|
268
|
-
const moduleTypesFile = resolve(options.rootDir, "src/
|
272
|
+
const moduleTypesFile = resolve(options.rootDir, "src/types/index.ts");
|
269
273
|
const moduleTypes = await promises.readFile(moduleTypesFile, "utf8").catch(() => "");
|
270
274
|
const normalisedModuleTypes = moduleTypes.replace(/export\s*\{.*?\}/gs, (match) => match.replace(/\b(type|interface)\b/g, ""));
|
271
275
|
for (const e of findExports(normalisedModuleTypes)) {
|
@@ -309,8 +313,18 @@ async function writeTypes(options, _moduleMeta) {
|
|
309
313
|
if (hasTypeExport("MetaData")) {
|
310
314
|
moduleImports.push("MetaData");
|
311
315
|
}
|
312
|
-
|
313
|
-
|
316
|
+
let fromPath;
|
317
|
+
if (existsSync(dtsFile)) {
|
318
|
+
const prevContent = await promises.readFile(dtsFile, "utf8").catch(() => "");
|
319
|
+
const match = prevContent.match(/export\s+\*\s+from\s+["'](.+)["']/);
|
320
|
+
if (match) {
|
321
|
+
fromPath = match[1];
|
322
|
+
}
|
323
|
+
}
|
324
|
+
let dtsContents;
|
325
|
+
const importFrom = fromPath || "./module.mjs";
|
326
|
+
dtsContents = `${`
|
327
|
+
${moduleImports.length ? `import type { ${moduleImports.join(", ")} } from '${importFrom}'` : ""}
|
314
328
|
|
315
329
|
${moduleImports.length ? `
|
316
330
|
export type { ${moduleImports.join(", ")} }` : ""}
|
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.0J4PF1--.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
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@silgi/module-builder",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.7.
|
4
|
+
"version": "0.7.4",
|
5
5
|
"private": false,
|
6
6
|
"description": "Complete solution for building Silgi modules",
|
7
7
|
"exports": {
|
@@ -23,15 +23,15 @@
|
|
23
23
|
"mlly": "^1.7.4",
|
24
24
|
"pathe": "^2.0.3",
|
25
25
|
"pkg-types": "^2.1.0",
|
26
|
-
"silgi": "^0.
|
27
|
-
"tsconfck": "^3.1.
|
26
|
+
"silgi": "^0.41.40",
|
27
|
+
"tsconfck": "^3.1.6",
|
28
28
|
"unbuild": "^3.5.0",
|
29
29
|
"unimport": "^5.0.1"
|
30
30
|
},
|
31
31
|
"devDependencies": {
|
32
|
-
"@antfu/eslint-config": "^4.13.
|
33
|
-
"@types/node": "^22.15.
|
34
|
-
"eslint": "^9.
|
32
|
+
"@antfu/eslint-config": "^4.13.2",
|
33
|
+
"@types/node": "^22.15.21",
|
34
|
+
"eslint": "^9.27.0",
|
35
35
|
"typescript": "^5.8.3"
|
36
36
|
},
|
37
37
|
"publishConfig": {
|