silgi 0.36.13 → 0.36.15
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/cli/build.mjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/kit/index.d.mts +1 -1
- package/dist/kit/index.mjs +7 -7
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -268,7 +268,7 @@ async function nextJS(silgi, skip = false) {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
for (const prefix of routerPrefixs) {
|
|
271
|
-
const file =
|
|
271
|
+
const file = join(silgi2.options.srcDir, "app", prefix, "[...all]", "route.ts");
|
|
272
272
|
const fileExists = existsSync(file);
|
|
273
273
|
if (!fileExists) {
|
|
274
274
|
const serverDirName = `@/${silgi2.options.silgi.serverDir.split("/src/")[1]}/core`;
|
package/dist/cli/index.mjs
CHANGED
package/dist/kit/index.d.mts
CHANGED
|
@@ -225,7 +225,7 @@ declare function defineSilgiModule<TOptions extends ModuleOptionsCustom>(): {
|
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
declare function prettyPath(p: string, highlight?: boolean): string;
|
|
228
|
-
declare function resolveSilgiPath(path: string,
|
|
228
|
+
declare function resolveSilgiPath(path: string, silgiOptions: SilgiCLI["options"], base?: string): string;
|
|
229
229
|
|
|
230
230
|
declare function defineSilgiPreset<P extends SilgiPreset, M extends SilgiPresetMeta>(preset: P, meta?: M): P & {
|
|
231
231
|
_meta: SilgiPresetMeta;
|
package/dist/kit/index.mjs
CHANGED
|
@@ -224,20 +224,20 @@ function prettyPath(p, highlight = true) {
|
|
|
224
224
|
p = relative(process.cwd(), p);
|
|
225
225
|
return highlight ? colors.cyan(p) : p;
|
|
226
226
|
}
|
|
227
|
-
function resolveSilgiPath(path,
|
|
227
|
+
function resolveSilgiPath(path, silgiOptions, base) {
|
|
228
228
|
if (typeof path !== "string") {
|
|
229
|
-
throw new TypeError(
|
|
229
|
+
throw new TypeError("Invalid path: " + path);
|
|
230
230
|
}
|
|
231
|
-
path = _compilePathTemplate(path)(
|
|
232
|
-
for (const base2 in
|
|
231
|
+
path = _compilePathTemplate(path)(silgiOptions);
|
|
232
|
+
for (const base2 in silgiOptions.alias) {
|
|
233
233
|
if (path.startsWith(base2)) {
|
|
234
|
-
path =
|
|
234
|
+
path = silgiOptions.alias[base2] + path.slice(base2.length);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
return resolve(base ||
|
|
237
|
+
return resolve(base || silgiOptions.srcDir, path);
|
|
238
238
|
}
|
|
239
239
|
function _compilePathTemplate(contents) {
|
|
240
|
-
return (params) => contents.replace(
|
|
240
|
+
return (params) => contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
|
|
241
241
|
const val = getProperty(params, match);
|
|
242
242
|
if (!val) {
|
|
243
243
|
consola.warn(
|