silgi 0.41.43 → 0.41.44
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 +17 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/kit/index.mjs +17 -1
- package/dist/types/index.d.mts +1 -1
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -1552,7 +1552,23 @@ async function generateApp(app, options = {}) {
|
|
|
1552
1552
|
app.templates = Object.values(defaultTemplates).concat(app.options.build.templates);
|
|
1553
1553
|
await app.callHook("app:templates", app);
|
|
1554
1554
|
app.templates = app.templates.map((tmpl) => {
|
|
1555
|
-
|
|
1555
|
+
let dir;
|
|
1556
|
+
switch (tmpl.where) {
|
|
1557
|
+
case ".silgi":
|
|
1558
|
+
dir = app.options.build.dir;
|
|
1559
|
+
break;
|
|
1560
|
+
case "server":
|
|
1561
|
+
dir = app.options.silgi.serverDir;
|
|
1562
|
+
break;
|
|
1563
|
+
case "client":
|
|
1564
|
+
dir = app.options.silgi.clientDir;
|
|
1565
|
+
break;
|
|
1566
|
+
case "root":
|
|
1567
|
+
dir = app.options.rootDir;
|
|
1568
|
+
break;
|
|
1569
|
+
default:
|
|
1570
|
+
dir = app.options.silgi.vfsDir;
|
|
1571
|
+
}
|
|
1556
1572
|
return normalizeTemplate(tmpl, dir);
|
|
1557
1573
|
});
|
|
1558
1574
|
const filteredTemplates = {
|
package/dist/cli/index.mjs
CHANGED
package/dist/kit/index.mjs
CHANGED
|
@@ -944,7 +944,23 @@ function normalizeTemplate(template, buildDir) {
|
|
|
944
944
|
}
|
|
945
945
|
if (!template.dst) {
|
|
946
946
|
const silgi = useSilgiCLI();
|
|
947
|
-
|
|
947
|
+
let dir;
|
|
948
|
+
switch (template.where) {
|
|
949
|
+
case ".silgi":
|
|
950
|
+
dir = silgi.options.build.dir;
|
|
951
|
+
break;
|
|
952
|
+
case "server":
|
|
953
|
+
dir = silgi.options.silgi.serverDir;
|
|
954
|
+
break;
|
|
955
|
+
case "client":
|
|
956
|
+
dir = silgi.options.silgi.clientDir;
|
|
957
|
+
break;
|
|
958
|
+
case "root":
|
|
959
|
+
dir = silgi.options.rootDir;
|
|
960
|
+
break;
|
|
961
|
+
default:
|
|
962
|
+
dir = silgi.options.rootDir;
|
|
963
|
+
}
|
|
948
964
|
template.dst = resolve(buildDir ?? dir, template.filename);
|
|
949
965
|
}
|
|
950
966
|
return template;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -840,7 +840,7 @@ interface SilgiTemplate<Options = TemplateDefaultOptions> {
|
|
|
840
840
|
/** The resolved path to the source file to be template */
|
|
841
841
|
src?: string;
|
|
842
842
|
/** Provided compile option instead of src */
|
|
843
|
-
where?: 'server' | 'client' | '.silgi';
|
|
843
|
+
where?: 'server' | 'client' | '.silgi' | 'root';
|
|
844
844
|
getContents?: (data: {
|
|
845
845
|
app: SilgiCLI;
|
|
846
846
|
options: Options;
|