@ankhorage/repository 0.5.8 → 0.6.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 +23 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +20 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/index.test.d.ts +2 -0
- package/dist/capabilities/index.test.d.ts.map +1 -0
- package/dist/capabilities/index.test.js +16 -0
- package/dist/capabilities/index.test.js.map +1 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/provider/createRepositoryRuntimeProvider.d.ts +2 -35
- package/dist/cli/provider/createRepositoryRuntimeProvider.d.ts.map +1 -1
- package/dist/cli/provider/createRepositoryRuntimeProvider.js +22 -8
- package/dist/cli/provider/createRepositoryRuntimeProvider.js.map +1 -1
- package/dist/cli/provider/createRepositoryRuntimeProvider.test.js +10 -7
- package/dist/cli/provider/createRepositoryRuntimeProvider.test.js.map +1 -1
- package/dist/index.test.js +2 -0
- package/dist/index.test.js.map +1 -1
- package/dist/metadata/index.d.ts +21 -1
- package/dist/metadata/index.d.ts.map +1 -1
- package/dist/metadata/index.js +2 -1
- package/dist/metadata/index.js.map +1 -1
- package/dist/package.test.d.ts +2 -0
- package/dist/package.test.d.ts.map +1 -0
- package/dist/package.test.js +27 -0
- package/dist/package.test.js.map +1 -0
- package/package.json +37 -4
- package/dist/metadata/repositoryPackageMetadata.d.ts +0 -18
- package/dist/metadata/repositoryPackageMetadata.d.ts.map +0 -1
- package/dist/metadata/repositoryPackageMetadata.js +0 -19
- package/dist/metadata/repositoryPackageMetadata.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/repository
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Standalone repository capability for connecting and managing an app project's source repository.
|
|
9
9
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*** Publish Repository's executable connection and materialization operations for Ankh discovery. */
|
|
2
|
+
export declare const CAPABILITIES: readonly [{
|
|
3
|
+
readonly id: "repository.connect";
|
|
4
|
+
readonly owner: "@ankhorage/repository";
|
|
5
|
+
readonly access: readonly ["invoke"];
|
|
6
|
+
readonly binding: {
|
|
7
|
+
readonly kind: "action";
|
|
8
|
+
readonly bindableAs: readonly ["target"];
|
|
9
|
+
};
|
|
10
|
+
readonly label: "Connect repository";
|
|
11
|
+
readonly description: "Create or safely resume a source repository connection.";
|
|
12
|
+
}, {
|
|
13
|
+
readonly id: "repository.materialize";
|
|
14
|
+
readonly owner: "@ankhorage/repository";
|
|
15
|
+
readonly access: readonly ["invoke"];
|
|
16
|
+
readonly binding: {
|
|
17
|
+
readonly kind: "action";
|
|
18
|
+
readonly bindableAs: readonly ["target"];
|
|
19
|
+
};
|
|
20
|
+
readonly label: "Materialize repository";
|
|
21
|
+
readonly description: "Materialize a GitHub repository revision as a local filesystem snapshot.";
|
|
22
|
+
}];
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;EAiBiB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*** Publish Repository's executable connection and materialization operations for Ankh discovery. */
|
|
2
|
+
export const CAPABILITIES = [
|
|
3
|
+
{
|
|
4
|
+
id: 'repository.connect',
|
|
5
|
+
owner: '@ankhorage/repository',
|
|
6
|
+
access: ['invoke'],
|
|
7
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
8
|
+
label: 'Connect repository',
|
|
9
|
+
description: 'Create or safely resume a source repository connection.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 'repository.materialize',
|
|
13
|
+
owner: '@ankhorage/repository',
|
|
14
|
+
access: ['invoke'],
|
|
15
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
16
|
+
label: 'Materialize repository',
|
|
17
|
+
description: 'Materialize a GitHub repository revision as a local filesystem snapshot.',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,oBAAoB;QACxB,KAAK,EAAE,uBAAuB;QAC9B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,yDAAyD;KACvE;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,uBAAuB;QAC9B,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,0EAA0E;KACxF;CACuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isCapability } from '@ankhorage/contracts/capabilities';
|
|
2
|
+
import { describe, expect, test } from 'bun:test';
|
|
3
|
+
import { CAPABILITIES } from './index.js';
|
|
4
|
+
describe('Repository capabilities', () => {
|
|
5
|
+
test('contains unique canonical descriptors for every externally invokable operation', () => {
|
|
6
|
+
expect(CAPABILITIES).toHaveLength(2);
|
|
7
|
+
expect(CAPABILITIES.every(isCapability)).toBeTrue();
|
|
8
|
+
expect(new Set(CAPABILITIES.map(({ id }) => id)).size).toBe(CAPABILITIES.length);
|
|
9
|
+
for (const capability of CAPABILITIES) {
|
|
10
|
+
expect(capability.owner).toBe('@ankhorage/repository');
|
|
11
|
+
expect(capability.access).toEqual(['invoke']);
|
|
12
|
+
expect(capability.binding).toEqual({ kind: 'action', bindableAs: ['target'] });
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/capabilities/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,CAAC,gFAAgF,EAAE,GAAG,EAAE;QAC1F,MAAM,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACpD,MAAM,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACjF,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;YACtC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;YACvD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC9C,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRepositoryRuntimeProvider } from './provider/createRepositoryRuntimeProvider.js';
|
|
2
|
-
declare const provider: import("
|
|
2
|
+
declare const provider: import("@ankhorage/ankh").AnkhRuntimeCommandProvider;
|
|
3
3
|
export { createRepositoryRuntimeProvider };
|
|
4
4
|
export default provider;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAEhG,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAEhG,QAAA,MAAM,QAAQ,sDAAoC,CAAC;AAEnD,OAAO,EAAE,+BAA+B,EAAE,CAAC;AAC3C,eAAe,QAAQ,CAAC"}
|
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type MaterializeCommandRequest } from '../commands/materialize/runMaterializeCommandAsync.js';
|
|
3
|
-
export interface RepositoryRuntimeProvider {
|
|
4
|
-
readonly id: 'repository';
|
|
5
|
-
readonly category: 'repository';
|
|
6
|
-
readonly version: string;
|
|
7
|
-
readonly capabilities: readonly ['repository.connect', 'repository.materialize'];
|
|
8
|
-
readonly commands: readonly [
|
|
9
|
-
{
|
|
10
|
-
readonly path: readonly ['connect'];
|
|
11
|
-
readonly capability: 'repository.connect';
|
|
12
|
-
readonly summary: string;
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
readonly path: readonly ['materialize'];
|
|
16
|
-
readonly capability: 'repository.materialize';
|
|
17
|
-
readonly summary: string;
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
readonly handlers: readonly [
|
|
21
|
-
{
|
|
22
|
-
readonly path: readonly ['connect'];
|
|
23
|
-
readonly handler: (request: ConnectCommandRequest) => Promise<{
|
|
24
|
-
readonly exitCode: number;
|
|
25
|
-
}>;
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
readonly path: readonly ['materialize'];
|
|
29
|
-
readonly handler: (request: MaterializeCommandRequest) => Promise<{
|
|
30
|
-
readonly exitCode: number;
|
|
31
|
-
}>;
|
|
32
|
-
}
|
|
33
|
-
];
|
|
34
|
-
}
|
|
1
|
+
import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';
|
|
35
2
|
/*** Create the package-level Ankh provider for repository connect and materialization commands. */
|
|
36
|
-
export declare function createRepositoryRuntimeProvider():
|
|
3
|
+
export declare function createRepositoryRuntimeProvider(): AnkhRuntimeCommandProvider;
|
|
37
4
|
//# sourceMappingURL=createRepositoryRuntimeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRepositoryRuntimeProvider.d.ts","sourceRoot":"","sources":["../../../src/cli/provider/createRepositoryRuntimeProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createRepositoryRuntimeProvider.d.ts","sourceRoot":"","sources":["../../../src/cli/provider/createRepositoryRuntimeProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAWlE,mGAAmG;AACnG,wBAAgB,+BAA+B,IAAI,0BAA0B,CAuB5E"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import packageJson from '../../../package.json';
|
|
2
|
+
import { CAPABILITIES } from '../../capabilities/index.js';
|
|
3
|
+
import { runConnectCommandAsync } from '../commands/connect/runConnectCommandAsync.js';
|
|
4
|
+
import { runMaterializeCommandAsync } from '../commands/materialize/runMaterializeCommandAsync.js';
|
|
5
|
+
const CONNECT_CAPABILITY_ID = 'repository.connect';
|
|
6
|
+
const MATERIALIZE_CAPABILITY_ID = 'repository.materialize';
|
|
4
7
|
/*** Create the package-level Ankh provider for repository connect and materialization commands. */
|
|
5
8
|
export function createRepositoryRuntimeProvider() {
|
|
6
9
|
return {
|
|
7
|
-
id:
|
|
8
|
-
category:
|
|
9
|
-
version:
|
|
10
|
-
capabilities:
|
|
11
|
-
commands: [
|
|
10
|
+
id: 'repository',
|
|
11
|
+
category: 'repository',
|
|
12
|
+
version: packageJson.version,
|
|
13
|
+
capabilities: CAPABILITIES,
|
|
14
|
+
commands: [
|
|
15
|
+
{
|
|
16
|
+
path: ['connect'],
|
|
17
|
+
capability: CONNECT_CAPABILITY_ID,
|
|
18
|
+
summary: 'Create or safely resume a source repository connection.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: ['materialize'],
|
|
22
|
+
capability: MATERIALIZE_CAPABILITY_ID,
|
|
23
|
+
summary: 'Materialize a GitHub repository URL as a local filesystem snapshot.',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
12
26
|
handlers: [
|
|
13
27
|
{ path: ['connect'], handler: runConnectCommandAsync },
|
|
14
28
|
{ path: ['materialize'], handler: runMaterializeCommandAsync },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRepositoryRuntimeProvider.js","sourceRoot":"","sources":["../../../src/cli/provider/createRepositoryRuntimeProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createRepositoryRuntimeProvider.js","sourceRoot":"","sources":["../../../src/cli/provider/createRepositoryRuntimeProvider.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uDAAuD,CAAC;AAEnG,MAAM,qBAAqB,GAAqB,oBAAoB,CAAC;AACrE,MAAM,yBAAyB,GAAqB,wBAAwB,CAAC;AAE7E,mGAAmG;AACnG,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,EAAE,EAAE,YAAY;QAChB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,CAAC,SAAS,CAAC;gBACjB,UAAU,EAAE,qBAAqB;gBACjC,OAAO,EAAE,yDAAyD;aACnE;YACD;gBACE,IAAI,EAAE,CAAC,aAAa,CAAC;gBACrB,UAAU,EAAE,yBAAyB;gBACrC,OAAO,EAAE,qEAAqE;aAC/E;SACF;QACD,QAAQ,EAAE;YACR,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE;YACtD,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE;SAC/D;KACmC,CAAC;AACzC,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { expect, test } from 'bun:test';
|
|
2
2
|
import packageJson from '../../../package.json';
|
|
3
|
+
import { CAPABILITIES } from '../../capabilities/index.js';
|
|
3
4
|
import { createRepositoryRuntimeProvider } from './createRepositoryRuntimeProvider.js';
|
|
4
|
-
test('
|
|
5
|
-
|
|
5
|
+
test('uses the canonical catalog and exposes only catalog command capabilities', () => {
|
|
6
|
+
const provider = createRepositoryRuntimeProvider();
|
|
7
|
+
expect(provider).toMatchObject({
|
|
6
8
|
id: 'repository',
|
|
7
9
|
category: 'repository',
|
|
8
10
|
version: packageJson.version,
|
|
9
|
-
capabilities: ['repository.connect', 'repository.materialize'],
|
|
10
|
-
commands: [
|
|
11
|
-
{ path: ['connect'], capability: 'repository.connect' },
|
|
12
|
-
{ path: ['materialize'], capability: 'repository.materialize' },
|
|
13
|
-
],
|
|
14
11
|
});
|
|
12
|
+
expect(provider.capabilities).toBe(CAPABILITIES);
|
|
13
|
+
const commandCapabilityIds = provider.commands.map(({ capability }) => capability);
|
|
14
|
+
const catalogCapabilityIds = CAPABILITIES.map(({ id }) => id);
|
|
15
|
+
expect(commandCapabilityIds).toHaveLength(catalogCapabilityIds.length);
|
|
16
|
+
expect(new Set(commandCapabilityIds).size).toBe(commandCapabilityIds.length);
|
|
17
|
+
expect(new Set(commandCapabilityIds)).toEqual(new Set(catalogCapabilityIds));
|
|
15
18
|
});
|
|
16
19
|
//# sourceMappingURL=createRepositoryRuntimeProvider.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRepositoryRuntimeProvider.test.js","sourceRoot":"","sources":["../../../src/cli/provider/createRepositoryRuntimeProvider.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"createRepositoryRuntimeProvider.test.js","sourceRoot":"","sources":["../../../src/cli/provider/createRepositoryRuntimeProvider.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,IAAI,CAAC,0EAA0E,EAAE,GAAG,EAAE;IACpF,MAAM,QAAQ,GAAG,+BAA+B,EAAE,CAAC;IAEnD,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;QAC7B,EAAE,EAAE,YAAY;QAChB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE,WAAW,CAAC,OAAO;KAC7B,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjD,MAAM,oBAAoB,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC;IACnF,MAAM,oBAAoB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IAE9D,MAAM,CAAC,oBAAoB,CAAC,CAAC,YAAY,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvE,MAAM,CAAC,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7E,MAAM,CAAC,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC"}
|
package/dist/index.test.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readdir, readFile } from 'node:fs/promises';
|
|
2
2
|
import { extname, join } from 'node:path';
|
|
3
3
|
import { expect, test } from 'bun:test';
|
|
4
|
+
import { CAPABILITIES } from './capabilities/index.js';
|
|
4
5
|
import * as packageApi from './index.js';
|
|
5
6
|
import { REPOSITORY_PACKAGE_METADATA } from './metadata/index.js';
|
|
6
7
|
test('exports only the provider-neutral repository API', () => {
|
|
@@ -13,6 +14,7 @@ test('publishes repository manifest authoring metadata', () => {
|
|
|
13
14
|
contractSubpath: '@ankhorage/contracts/repository',
|
|
14
15
|
providers: ['github'],
|
|
15
16
|
});
|
|
17
|
+
expect(REPOSITORY_PACKAGE_METADATA.capabilities).toBe(CAPABILITIES);
|
|
16
18
|
});
|
|
17
19
|
async function collectProductionTypeScriptFiles(directory) {
|
|
18
20
|
const entries = await readdir(directory, { withFileTypes: true });
|
package/dist/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC5D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC5D,MAAM,CAAC,2BAA2B,CAAC,CAAC,aAAa,CAAC;QAChD,WAAW,EAAE,uBAAuB;QACpC,gBAAgB,EAAE,YAAY;QAC9B,eAAe,EAAE,iCAAiC;QAClD,SAAS,EAAE,CAAC,QAAQ,CAAC;KACtB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC5D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC5D,MAAM,CAAC,2BAA2B,CAAC,CAAC,aAAa,CAAC;QAChD,WAAW,EAAE,uBAAuB;QACpC,gBAAgB,EAAE,YAAY;QAC9B,eAAe,EAAE,iCAAiC;QAClD,SAAS,EAAE,CAAC,QAAQ,CAAC;KACtB,CAAC,CAAC;IACH,MAAM,CAAC,2BAA2B,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,gCAAgC,CAAC,SAAiB;IAC/D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,CAAC,WAAW,EAAE;YAAE,OAAO,gCAAgC,CAAC,IAAI,CAAC,CAAC;QACvE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;YACtF,CAAC,CAAC,CAAC,IAAI,CAAC;YACR,CAAC,CAAC,EAAE,CAAC;IACT,CAAC,CAAC,CACH,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAED,IAAI,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;IAC5E,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,gCAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IACjF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAEhF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC"}
|
package/dist/metadata/index.d.ts
CHANGED
|
@@ -3,7 +3,27 @@ export declare const REPOSITORY_PACKAGE_METADATA: {
|
|
|
3
3
|
readonly manifestProperty: "repository";
|
|
4
4
|
readonly contractSubpath: "@ankhorage/contracts/repository";
|
|
5
5
|
readonly providers: readonly ["github"];
|
|
6
|
-
readonly capabilities: readonly [
|
|
6
|
+
readonly capabilities: readonly [{
|
|
7
|
+
readonly id: "repository.connect";
|
|
8
|
+
readonly owner: "@ankhorage/repository";
|
|
9
|
+
readonly access: readonly ["invoke"];
|
|
10
|
+
readonly binding: {
|
|
11
|
+
readonly kind: "action";
|
|
12
|
+
readonly bindableAs: readonly ["target"];
|
|
13
|
+
};
|
|
14
|
+
readonly label: "Connect repository";
|
|
15
|
+
readonly description: "Create or safely resume a source repository connection.";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "repository.materialize";
|
|
18
|
+
readonly owner: "@ankhorage/repository";
|
|
19
|
+
readonly access: readonly ["invoke"];
|
|
20
|
+
readonly binding: {
|
|
21
|
+
readonly kind: "action";
|
|
22
|
+
readonly bindableAs: readonly ["target"];
|
|
23
|
+
};
|
|
24
|
+
readonly label: "Materialize repository";
|
|
25
|
+
readonly description: "Materialize a GitHub repository revision as a local filesystem snapshot.";
|
|
26
|
+
}];
|
|
7
27
|
readonly github: {
|
|
8
28
|
readonly cli: "gh";
|
|
9
29
|
readonly defaultBranch: "main";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU9B,CAAC"}
|
package/dist/metadata/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { CAPABILITIES } from '../capabilities/index.js';
|
|
1
2
|
export const REPOSITORY_PACKAGE_METADATA = {
|
|
2
3
|
packageName: '@ankhorage/repository',
|
|
3
4
|
manifestProperty: 'repository',
|
|
4
5
|
contractSubpath: '@ankhorage/contracts/repository',
|
|
5
6
|
providers: ['github'],
|
|
6
|
-
capabilities:
|
|
7
|
+
capabilities: CAPABILITIES,
|
|
7
8
|
github: {
|
|
8
9
|
cli: 'gh',
|
|
9
10
|
defaultBranch: 'main',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,WAAW,EAAE,uBAAuB;IACpC,gBAAgB,EAAE,YAAY;IAC9B,eAAe,EAAE,iCAAiC;IAClD,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,WAAW,EAAE,uBAAuB;IACpC,gBAAgB,EAAE,YAAY;IAC9B,eAAe,EAAE,iCAAiC;IAClD,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE;QACN,GAAG,EAAE,IAAI;QACT,aAAa,EAAE,MAAM;KACtB;CACO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.test.d.ts","sourceRoot":"","sources":["../src/package.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { areCapabilitiesEqual, isCapability } from '@ankhorage/contracts/capabilities';
|
|
2
|
+
import { describe, expect, test } from 'bun:test';
|
|
3
|
+
import packageJson from '../package.json';
|
|
4
|
+
import { CAPABILITIES } from './capabilities/index.js';
|
|
5
|
+
describe('package metadata', () => {
|
|
6
|
+
test('publishes the canonical capability catalog and public capability entrypoint', () => {
|
|
7
|
+
expect(packageJson.ankh.capabilities).toHaveLength(CAPABILITIES.length);
|
|
8
|
+
expect(packageJson.ankh.capabilities.every(isCapability)).toBeTrue();
|
|
9
|
+
expect(packageJson.ankh.capabilities.map((capability) => JSON.stringify(capability))).toEqual(CAPABILITIES.map((capability) => JSON.stringify(capability)));
|
|
10
|
+
expect(packageJson.exports['./capabilities']).toEqual({
|
|
11
|
+
types: './dist/capabilities/index.d.ts',
|
|
12
|
+
default: './dist/capabilities/index.js',
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
test('does not publish legacy string-only capabilities', () => {
|
|
16
|
+
for (const [index, capability] of CAPABILITIES.entries()) {
|
|
17
|
+
const published = packageJson.ankh.capabilities.at(index);
|
|
18
|
+
if (published === undefined)
|
|
19
|
+
throw new Error('Published capability metadata is incomplete.');
|
|
20
|
+
if (!isCapability(published))
|
|
21
|
+
throw new Error('Published capability metadata is invalid.');
|
|
22
|
+
expect(typeof published).toBe('object');
|
|
23
|
+
expect(areCapabilitiesEqual(published, capability)).toBeTrue();
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=package.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.test.js","sourceRoot":"","sources":["../src/package.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,CAAC,6EAA6E,EAAE,GAAG,EAAE;QACvF,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACrE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAC3F,YAAY,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAC7D,CAAC;QACF,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC;YACpD,KAAK,EAAE,gCAAgC;YACvC,OAAO,EAAE,8BAA8B;SACxC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC5D,KAAK,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;YACzD,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;YAC1D,IAAI,SAAS,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAC7F,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC3F,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxC,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/repository",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Standalone repository capability for connecting and managing an app project's source repository.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,14 +48,46 @@
|
|
|
48
48
|
"types": "./dist/cli/index.d.ts",
|
|
49
49
|
"default": "./dist/cli/index.js"
|
|
50
50
|
},
|
|
51
|
+
"./capabilities": {
|
|
52
|
+
"types": "./dist/capabilities/index.d.ts",
|
|
53
|
+
"default": "./dist/capabilities/index.js"
|
|
54
|
+
},
|
|
51
55
|
"./package.json": "./package.json"
|
|
52
56
|
},
|
|
53
57
|
"ankh": {
|
|
54
58
|
"category": "repository",
|
|
55
59
|
"provider": "./dist/cli/index.js",
|
|
56
60
|
"capabilities": [
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
{
|
|
62
|
+
"id": "repository.connect",
|
|
63
|
+
"owner": "@ankhorage/repository",
|
|
64
|
+
"access": [
|
|
65
|
+
"invoke"
|
|
66
|
+
],
|
|
67
|
+
"binding": {
|
|
68
|
+
"kind": "action",
|
|
69
|
+
"bindableAs": [
|
|
70
|
+
"target"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"label": "Connect repository",
|
|
74
|
+
"description": "Create or safely resume a source repository connection."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "repository.materialize",
|
|
78
|
+
"owner": "@ankhorage/repository",
|
|
79
|
+
"access": [
|
|
80
|
+
"invoke"
|
|
81
|
+
],
|
|
82
|
+
"binding": {
|
|
83
|
+
"kind": "action",
|
|
84
|
+
"bindableAs": [
|
|
85
|
+
"target"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"label": "Materialize repository",
|
|
89
|
+
"description": "Materialize a GitHub repository revision as a local filesystem snapshot."
|
|
90
|
+
}
|
|
59
91
|
]
|
|
60
92
|
},
|
|
61
93
|
"publishConfig": {
|
|
@@ -76,7 +108,7 @@
|
|
|
76
108
|
"knip:check": "ankhorage-knip"
|
|
77
109
|
},
|
|
78
110
|
"devDependencies": {
|
|
79
|
-
"@ankhorage/devtools": "^2.1.
|
|
111
|
+
"@ankhorage/devtools": "^2.1.19",
|
|
80
112
|
"@ankhorage/paradox": "^0.2.28",
|
|
81
113
|
"@types/bun": "^1.4.2",
|
|
82
114
|
"@types/node": "^26.6.4",
|
|
@@ -84,6 +116,7 @@
|
|
|
84
116
|
},
|
|
85
117
|
"packageManager": "bun@1.4.2",
|
|
86
118
|
"dependencies": {
|
|
119
|
+
"@ankhorage/ankh": "^0.12.0",
|
|
87
120
|
"@ankhorage/contracts": "^24.1.0",
|
|
88
121
|
"ignore": "^7.0.12"
|
|
89
122
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const repositoryPackageMetadata: {
|
|
2
|
-
readonly packageName: string;
|
|
3
|
-
readonly provider: "repository";
|
|
4
|
-
readonly category: "repository";
|
|
5
|
-
readonly version: string;
|
|
6
|
-
readonly capabilities: readonly ["repository.connect", "repository.materialize"];
|
|
7
|
-
readonly command: {
|
|
8
|
-
readonly path: readonly ["connect"];
|
|
9
|
-
readonly capability: "repository.connect";
|
|
10
|
-
readonly summary: "Create or safely resume a source repository connection.";
|
|
11
|
-
};
|
|
12
|
-
readonly materializeCommand: {
|
|
13
|
-
readonly path: readonly ["materialize"];
|
|
14
|
-
readonly capability: "repository.materialize";
|
|
15
|
-
readonly summary: "Materialize a GitHub repository URL as a local filesystem snapshot.";
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=repositoryPackageMetadata.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repositoryPackageMetadata.d.ts","sourceRoot":"","sources":["../../src/metadata/repositoryPackageMetadata.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAgB5B,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import packageJson from '../../package.json';
|
|
2
|
-
export const repositoryPackageMetadata = {
|
|
3
|
-
packageName: packageJson.name,
|
|
4
|
-
provider: 'repository',
|
|
5
|
-
category: 'repository',
|
|
6
|
-
version: packageJson.version,
|
|
7
|
-
capabilities: ['repository.connect', 'repository.materialize'],
|
|
8
|
-
command: {
|
|
9
|
-
path: ['connect'],
|
|
10
|
-
capability: 'repository.connect',
|
|
11
|
-
summary: 'Create or safely resume a source repository connection.',
|
|
12
|
-
},
|
|
13
|
-
materializeCommand: {
|
|
14
|
-
path: ['materialize'],
|
|
15
|
-
capability: 'repository.materialize',
|
|
16
|
-
summary: 'Materialize a GitHub repository URL as a local filesystem snapshot.',
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=repositoryPackageMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repositoryPackageMetadata.js","sourceRoot":"","sources":["../../src/metadata/repositoryPackageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,WAAW,EAAE,WAAW,CAAC,IAAI;IAC7B,QAAQ,EAAE,YAAqB;IAC/B,QAAQ,EAAE,YAAqB;IAC/B,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,YAAY,EAAE,CAAC,oBAAoB,EAAE,wBAAwB,CAAU;IACvE,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,SAAS,CAAU;QAC1B,UAAU,EAAE,oBAA6B;QACzC,OAAO,EAAE,yDAAyD;KACnE;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,CAAC,aAAa,CAAU;QAC9B,UAAU,EAAE,wBAAiC;QAC7C,OAAO,EAAE,qEAAqE;KAC/E;CACO,CAAC"}
|