silgi 0.20.43 → 0.21.1
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/dev.mjs +24 -1
- package/dist/cli/types.mjs +22 -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/cli/dev.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import { basename } from 'node:path';
|
|
|
2
2
|
import { watch } from 'chokidar';
|
|
3
3
|
import { defineCommand, runCommand } from 'citty';
|
|
4
4
|
import consola from 'consola';
|
|
5
|
+
import { join } from 'pathe';
|
|
5
6
|
import { useSilgiCLI } from 'silgi/core';
|
|
6
7
|
import { version } from 'silgi/meta';
|
|
7
8
|
import { s as silgiCLIIClose } from '../_chunks/silgiApp.mjs';
|
|
8
9
|
import { c as commonArgs, p as prepare } from './prepare.mjs';
|
|
9
10
|
import 'ufo';
|
|
10
11
|
import 'unctx';
|
|
11
|
-
import 'pathe';
|
|
12
12
|
import 'silgi/kit';
|
|
13
13
|
import 'node:fs';
|
|
14
14
|
import 'node:fs/promises';
|
|
@@ -70,6 +70,18 @@ const dev = defineCommand({
|
|
|
70
70
|
rawArgs: ["--commands", "run", "--dev", "true"]
|
|
71
71
|
});
|
|
72
72
|
const silgi = useSilgiCLI();
|
|
73
|
+
silgi.options.watchOptions.ignored ??= [];
|
|
74
|
+
silgi.options.watchOptions.ignoreInitial = true;
|
|
75
|
+
if (Array.isArray(silgi.options.watchOptions.ignored)) {
|
|
76
|
+
silgi.options.watchOptions.ignored.push(
|
|
77
|
+
join(silgi.options.silgi.serverDir),
|
|
78
|
+
`!${join(silgi.options.silgi.serverDir, "config")}`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
silgi.options.devServer.watch.push(
|
|
82
|
+
join(silgi.options.serverDir),
|
|
83
|
+
join(silgi.options.silgi.serverDir, "config")
|
|
84
|
+
);
|
|
73
85
|
let watcher;
|
|
74
86
|
if (silgi.options.devServer.watch.length > 0) {
|
|
75
87
|
watcher = watch(silgi.options.devServer.watch, silgi.options.watchOptions);
|
|
@@ -95,6 +107,17 @@ const dev = defineCommand({
|
|
|
95
107
|
const endTime = performance.now();
|
|
96
108
|
const elapsedTime = Math.round(endTime - startTime);
|
|
97
109
|
silgi.logger.success(`${basename(path)} - ${elapsedTime}ms`);
|
|
110
|
+
}).on("unlink", async (path, stats) => {
|
|
111
|
+
const startTime = performance.now();
|
|
112
|
+
silgi.errors = [];
|
|
113
|
+
await reloadScan(path, stats);
|
|
114
|
+
await runCommand(prepare, {
|
|
115
|
+
rawArgs: ["--commands", "run", "--dev", "true"]
|
|
116
|
+
});
|
|
117
|
+
silgi.errors = [];
|
|
118
|
+
const endTime = performance.now();
|
|
119
|
+
const elapsedTime = Math.round(endTime - startTime);
|
|
120
|
+
silgi.logger.success(`${basename(path)} - ${elapsedTime}ms`);
|
|
98
121
|
});
|
|
99
122
|
}
|
|
100
123
|
process.on("SIGINT", async () => {
|
package/dist/cli/types.mjs
CHANGED
|
@@ -83,7 +83,28 @@ const SilgiCLIDefaults = {
|
|
|
83
83
|
// Dev
|
|
84
84
|
dev: false,
|
|
85
85
|
// devServer: { watch: [] },
|
|
86
|
-
watchOptions: {
|
|
86
|
+
watchOptions: {
|
|
87
|
+
ignoreInitial: true,
|
|
88
|
+
ignored: [
|
|
89
|
+
"**/node_modules/**",
|
|
90
|
+
"**/.git/**",
|
|
91
|
+
"**/.silgi/**",
|
|
92
|
+
"**/.output/**",
|
|
93
|
+
"**/.vscode/**",
|
|
94
|
+
"**/.idea/**",
|
|
95
|
+
"**/.nuxt/**",
|
|
96
|
+
"**/.next/**",
|
|
97
|
+
"**/.gitignore",
|
|
98
|
+
"**/.gitattributes",
|
|
99
|
+
"**/assets/**",
|
|
100
|
+
"**/dist/**",
|
|
101
|
+
"**/build/**",
|
|
102
|
+
"**/coverage/**",
|
|
103
|
+
"**/test/**",
|
|
104
|
+
"**/tests/**",
|
|
105
|
+
"**/tmp/**"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
87
108
|
// devProxy: {},
|
|
88
109
|
// Logging
|
|
89
110
|
// logging: {
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED