@empire-builder-kit/nx 1.0.0-beta.4 → 1.0.0-beta.6

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.
Files changed (72) hide show
  1. package/README.md +13 -4
  2. package/executors.json +20 -0
  3. package/generators.json +5 -0
  4. package/package.json +15 -1
  5. package/src/executors/deployment-plan/deployment-plan.d.ts +9 -0
  6. package/src/executors/deployment-plan/deployment-plan.js +50 -0
  7. package/src/executors/deployment-plan/deployment-plan.js.map +1 -0
  8. package/src/executors/deployment-plan/schema.json +24 -0
  9. package/src/executors/foundation-preflight/foundation-preflight.js +22 -0
  10. package/src/executors/foundation-preflight/foundation-preflight.js.map +1 -1
  11. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +8 -0
  12. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +41 -0
  13. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js.map +1 -0
  14. package/src/executors/foundation-profile-preflight/schema.json +21 -0
  15. package/src/executors/github-bootstrap/github-bootstrap.d.ts +8 -0
  16. package/src/executors/github-bootstrap/github-bootstrap.js +27 -0
  17. package/src/executors/github-bootstrap/github-bootstrap.js.map +1 -0
  18. package/src/executors/github-bootstrap/schema.json +25 -0
  19. package/src/executors/sst-lifecycle/run-sst-command.d.ts +2 -0
  20. package/src/executors/sst-lifecycle/run-sst-command.js +58 -5
  21. package/src/executors/sst-lifecycle/run-sst-command.js.map +1 -1
  22. package/src/executors/work-markers/schema.json +14 -0
  23. package/src/executors/work-markers/work-markers.d.ts +6 -0
  24. package/src/executors/work-markers/work-markers.js +20 -0
  25. package/src/executors/work-markers/work-markers.js.map +1 -0
  26. package/src/generators/preset/workspace-files.d.ts +1 -1
  27. package/src/generators/preset/workspace-files.js +702 -38
  28. package/src/generators/preset/workspace-files.js.map +1 -1
  29. package/src/generators/repository-policy/repository-policy.d.ts +4 -0
  30. package/src/generators/repository-policy/repository-policy.js +55 -0
  31. package/src/generators/repository-policy/repository-policy.js.map +1 -0
  32. package/src/generators/repository-policy/schema.d.ts +16 -0
  33. package/src/generators/repository-policy/schema.json +41 -0
  34. package/src/generators/slice/slice.js +22 -0
  35. package/src/generators/slice/slice.js.map +1 -1
  36. package/src/git-policy/action-pins.d.ts +28 -0
  37. package/src/git-policy/action-pins.js +35 -0
  38. package/src/git-policy/action-pins.js.map +1 -0
  39. package/src/git-policy/github-bootstrap.d.ts +20 -0
  40. package/src/git-policy/github-bootstrap.js +676 -0
  41. package/src/git-policy/github-bootstrap.js.map +1 -0
  42. package/src/git-policy/index.d.ts +3 -0
  43. package/src/git-policy/index.js +7 -0
  44. package/src/git-policy/index.js.map +1 -0
  45. package/src/git-policy/routing.d.ts +15 -0
  46. package/src/git-policy/routing.js +77 -0
  47. package/src/git-policy/routing.js.map +1 -0
  48. package/src/index.d.ts +3 -0
  49. package/src/index.js +3 -0
  50. package/src/index.js.map +1 -1
  51. package/src/repository-policy/aurora-preflight.d.ts +15 -0
  52. package/src/repository-policy/aurora-preflight.js +45 -0
  53. package/src/repository-policy/aurora-preflight.js.map +1 -0
  54. package/src/repository-policy/deployment-plan.d.ts +24 -0
  55. package/src/repository-policy/deployment-plan.js +124 -0
  56. package/src/repository-policy/deployment-plan.js.map +1 -0
  57. package/src/repository-policy/foundation-profile.d.ts +20 -0
  58. package/src/repository-policy/foundation-profile.js +45 -0
  59. package/src/repository-policy/foundation-profile.js.map +1 -0
  60. package/src/repository-policy/index.d.ts +4 -0
  61. package/src/repository-policy/index.js +8 -0
  62. package/src/repository-policy/index.js.map +1 -0
  63. package/src/repository-policy/policy.d.ts +53 -0
  64. package/src/repository-policy/policy.js +250 -0
  65. package/src/repository-policy/policy.js.map +1 -0
  66. package/src/schemas/repository-policy-v1.json +42 -0
  67. package/src/work-markers/index.d.ts +1 -0
  68. package/src/work-markers/index.js +5 -0
  69. package/src/work-markers/index.js.map +1 -0
  70. package/src/work-markers/work-markers.d.ts +39 -0
  71. package/src/work-markers/work-markers.js +359 -0
  72. package/src/work-markers/work-markers.js.map +1 -0
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REPOSITORY_MODE_PRESETS = exports.SLICE_PRODUCTION_STATUSES = exports.DEFAULT_RECOVERY_PRODUCTION_FOUNDATION_PROFILE = exports.PRODUCTION_FOUNDATION_PROFILES = exports.PRODUCTION_ACCESS_VALUES = exports.REPOSITORY_POLICY_SCHEMA_URL = exports.REPOSITORY_POLICY_SCHEMA_VERSION = exports.REPOSITORY_POLICY_FILE = void 0;
4
+ exports.validateRepositoryOperatingPolicy = validateRepositoryOperatingPolicy;
5
+ exports.formatRepositoryPolicyIssues = formatRepositoryPolicyIssues;
6
+ exports.parseRepositoryOperatingPolicy = parseRepositoryOperatingPolicy;
7
+ exports.readRepositoryOperatingPolicy = readRepositoryOperatingPolicy;
8
+ exports.createIncubationRepositoryPolicy = createIncubationRepositoryPolicy;
9
+ exports.applyRepositoryPolicyChange = applyRepositoryPolicyChange;
10
+ exports.evaluateRepositoryPolicyRequest = evaluateRepositoryPolicyRequest;
11
+ exports.assertRepositoryPolicyRequest = assertRepositoryPolicyRequest;
12
+ const node_fs_1 = require("node:fs");
13
+ const node_path_1 = require("node:path");
14
+ const validation_js_1 = require("../validation.js");
15
+ exports.REPOSITORY_POLICY_FILE = 'ebk.repository-policy.json';
16
+ exports.REPOSITORY_POLICY_SCHEMA_VERSION = 1;
17
+ exports.REPOSITORY_POLICY_SCHEMA_URL = './node_modules/@empire-builder-kit/nx/schemas/repository-policy-v1.json';
18
+ exports.PRODUCTION_ACCESS_VALUES = ['disabled', 'controlled'];
19
+ exports.PRODUCTION_FOUNDATION_PROFILES = [
20
+ 'cost-optimized',
21
+ 'standard',
22
+ ];
23
+ exports.DEFAULT_RECOVERY_PRODUCTION_FOUNDATION_PROFILE = 'standard';
24
+ exports.SLICE_PRODUCTION_STATUSES = ['blocked', 'pilot', 'ready'];
25
+ exports.REPOSITORY_MODE_PRESETS = [
26
+ 'incubation',
27
+ 'controlled-production',
28
+ 'operational',
29
+ ];
30
+ const SLICE_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
31
+ const POLICY_PROPERTIES = new Set([
32
+ '$schema',
33
+ 'productionAccess',
34
+ 'productionFoundation',
35
+ 'schemaVersion',
36
+ 'slices',
37
+ ]);
38
+ function rejectUnknownProperties(value, allowed, path, issues) {
39
+ for (const property of Object.keys(value)) {
40
+ if (!allowed.has(property)) {
41
+ issues.push({
42
+ message: 'is not an allowed property',
43
+ path: `${path}.${property}`,
44
+ });
45
+ }
46
+ }
47
+ }
48
+ function isOneOf(value, values) {
49
+ return typeof value === 'string' && values.includes(value);
50
+ }
51
+ function validateRepositoryOperatingPolicy(value) {
52
+ if (!(0, validation_js_1.isRecord)(value)) {
53
+ return {
54
+ issues: [{ message: 'must be an object', path: 'policy' }],
55
+ valid: false,
56
+ };
57
+ }
58
+ const issues = [];
59
+ rejectUnknownProperties(value, POLICY_PROPERTIES, 'policy', issues);
60
+ if (value.schemaVersion !== exports.REPOSITORY_POLICY_SCHEMA_VERSION) {
61
+ issues.push({ message: 'must equal 1', path: 'policy.schemaVersion' });
62
+ }
63
+ if (value.$schema !== undefined &&
64
+ (typeof value.$schema !== 'string' || value.$schema.trim() === '')) {
65
+ issues.push({
66
+ message: 'must be a non-empty string',
67
+ path: 'policy.$schema',
68
+ });
69
+ }
70
+ if (!isOneOf(value.productionAccess, exports.PRODUCTION_ACCESS_VALUES)) {
71
+ issues.push({
72
+ message: `must equal ${exports.PRODUCTION_ACCESS_VALUES.join(' or ')}`,
73
+ path: 'policy.productionAccess',
74
+ });
75
+ }
76
+ if (value.productionFoundation !== undefined) {
77
+ if (!(0, validation_js_1.isRecord)(value.productionFoundation)) {
78
+ issues.push({
79
+ message: 'must be an object',
80
+ path: 'policy.productionFoundation',
81
+ });
82
+ }
83
+ else {
84
+ rejectUnknownProperties(value.productionFoundation, new Set(['profile']), 'policy.productionFoundation', issues);
85
+ if (!isOneOf(value.productionFoundation.profile, exports.PRODUCTION_FOUNDATION_PROFILES)) {
86
+ issues.push({
87
+ message: `must equal ${exports.PRODUCTION_FOUNDATION_PROFILES.join(' or ')}`,
88
+ path: 'policy.productionFoundation.profile',
89
+ });
90
+ }
91
+ }
92
+ }
93
+ if (!(0, validation_js_1.isRecord)(value.slices)) {
94
+ issues.push({ message: 'must be an object', path: 'policy.slices' });
95
+ }
96
+ else {
97
+ for (const [slice, entry] of Object.entries(value.slices)) {
98
+ const path = `policy.slices.${slice}`;
99
+ if (!SLICE_NAME_PATTERN.test(slice)) {
100
+ issues.push({
101
+ message: 'name must use lowercase letters, numbers, and hyphens',
102
+ path,
103
+ });
104
+ }
105
+ if (!(0, validation_js_1.isRecord)(entry)) {
106
+ issues.push({ message: 'must be an object', path });
107
+ continue;
108
+ }
109
+ rejectUnknownProperties(entry, new Set(['productionStatus']), path, issues);
110
+ if (!isOneOf(entry.productionStatus, exports.SLICE_PRODUCTION_STATUSES)) {
111
+ issues.push({
112
+ message: `must equal ${exports.SLICE_PRODUCTION_STATUSES.join(', ')}`,
113
+ path: `${path}.productionStatus`,
114
+ });
115
+ }
116
+ }
117
+ }
118
+ return (0, validation_js_1.validationResult)(value, issues);
119
+ }
120
+ function formatRepositoryPolicyIssues(issues) {
121
+ return issues.map(({ message, path }) => `- ${path}: ${message}`).join('\n');
122
+ }
123
+ function parseRepositoryOperatingPolicy(contents, source = exports.REPOSITORY_POLICY_FILE) {
124
+ let value;
125
+ try {
126
+ value = JSON.parse(contents);
127
+ }
128
+ catch (error) {
129
+ throw new Error(`Repository Operating Policy at ${source} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
130
+ }
131
+ const result = validateRepositoryOperatingPolicy(value);
132
+ if (!result.valid) {
133
+ throw new Error(`Repository Operating Policy at ${source} is invalid:\n${formatRepositoryPolicyIssues(result.issues)}`);
134
+ }
135
+ return result.value;
136
+ }
137
+ function readRepositoryOperatingPolicy(workspaceRoot) {
138
+ const path = (0, node_path_1.join)(workspaceRoot, exports.REPOSITORY_POLICY_FILE);
139
+ let contents;
140
+ try {
141
+ contents = (0, node_fs_1.readFileSync)(path, 'utf8');
142
+ }
143
+ catch (error) {
144
+ throw new Error(`Repository Operating Policy is required at ${path}: ${error instanceof Error ? error.message : String(error)}`);
145
+ }
146
+ return parseRepositoryOperatingPolicy(contents, path);
147
+ }
148
+ function createIncubationRepositoryPolicy() {
149
+ return {
150
+ $schema: exports.REPOSITORY_POLICY_SCHEMA_URL,
151
+ productionAccess: 'disabled',
152
+ productionFoundation: {
153
+ profile: exports.DEFAULT_RECOVERY_PRODUCTION_FOUNDATION_PROFILE,
154
+ },
155
+ schemaVersion: exports.REPOSITORY_POLICY_SCHEMA_VERSION,
156
+ slices: {},
157
+ };
158
+ }
159
+ function applyRepositoryPolicyChange(current, change) {
160
+ const next = structuredClone(current);
161
+ if (change.preset === 'incubation') {
162
+ next.productionAccess = 'disabled';
163
+ next.productionFoundation ??= {
164
+ profile: exports.DEFAULT_RECOVERY_PRODUCTION_FOUNDATION_PROFILE,
165
+ };
166
+ for (const entry of Object.values(next.slices)) {
167
+ entry.productionStatus = 'blocked';
168
+ }
169
+ }
170
+ else if (change.preset === 'controlled-production') {
171
+ next.productionAccess = 'controlled';
172
+ next.productionFoundation = { profile: 'cost-optimized' };
173
+ }
174
+ else if (change.preset === 'operational') {
175
+ next.productionAccess = 'controlled';
176
+ next.productionFoundation = { profile: 'standard' };
177
+ }
178
+ if (change.productionAccess !== undefined) {
179
+ next.productionAccess = change.productionAccess;
180
+ }
181
+ if (change.productionFoundationProfile !== undefined) {
182
+ next.productionFoundation = {
183
+ profile: change.productionFoundationProfile,
184
+ };
185
+ }
186
+ for (const [slice, productionStatus] of Object.entries(change.slices ?? {})) {
187
+ if (!SLICE_NAME_PATTERN.test(slice)) {
188
+ throw new Error(`Product Slice name ${slice} must use lowercase letters, numbers, and hyphens.`);
189
+ }
190
+ next.slices[slice] = { productionStatus };
191
+ }
192
+ const result = validateRepositoryOperatingPolicy(next);
193
+ if (!result.valid) {
194
+ throw new Error(`Repository Operating Policy change is invalid:\n${formatRepositoryPolicyIssues(result.issues)}`);
195
+ }
196
+ return result.value;
197
+ }
198
+ function evaluateRepositoryPolicyRequest(policy, request) {
199
+ const reasons = [];
200
+ const projectNames = new Set();
201
+ for (const project of request.projects) {
202
+ if (projectNames.has(project.name)) {
203
+ reasons.push(`Project ${project.name} is selected more than once.`);
204
+ }
205
+ projectNames.add(project.name);
206
+ }
207
+ if (request.stage !== 'production') {
208
+ return { allowed: reasons.length === 0, reasons };
209
+ }
210
+ if (request.action === 'dev') {
211
+ reasons.push('Production development mode is prohibited.');
212
+ }
213
+ // Removal and unlock are dedicated protected recovery paths. The policy must
214
+ // still parse, but a blocked or disabled posture must not strand resources.
215
+ const recoveryAction = request.action === 'remove' || request.action === 'unlock';
216
+ if (!recoveryAction && policy.productionAccess !== 'controlled') {
217
+ reasons.push('Repository production access is disabled.');
218
+ }
219
+ const configuredProfile = policy.productionFoundation?.profile;
220
+ const profile = recoveryAction
221
+ ? (configuredProfile ?? exports.DEFAULT_RECOVERY_PRODUCTION_FOUNDATION_PROFILE)
222
+ : configuredProfile;
223
+ if (!recoveryAction && !profile) {
224
+ reasons.push('Production Foundation profile is not explicitly configured.');
225
+ }
226
+ if (!recoveryAction) {
227
+ for (const project of request.projects) {
228
+ if (project.kind !== 'slice')
229
+ continue;
230
+ const status = policy.slices[project.name]?.productionStatus ?? 'blocked';
231
+ if (status === 'blocked') {
232
+ reasons.push(`Product Slice ${project.name} is blocked for production deployment.`);
233
+ }
234
+ }
235
+ }
236
+ return {
237
+ allowed: reasons.length === 0,
238
+ ...(profile ? { effectiveProductionProfile: profile } : {}),
239
+ reasons,
240
+ };
241
+ }
242
+ function assertRepositoryPolicyRequest(workspaceRoot, request) {
243
+ const policy = readRepositoryOperatingPolicy(workspaceRoot);
244
+ const decision = evaluateRepositoryPolicyRequest(policy, request);
245
+ if (!decision.allowed) {
246
+ throw new Error(`Repository Operating Policy rejected ${request.action} for ${request.stage}:\n${decision.reasons.map((reason) => `- ${reason}`).join('\n')}`);
247
+ }
248
+ return decision;
249
+ }
250
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../../../packages/nx/src/repository-policy/policy.ts"],"names":[],"mappings":";;;AA4GA,8EA0FC;AAED,oEAIC;AAED,wEAmBC;AAED,sEAaC;AAED,4EAUC;AAED,kEA6CC;AAED,0EAqDC;AAED,sEAYC;AAhXD,qCAAuC;AACvC,yCAAiC;AACjC,oDAK0B;AAEb,QAAA,sBAAsB,GAAG,4BAAqC,CAAC;AAC/D,QAAA,gCAAgC,GAAG,CAAU,CAAC;AAC9C,QAAA,4BAA4B,GACvC,yEAAkF,CAAC;AAExE,QAAA,wBAAwB,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC;AAC/D,QAAA,8BAA8B,GAAG;IAC5C,gBAAgB;IAChB,UAAU;CACF,CAAC;AACE,QAAA,8CAA8C,GACzD,UAAmB,CAAC;AACT,QAAA,yBAAyB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AACnE,QAAA,uBAAuB,GAAG;IACrC,YAAY;IACZ,uBAAuB;IACvB,aAAa;CACL,CAAC;AAkDX,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,SAAS;IACT,kBAAkB;IAClB,sBAAsB;IACtB,eAAe;IACf,QAAQ;CACT,CAAC,CAAC;AAEH,SAAS,uBAAuB,CAC9B,KAA8B,EAC9B,OAA4B,EAC5B,IAAY,EACZ,MAAyB;IAEzB,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3B,MAAM,CAAC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GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC9I,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://empirebuilderkit.dev/schemas/repository-policy-v1.json",
4
+ "title": "Empire Builder Kit repository operating policy v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "productionAccess", "slices"],
8
+ "properties": {
9
+ "$schema": { "type": "string", "minLength": 1 },
10
+ "schemaVersion": { "const": 1 },
11
+ "productionAccess": {
12
+ "type": "string",
13
+ "enum": ["disabled", "controlled"]
14
+ },
15
+ "productionFoundation": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["profile"],
19
+ "properties": {
20
+ "profile": {
21
+ "type": "string",
22
+ "enum": ["cost-optimized", "standard"]
23
+ }
24
+ }
25
+ },
26
+ "slices": {
27
+ "type": "object",
28
+ "propertyNames": { "pattern": "^[a-z0-9][a-z0-9-]*$" },
29
+ "additionalProperties": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["productionStatus"],
33
+ "properties": {
34
+ "productionStatus": {
35
+ "type": "string",
36
+ "enum": ["blocked", "pilot", "ready"]
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1 @@
1
+ export * from './work-markers.js';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./work-markers.js"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/nx/src/work-markers/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -0,0 +1,39 @@
1
+ import { type GeneratedPathMode } from '../ownership/index.js';
2
+ export declare const WORK_MARKER_KINDS: readonly ["TODO", "ASSUMPTION", "QUESTION", "SECURITY", "BLOCKER"];
3
+ export type WorkMarkerKind = (typeof WORK_MARKER_KINDS)[number];
4
+ export type WorkMarkerOwnership = GeneratedPathMode | 'user-owned';
5
+ export type WorkMarkerCommentPrefix = '//' | '#' | '--' | '/*' | '<!--';
6
+ export interface WorkMarkerCommentInput {
7
+ commentPrefix?: WorkMarkerCommentPrefix;
8
+ description: string;
9
+ kind: WorkMarkerKind;
10
+ reference: string;
11
+ }
12
+ export interface WorkMarker {
13
+ description: string;
14
+ kind: WorkMarkerKind;
15
+ line: number;
16
+ ownership: WorkMarkerOwnership;
17
+ path: string;
18
+ reference: string;
19
+ }
20
+ export type WorkMarkerIssueCode = 'invalid-marker-syntax' | 'invalid-ownership-record' | 'managed-file-marker' | 'ownership-conflict' | 'unreadable-path' | 'unknown-marker-kind';
21
+ export interface WorkMarkerIssue {
22
+ code: WorkMarkerIssueCode;
23
+ line: number;
24
+ message: string;
25
+ path: string;
26
+ }
27
+ export interface WorkMarkerReport {
28
+ blockingMarkers: WorkMarker[];
29
+ issues: WorkMarkerIssue[];
30
+ markers: WorkMarker[];
31
+ root: string;
32
+ }
33
+ export interface WorkMarkerAssertionOptions {
34
+ protectedPromotion?: boolean;
35
+ }
36
+ export declare function scanWorkMarkers(root: string): WorkMarkerReport;
37
+ export declare function formatWorkMarkerComment(input: WorkMarkerCommentInput): string;
38
+ export declare function formatWorkMarkerReport(report: WorkMarkerReport): string;
39
+ export declare function assertWorkMarkerReport(report: WorkMarkerReport, options?: WorkMarkerAssertionOptions): void;