@ankhorage/rules 0.2.0 → 0.2.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/rules
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ec513d5: Publish the canonical Rules configuration validation capability and align Ankh discovery with Contracts 24.1.
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/rules
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v0.2.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: canonical](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.2.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: canonical](././paradox/badges/docs.svg)
7
7
 
8
8
  Domain-agnostic rule engine and JSON configuration for Ankhorage.
9
9
 
@@ -0,0 +1,12 @@
1
+ export declare const CAPABILITIES: readonly [{
2
+ readonly id: "rules.config.validate";
3
+ readonly owner: "@ankhorage/rules";
4
+ readonly access: readonly ["invoke"];
5
+ readonly binding: {
6
+ readonly kind: "action";
7
+ readonly bindableAs: readonly ["target"];
8
+ };
9
+ readonly label: "Validate rules configuration";
10
+ readonly description: "Validate the generic JSON shape of a repository rules.json file.";
11
+ }];
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;EASiB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export const CAPABILITIES = [
2
+ {
3
+ id: 'rules.config.validate',
4
+ owner: '@ankhorage/rules',
5
+ access: ['invoke'],
6
+ binding: { kind: 'action', bindableAs: ['target'] },
7
+ label: 'Validate rules configuration',
8
+ description: 'Validate the generic JSON shape of a repository rules.json file.',
9
+ },
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,kBAAkB;QACzB,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,kEAAkE;KAChF;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capabilities';\n\nexport const CAPABILITIES = [\n {\n id: 'rules.config.validate',\n owner: '@ankhorage/rules',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Validate rules configuration',\n description: 'Validate the generic JSON shape of a repository rules.json file.',\n },\n] as const satisfies readonly Capability[];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createRulesRuntimeProvider.d.ts","sourceRoot":"","sources":["../../src/cli/createRulesRuntimeProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AASlE,wFAAwF;AACxF,wBAAgB,0BAA0B,IAAI,0BAA0B,CAwBvE"}
1
+ {"version":3,"file":"createRulesRuntimeProvider.d.ts","sourceRoot":"","sources":["../../src/cli/createRulesRuntimeProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAOlE,wFAAwF;AACxF,wBAAgB,0BAA0B,IAAI,0BAA0B,CAwBvE"}
@@ -1,4 +1,5 @@
1
- import { RULES_CAPABILITIES, RULES_COMMAND_CATEGORY, RULES_PACKAGE_VERSION, } from '../constants/rules.js';
1
+ import { CAPABILITIES } from '../capabilities/index.js';
2
+ import { RULES_COMMAND_CATEGORY, RULES_PACKAGE_VERSION } from '../constants/rules.js';
2
3
  import { validate } from './commands/config/validate.js';
3
4
  /*** Create the Ankh provider that registers the generic Rules configuration command. */
4
5
  export function createRulesRuntimeProvider() {
@@ -6,11 +7,11 @@ export function createRulesRuntimeProvider() {
6
7
  id: '@ankhorage/rules',
7
8
  category: RULES_COMMAND_CATEGORY,
8
9
  version: RULES_PACKAGE_VERSION,
9
- capabilities: [...RULES_CAPABILITIES],
10
+ capabilities: CAPABILITIES,
10
11
  commands: [
11
12
  {
12
13
  path: ['config', 'validate'],
13
- capability: RULES_CAPABILITIES[0],
14
+ capability: 'rules.config.validate',
14
15
  summary: 'Validate the generic JSON shape of a repository rules.json file.',
15
16
  },
16
17
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"createRulesRuntimeProvider.js","sourceRoot":"","sources":["../../src/cli/createRulesRuntimeProvider.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,wFAAwF;AACxF,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,qBAAqB;QAC9B,YAAY,EAAE,CAAC,GAAG,kBAAkB,CAAC;QACrC,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;gBAC5B,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC;gBACjC,OAAO,EAAE,kEAAkE;aAC5E;SACF;QACD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;gBAC5B,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;oBACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;oBACjD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACvC,CAAC;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';\n\nimport {\n RULES_CAPABILITIES,\n RULES_COMMAND_CATEGORY,\n RULES_PACKAGE_VERSION,\n} from '../constants/rules.js';\nimport { validate } from './commands/config/validate.js';\n\n/*** Create the Ankh provider that registers the generic Rules configuration command. */\nexport function createRulesRuntimeProvider(): AnkhRuntimeCommandProvider {\n return {\n id: '@ankhorage/rules',\n category: RULES_COMMAND_CATEGORY,\n version: RULES_PACKAGE_VERSION,\n capabilities: [...RULES_CAPABILITIES],\n commands: [\n {\n path: ['config', 'validate'],\n capability: RULES_CAPABILITIES[0],\n summary: 'Validate the generic JSON shape of a repository rules.json file.',\n },\n ],\n handlers: [\n {\n path: ['config', 'validate'],\n handler: async ({ argv, context }) => {\n const result = await validate(argv, context.cwd);\n context.writeStdout(result.stdout);\n return { exitCode: result.exitCode };\n },\n },\n ],\n };\n}\n"]}
1
+ {"version":3,"file":"createRulesRuntimeProvider.js","sourceRoot":"","sources":["../../src/cli/createRulesRuntimeProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,wFAAwF;AACxF,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,qBAAqB;QAC9B,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;gBAC5B,UAAU,EAAE,uBAAkD;gBAC9D,OAAO,EAAE,kEAAkE;aAC5E;SACF;QACD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;gBAC5B,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;oBACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;oBACjD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACvC,CAAC;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';\nimport type { Capability } from '@ankhorage/contracts/capabilities';\n\nimport { CAPABILITIES } from '../capabilities/index.js';\nimport { RULES_COMMAND_CATEGORY, RULES_PACKAGE_VERSION } from '../constants/rules.js';\nimport { validate } from './commands/config/validate.js';\n\n/*** Create the Ankh provider that registers the generic Rules configuration command. */\nexport function createRulesRuntimeProvider(): AnkhRuntimeCommandProvider {\n return {\n id: '@ankhorage/rules',\n category: RULES_COMMAND_CATEGORY,\n version: RULES_PACKAGE_VERSION,\n capabilities: CAPABILITIES,\n commands: [\n {\n path: ['config', 'validate'],\n capability: 'rules.config.validate' satisfies Capability['id'],\n summary: 'Validate the generic JSON shape of a repository rules.json file.',\n },\n ],\n handlers: [\n {\n path: ['config', 'validate'],\n handler: async ({ argv, context }) => {\n const result = await validate(argv, context.cwd);\n context.writeStdout(result.stdout);\n return { exitCode: result.exitCode };\n },\n },\n ],\n };\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  /*** Package-wide Rules metadata used by CLI delivery edges. */
2
2
  export declare const RULES_COMMAND_CATEGORY = "rules";
3
- export declare const RULES_CAPABILITIES: readonly ["rules.config.validate"];
4
3
  export declare const RULES_PACKAGE_VERSION: string;
5
4
  //# sourceMappingURL=rules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/constants/rules.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAC9C,eAAO,MAAM,kBAAkB,oCAAqC,CAAC;AACrE,eAAO,MAAM,qBAAqB,QAAsB,CAAC"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/constants/rules.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAC9C,eAAO,MAAM,qBAAqB,QAAsB,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import packageJson from '../../package.json';
2
2
  /*** Package-wide Rules metadata used by CLI delivery edges. */
3
3
  export const RULES_COMMAND_CATEGORY = 'rules';
4
- export const RULES_CAPABILITIES = ['rules.config.validate'];
5
4
  export const RULES_PACKAGE_VERSION = packageJson.version;
6
5
  //# sourceMappingURL=rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/constants/rules.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,uBAAuB,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC","sourcesContent":["import packageJson from '../../package.json';\n\n/*** Package-wide Rules metadata used by CLI delivery edges. */\nexport const RULES_COMMAND_CATEGORY = 'rules';\nexport const RULES_CAPABILITIES = ['rules.config.validate'] as const;\nexport const RULES_PACKAGE_VERSION = packageJson.version;\n"]}
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/constants/rules.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC","sourcesContent":["import packageJson from '../../package.json';\n\n/*** Package-wide Rules metadata used by CLI delivery edges. */\nexport const RULES_COMMAND_CATEGORY = 'rules';\nexport const RULES_PACKAGE_VERSION = packageJson.version;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/rules",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Domain-agnostic rule engine and JSON configuration for Ankhorage.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,7 +33,11 @@
33
33
  "types": "./dist/cli/index.d.ts",
34
34
  "import": "./dist/cli/index.js"
35
35
  },
36
- "./package.json": "./package.json"
36
+ "./package.json": "./package.json",
37
+ "./capabilities": {
38
+ "types": "./dist/capabilities/index.d.ts",
39
+ "import": "./dist/capabilities/index.js"
40
+ }
37
41
  },
38
42
  "bin": {
39
43
  "ankhorage-rules": "./dist/cli/standalone.js"
@@ -42,11 +46,24 @@
42
46
  "category": "rules",
43
47
  "provider": "./dist/cli/index.js",
44
48
  "capabilities": [
45
- "rules.config.validate"
49
+ {
50
+ "id": "rules.config.validate",
51
+ "owner": "@ankhorage/rules",
52
+ "access": [
53
+ "invoke"
54
+ ],
55
+ "binding": {
56
+ "kind": "action",
57
+ "bindableAs": [
58
+ "target"
59
+ ]
60
+ },
61
+ "label": "Validate rules configuration",
62
+ "description": "Validate the generic JSON shape of a repository rules.json file."
63
+ }
46
64
  ]
47
65
  },
48
66
  "devDependencies": {
49
- "@ankhorage/ankh": "^0.10.4",
50
67
  "@ankhorage/devtools": "^2.0.8",
51
68
  "@ankhorage/paradox": "^0.2.6",
52
69
  "@types/bun": "^1.4.2",
@@ -54,6 +71,8 @@
54
71
  "typescript": "~6.0.3"
55
72
  },
56
73
  "dependencies": {
74
+ "@ankhorage/ankh": "^0.12.0",
75
+ "@ankhorage/contracts": "^24.1.0",
57
76
  "@ankhorage/utility": "^1.9.0"
58
77
  },
59
78
  "packageManager": "bun@1.4.2",