silgi 0.17.2 → 0.17.3
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/loader.mjs +2 -1
- package/dist/cli/writeTypesAndFiles.mjs +12 -0
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/presets/npmpackage/preset.mjs +4 -1
- package/dist/types/index.d.mts +5 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/loader.mjs
CHANGED
|
@@ -102,7 +102,8 @@ const SilgiCLIDefaults = {
|
|
|
102
102
|
tsconfigPath: ".silgi/types/silgi.tsconfig.json",
|
|
103
103
|
tsConfig: {},
|
|
104
104
|
customConditions: [],
|
|
105
|
-
generateRuntimeConfigTypes: true
|
|
105
|
+
generateRuntimeConfigTypes: true,
|
|
106
|
+
removeFileExtension: false
|
|
106
107
|
},
|
|
107
108
|
conditions: [],
|
|
108
109
|
nodeModulesDirs: [],
|
|
@@ -756,6 +756,9 @@ async function prepareServerFiles(silgi) {
|
|
|
756
756
|
scanned.shareds = deduplicateArray(scanned.shareds);
|
|
757
757
|
const importsContent = [
|
|
758
758
|
...Object.entries(importItems).map(([_name, { from, import: imports }]) => {
|
|
759
|
+
if (silgi.options.typescript.removeFileExtension) {
|
|
760
|
+
from = from.replace(/\.\w+$/, "");
|
|
761
|
+
}
|
|
759
762
|
return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${from}'`;
|
|
760
763
|
}),
|
|
761
764
|
"",
|
|
@@ -1694,6 +1697,9 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
|
|
|
1694
1697
|
}
|
|
1695
1698
|
const importsContent = [
|
|
1696
1699
|
...Object.entries(importItems).map(([_name, { from, import: imports }]) => {
|
|
1700
|
+
if (silgi.options.typescript.removeFileExtension) {
|
|
1701
|
+
from = from.replace(/\.\w+$/, "");
|
|
1702
|
+
}
|
|
1697
1703
|
return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${from}'`;
|
|
1698
1704
|
}),
|
|
1699
1705
|
"",
|
|
@@ -1796,6 +1802,9 @@ async function createDTSFramework(silgi) {
|
|
|
1796
1802
|
const content = [
|
|
1797
1803
|
...Object.entries(importItems).map(([_name, { from, import: imports }]) => {
|
|
1798
1804
|
const path = isAbsolute(from) ? relativeWithDot(silgi.options.build.typesDir, from) : from;
|
|
1805
|
+
if (silgi.options.typescript.removeFileExtension) {
|
|
1806
|
+
from = from.replace(/\.\w+$/, "");
|
|
1807
|
+
}
|
|
1799
1808
|
return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${path}'`;
|
|
1800
1809
|
}),
|
|
1801
1810
|
"",
|
|
@@ -1960,6 +1969,9 @@ async function prepareSchema(silgi) {
|
|
|
1960
1969
|
const importsContent = [
|
|
1961
1970
|
...Object.entries(importItems).map(([_name, { from, import: imports }]) => {
|
|
1962
1971
|
const path = isAbsolute(from) ? relativeWithDot(silgi.options.build.typesDir, from) : from;
|
|
1972
|
+
if (silgi.options.typescript.removeFileExtension) {
|
|
1973
|
+
from = from.replace(/\.\w+$/, "");
|
|
1974
|
+
}
|
|
1963
1975
|
return `import { ${imports.map(({ type, name }) => type ? `type ${name}` : name).join(", ")} } from '${path}'`;
|
|
1964
1976
|
}),
|
|
1965
1977
|
"",
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -759,6 +759,11 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
759
759
|
* @default true
|
|
760
760
|
*/
|
|
761
761
|
generateRuntimeConfigTypes: boolean;
|
|
762
|
+
/**
|
|
763
|
+
* @default false
|
|
764
|
+
* Behavior of import paths in auto-generated silgi files
|
|
765
|
+
*/
|
|
766
|
+
removeFileExtension: boolean;
|
|
762
767
|
};
|
|
763
768
|
alias: Record<string, string>;
|
|
764
769
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -759,6 +759,11 @@ interface SilgiCLIOptions extends PresetOptions {
|
|
|
759
759
|
* @default true
|
|
760
760
|
*/
|
|
761
761
|
generateRuntimeConfigTypes: boolean;
|
|
762
|
+
/**
|
|
763
|
+
* @default false
|
|
764
|
+
* Behavior of import paths in auto-generated silgi files
|
|
765
|
+
*/
|
|
766
|
+
removeFileExtension: boolean;
|
|
762
767
|
};
|
|
763
768
|
alias: Record<string, string>;
|
|
764
769
|
/**
|