silgi 0.41.49 → 0.41.51
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 +5 -0
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/loader.mjs +25 -18
- package/dist/types/index.d.mts +1 -0
- package/package.json +1 -1
package/dist/cli/build.mjs
CHANGED
|
@@ -1576,6 +1576,11 @@ async function generateApp(app, options = {}) {
|
|
|
1576
1576
|
post: []
|
|
1577
1577
|
};
|
|
1578
1578
|
for (const template of app.templates) {
|
|
1579
|
+
if (template.watch === false) {
|
|
1580
|
+
if (Array.isArray(app.options.watchOptions.ignored)) {
|
|
1581
|
+
app.options.watchOptions.ignored.push(`!${template.dst || template.src}`);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1579
1584
|
if (options.filter && !options.filter(template)) {
|
|
1580
1585
|
continue;
|
|
1581
1586
|
}
|
package/dist/cli/index.mjs
CHANGED
package/dist/cli/loader.mjs
CHANGED
|
@@ -28,16 +28,7 @@ const SilgiCLIDefaults = {
|
|
|
28
28
|
},
|
|
29
29
|
storages: [],
|
|
30
30
|
devServer: {
|
|
31
|
-
watch: [
|
|
32
|
-
"{{ serverDir }}/services",
|
|
33
|
-
"{{ serverDir }}/schemas",
|
|
34
|
-
"{{ serverDir }}/shared",
|
|
35
|
-
"{{ serverDir }}/utils",
|
|
36
|
-
"{{ serverDir }}/types",
|
|
37
|
-
"{{ silgi.serverDir }}/config",
|
|
38
|
-
"{{ silgi.serverDir }}/modules",
|
|
39
|
-
"{{ rootDir }}/silgi.config.ts"
|
|
40
|
-
]
|
|
31
|
+
watch: []
|
|
41
32
|
},
|
|
42
33
|
package: {
|
|
43
34
|
name: "",
|
|
@@ -118,14 +109,7 @@ const SilgiCLIDefaults = {
|
|
|
118
109
|
"**/coverage/**",
|
|
119
110
|
"**/test/**",
|
|
120
111
|
"**/tests/**",
|
|
121
|
-
"**/tmp/**"
|
|
122
|
-
"!{{ serverDir }}/config",
|
|
123
|
-
"{{ serverDir }}/permission.ts",
|
|
124
|
-
"{{ serverDir }}/core.ts",
|
|
125
|
-
"{{ serverDir }}/meta.ts",
|
|
126
|
-
"{{ serverDir }}/configs.ts",
|
|
127
|
-
"{{ serverDir }}/vfs",
|
|
128
|
-
"{{ serverDir }}/scan.ts"
|
|
112
|
+
"**/tmp/**"
|
|
129
113
|
]
|
|
130
114
|
},
|
|
131
115
|
// Advanced
|
|
@@ -481,6 +465,29 @@ async function resolvePathOptions(options) {
|
|
|
481
465
|
options.appConfigFiles.push(configFile);
|
|
482
466
|
}
|
|
483
467
|
}
|
|
468
|
+
options.watchOptions.ignored ??= [];
|
|
469
|
+
options.watchOptions.ignoreInitial = true;
|
|
470
|
+
if (Array.isArray(options.watchOptions.ignored)) {
|
|
471
|
+
options.watchOptions.ignored.push(
|
|
472
|
+
`!${join(options.silgi.serverDir, "config")}`,
|
|
473
|
+
`${join(options.silgi.serverDir, "permission.ts")}`,
|
|
474
|
+
`${join(options.silgi.serverDir, "core.ts")}`,
|
|
475
|
+
`${join(options.silgi.serverDir, "meta.ts")}`,
|
|
476
|
+
`${join(options.silgi.serverDir, "configs.ts")}`,
|
|
477
|
+
`${join(options.silgi.serverDir, "vfs")}`,
|
|
478
|
+
`${join(options.silgi.serverDir, "scan.ts")}`
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
options.devServer.watch.push(
|
|
482
|
+
join(options.serverDir, "services"),
|
|
483
|
+
join(options.serverDir, "schemas"),
|
|
484
|
+
join(options.serverDir, "shared"),
|
|
485
|
+
join(options.serverDir, "utils"),
|
|
486
|
+
join(options.serverDir, "types"),
|
|
487
|
+
join(options.silgi.serverDir, "config"),
|
|
488
|
+
join(options.silgi.serverDir, "modules"),
|
|
489
|
+
join(options.rootDir, "silgi.config.ts")
|
|
490
|
+
);
|
|
484
491
|
}
|
|
485
492
|
function _tryResolve(path, base = ".", extensions = ["", ".js", ".ts", ".mjs", ".cjs", ".json"]) {
|
|
486
493
|
path = resolve(base, path);
|
package/dist/types/index.d.mts
CHANGED
|
@@ -848,6 +848,7 @@ interface SilgiTemplate<Options = TemplateDefaultOptions> {
|
|
|
848
848
|
/** Write to filesystem */
|
|
849
849
|
write?: boolean;
|
|
850
850
|
skipIfExists?: boolean;
|
|
851
|
+
watch?: false;
|
|
851
852
|
}
|
|
852
853
|
interface ResolvedSilgiTemplate<Options = TemplateDefaultOptions> extends SilgiTemplate<Options> {
|
|
853
854
|
filename: string;
|