silgi 0.8.28 → 0.8.29
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/kit/index.d.mts +9 -1
- package/dist/kit/index.d.ts +9 -1
- package/dist/kit/index.mjs +8 -1
- 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/kit/index.d.mts
CHANGED
|
@@ -91,5 +91,13 @@ declare function toArray<T>(value: T | T[]): T[];
|
|
|
91
91
|
*/
|
|
92
92
|
declare function filterInPlace<T>(array: T[], predicate: (item: T, index: number, arr: T[]) => unknown): T[];
|
|
93
93
|
declare const MODE_RE: RegExp;
|
|
94
|
+
/**
|
|
95
|
+
* Check if a Silgi module is installed by name.
|
|
96
|
+
*
|
|
97
|
+
* This will check both the installed modules and the modules to be installed. Note
|
|
98
|
+
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
99
|
+
*/
|
|
100
|
+
declare function hasSilgiModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
101
|
+
declare function hasInstalledModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
94
102
|
|
|
95
|
-
export { MODE_RE, addTemplate, createResolver, defineSilgiModule, defineSilgiPreset, filterInPlace, isDirectory, isH3, isNitro, isNuxt, normalizeTemplate, prettyPath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, writeFile };
|
|
103
|
+
export { MODE_RE, addTemplate, createResolver, defineSilgiModule, defineSilgiPreset, filterInPlace, hasInstalledModule, hasSilgiModule, isDirectory, isH3, isNitro, isNuxt, normalizeTemplate, prettyPath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, writeFile };
|
package/dist/kit/index.d.ts
CHANGED
|
@@ -91,5 +91,13 @@ declare function toArray<T>(value: T | T[]): T[];
|
|
|
91
91
|
*/
|
|
92
92
|
declare function filterInPlace<T>(array: T[], predicate: (item: T, index: number, arr: T[]) => unknown): T[];
|
|
93
93
|
declare const MODE_RE: RegExp;
|
|
94
|
+
/**
|
|
95
|
+
* Check if a Silgi module is installed by name.
|
|
96
|
+
*
|
|
97
|
+
* This will check both the installed modules and the modules to be installed. Note
|
|
98
|
+
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
99
|
+
*/
|
|
100
|
+
declare function hasSilgiModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
101
|
+
declare function hasInstalledModule(moduleKey: string, silgi?: SilgiCLI): boolean;
|
|
94
102
|
|
|
95
|
-
export { MODE_RE, addTemplate, createResolver, defineSilgiModule, defineSilgiPreset, filterInPlace, isDirectory, isH3, isNitro, isNuxt, normalizeTemplate, prettyPath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, writeFile };
|
|
103
|
+
export { MODE_RE, addTemplate, createResolver, defineSilgiModule, defineSilgiPreset, filterInPlace, hasInstalledModule, hasSilgiModule, isDirectory, isH3, isNitro, isNuxt, normalizeTemplate, prettyPath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, writeFile };
|
package/dist/kit/index.mjs
CHANGED
|
@@ -255,6 +255,13 @@ function filterInPlace(array, predicate) {
|
|
|
255
255
|
return array;
|
|
256
256
|
}
|
|
257
257
|
const MODE_RE = /\.(server|client)(\.\w+)*$/;
|
|
258
|
+
function hasSilgiModule(moduleKey, silgi = useSilgiCLI()) {
|
|
259
|
+
return silgi.scanModules.some(({ meta }) => meta.configKey === moduleKey) || Object.keys(silgi.scanModules).includes(moduleKey);
|
|
260
|
+
}
|
|
261
|
+
function hasInstalledModule(moduleKey, silgi = useSilgiCLI()) {
|
|
262
|
+
const find = silgi.scanModules.find(({ meta }) => meta.configKey === moduleKey);
|
|
263
|
+
return find?.installed ?? false;
|
|
264
|
+
}
|
|
258
265
|
|
|
259
266
|
function addTemplate(_template) {
|
|
260
267
|
const silgi = useSilgiCLI();
|
|
@@ -298,4 +305,4 @@ function normalizeTemplate(template, buildDir) {
|
|
|
298
305
|
return template;
|
|
299
306
|
}
|
|
300
307
|
|
|
301
|
-
export { MODE_RE, addTemplate, createResolver, defineSilgiModule, defineSilgiPreset, filterInPlace, isDirectory$1 as isDirectory, isH3, isNitro, isNuxt, normalizeTemplate, prettyPath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, writeFile };
|
|
308
|
+
export { MODE_RE, addTemplate, createResolver, defineSilgiModule, defineSilgiPreset, filterInPlace, hasInstalledModule, hasSilgiModule, isDirectory$1 as isDirectory, isH3, isNitro, isNuxt, normalizeTemplate, prettyPath, relativeWithDot, resolveAlias, resolvePath, resolveSilgiModule, resolveSilgiPath, toArray, tryResolveModule, useLogger, writeFile };
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED