@lunora/cli 1.0.0-alpha.11 → 1.0.0-alpha.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/index.mjs +2 -2
- package/dist/packem_chunks/handler.mjs +3 -3
- package/dist/packem_chunks/handler16.mjs +1 -1
- package/dist/packem_chunks/handler18.mjs +1 -1
- package/dist/packem_chunks/planDevCommand.mjs +1 -1
- package/dist/packem_chunks/runInitCommand.mjs +3 -3
- package/dist/packem_chunks/runResetCommand.mjs +1 -1
- package/dist/packem_shared/{commands-zs-0Es9F.mjs → commands-DVr4lduS.mjs} +2 -2
- package/dist/packem_shared/{insertSchemaExtension-BuzF6-t2.mjs → insertSchemaExtension-DAqbfr9Z.mjs} +15 -10
- package/dist/packem_shared/{runAddCommand-DWlzKNPC.mjs → runAddCommand-C-NOz8NJ.mjs} +1 -1
- package/dist/packem_shared/{storage-7faZve2Z.mjs → storage-DL9OE4oE.mjs} +1 -1
- package/dist/packem_shared/{tui-prompts-Dvlh5xWt.mjs → tui-prompts-M6OWsuyw.mjs} +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ export { runMigrateGenerateCommand } from './packem_chunks/runMigrateGenerateCom
|
|
|
8
8
|
export { runResetCommand } from './packem_chunks/runResetCommand.mjs';
|
|
9
9
|
export { runRpcCommand } from './packem_chunks/runRpcCommand.mjs';
|
|
10
10
|
export { default as parseArgs } from './packem_shared/parseArgs-YXFuKdEk.mjs';
|
|
11
|
-
export { insertSchemaExtension } from './packem_shared/insertSchemaExtension-
|
|
11
|
+
export { insertSchemaExtension } from './packem_shared/insertSchemaExtension-DAqbfr9Z.mjs';
|
|
12
12
|
export { createLogger, pail } from './packem_shared/createLogger-B40gPzQo.mjs';
|
|
13
13
|
export { diffSnapshots, renderAddColumn, renderCreateIndex, renderCreateTable, renderDropIndex, renderDropTable, renderMigrationFile, validatorKindToSqlType } from './packem_shared/diffSnapshots-BeDvvNiF.mjs';
|
|
14
14
|
export { default as schemaIrToSnapshot } from './packem_shared/schemaIrToSnapshot-DdsljJT-.mjs';
|
|
@@ -16,4 +16,4 @@ export { createRecordingSpawner, defaultSpawner } from './packem_shared/createRe
|
|
|
16
16
|
export { default as parseManifest } from './packem_shared/parseManifest--vZf2FY1.mjs';
|
|
17
17
|
export { REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, validateWranglerProject as validateWrangler, validateWranglerConfig } from '@lunora/config';
|
|
18
18
|
export { buildRegistryIndex } from './packem_shared/buildRegistryIndex-BcYe607_.mjs';
|
|
19
|
-
export { r as runAddCommand, a as runBuildIndexCommand, b as runRegistryViewCommand } from './packem_shared/commands-
|
|
19
|
+
export { r as runAddCommand, a as runBuildIndexCommand, b as runRegistryViewCommand } from './packem_shared/commands-DVr4lduS.mjs';
|
|
@@ -2,9 +2,9 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { findWranglerFile } from '@lunora/config';
|
|
3
3
|
import { join, basename } from '@visulima/path';
|
|
4
4
|
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
5
|
-
import { t as tuiText, a as tuiSelect } from '../packem_shared/tui-prompts-
|
|
6
|
-
import { n as normalizeFeature, E as EMAIL_ITEM, s as sanitizeBucketName, d as deriveBucketName, p as promptBucketName, r as resolveTypedDestination, M as MAIL_DESTINATION_PROMPT, a as sanitizeDatabaseName, b as deriveDatabaseName, c as promptDatabaseName, D as DEFAULT_AUTH_ITEM, e as promptAuthProvider, A as AUTH_PROVIDER_OPTIONS, w as withStorageBucketName, f as withMailDestination, g as withAuthDatabaseName } from '../packem_shared/storage-
|
|
7
|
-
import { r as runAddCommand } from '../packem_shared/commands-
|
|
5
|
+
import { t as tuiText, a as tuiSelect } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
6
|
+
import { n as normalizeFeature, E as EMAIL_ITEM, s as sanitizeBucketName, d as deriveBucketName, p as promptBucketName, r as resolveTypedDestination, M as MAIL_DESTINATION_PROMPT, a as sanitizeDatabaseName, b as deriveDatabaseName, c as promptDatabaseName, D as DEFAULT_AUTH_ITEM, e as promptAuthProvider, A as AUTH_PROVIDER_OPTIONS, w as withStorageBucketName, f as withMailDestination, g as withAuthDatabaseName } from '../packem_shared/storage-DL9OE4oE.mjs';
|
|
7
|
+
import { r as runAddCommand } from '../packem_shared/commands-DVr4lduS.mjs';
|
|
8
8
|
|
|
9
9
|
const providerToItem = (provider) => {
|
|
10
10
|
const value = provider.trim().toLowerCase();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
2
|
-
import { r as runAddCommand, b as runRegistryViewCommand, a as runBuildIndexCommand } from '../packem_shared/commands-
|
|
2
|
+
import { r as runAddCommand, b as runRegistryViewCommand, a as runBuildIndexCommand } from '../packem_shared/commands-DVr4lduS.mjs';
|
|
3
3
|
|
|
4
4
|
const execute = defineHandler(({ argument, cwd, logger, options }) => {
|
|
5
5
|
const subcommand = argument[0];
|
|
@@ -7,7 +7,7 @@ import { join } from '@visulima/path';
|
|
|
7
7
|
import { Project } from 'ts-morph';
|
|
8
8
|
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
9
9
|
import { a as resolveProductionWorkerUrl } from '../packem_shared/resolve-target-qbsJ_5sF.mjs';
|
|
10
|
-
import { b as tuiConfirm } from '../packem_shared/tui-prompts-
|
|
10
|
+
import { b as tuiConfirm } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
11
11
|
import { runImportCommand } from '../packem_shared/DEFAULT_IMPORT_BATCH_SIZE-Ck-2bU08.mjs';
|
|
12
12
|
import { runResetCommand } from './runResetCommand.mjs';
|
|
13
13
|
|
|
@@ -9,7 +9,7 @@ import { d as detectPackageManager, e as execArgsFor } from '../packem_shared/de
|
|
|
9
9
|
import { createServer, request } from 'node:http';
|
|
10
10
|
import { connect } from 'node:net';
|
|
11
11
|
import { loadStudioAssets, studioAssetsStamp, renderStudioHtml, resolveAdminToken, SCHEMA_EDIT_ENDPOINT, POLICY_SCAFFOLD_ENDPOINT, SEED_ENDPOINT, serveJsonHandler, handleSchemaEditRequest, handlePolicyScaffoldRequest, handleSeedRequest } from '@lunora/config/studio-host';
|
|
12
|
-
import { c as createTuiConfirm } from '../packem_shared/tui-prompts-
|
|
12
|
+
import { c as createTuiConfirm } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
13
13
|
|
|
14
14
|
const DEFAULT_DEBOUNCE_MS = 100;
|
|
15
15
|
const PATH_SEGMENT_SEPARATOR = /[/\\]/u;
|
|
@@ -10,11 +10,11 @@ import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
|
10
10
|
import { a as detectInstalledManagers, i as installArgsFor } from '../packem_shared/detect-package-manager-DYp7n3mJ.mjs';
|
|
11
11
|
import MagicString from 'magic-string';
|
|
12
12
|
import { Project, SyntaxKind } from 'ts-morph';
|
|
13
|
-
import { c as resolveSourceRef, d as resolveDistTag, r as runAddCommand } from '../packem_shared/commands-
|
|
13
|
+
import { c as resolveSourceRef, d as resolveDistTag, r as runAddCommand } from '../packem_shared/commands-DVr4lduS.mjs';
|
|
14
14
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
15
|
-
import { d as tuiMascot, e as tuiStep, P as PromptCancelledError, f as tuiMoonrise, t as tuiText, g as tuiHeadline, h as tuiInfo, a as tuiSelect, w as withTuiSpinner, b as tuiConfirm, i as tuiNextSteps, j as tuiTasks, k as tuiMultiSelect, l as withTuiBadgeProgress } from '../packem_shared/tui-prompts-
|
|
15
|
+
import { d as tuiMascot, e as tuiStep, P as PromptCancelledError, f as tuiMoonrise, t as tuiText, g as tuiHeadline, h as tuiInfo, a as tuiSelect, w as withTuiSpinner, b as tuiConfirm, i as tuiNextSteps, j as tuiTasks, k as tuiMultiSelect, l as withTuiBadgeProgress } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
16
16
|
import { logStep } from '../packem_shared/createLogger-B40gPzQo.mjs';
|
|
17
|
-
import { E as EMAIL_ITEM, p as promptBucketName, w as withStorageBucketName, M as MAIL_DESTINATION_PROMPT, r as resolveTypedDestination, f as withMailDestination, e as promptAuthProvider, c as promptDatabaseName, g as withAuthDatabaseName } from '../packem_shared/storage-
|
|
17
|
+
import { E as EMAIL_ITEM, p as promptBucketName, w as withStorageBucketName, M as MAIL_DESTINATION_PROMPT, r as resolveTypedDestination, f as withMailDestination, e as promptAuthProvider, c as promptDatabaseName, g as withAuthDatabaseName } from '../packem_shared/storage-DL9OE4oE.mjs';
|
|
18
18
|
import dns from 'node:dns/promises';
|
|
19
19
|
|
|
20
20
|
const GITHUB_CONTENT = `name: Deploy
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, rmSync } from 'node:fs';
|
|
2
2
|
import { join } from '@visulima/path';
|
|
3
3
|
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
4
|
-
import { b as tuiConfirm } from '../packem_shared/tui-prompts-
|
|
4
|
+
import { b as tuiConfirm } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
5
5
|
|
|
6
6
|
const runResetCommand = async (options) => {
|
|
7
7
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -3,9 +3,9 @@ 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 { b as tuiConfirm } from './tui-prompts-
|
|
6
|
+
import { b as tuiConfirm } from './tui-prompts-M6OWsuyw.mjs';
|
|
7
7
|
import { collectCatalog, buildRegistryIndex } from './buildRegistryIndex-BcYe607_.mjs';
|
|
8
|
-
import { insertSchemaExtension } from './insertSchemaExtension-
|
|
8
|
+
import { insertSchemaExtension } from './insertSchemaExtension-DAqbfr9Z.mjs';
|
|
9
9
|
import { createHash } from 'node:crypto';
|
|
10
10
|
import { tmpdir } from 'node:os';
|
|
11
11
|
import { downloadTemplate } from 'giget';
|
package/dist/packem_shared/{insertSchemaExtension-BuzF6-t2.mjs → insertSchemaExtension-DAqbfr9Z.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Project, SyntaxKind } from 'ts-morph';
|
|
1
|
+
import { Project, SyntaxKind, Node } from 'ts-morph';
|
|
2
2
|
|
|
3
3
|
const VALID_JS_IDENTIFIER = /^[A-Za-z_$][\w$]*$/u;
|
|
4
4
|
const startMarker = (key) => `// lunora:add:${key}:start`;
|
|
@@ -12,6 +12,19 @@ const findDefineSchemaCall = (callExpressions) => {
|
|
|
12
12
|
}
|
|
13
13
|
return void 0;
|
|
14
14
|
};
|
|
15
|
+
const outermostChainExpression = (defineSchemaCall) => {
|
|
16
|
+
let node = defineSchemaCall;
|
|
17
|
+
for (let parent = node.getParent(); parent !== void 0; parent = node.getParent()) {
|
|
18
|
+
if (Node.isPropertyAccessExpression(parent) && parent.getExpression() === node) {
|
|
19
|
+
node = parent;
|
|
20
|
+
} else if (Node.isCallExpression(parent) && parent.getExpression() === node) {
|
|
21
|
+
node = parent;
|
|
22
|
+
} else {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return node;
|
|
27
|
+
};
|
|
15
28
|
const insertSchemaExtension = (source, key) => {
|
|
16
29
|
if (!VALID_JS_IDENTIFIER.test(key)) {
|
|
17
30
|
return { ok: false, reason: "invalid-identifier" };
|
|
@@ -33,15 +46,7 @@ const insertSchemaExtension = (source, key) => {
|
|
|
33
46
|
if (tablesArgument?.getKind() !== SyntaxKind.ObjectLiteralExpression) {
|
|
34
47
|
return { ok: false, reason: "non-object-argument" };
|
|
35
48
|
}
|
|
36
|
-
const
|
|
37
|
-
if (!variableDeclaration) {
|
|
38
|
-
return { ok: false, reason: "no-define-schema" };
|
|
39
|
-
}
|
|
40
|
-
const initializer = variableDeclaration.getInitializer();
|
|
41
|
-
if (!initializer) {
|
|
42
|
-
return { ok: false, reason: "no-define-schema" };
|
|
43
|
-
}
|
|
44
|
-
const insertAt = initializer.getEnd();
|
|
49
|
+
const insertAt = outermostChainExpression(defineSchemaCall).getEnd();
|
|
45
50
|
const chainText = `
|
|
46
51
|
${startMarker(key)}
|
|
47
52
|
.extend(${key}.extension)
|
|
@@ -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-DVr4lduS.mjs';
|
|
4
4
|
import './buildRegistryIndex-BcYe607_.mjs';
|
|
@@ -449,7 +449,7 @@ const tuiNextSteps = async (badge, header, steps, help) => {
|
|
|
449
449
|
] })
|
|
450
450
|
);
|
|
451
451
|
};
|
|
452
|
-
const TASK_INDENT = " ".repeat(
|
|
452
|
+
const TASK_INDENT = " ".repeat(BADGE_COLUMN_WIDTH - 1);
|
|
453
453
|
const SPINNER_FIRST = "#a855f7";
|
|
454
454
|
const SPINNER_LAST = "#06b6d4";
|
|
455
455
|
const SPINNER_COLORS = [SPINNER_FIRST, "#9b51f6", "#8a5cf6", "#6f86f6", "#4aa6ef", "#2bb6dd", "#12bcd0", SPINNER_LAST];
|