@ankhorage/infra 0.3.1 → 0.3.2
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/CHANGELOG.md +6 -0
- package/dist/{cli.d.ts → cli/bin.d.ts} +3 -3
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/{cli.js → cli/bin.js} +3 -3
- package/dist/cli/bin.js.map +1 -0
- package/dist/readme-usage.js +1 -1
- package/dist/readme-usage.js.map +1 -1
- package/package.json +2 -2
- package/src/{cli.ts → cli/bin.ts} +3 -3
- package/src/{cli.test.ts → cli/cli.test.ts} +3 -3
- package/src/package.test.ts +1 -1
- package/src/readme-usage.ts +1 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ankhorage/infra
|
|
2
2
|
|
|
3
|
+
## 0.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f407622: Move the standalone infrastructure CLI and its tests under the canonical `src/cli/` package boundary while preserving the published `ankhorage-infra` binary.
|
|
8
|
+
|
|
3
9
|
## 0.3.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import type { InfraCommandContext, InfraCommandRunResult } from '
|
|
3
|
-
import { type InfraCommandServices, type RunInfraCommandImpl } from '
|
|
2
|
+
import type { InfraCommandContext, InfraCommandRunResult } from '../commandContext.js';
|
|
3
|
+
import { type InfraCommandServices, type RunInfraCommandImpl } from '../commands.js';
|
|
4
4
|
export interface InfraCliOptions {
|
|
5
5
|
readonly context?: InfraCommandContext;
|
|
6
6
|
readonly runCommandImpl?: RunInfraCommandImpl;
|
|
7
7
|
readonly services?: Partial<InfraCommandServices>;
|
|
8
8
|
}
|
|
9
9
|
export declare function runCli(argv: readonly string[], options?: InfraCliOptions): Promise<InfraCommandRunResult>;
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=bin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,OAAO,EAEL,KAAK,oBAAoB,EAIzB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACnD;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CA+BhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { createDefaultCommandContext } from '
|
|
3
|
-
import { findInfraCommandByStandaloneName, renderRootHelp, renderUnknownCommand, runInfraCommand, } from '
|
|
2
|
+
import { createDefaultCommandContext } from '../commandContext.js';
|
|
3
|
+
import { findInfraCommandByStandaloneName, renderRootHelp, renderUnknownCommand, runInfraCommand, } from '../commands.js';
|
|
4
4
|
export async function runCli(argv, options = {}) {
|
|
5
5
|
const context = options.context ?? createDefaultCommandContext();
|
|
6
6
|
const runCommand = options.runCommandImpl ?? runInfraCommand;
|
|
@@ -36,4 +36,4 @@ if (import.meta.main) {
|
|
|
36
36
|
const result = await runCli(process.argv.slice(2));
|
|
37
37
|
process.exit(result.exitCode);
|
|
38
38
|
}
|
|
39
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=bin.js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AE,OAAO,CAAC,QAAQ;KAC3B,CACF,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AACxE,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC","sourcesContent":["#!/usr/bin/env bun\n\nimport type { InfraCommandContext, InfraCommandRunResult } from '../commandContext.js';\nimport { createDefaultCommandContext } from '../commandContext.js';\nimport {\n findInfraCommandByStandaloneName,\n type InfraCommandServices,\n renderRootHelp,\n renderUnknownCommand,\n runInfraCommand,\n type RunInfraCommandImpl,\n} from '../commands.js';\n\nexport interface InfraCliOptions {\n readonly context?: InfraCommandContext;\n readonly runCommandImpl?: RunInfraCommandImpl;\n readonly services?: Partial<InfraCommandServices>;\n}\n\nexport async function runCli(\n argv: readonly string[],\n options: InfraCliOptions = {},\n): Promise<InfraCommandRunResult> {\n const context = options.context ?? createDefaultCommandContext();\n const runCommand = options.runCommandImpl ?? runInfraCommand;\n const [firstToken, ...restTokens] = argv;\n\n if (firstToken === undefined || isHelpToken(firstToken)) {\n context.writeStdout(renderRootHelp(context.version));\n return { exitCode: 0 };\n }\n\n if (isVersionToken(firstToken)) {\n context.writeStdout(`${context.version}\\n`);\n return { exitCode: 0 };\n }\n\n const command = findInfraCommandByStandaloneName(firstToken);\n if (command === null) {\n context.writeStderr(renderUnknownCommand(firstToken));\n return { exitCode: 1 };\n }\n\n return runCommand(\n {\n argv: restTokens,\n command,\n context,\n },\n {\n services: options.services,\n },\n );\n}\n\nfunction isHelpToken(value: string): boolean {\n return value === '--help' || value === '-h' || value === 'help';\n}\n\nfunction isVersionToken(value: string): boolean {\n return value === '--version' || value === '-v' || value === 'version';\n}\n\nif (import.meta.main) {\n const result = await runCli(process.argv.slice(2));\n process.exit(result.exitCode);\n}\n"]}
|
package/dist/readme-usage.js
CHANGED
package/dist/readme-usage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme-usage.js","sourceRoot":"","sources":["../src/readme-usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"readme-usage.js","sourceRoot":"","sources":["../src/readme-usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["import { runCli } from './cli/bin.js';\n\n/***\n * Provider and CLI surface\n *\n * `@ankhorage/infra` owns infra command behavior.\n *\n * The same shared command implementation backs both:\n *\n * - `ankh infra ...`\n * - `bunx @ankhorage/infra ...`\n *\n * Current command surface:\n *\n * - `validate`\n * - `generate`\n * - `status`\n * - `up`\n * - `down`\n *\n * `status` runs the generated live runtime status script for a project.\n *\n * Project resolution is project-aware:\n *\n * - pass `[project]`, or\n * - omit it when cwd is already inside `apps/<project>`\n *\n * @usage\n */\nawait runCli(['--help']);\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/infra",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"description": "Project-aware infrastructure generation library and executable Ankh provider for Ankhorage.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/infra#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"./package.json": "./package.json"
|
|
63
63
|
},
|
|
64
64
|
"bin": {
|
|
65
|
-
"ankhorage-infra": "./dist/cli.js"
|
|
65
|
+
"ankhorage-infra": "./dist/cli/bin.js"
|
|
66
66
|
},
|
|
67
67
|
"ankh": {
|
|
68
68
|
"category": "infra",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import type { InfraCommandContext, InfraCommandRunResult } from '
|
|
4
|
-
import { createDefaultCommandContext } from '
|
|
3
|
+
import type { InfraCommandContext, InfraCommandRunResult } from '../commandContext.js';
|
|
4
|
+
import { createDefaultCommandContext } from '../commandContext.js';
|
|
5
5
|
import {
|
|
6
6
|
findInfraCommandByStandaloneName,
|
|
7
7
|
type InfraCommandServices,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
renderUnknownCommand,
|
|
10
10
|
runInfraCommand,
|
|
11
11
|
type RunInfraCommandImpl,
|
|
12
|
-
} from '
|
|
12
|
+
} from '../commands.js';
|
|
13
13
|
|
|
14
14
|
export interface InfraCliOptions {
|
|
15
15
|
readonly context?: InfraCommandContext;
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
} from '@ankhorage/ankh';
|
|
7
7
|
import { describe, expect, test } from 'bun:test';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { createCapturedCommandContext } from '../testSupport.js';
|
|
10
|
+
import { runCli } from './bin.js';
|
|
11
|
+
import { createInfraRuntimeProvider } from './index.js';
|
|
12
12
|
|
|
13
13
|
describe('standalone cli and provider-backed dispatch', () => {
|
|
14
14
|
test('prints help and version for the standalone CLI', async () => {
|
package/src/package.test.ts
CHANGED
|
@@ -14,7 +14,7 @@ describe('package metadata', () => {
|
|
|
14
14
|
expect(packageJson.name).toBe('@ankhorage/infra');
|
|
15
15
|
expect(packageJson.type).toBe('module');
|
|
16
16
|
expect(packageJson.bin).toEqual({
|
|
17
|
-
'ankhorage-infra': './dist/cli.js',
|
|
17
|
+
'ankhorage-infra': './dist/cli/bin.js',
|
|
18
18
|
});
|
|
19
19
|
expect(packageJson.ankh).toEqual(expectedAnkhMetadata);
|
|
20
20
|
expect(JSON.parse(JSON.stringify(expectedAnkhMetadata))).toEqual(expectedAnkhMetadata);
|
package/src/readme-usage.ts
CHANGED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EAEL,KAAK,oBAAoB,EAIzB,KAAK,mBAAmB,EACzB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACnD;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CA+BhC"}
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,gCAAgC,EAEhC,cAAc,EACd,oBAAoB,EACpB,eAAe,GAEhB,MAAM,eAAe,CAAC;AAQvB,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,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AACxE,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC","sourcesContent":["#!/usr/bin/env bun\n\nimport type { InfraCommandContext, InfraCommandRunResult } from './commandContext.js';\nimport { createDefaultCommandContext } from './commandContext.js';\nimport {\n findInfraCommandByStandaloneName,\n type InfraCommandServices,\n renderRootHelp,\n renderUnknownCommand,\n runInfraCommand,\n type RunInfraCommandImpl,\n} from './commands.js';\n\nexport interface InfraCliOptions {\n readonly context?: InfraCommandContext;\n readonly runCommandImpl?: RunInfraCommandImpl;\n readonly services?: Partial<InfraCommandServices>;\n}\n\nexport async function runCli(\n argv: readonly string[],\n options: InfraCliOptions = {},\n): Promise<InfraCommandRunResult> {\n const context = options.context ?? createDefaultCommandContext();\n const runCommand = options.runCommandImpl ?? runInfraCommand;\n const [firstToken, ...restTokens] = argv;\n\n if (firstToken === undefined || isHelpToken(firstToken)) {\n context.writeStdout(renderRootHelp(context.version));\n return { exitCode: 0 };\n }\n\n if (isVersionToken(firstToken)) {\n context.writeStdout(`${context.version}\\n`);\n return { exitCode: 0 };\n }\n\n const command = findInfraCommandByStandaloneName(firstToken);\n if (command === null) {\n context.writeStderr(renderUnknownCommand(firstToken));\n return { exitCode: 1 };\n }\n\n return runCommand(\n {\n argv: restTokens,\n command,\n context,\n },\n {\n services: options.services,\n },\n );\n}\n\nfunction isHelpToken(value: string): boolean {\n return value === '--help' || value === '-h' || value === 'help';\n}\n\nfunction isVersionToken(value: string): boolean {\n return value === '--version' || value === '-v' || value === 'version';\n}\n\nif (import.meta.main) {\n const result = await runCli(process.argv.slice(2));\n process.exit(result.exitCode);\n}\n"]}
|