@ankhorage/infra 7.1.107 → 7.2.0
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/README.md +1 -1
- package/dist/capabilities/index.d.ts +83 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +68 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/cli/commands/destroy.js +1 -2
- package/dist/cli/commands/destroy.js.map +1 -1
- package/dist/cli/commands/down.d.ts.map +1 -1
- package/dist/cli/commands/down.js +1 -2
- package/dist/cli/commands/down.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +1 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/outputs.d.ts.map +1 -1
- package/dist/cli/commands/outputs.js +1 -2
- package/dist/cli/commands/outputs.js.map +1 -1
- package/dist/cli/commands/plan.d.ts.map +1 -1
- package/dist/cli/commands/plan.js +1 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +1 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/up.d.ts.map +1 -1
- package/dist/cli/commands/up.js +1 -2
- package/dist/cli/commands/up.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +1 -2
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/createInfraRuntimeProvider.d.ts.map +1 -1
- package/dist/cli/createInfraRuntimeProvider.js +3 -2
- package/dist/cli/createInfraRuntimeProvider.js.map +1 -1
- package/dist/constants.d.ts +81 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -11
- package/dist/constants.js.map +1 -1
- package/dist/metadata/index.d.ts +1 -1
- package/dist/metadata/index.d.ts.map +1 -1
- package/dist/metadata/index.js +1 -1
- package/dist/metadata/index.js.map +1 -1
- package/dist/types/infraCli.d.ts +2 -2
- package/dist/types/infraCli.d.ts.map +1 -1
- package/dist/types/infraCli.js.map +1 -1
- package/package.json +129 -12
- package/src/capabilities/index.test.ts +17 -0
- package/src/capabilities/index.ts +71 -0
- package/src/cli/commands/destroy.ts +2 -2
- package/src/cli/commands/down.ts +3 -2
- package/src/cli/commands/generate.ts +3 -2
- package/src/cli/commands/outputs.ts +3 -2
- package/src/cli/commands/plan.ts +3 -2
- package/src/cli/commands/status.ts +3 -2
- package/src/cli/commands/up.ts +3 -2
- package/src/cli/commands/validate.ts +3 -2
- package/src/cli/createInfraRuntimeProvider.ts +3 -7
- package/src/cli/index.test.ts +3 -11
- package/src/commands.test.ts +4 -0
- package/src/constants.ts +3 -17
- package/src/metadata/index.ts +0 -1
- package/src/package.test.ts +21 -23
- package/src/types/infraCli.ts +2 -2
package/src/package.test.ts
CHANGED
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { areCapabilitiesEqual, isCapability } from '@ankhorage/contracts/capabilities';
|
|
2
2
|
import { describe, expect, test } from 'bun:test';
|
|
3
3
|
|
|
4
4
|
import packageJson from '../package.json';
|
|
5
|
+
import { CAPABILITIES } from './capabilities/index.js';
|
|
5
6
|
|
|
6
7
|
describe('package metadata', () => {
|
|
7
|
-
test('publishes the
|
|
8
|
-
const expectedAnkhMetadata = {
|
|
9
|
-
category: 'infra',
|
|
10
|
-
provider: './dist/cli/index.js',
|
|
11
|
-
capabilities: [
|
|
12
|
-
'infra.validate',
|
|
13
|
-
'infra.plan',
|
|
14
|
-
'infra.generate',
|
|
15
|
-
'infra.up',
|
|
16
|
-
'infra.status',
|
|
17
|
-
'infra.outputs',
|
|
18
|
-
'infra.down',
|
|
19
|
-
'infra.destroy',
|
|
20
|
-
],
|
|
21
|
-
} as const satisfies AnkhPackageMetadata;
|
|
22
|
-
|
|
8
|
+
test('publishes the canonical capability catalog and bin entry', () => {
|
|
23
9
|
expect(packageJson.name).toBe('@ankhorage/infra');
|
|
24
10
|
expect(packageJson.type).toBe('module');
|
|
25
11
|
expect(packageJson.bin).toEqual({
|
|
26
12
|
'ankhorage-infra': './dist/cli/bin.js',
|
|
27
13
|
});
|
|
28
|
-
expect(packageJson.ankh).
|
|
14
|
+
expect(packageJson.ankh.category).toBe('infra');
|
|
15
|
+
expect(packageJson.ankh.provider).toBe('./dist/cli/index.js');
|
|
16
|
+
expect(packageJson.ankh.capabilities).toHaveLength(CAPABILITIES.length);
|
|
17
|
+
expect(packageJson.ankh.capabilities.every(isCapability)).toBeTrue();
|
|
18
|
+
expect(packageJson.ankh.capabilities).toEqual(CAPABILITIES);
|
|
29
19
|
expect(packageJson.exports['./project']).toEqual({
|
|
30
20
|
types: './dist/project/index.d.ts',
|
|
31
21
|
import: './dist/project/index.js',
|
|
32
22
|
default: './dist/project/index.js',
|
|
33
23
|
});
|
|
34
|
-
expect(
|
|
24
|
+
expect(packageJson.exports['./capabilities']).toEqual({
|
|
25
|
+
types: './dist/capabilities/index.d.ts',
|
|
26
|
+
import: './dist/capabilities/index.js',
|
|
27
|
+
default: './dist/capabilities/index.js',
|
|
28
|
+
});
|
|
29
|
+
});
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
test('rejects string-only and conflicting capability metadata publication', () => {
|
|
32
|
+
for (const [index, capability] of CAPABILITIES.entries()) {
|
|
33
|
+
const published = packageJson.ankh.capabilities.at(index);
|
|
34
|
+
if (published === undefined) throw new Error('Published capability metadata is incomplete.');
|
|
35
|
+
expect(typeof published).toBe('object');
|
|
36
|
+
expect(areCapabilitiesEqual(published, capability)).toBeTrue();
|
|
37
|
+
}
|
|
40
38
|
});
|
|
41
39
|
});
|
package/src/types/infraCli.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Capability } from '@ankhorage/contracts/capabilities';
|
|
2
2
|
import type { AppEnvironmentId } from '@ankhorage/contracts/environments';
|
|
3
3
|
import type {
|
|
4
4
|
InfraEnvironmentSpec,
|
|
@@ -57,7 +57,7 @@ type InfraCommandImplementation = (
|
|
|
57
57
|
) => Promise<InfraCommandRunResult>;
|
|
58
58
|
|
|
59
59
|
export interface InfraCommandDefinition {
|
|
60
|
-
readonly capability:
|
|
60
|
+
readonly capability: Capability['id'];
|
|
61
61
|
readonly path: readonly [InfraCommandName];
|
|
62
62
|
readonly standaloneName: InfraCommandName;
|
|
63
63
|
readonly summary: string;
|