silgi 0.27.10 → 0.27.12
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/index.mjs +1 -1
- package/dist/cli/prepare.mjs +47 -0
- package/dist/cli/types.mjs +1 -0
- package/dist/types/index.d.mts +1 -0
- package/package.json +11 -11
package/dist/cli/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -108,6 +108,11 @@ const command$1 = defineCommand({
|
|
|
108
108
|
label: "Command Tags",
|
|
109
109
|
hint: "It executes all commands that are related to the tags you select."
|
|
110
110
|
}] : [],
|
|
111
|
+
{
|
|
112
|
+
value: "functions",
|
|
113
|
+
label: "Functions",
|
|
114
|
+
hint: "Select and run individual functions"
|
|
115
|
+
},
|
|
111
116
|
...Object.keys(cliJson).filter((key) => {
|
|
112
117
|
const scripts = cliJson[key];
|
|
113
118
|
const scriptValues = Object.values(scripts);
|
|
@@ -141,6 +146,48 @@ const command$1 = defineCommand({
|
|
|
141
146
|
})).filter((script) => script.handler.tags?.includes(selectedTags));
|
|
142
147
|
}
|
|
143
148
|
).flat();
|
|
149
|
+
} else if (commandName === "functions") {
|
|
150
|
+
const availableFunctions = [];
|
|
151
|
+
for (const cmd of Object.keys(cliJson)) {
|
|
152
|
+
const scripts = cliJson[cmd];
|
|
153
|
+
for (const scriptName of Object.keys(scripts)) {
|
|
154
|
+
const script = scripts[scriptName];
|
|
155
|
+
if (script && script.type === "function") {
|
|
156
|
+
availableFunctions.push({
|
|
157
|
+
command: cmd,
|
|
158
|
+
script: scriptName,
|
|
159
|
+
handler: script
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (availableFunctions.length === 0) {
|
|
165
|
+
consola.warn("No functions found in cli.json");
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const selectedFunction = await p.select({
|
|
169
|
+
message: "Select a function to run",
|
|
170
|
+
options: availableFunctions.map((fn) => ({
|
|
171
|
+
label: `${fn.command} \u2192 ${fn.script}`,
|
|
172
|
+
value: `${fn.command}:${fn.script}`,
|
|
173
|
+
hint: fn.handler.description || void 0
|
|
174
|
+
}))
|
|
175
|
+
});
|
|
176
|
+
if (!selectedFunction)
|
|
177
|
+
return;
|
|
178
|
+
const [selectedCmd, selectedScript] = selectedFunction.split(":");
|
|
179
|
+
const selectedFunctionObj = availableFunctions.find(
|
|
180
|
+
(fn) => fn.command === selectedCmd && fn.script === selectedScript
|
|
181
|
+
);
|
|
182
|
+
if (!selectedFunctionObj || !selectedFunctionObj.handler) {
|
|
183
|
+
consola.error(`Function ${selectedCmd}:${selectedScript} not found or invalid`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
selectedCommands = [{
|
|
187
|
+
command: selectedCmd,
|
|
188
|
+
script: selectedScript,
|
|
189
|
+
handler: selectedFunctionObj.handler
|
|
190
|
+
}];
|
|
144
191
|
} else {
|
|
145
192
|
const scripts = cliJson[commandName];
|
|
146
193
|
const scriptName = await p.select({
|
package/dist/cli/types.mjs
CHANGED
package/dist/types/index.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silgi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.12",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"lib"
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@fastify/deepmerge": "
|
|
36
|
-
"@nuxt/kit": "
|
|
37
|
-
"@nuxt/schema": "
|
|
38
|
-
"@silgi/ecosystem": "
|
|
39
|
-
"h3": "
|
|
40
|
-
"nitropack": "
|
|
41
|
-
"nuxt": "
|
|
42
|
-
"typescript": "
|
|
43
|
-
"vue": "
|
|
44
|
-
"zod": "
|
|
35
|
+
"@fastify/deepmerge": ">=3.0.0",
|
|
36
|
+
"@nuxt/kit": ">=3.16.1",
|
|
37
|
+
"@nuxt/schema": ">=3.16.1",
|
|
38
|
+
"@silgi/ecosystem": ">=0.4.4",
|
|
39
|
+
"h3": ">=1.15.1",
|
|
40
|
+
"nitropack": ">=2.11.7",
|
|
41
|
+
"nuxt": ">=3.16.1",
|
|
42
|
+
"typescript": ">=5.8.2",
|
|
43
|
+
"vue": ">=3.5.13",
|
|
44
|
+
"zod": ">=3.24.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@nuxt/kit": {
|