@lunora/cli 1.0.0-alpha.5 → 1.0.0-alpha.6
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/bin.mjs +1 -1
- package/dist/index.d.mts +50 -10
- package/dist/index.d.ts +50 -10
- package/dist/index.mjs +5 -5
- package/dist/packem_chunks/handler.mjs +2 -2
- package/dist/packem_chunks/handler14.mjs +1 -1
- package/dist/packem_chunks/handler16.mjs +1 -1
- package/dist/packem_chunks/handler18.mjs +1 -1
- package/dist/packem_chunks/handler19.mjs +1 -1
- package/dist/packem_chunks/handler2.mjs +1 -1
- package/dist/packem_chunks/handler21.mjs +1 -1
- package/dist/packem_chunks/handler5.mjs +1 -1
- package/dist/packem_chunks/handler6.mjs +1 -1
- package/dist/packem_chunks/planDevCommand.mjs +4 -48
- package/dist/packem_chunks/runDeployCommand.mjs +1 -1
- package/dist/packem_chunks/runInitCommand.mjs +459 -35
- package/dist/packem_chunks/runMigrateGenerateCommand.mjs +4 -4
- package/dist/packem_chunks/runResetCommand.mjs +1 -1
- package/dist/packem_shared/{COMMANDS-DXaq12xm.mjs → COMMANDS-Bn8luojF.mjs} +10 -2
- package/dist/packem_shared/{commands-B9nASOYd.mjs → commands-DqsEzojt.mjs} +2 -2
- package/dist/packem_shared/detect-package-manager-DYp7n3mJ.mjs +61 -0
- package/dist/packem_shared/{diffSnapshots-RR2ZE8Ya.mjs → diffSnapshots-BeDvvNiF.mjs} +1 -1
- package/dist/packem_shared/{runAddCommand-BF7XreDW.mjs → runAddCommand-G544_v6e.mjs} +1 -1
- package/dist/packem_shared/{schemaIrToSnapshot-aBTo7TM5.mjs → schemaIrToSnapshot-DdsljJT-.mjs} +1 -1
- package/dist/packem_shared/{tui-prompts-Bm15GPJA.mjs → tui-prompts-XHFxlOg5.mjs} +41 -1
- package/package.json +3 -5
- /package/dist/packem_shared/{defaultSpawner-DxI3mebw.mjs → createRecordingSpawner-DxI3mebw.mjs} +0 -0
|
@@ -3,7 +3,7 @@ import { dirname, join } from '@visulima/path';
|
|
|
3
3
|
import { DEV_VARS_FILE, parseDevVariableEntries } from '@lunora/config';
|
|
4
4
|
import { modify, applyEdits, parse } from 'jsonc-parser';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import { a as tuiConfirm } from './tui-prompts-
|
|
6
|
+
import { a as tuiConfirm } from './tui-prompts-XHFxlOg5.mjs';
|
|
7
7
|
import { collectCatalog, buildRegistryIndex } from './buildRegistryIndex-BcYe607_.mjs';
|
|
8
8
|
import { insertSchemaExtension } from './insertSchemaExtension-BuzF6-t2.mjs';
|
|
9
9
|
import { createHash } from 'node:crypto';
|
|
@@ -785,4 +785,4 @@ const runBuildIndexCommand = async (options) => {
|
|
|
785
785
|
return empty;
|
|
786
786
|
};
|
|
787
787
|
|
|
788
|
-
export { runBuildIndexCommand as a, runRegistryViewCommand as b,
|
|
788
|
+
export { runBuildIndexCommand as a, runRegistryViewCommand as b, resolveDistTag as c, resolveSourceRef as d, runListCommand as e, runAddCommand as r };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from '@visulima/path';
|
|
4
|
+
|
|
5
|
+
const FALLBACK = "pnpm";
|
|
6
|
+
const KNOWN_MANAGERS = ["pnpm", "yarn", "npm", "bun"];
|
|
7
|
+
const INSTALL_PREFERENCE = ["pnpm", "bun", "yarn", "npm"];
|
|
8
|
+
const isManagerInstalled = (manager) => {
|
|
9
|
+
try {
|
|
10
|
+
return spawnSync(manager, ["--version"], { stdio: "ignore", timeout: 5e3 }).status === 0;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const detectInstalledManagers = (probe = isManagerInstalled) => INSTALL_PREFERENCE.filter((manager) => probe(manager));
|
|
16
|
+
const installArgsFor = (manager) => {
|
|
17
|
+
return { args: ["install"], command: manager };
|
|
18
|
+
};
|
|
19
|
+
const parseDeclaredManager = (declared) => {
|
|
20
|
+
if (typeof declared !== "string") {
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
return KNOWN_MANAGERS.find((manager) => declared.startsWith(`${manager}@`));
|
|
24
|
+
};
|
|
25
|
+
const readDeclaredManager = (directory) => {
|
|
26
|
+
const candidate = join(directory, "package.json");
|
|
27
|
+
if (!existsSync(candidate)) {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const parsed = JSON.parse(readFileSync(candidate, "utf8"));
|
|
32
|
+
return parseDeclaredManager(parsed.packageManager);
|
|
33
|
+
} catch {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const detectPackageManager = (startDirectory) => {
|
|
38
|
+
let directory = startDirectory;
|
|
39
|
+
while (directory && directory !== dirname(directory)) {
|
|
40
|
+
const declared = readDeclaredManager(directory);
|
|
41
|
+
if (declared !== void 0) {
|
|
42
|
+
return declared;
|
|
43
|
+
}
|
|
44
|
+
directory = dirname(directory);
|
|
45
|
+
}
|
|
46
|
+
return FALLBACK;
|
|
47
|
+
};
|
|
48
|
+
const execArgsFor = (manager, command, args) => {
|
|
49
|
+
if (manager === "yarn") {
|
|
50
|
+
return { args: [command, ...args], command: "yarn" };
|
|
51
|
+
}
|
|
52
|
+
if (manager === "bun") {
|
|
53
|
+
return { args: ["x", command, ...args], command: "bun" };
|
|
54
|
+
}
|
|
55
|
+
if (manager === "npm") {
|
|
56
|
+
return { args: ["--", command, ...args], command: "npx" };
|
|
57
|
+
}
|
|
58
|
+
return { args: ["exec", command, ...args], command: "pnpm" };
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { detectInstalledManagers as a, detectPackageManager as d, execArgsFor as e, installArgsFor as i };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { quoteIdentifier,
|
|
1
|
+
import { quoteIdentifier, sqlAffinityForKind, frameworkColumnDdl, columnRef, physicalIndexName } from '@lunora/d1/dialect';
|
|
2
2
|
|
|
3
3
|
const validatorKindToSqlType = (kind) => sqlAffinityForKind(kind);
|
|
4
4
|
const renderColumnDefinition = (name, column) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'node:fs';
|
|
2
2
|
import '@visulima/path';
|
|
3
|
-
export { r as runAddCommand, a as runBuildIndexCommand, e as runListCommand, b as runRegistryViewCommand } from './commands-
|
|
3
|
+
export { r as runAddCommand, a as runBuildIndexCommand, e as runListCommand, b as runRegistryViewCommand } from './commands-DqsEzojt.mjs';
|
|
4
4
|
import './buildRegistryIndex-BcYe607_.mjs';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { isInteractive } from '@lunora/config';
|
|
3
3
|
import { render } from '@visulima/tui';
|
|
4
|
+
import { BigText } from '@visulima/tui/components/big-text';
|
|
4
5
|
import { Box } from '@visulima/tui/components/box';
|
|
5
6
|
import { CommandPalette } from '@visulima/tui/components/command-palette';
|
|
6
7
|
import { ConfirmInput } from '@visulima/tui/components/confirm-input';
|
|
@@ -8,6 +9,7 @@ import { MultiSelect } from '@visulima/tui/components/multi-select';
|
|
|
8
9
|
import { SelectInput } from '@visulima/tui/components/select-input';
|
|
9
10
|
import { Spinner } from '@visulima/tui/components/spinner';
|
|
10
11
|
import { Text } from '@visulima/tui/components/text';
|
|
12
|
+
import { TextInput } from '@visulima/tui/components/text-input';
|
|
11
13
|
import { useApp } from '@visulima/tui/hooks/use-app';
|
|
12
14
|
import { useInput } from '@visulima/tui/hooks/use-input';
|
|
13
15
|
import { useEffect } from 'react';
|
|
@@ -107,6 +109,33 @@ const tuiSelect = async (message, options, settings) => {
|
|
|
107
109
|
settings?.default
|
|
108
110
|
);
|
|
109
111
|
};
|
|
112
|
+
const TextView = ({ defaultValue, finish, message, placeholder }) => {
|
|
113
|
+
const commit = useCommit(finish);
|
|
114
|
+
useEscapeToExit();
|
|
115
|
+
return jsxs(PromptFrame, { children: [
|
|
116
|
+
jsx(Text, { bold: true, children: message }),
|
|
117
|
+
jsx(
|
|
118
|
+
TextInput,
|
|
119
|
+
{
|
|
120
|
+
defaultValue,
|
|
121
|
+
onSubmit: (value) => {
|
|
122
|
+
commit(value.trim() === "" ? defaultValue : value.trim());
|
|
123
|
+
},
|
|
124
|
+
placeholder
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] });
|
|
128
|
+
};
|
|
129
|
+
const tuiText = async (message, settings) => {
|
|
130
|
+
const fallback = settings?.default ?? "";
|
|
131
|
+
if (!isInteractive()) {
|
|
132
|
+
return fallback;
|
|
133
|
+
}
|
|
134
|
+
return runInkPrompt(
|
|
135
|
+
(finish) => jsx(TextView, { defaultValue: fallback, finish, message, placeholder: settings?.placeholder }),
|
|
136
|
+
fallback
|
|
137
|
+
);
|
|
138
|
+
};
|
|
110
139
|
const MultiSelectView = ({ defaults, finish, message, options }) => {
|
|
111
140
|
const commit = useCommit(finish);
|
|
112
141
|
useEscapeToExit();
|
|
@@ -207,6 +236,17 @@ const tuiOutro = async (message) => {
|
|
|
207
236
|
] })
|
|
208
237
|
);
|
|
209
238
|
};
|
|
239
|
+
const tuiBanner = async (subtitle) => {
|
|
240
|
+
if (!isInteractive()) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
await printFrame(
|
|
244
|
+
jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
245
|
+
jsx(BigText, { colors: [ACCENT], font: "tiny", space: false, text: "LUNORA" }),
|
|
246
|
+
jsx(Text, { dimColor: true, children: subtitle })
|
|
247
|
+
] })
|
|
248
|
+
);
|
|
249
|
+
};
|
|
210
250
|
const SpinnerView = ({ label }) => jsxs(Box, { children: [
|
|
211
251
|
jsx(Text, { color: ACCENT, children: jsx(Spinner, { type: "dots" }) }),
|
|
212
252
|
jsxs(Text, { children: [
|
|
@@ -226,4 +266,4 @@ const withTuiSpinner = async (label, task) => {
|
|
|
226
266
|
}
|
|
227
267
|
};
|
|
228
268
|
|
|
229
|
-
export { tuiConfirm as a,
|
|
269
|
+
export { tuiConfirm as a, tuiOutro as b, createTuiConfirm as c, tuiBanner as d, tuiText as e, tuiIntro as f, tuiMultiSelect as g, tuiSelect as t, withTuiSpinner as w };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.6",
|
|
4
4
|
"description": "The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lunora": "./dist/bin.mjs"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
|
-
"dist",
|
|
33
|
+
"./dist",
|
|
34
34
|
"__assets__",
|
|
35
35
|
"skills",
|
|
36
36
|
"README.md",
|
|
@@ -57,15 +57,13 @@
|
|
|
57
57
|
"@lunora/container": "1.0.0-alpha.1",
|
|
58
58
|
"@lunora/d1": "1.0.0-alpha.3",
|
|
59
59
|
"@lunora/seed": "1.0.0-alpha.1",
|
|
60
|
-
"@lunora/server": "1.0.0-alpha.1",
|
|
61
|
-
"@lunora/studio": "1.0.0-alpha.2",
|
|
62
|
-
"@lunora/values": "1.0.0-alpha.1",
|
|
63
60
|
"@visulima/cerebro": "3.0.0-alpha.32",
|
|
64
61
|
"@visulima/fs": "5.0.0-alpha.32",
|
|
65
62
|
"@visulima/pail": "4.0.0-alpha.22",
|
|
66
63
|
"@visulima/path": "3.0.0-alpha.13",
|
|
67
64
|
"@visulima/spinner": "1.0.0-alpha.4",
|
|
68
65
|
"@visulima/tui": "1.0.0-alpha.26",
|
|
66
|
+
"cfonts": "^3.3.1",
|
|
69
67
|
"giget": "3.3.0",
|
|
70
68
|
"jsonc-parser": "^3.3.1",
|
|
71
69
|
"magic-string": "^0.30.21",
|
/package/dist/packem_shared/{defaultSpawner-DxI3mebw.mjs → createRecordingSpawner-DxI3mebw.mjs}
RENAMED
|
File without changes
|