silgi 0.7.21 → 0.7.22
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/prepare.mjs +74 -73
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -825,6 +825,9 @@ const commonArgs = {
|
|
|
825
825
|
async function registerModuleExportScan(silgi) {
|
|
826
826
|
silgi.hook("prepare:schema.ts", async (options) => {
|
|
827
827
|
for (const module of silgi.scanModules) {
|
|
828
|
+
if (module.meta._packageName || silgi.options.preset === "npm-package") {
|
|
829
|
+
continue;
|
|
830
|
+
}
|
|
828
831
|
const exports = module.meta.exports;
|
|
829
832
|
if (!exports?.length)
|
|
830
833
|
continue;
|
|
@@ -835,79 +838,77 @@ async function registerModuleExportScan(silgi) {
|
|
|
835
838
|
from: module.meta._packageName ? moduleName : relativeWithDot(silgi.options.build.typesDir, module.entryPath)
|
|
836
839
|
};
|
|
837
840
|
const exportedTypes = exports.filter((exp) => exp.type).map((exp) => exp.name);
|
|
838
|
-
if (
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
options.methods.push({ key: configKey, value: importName });
|
|
910
|
-
}
|
|
841
|
+
if (exportedTypes.includes("ModuleOptions")) {
|
|
842
|
+
const importName = pascalCase(`${configKey}Config`);
|
|
843
|
+
options.importItems[configKey].import.push({
|
|
844
|
+
name: `ModuleOptions as ${importName}`,
|
|
845
|
+
type: true
|
|
846
|
+
});
|
|
847
|
+
options.options.push({ key: configKey, value: importName });
|
|
848
|
+
}
|
|
849
|
+
if (exportedTypes.includes("SilgiRuntimeOptions")) {
|
|
850
|
+
const importName = pascalCase(`${configKey}RuntimeConfig`);
|
|
851
|
+
options.importItems[configKey].import.push({
|
|
852
|
+
name: `SilgiRuntimeOptions as ${importName}`,
|
|
853
|
+
type: true
|
|
854
|
+
});
|
|
855
|
+
options.runtimeOptions.push({ key: configKey, value: importName });
|
|
856
|
+
}
|
|
857
|
+
if (exportedTypes.includes("ModuleRuntimeContext")) {
|
|
858
|
+
const importName = pascalCase(`${configKey}RuntimeContext`);
|
|
859
|
+
options.importItems[configKey].import.push({
|
|
860
|
+
name: `ModuleRuntimeContext as ${importName}`,
|
|
861
|
+
type: true
|
|
862
|
+
});
|
|
863
|
+
options.contexts.push({ key: configKey, value: importName });
|
|
864
|
+
}
|
|
865
|
+
if (exportedTypes.includes("ModuleRuntimeAction")) {
|
|
866
|
+
const importName = pascalCase(`${configKey}Action`);
|
|
867
|
+
options.importItems[configKey].import.push({
|
|
868
|
+
name: `ModuleRuntimeAction as ${importName}`,
|
|
869
|
+
type: true
|
|
870
|
+
});
|
|
871
|
+
options.actions.push({ key: configKey, value: importName });
|
|
872
|
+
}
|
|
873
|
+
if (exportedTypes.includes("ModuleRuntimeShared")) {
|
|
874
|
+
const importName = pascalCase(`${configKey}Shared`);
|
|
875
|
+
options.importItems[configKey].import.push({
|
|
876
|
+
name: `ModuleRuntimeShared as ${importName}`,
|
|
877
|
+
type: true
|
|
878
|
+
});
|
|
879
|
+
options.shareds.push({ key: configKey, value: importName });
|
|
880
|
+
}
|
|
881
|
+
if (exportedTypes.includes("ModuleHooks")) {
|
|
882
|
+
const importName = pascalCase(`${configKey}Hooks`);
|
|
883
|
+
options.importItems[configKey].import.push({
|
|
884
|
+
name: `ModuleHooks as ${importName}`,
|
|
885
|
+
type: true
|
|
886
|
+
});
|
|
887
|
+
options.hooks.push({ key: configKey, value: importName });
|
|
888
|
+
}
|
|
889
|
+
if (exportedTypes.includes("ModuleRuntimeHooks")) {
|
|
890
|
+
const importName = pascalCase(`${configKey}RuntimeHooks`);
|
|
891
|
+
options.importItems[configKey].import.push({
|
|
892
|
+
name: `ModuleRuntimeHooks as ${importName}`,
|
|
893
|
+
type: true
|
|
894
|
+
});
|
|
895
|
+
options.runtimeHooks.push({ key: configKey, value: importName });
|
|
896
|
+
}
|
|
897
|
+
if (exportedTypes.includes("ModuleRuntimeOptions")) {
|
|
898
|
+
const importName = pascalCase(`${configKey}RuntimeOptions`);
|
|
899
|
+
options.importItems[configKey].import.push({
|
|
900
|
+
name: `ModuleRuntimeOptions as ${importName}`,
|
|
901
|
+
type: true
|
|
902
|
+
});
|
|
903
|
+
options.runtimeOptions.push({ key: configKey, value: importName });
|
|
904
|
+
}
|
|
905
|
+
if (exportedTypes.includes("SilgiRuntimeMethods")) {
|
|
906
|
+
const importName = pascalCase(`${configKey}RuntimeMethods`);
|
|
907
|
+
options.importItems[configKey].import.push({
|
|
908
|
+
name: `SilgiRuntimeMethods as ${importName}`,
|
|
909
|
+
type: true
|
|
910
|
+
});
|
|
911
|
+
options.methods.push({ key: configKey, value: importName });
|
|
911
912
|
}
|
|
912
913
|
}
|
|
913
914
|
});
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED