silgi 0.8.15 → 0.8.16
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/index.mjs +2 -1
- package/dist/cli/install.mjs +57 -0
- package/dist/cli/prepare.mjs +2 -2
- 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/index.mjs
CHANGED
|
@@ -16,7 +16,8 @@ const main = defineCommand({
|
|
|
16
16
|
subCommands: {
|
|
17
17
|
prepare: () => import('./prepare.mjs').then((m) => m.default),
|
|
18
18
|
init: () => import('./init.mjs').then((m) => m.default),
|
|
19
|
-
run: () => import('./run.mjs').then((m) => m.default)
|
|
19
|
+
run: () => import('./run.mjs').then((m) => m.default),
|
|
20
|
+
install: () => import('./install.mjs').then((m) => m.default)
|
|
20
21
|
},
|
|
21
22
|
run({ args }) {
|
|
22
23
|
if (args.version)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { defineCommand } from 'citty';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
import { resolve } from 'pathe';
|
|
6
|
+
import { version } from 'silgi/meta';
|
|
7
|
+
import { c as commonArgs } from './common.mjs';
|
|
8
|
+
import { l as loadOptions } from './loader.mjs';
|
|
9
|
+
import 'c12';
|
|
10
|
+
import 'compatx';
|
|
11
|
+
import 'klona/full';
|
|
12
|
+
import 'std-env';
|
|
13
|
+
import 'consola/utils';
|
|
14
|
+
import 'escape-string-regexp';
|
|
15
|
+
import 'mlly';
|
|
16
|
+
import 'pkg-types';
|
|
17
|
+
import 'silgi/kit';
|
|
18
|
+
import 'silgi/runtime/meta';
|
|
19
|
+
import 'ufo';
|
|
20
|
+
|
|
21
|
+
const install = defineCommand({
|
|
22
|
+
meta: {
|
|
23
|
+
name: "install",
|
|
24
|
+
description: "Install dependencies from the install.json file.",
|
|
25
|
+
version: version
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
...commonArgs,
|
|
29
|
+
preset: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "The build preset to use (you can also use `SILGI_PRESET` environment variable)."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
async run() {
|
|
35
|
+
const silgiConfig = await loadOptions({});
|
|
36
|
+
const getCli = resolve(silgiConfig.build.dir, "install.json");
|
|
37
|
+
const cli = readFileSync(getCli, "utf-8");
|
|
38
|
+
const cliJson = JSON.parse(cli);
|
|
39
|
+
if (Object.keys(cliJson).length === 0) {
|
|
40
|
+
consola.info("Empty command list, maybe forgot pnpm silgi prepare?");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const deps = Object.keys(cliJson.dependencies || {}).join(" ");
|
|
44
|
+
const devDeps = Object.keys(cliJson.devDependencies || {}).join(" ");
|
|
45
|
+
if (deps) {
|
|
46
|
+
consola.info("Installing dependencies...");
|
|
47
|
+
execSync(`ni ${deps}`, { stdio: "inherit" });
|
|
48
|
+
}
|
|
49
|
+
if (devDeps) {
|
|
50
|
+
consola.info("Installing dev dependencies...");
|
|
51
|
+
execSync(`ni ${devDeps} -D`, { stdio: "inherit" });
|
|
52
|
+
}
|
|
53
|
+
consola.success("All dependencies installed successfully.");
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export { install as default };
|
package/dist/cli/prepare.mjs
CHANGED
|
@@ -1546,10 +1546,10 @@ async function installPackages(silgi) {
|
|
|
1546
1546
|
const packages = {
|
|
1547
1547
|
dependencies: {
|
|
1548
1548
|
"@fastify/deepmerge": devDependencies["@fastify/deepmerge"],
|
|
1549
|
-
...silgi.options.installPackages
|
|
1549
|
+
...silgi.options.installPackages?.dependencies
|
|
1550
1550
|
},
|
|
1551
1551
|
devDependencies: {
|
|
1552
|
-
...silgi.options.installPackages
|
|
1552
|
+
...silgi.options.installPackages?.devDependencies
|
|
1553
1553
|
}
|
|
1554
1554
|
};
|
|
1555
1555
|
await silgi.callHook("prepare:installPackages", packages);
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED