@silgi/module-builder 0.0.7 → 0.0.9
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,11 +15,12 @@ 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.C4HY6vdM.mjs';
|
19
19
|
|
20
20
|
const srcDir = fileURLToPath(new URL("src", import.meta.url));
|
21
21
|
const subpaths = [
|
22
|
-
"runtime"
|
22
|
+
"runtime",
|
23
|
+
"types"
|
23
24
|
];
|
24
25
|
const build = defineCommand({
|
25
26
|
meta: {
|
@@ -129,7 +130,8 @@ const build = defineCommand({
|
|
129
130
|
// jsx: 'automatic',
|
130
131
|
// jsxFactory: 'h',
|
131
132
|
// },
|
132
|
-
}
|
133
|
+
},
|
134
|
+
{ input: "src/types/index.ts" }
|
133
135
|
],
|
134
136
|
rollup: {
|
135
137
|
esbuild: {
|
@@ -144,6 +146,7 @@ const build = defineCommand({
|
|
144
146
|
"silgi/kit",
|
145
147
|
"silgi/runtime",
|
146
148
|
"silgi/module",
|
149
|
+
...subpaths.map((subpath) => `${packageData.name}/${subpath}`),
|
147
150
|
...Object.keys(packageData.dependencies || {}),
|
148
151
|
...Object.keys(packageData.peerDependencies || {}),
|
149
152
|
...Object.keys(rootPkg.dependencies || {}),
|
@@ -251,7 +254,13 @@ const build = defineCommand({
|
|
251
254
|
stubOptions: {
|
252
255
|
jiti: {
|
253
256
|
alias: {
|
254
|
-
[`${packageData.name}/runtime/*`]: resolve(srcDir, "../runtime/*")
|
257
|
+
[`${packageData.name}/runtime/*`]: resolve(srcDir, "../runtime/*"),
|
258
|
+
...Object.fromEntries(
|
259
|
+
subpaths.map((subpath) => [
|
260
|
+
`${packageData.name}/${subpath}`,
|
261
|
+
resolve(srcDir, `${subpath}/index.ts`)
|
262
|
+
])
|
263
|
+
)
|
255
264
|
}
|
256
265
|
}
|
257
266
|
}
|
@@ -259,7 +268,7 @@ const build = defineCommand({
|
|
259
268
|
}
|
260
269
|
});
|
261
270
|
async function writeTypes(options, isStub, moduleMeta) {
|
262
|
-
const dtsFile = resolve(options.outDir, "
|
271
|
+
const dtsFile = resolve(options.outDir, "moduleTypes.d.ts");
|
263
272
|
if (existsSync(dtsFile)) {
|
264
273
|
return;
|
265
274
|
}
|
@@ -335,7 +344,7 @@ export { ${moduleReExports[0].names.map((n) => (n === "default" ? "" : "type ")
|
|
335
344
|
`.trim().replace(/[\n\r]{3,}/g, "\n\n")}
|
336
345
|
`;
|
337
346
|
await promises.writeFile(dtsFile, dtsContents, "utf8");
|
338
|
-
await promises.writeFile(resolve(options.rootDir, "
|
347
|
+
await promises.writeFile(resolve(options.rootDir, "moduleTypes.d.ts"), `export * from './dist/moduleTypes';
|
339
348
|
`, "utf8");
|
340
349
|
}
|
341
350
|
async function loadTSCompilerOptions(path) {
|
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.C4HY6vdM.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