silgi 0.7.10 → 0.7.11
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/config/index.mjs +0 -1
- package/dist/cli/prepare.mjs +1 -2
- package/dist/cli/types.mjs +5 -43
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/types/index.d.mts +0 -4
- package/dist/types/index.d.ts +0 -4
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -1629,8 +1629,7 @@ const prepare = defineCommand({
|
|
|
1629
1629
|
const silgi = await createSilgiCLI({
|
|
1630
1630
|
rootDir,
|
|
1631
1631
|
dev: args.stub,
|
|
1632
|
-
stub: args.stub
|
|
1633
|
-
typescript: { internalPaths: args.stub }
|
|
1632
|
+
stub: args.stub
|
|
1634
1633
|
});
|
|
1635
1634
|
await prepare$1();
|
|
1636
1635
|
for (const framework of frameworkSetup) {
|
package/dist/cli/types.mjs
CHANGED
|
@@ -4,15 +4,14 @@ import { klona } from 'klona/full';
|
|
|
4
4
|
import { isDebug, isTest } from 'std-env';
|
|
5
5
|
import consola from 'consola';
|
|
6
6
|
import { colors } from 'consola/utils';
|
|
7
|
-
import { relative, join, resolve,
|
|
7
|
+
import { relative, join, resolve, dirname, isAbsolute } from 'pathe';
|
|
8
8
|
import escapeRE from 'escape-string-regexp';
|
|
9
|
-
import { resolveModuleExportNames
|
|
9
|
+
import { resolveModuleExportNames } from 'mlly';
|
|
10
10
|
import { existsSync, promises, lstatSync } from 'node:fs';
|
|
11
|
-
import { pathToFileURL } from 'node:url';
|
|
12
11
|
import { findWorkspaceDir, readPackageJSON } from 'pkg-types';
|
|
13
|
-
import { resolveSilgiPath,
|
|
12
|
+
import { resolveSilgiPath, relativeWithDot, resolveSilgiModule } from 'silgi/kit';
|
|
14
13
|
import { runtimeDir, pkgDir } from 'silgi/runtime/meta';
|
|
15
|
-
import {
|
|
14
|
+
import { withLeadingSlash, withTrailingSlash } from 'ufo';
|
|
16
15
|
import { defu } from 'defu';
|
|
17
16
|
|
|
18
17
|
const SilgiCLIDefaults = {
|
|
@@ -91,7 +90,6 @@ const SilgiCLIDefaults = {
|
|
|
91
90
|
generateTsConfig: true,
|
|
92
91
|
// generateRuntimeConfigTypes: true,
|
|
93
92
|
tsconfigPath: "types/silgi.tsconfig.json",
|
|
94
|
-
internalPaths: false,
|
|
95
93
|
tsConfig: {},
|
|
96
94
|
customConditions: []
|
|
97
95
|
},
|
|
@@ -308,7 +306,7 @@ async function resolvePathOptions(options) {
|
|
|
308
306
|
options.alias[packageJson.name] = join(options.rootDir, "src/module.ts");
|
|
309
307
|
options.alias[`${packageJson.name}/runtime/`] = join(options.rootDir, "src/runtime/");
|
|
310
308
|
}
|
|
311
|
-
if (options.
|
|
309
|
+
if (options.stub) {
|
|
312
310
|
options.alias = {
|
|
313
311
|
...options.alias,
|
|
314
312
|
"silgi/runtime": join(runtimeDir),
|
|
@@ -432,26 +430,6 @@ async function resolvePathOptions(options) {
|
|
|
432
430
|
options.appConfigFiles.push(configFile);
|
|
433
431
|
}
|
|
434
432
|
}
|
|
435
|
-
const modulesRuntimePaths = {};
|
|
436
|
-
if (options.preset === "npm-package") {
|
|
437
|
-
for (let i of options.modules) {
|
|
438
|
-
if (typeof i === "string") {
|
|
439
|
-
i = resolveAlias(i, options.alias);
|
|
440
|
-
if (isRelative(i)) {
|
|
441
|
-
i = resolve(options.rootDir, i);
|
|
442
|
-
}
|
|
443
|
-
const src = isAbsolute(i) ? pathToFileURL(await resolvePath(i, { fallbackToOriginal: false, extensions: options.extensions })).href : await resolvePath$1(i, { url: options.modulesDir.map((m) => pathToFileURL(m.replace(/\/node_modules\/?$/, ""))), extensions: options.extensions });
|
|
444
|
-
const cleanPath = src.replace(/(\/(?:src|dist)(?:\/runtime)?(?:\/.*)?$)/, "");
|
|
445
|
-
modulesRuntimePaths[`${i}/runtime`] = `${cleanPath}/src/runtime`;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
for (const [key, value] of Object.entries(modulesRuntimePaths)) {
|
|
449
|
-
options.alias = {
|
|
450
|
-
...options.alias,
|
|
451
|
-
[`${key}`]: value
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
433
|
}
|
|
456
434
|
function _tryResolve(path, base = ".", extensions = ["", ".js", ".ts", ".mjs", ".cjs", ".json"]) {
|
|
457
435
|
path = resolve(base, path);
|
|
@@ -665,22 +643,6 @@ async function silgiGenerateType(silgi) {
|
|
|
665
643
|
}
|
|
666
644
|
return acc;
|
|
667
645
|
}, {})
|
|
668
|
-
// ...(silgi.options.typescript?.internalPaths
|
|
669
|
-
// ? {
|
|
670
|
-
// 'silgi/runtime': [
|
|
671
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
|
|
672
|
-
// ],
|
|
673
|
-
// '#internal/silgi': [
|
|
674
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, 'index')),
|
|
675
|
-
// ],
|
|
676
|
-
// 'silgi/runtime/*': [
|
|
677
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
|
|
678
|
-
// ],
|
|
679
|
-
// '#internal/silgi/*': [
|
|
680
|
-
// relativeWithDot(tsconfigDir, join(runtimeDir, '*')),
|
|
681
|
-
// ],
|
|
682
|
-
// }
|
|
683
|
-
// : {}),
|
|
684
646
|
}
|
|
685
647
|
},
|
|
686
648
|
include: [...include],
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
package/dist/types/index.d.ts
CHANGED