silgi 0.20.33 → 0.20.35
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 -15
- package/dist/cli/install.mjs +2 -3
- package/dist/cli/prepare.mjs +2358 -9
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cli/common.mjs +0 -2361
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/dev.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { watch } from 'chokidar';
|
|
2
|
-
import { defineCommand } from 'citty';
|
|
2
|
+
import { defineCommand, runCommand } from 'citty';
|
|
3
3
|
import consola from 'consola';
|
|
4
|
-
import { basename, resolve } from 'pathe';
|
|
5
4
|
import { version } from 'silgi/meta';
|
|
5
|
+
import { basename } from 'pathe';
|
|
6
6
|
import { h as hasError } from './compatibility.mjs';
|
|
7
|
-
import { s as scanFiles, w as writeScanFiles, g as generateApp, c as commonArgs,
|
|
7
|
+
import { s as scanFiles, w as writeScanFiles, g as generateApp, c as commonArgs, p as prepare } from './prepare.mjs';
|
|
8
8
|
import 'silgi/core';
|
|
9
9
|
import 'semver/functions/satisfies.js';
|
|
10
|
+
import 'silgi/kit';
|
|
10
11
|
import 'node:fs';
|
|
11
12
|
import 'node:fs/promises';
|
|
12
13
|
import 'hookable';
|
|
13
|
-
import 'silgi/kit';
|
|
14
14
|
import 'silgi/runtime/meta';
|
|
15
15
|
import 'silgi/types';
|
|
16
16
|
import 'unimport';
|
|
@@ -38,6 +38,8 @@ import 'consola/utils';
|
|
|
38
38
|
import 'escape-string-regexp';
|
|
39
39
|
import 'pkg-types';
|
|
40
40
|
import 'pathe/utils';
|
|
41
|
+
import 'node:child_process';
|
|
42
|
+
import 'picocolors';
|
|
41
43
|
|
|
42
44
|
async function reloadScan(silgi, path, _stats) {
|
|
43
45
|
const startTime = performance.now();
|
|
@@ -72,21 +74,28 @@ const dev = defineCommand({
|
|
|
72
74
|
}
|
|
73
75
|
},
|
|
74
76
|
async run({ args }) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
rootDir,
|
|
78
|
-
dev: args.stub,
|
|
79
|
-
stub: args.stub,
|
|
80
|
-
preset: args.preset,
|
|
81
|
-
commandType: "prepare"
|
|
77
|
+
await runCommand(prepare, {
|
|
78
|
+
rawArgs: ["--commands", "run"]
|
|
82
79
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
const silgi = globalThis.__silgi_temp_obj;
|
|
81
|
+
if (!silgi) {
|
|
82
|
+
consola.error("Silgi not found");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
86
85
|
let watcher;
|
|
87
86
|
if (silgi.options.devServer.watch.length > 0) {
|
|
88
87
|
watcher = watch(silgi.options.devServer.watch, silgi.options.watchOptions);
|
|
89
|
-
watcher.on("add", async (...data) =>
|
|
88
|
+
watcher.on("add", async (...data) => async () => {
|
|
89
|
+
await runCommand(prepare, {
|
|
90
|
+
rawArgs: ["--commands", "run"]
|
|
91
|
+
});
|
|
92
|
+
await reloadScan(silgi, ...data);
|
|
93
|
+
}).on("change", async (...data) => async () => {
|
|
94
|
+
await runCommand(prepare, {
|
|
95
|
+
rawArgs: ["--commands", "run"]
|
|
96
|
+
});
|
|
97
|
+
await reloadScan(silgi, ...data);
|
|
98
|
+
});
|
|
90
99
|
}
|
|
91
100
|
const close = async () => {
|
|
92
101
|
await silgi.close();
|
package/dist/cli/install.mjs
CHANGED
|
@@ -4,13 +4,12 @@ import { defineCommand, runCommand } from 'citty';
|
|
|
4
4
|
import { consola } from 'consola';
|
|
5
5
|
import { resolve } from 'pathe';
|
|
6
6
|
import { version } from 'silgi/meta';
|
|
7
|
-
import { c as commonArgs } from './
|
|
8
|
-
import { p as prepare } from './prepare.mjs';
|
|
7
|
+
import { c as commonArgs, p as prepare } from './prepare.mjs';
|
|
9
8
|
import { l as loadOptions } from './types.mjs';
|
|
9
|
+
import 'silgi/kit';
|
|
10
10
|
import 'node:fs/promises';
|
|
11
11
|
import 'hookable';
|
|
12
12
|
import 'silgi/core';
|
|
13
|
-
import 'silgi/kit';
|
|
14
13
|
import 'silgi/runtime/meta';
|
|
15
14
|
import 'silgi/types';
|
|
16
15
|
import 'unimport';
|