declastruct 1.3.1 → 1.4.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/dist/contract/cli/apply.js +4 -3
- package/dist/contract/cli/apply.js.map +1 -1
- package/dist/contract/cli/plan.js +4 -3
- package/dist/contract/cli/plan.js.map +1 -1
- package/dist/contract/sdk/index.d.ts +3 -3
- package/dist/contract/sdk/index.js +4 -3
- package/dist/contract/sdk/index.js.map +1 -1
- package/dist/domain/constants.d.ts +3 -0
- package/dist/domain/constants.js +5 -0
- package/dist/domain/constants.js.map +1 -0
- package/dist/domain.objects/DeclastructDao.d.ts +1 -1
- package/dist/domain.objects/DeclastructPlan.d.ts +2 -2
- package/dist/domain.objects/DeclastructProvider.d.ts +1 -1
- package/dist/domain.objects/DeclastructProvider.js.map +1 -1
- package/dist/domain.operations/apply/applyChange.d.ts +3 -3
- package/dist/domain.operations/apply/applyChanges.d.ts +6 -6
- package/dist/domain.operations/apply/applyChanges.js +24 -14
- package/dist/domain.operations/apply/applyChanges.js.map +1 -1
- package/dist/domain.operations/plan/computeChange.d.ts +1 -1
- package/dist/domain.operations/plan/extractResourcesFromPlan.d.ts +2 -2
- package/dist/domain.operations/plan/getDaoByResource.d.ts +3 -3
- package/dist/domain.operations/plan/getDisplayableDiff.d.ts +1 -1
- package/dist/domain.operations/plan/getDisplayableDiff.js.map +1 -1
- package/dist/domain.operations/plan/hashChanges.d.ts +1 -1
- package/dist/domain.operations/plan/planChanges.d.ts +4 -4
- package/dist/domain.operations/plan/planChanges.js +40 -23
- package/dist/domain.operations/plan/planChanges.js.map +1 -1
- package/dist/domain.operations/plan/validate.d.ts +1 -1
- package/dist/infra/asIsoTimestamp.d.ts +1 -1
- package/dist/infra/colorizeAction.d.ts +7 -0
- package/dist/infra/colorizeAction.js +31 -0
- package/dist/infra/colorizeAction.js.map +1 -0
- package/dist/infra/withSpinner.d.ts +12 -0
- package/dist/infra/withSpinner.js +90 -0
- package/dist/infra/withSpinner.js.map +1 -0
- package/package.json +26 -33
|
@@ -77,6 +77,7 @@ const executeApplyCommand = async (input) => {
|
|
|
77
77
|
if (!(0, fs_1.existsSync)(resolvedWishPath))
|
|
78
78
|
throw new helpful_errors_1.BadRequestError(`Wish file not found: ${resolvedWishPath}`);
|
|
79
79
|
// log header
|
|
80
|
+
log.info('');
|
|
80
81
|
log.info('🌊 declastruct apply');
|
|
81
82
|
if (resolvedPlanPath)
|
|
82
83
|
log.info(` plan: ${resolvedPlanPath}`);
|
|
@@ -93,7 +94,7 @@ const executeApplyCommand = async (input) => {
|
|
|
93
94
|
const resources = await wish.getResources();
|
|
94
95
|
const providers = await wish.getProviders();
|
|
95
96
|
// initialize providers
|
|
96
|
-
log.info('✨ start providers...');
|
|
97
|
+
// log.info('✨ start providers...');
|
|
97
98
|
await Promise.all(providers.map((p) => p.hooks.beforeAll()));
|
|
98
99
|
// create context
|
|
99
100
|
const context = {
|
|
@@ -107,8 +108,8 @@ const executeApplyCommand = async (input) => {
|
|
|
107
108
|
providers,
|
|
108
109
|
}, context);
|
|
109
110
|
// cleanup providers
|
|
110
|
-
log.info('');
|
|
111
|
-
log.info('✨ stop providers...');
|
|
111
|
+
// log.info('');
|
|
112
|
+
// log.info('✨ stop providers...');
|
|
112
113
|
await Promise.all(providers.map((p) => p.hooks.afterAll()));
|
|
113
114
|
// log summary
|
|
114
115
|
log.info('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/contract/cli/apply.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAAoC;AACpC,2BAAgC;AAChC,0CAAuC;AACvC,mDAAiD;AACjD,+BAA+B;AAE/B,0EAAuE;AACvE,6EAA0E;AAE1E,MAAM,GAAG,GAAG,OAAO,CAAC;AAEpB;;;;;;GAMG;AACI,MAAM,mBAAmB,GAAG,KAAK,EAAE,KAGzC,EAAiB,EAAE;IAClB,oCAA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cAAc;IACd,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACb,GAAG,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,cAAc,CAAC,MAAM,UAAU,CAAC,CAAC;IAC/D,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACf,CAAC,CAAC;AAvFW,QAAA,mBAAmB,uBAuF9B"}
|
|
@@ -48,6 +48,7 @@ const executePlanCommand = async ({ wishFilePath, planFilePath, }) => {
|
|
|
48
48
|
if (!(0, fs_1.existsSync)(resolvedWishPath)) {
|
|
49
49
|
throw new helpful_errors_1.BadRequestError(`Wish file not found: ${resolvedWishPath}`);
|
|
50
50
|
}
|
|
51
|
+
log.info('');
|
|
51
52
|
log.info('🌊 declastruct plan');
|
|
52
53
|
log.info(` wish: ${resolvedWishPath}`);
|
|
53
54
|
log.info(` plan: ${resolvedPlanPath}`);
|
|
@@ -65,7 +66,7 @@ const executePlanCommand = async ({ wishFilePath, planFilePath, }) => {
|
|
|
65
66
|
const resources = await wish.getResources();
|
|
66
67
|
const providers = await wish.getProviders();
|
|
67
68
|
// initialize providers
|
|
68
|
-
log.info('✨ start providers...');
|
|
69
|
+
// log.info('✨ start providers...');
|
|
69
70
|
await Promise.all(providers.map((p) => p.hooks.beforeAll()));
|
|
70
71
|
// create context
|
|
71
72
|
const context = {
|
|
@@ -84,8 +85,8 @@ const executePlanCommand = async ({ wishFilePath, planFilePath, }) => {
|
|
|
84
85
|
// write plan to file
|
|
85
86
|
await (0, promises_1.writeFile)(resolvedPlanPath, JSON.stringify(plan, null, 2), 'utf-8');
|
|
86
87
|
// cleanup providers
|
|
87
|
-
log.info('');
|
|
88
|
-
log.info('✨ stop providers...');
|
|
88
|
+
// log.info('');
|
|
89
|
+
// log.info('✨ stop providers...');
|
|
89
90
|
await Promise.all(providers.map((p) => p.hooks.afterAll()));
|
|
90
91
|
// log summary
|
|
91
92
|
log.info('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAEjE,cAAc;IACd,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACb,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,OAAO,CAAC,MAAM,YAAY,CAAC,CAAC;IAC5D,GAAG,CAAC,IAAI,CAAC,WAAW,gBAAgB,EAAE,CAAC,CAAC;IACxC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACf,CAAC,CAAC;AA1EW,QAAA,kBAAkB,sBA0E7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { ContextDeclastruct } from '../../domain.objects/ContextDeclastruct';
|
|
2
2
|
export { DeclastructChange, DeclastructChangeAction, } from '../../domain.objects/DeclastructChange';
|
|
3
3
|
export { DeclastructDao } from '../../domain.objects/DeclastructDao';
|
|
4
|
-
export { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
5
4
|
export { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
6
|
-
export {
|
|
5
|
+
export { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
6
|
+
export type { IsoTimestamp } from '../../domain.objects/IsoTimestamp';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// domain objects
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
+
exports.DeclastructProvider = exports.DeclastructPlan = exports.DeclastructDao = exports.DeclastructChangeAction = exports.DeclastructChange = void 0;
|
|
4
5
|
var DeclastructChange_1 = require("../../domain.objects/DeclastructChange");
|
|
5
6
|
Object.defineProperty(exports, "DeclastructChange", { enumerable: true, get: function () { return DeclastructChange_1.DeclastructChange; } });
|
|
6
7
|
Object.defineProperty(exports, "DeclastructChangeAction", { enumerable: true, get: function () { return DeclastructChange_1.DeclastructChangeAction; } });
|
|
7
8
|
var DeclastructDao_1 = require("../../domain.objects/DeclastructDao");
|
|
8
9
|
Object.defineProperty(exports, "DeclastructDao", { enumerable: true, get: function () { return DeclastructDao_1.DeclastructDao; } });
|
|
9
|
-
var DeclastructProvider_1 = require("../../domain.objects/DeclastructProvider");
|
|
10
|
-
Object.defineProperty(exports, "DeclastructProvider", { enumerable: true, get: function () { return DeclastructProvider_1.DeclastructProvider; } });
|
|
11
10
|
var DeclastructPlan_1 = require("../../domain.objects/DeclastructPlan");
|
|
12
11
|
Object.defineProperty(exports, "DeclastructPlan", { enumerable: true, get: function () { return DeclastructPlan_1.DeclastructPlan; } });
|
|
12
|
+
var DeclastructProvider_1 = require("../../domain.objects/DeclastructProvider");
|
|
13
|
+
Object.defineProperty(exports, "DeclastructProvider", { enumerable: true, get: function () { return DeclastructProvider_1.DeclastructProvider; } });
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contract/sdk/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contract/sdk/index.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAGjB,4EAGgD;AAF9C,sHAAA,iBAAiB,OAAA;AACjB,4HAAA,uBAAuB,OAAA;AAEzB,sEAAqE;AAA5D,gHAAA,cAAc,OAAA;AACvB,wEAAuE;AAA9D,kHAAA,eAAe,OAAA;AACxB,gFAA+E;AAAtE,0HAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/domain/constants.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DomainEntity, DomainLiteral, type Ref, type Refable, type RefByPrimary, type RefByUnique } from 'domain-objects';
|
|
2
|
-
import {
|
|
2
|
+
import type { HasMetadata } from 'type-fns';
|
|
3
3
|
/**
|
|
4
4
|
* .what = standardized data access interface for any resource type
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DomainEntity } from 'domain-objects';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { DeclastructChange } from './DeclastructChange';
|
|
3
|
+
import type { IsoTimestamp } from './IsoTimestamp';
|
|
4
4
|
/**
|
|
5
5
|
* .what = collection of all planned changes required to fulfill a wish
|
|
6
6
|
* .why = enables review, version control, and validation of infrastructure changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DomainLiteral } from 'domain-objects';
|
|
2
|
-
import {
|
|
2
|
+
import type { DeclastructDao } from './DeclastructDao';
|
|
3
3
|
export type DeclastructDaosShape<TContext> = Record<string, DeclastructDao<any, any, TContext>>;
|
|
4
4
|
/**
|
|
5
5
|
* .what = bundles all DAOs and lifecycle hooks for a specific infrastructure provider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclastructProvider.js","sourceRoot":"","sources":["../../src/domain.objects/DeclastructProvider.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;
|
|
1
|
+
{"version":3,"file":"DeclastructProvider.js","sourceRoot":"","sources":["../../src/domain.objects/DeclastructProvider.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AA0C/C,MAAa,mBAKX,SAAQ,8BAA8D;CACT;AAN/D,kDAM+D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DomainEntity } from 'domain-objects';
|
|
2
|
-
import { DeclastructChange } from '../../domain.objects/DeclastructChange';
|
|
3
|
-
import { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
1
|
+
import type { DomainEntity } from 'domain-objects';
|
|
2
|
+
import { type DeclastructChange } from '../../domain.objects/DeclastructChange';
|
|
3
|
+
import type { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
4
4
|
/**
|
|
5
5
|
* .what = applies a single change to infrastructure
|
|
6
6
|
* .why = executes the actual infrastructure modification
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DomainEntity } from 'domain-objects';
|
|
2
|
-
import { ContextLogTrail } from 'simple-log-methods';
|
|
3
|
-
import { ContextDeclastruct } from '../../domain.objects/ContextDeclastruct';
|
|
4
|
-
import { DeclastructChange } from '../../domain.objects/DeclastructChange';
|
|
5
|
-
import { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
6
|
-
import { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
1
|
+
import { type DomainEntity } from 'domain-objects';
|
|
2
|
+
import type { ContextLogTrail } from 'simple-log-methods';
|
|
3
|
+
import type { ContextDeclastruct } from '../../domain.objects/ContextDeclastruct';
|
|
4
|
+
import { type DeclastructChange } from '../../domain.objects/DeclastructChange';
|
|
5
|
+
import type { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
6
|
+
import type { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
7
7
|
/**
|
|
8
8
|
* .what = applies changes to achieve desired state
|
|
9
9
|
* .why = executes infrastructure changes in a controlled, observable manner
|
|
@@ -4,6 +4,8 @@ exports.applyChanges = void 0;
|
|
|
4
4
|
const domain_objects_1 = require("domain-objects");
|
|
5
5
|
const helpful_errors_1 = require("helpful-errors");
|
|
6
6
|
const DeclastructChange_1 = require("../../domain.objects/DeclastructChange");
|
|
7
|
+
const colorizeAction_1 = require("../../infra/colorizeAction");
|
|
8
|
+
const withSpinner_1 = require("../../infra/withSpinner");
|
|
7
9
|
const planChanges_1 = require("../plan/planChanges");
|
|
8
10
|
const validate_1 = require("../plan/validate");
|
|
9
11
|
const applyChange_1 = require("./applyChange");
|
|
@@ -21,6 +23,13 @@ const applyChanges = async (input, context) => {
|
|
|
21
23
|
providers: input.providers,
|
|
22
24
|
wishFilePath: input.plan?.wish.uri ?? 'ignorable',
|
|
23
25
|
}, context);
|
|
26
|
+
// use current plan for apply (works for both modes)
|
|
27
|
+
const planToApply = currentPlan;
|
|
28
|
+
// check if there are any actionable changes (non-KEEP)
|
|
29
|
+
const hasActionableChanges = planToApply.changes.some((change) => change.action !== DeclastructChange_1.DeclastructChangeAction.KEEP);
|
|
30
|
+
// skip apply phase if everything is in sync
|
|
31
|
+
if (!hasActionableChanges)
|
|
32
|
+
return { appliedChanges: [] };
|
|
24
33
|
// validate plan matches current state (skip if no plan provided, i.e. yolo mode)
|
|
25
34
|
if (input.plan) {
|
|
26
35
|
(0, validate_1.assertPlanStillValid)({
|
|
@@ -32,10 +41,8 @@ const applyChanges = async (input, context) => {
|
|
|
32
41
|
}
|
|
33
42
|
else {
|
|
34
43
|
context.log.info('');
|
|
35
|
-
context.log.info('🤙 yolo, plan
|
|
44
|
+
context.log.info('🤙 yolo, plan auto approved...');
|
|
36
45
|
}
|
|
37
|
-
// use current plan for apply (works for both modes)
|
|
38
|
-
const planToApply = currentPlan;
|
|
39
46
|
// log apply phase header
|
|
40
47
|
context.log.info('');
|
|
41
48
|
context.log.info('🪄 apply changes...');
|
|
@@ -45,26 +52,29 @@ const applyChanges = async (input, context) => {
|
|
|
45
52
|
for (const change of planToApply.changes) {
|
|
46
53
|
// log KEEP actions and skip
|
|
47
54
|
if (change.action === DeclastructChange_1.DeclastructChangeAction.KEEP) {
|
|
48
|
-
context.log.info(`↓
|
|
55
|
+
context.log.info(`↓ ${(0, colorizeAction_1.colorizeAction)(change.action)} ${change.forResource.slug}`);
|
|
49
56
|
continue;
|
|
50
57
|
}
|
|
51
58
|
// find the desired resource
|
|
52
59
|
const resourceFound = input.resources.find((candidate) => candidate.constructor.name === change.forResource.class &&
|
|
53
60
|
(0, domain_objects_1.getUniqueIdentifierSlug)(candidate) === change.forResource.slug) ??
|
|
54
61
|
helpful_errors_1.UnexpectedCodePathError.throw('could not find resource specified in plan. was it removed?', { change });
|
|
55
|
-
// log action
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const applied = await (0,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
// log the action line (stays fixed)
|
|
63
|
+
const actionLabel = (0, colorizeAction_1.colorizeAction)(change.action);
|
|
64
|
+
context.log.info(`○ ${actionLabel} ${change.forResource.slug}`);
|
|
65
|
+
// apply the change with spinner on line below
|
|
66
|
+
const { result: applied, durationMs } = await (0, withSpinner_1.withSpinner)({
|
|
67
|
+
message: 'inflight',
|
|
68
|
+
operation: () => (0, applyChange_1.applyChange)({
|
|
69
|
+
change,
|
|
70
|
+
resource: resourceFound,
|
|
71
|
+
providers: input.providers,
|
|
72
|
+
}),
|
|
63
73
|
});
|
|
64
|
-
const durationMs = Date.now() - startMs;
|
|
65
74
|
// log completion with duration
|
|
66
75
|
const durationSec = (durationMs / 1000).toFixed(2);
|
|
67
|
-
context.log.info(` └─ ✔ done in ${durationSec}s
|
|
76
|
+
context.log.info(` └─ ✔ done in ${durationSec}s`);
|
|
77
|
+
context.log.info('');
|
|
68
78
|
appliedChanges.push(applied);
|
|
69
79
|
}
|
|
70
80
|
return { appliedChanges };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyChanges.js","sourceRoot":"","sources":["../../../src/domain.operations/apply/applyChanges.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"applyChanges.js","sourceRoot":"","sources":["../../../src/domain.operations/apply/applyChanges.ts"],"names":[],"mappings":";;;AAAA,mDAA4E;AAC5E,mDAAyD;AAIzD,8EAGgD;AAGhD,+DAA4D;AAC5D,yDAAsD;AACtD,qDAAkD;AAClD,+CAAwD;AACxD,+CAA4C;AAE5C;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,KAAK,EAC/B,KAIC,EACD,OAA6C,EACK,EAAE;IACpD,8BAA8B;IAC9B,MAAM,WAAW,GAAG,MAAM,IAAA,yBAAW,EACnC;QACE,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,YAAY,EAAE,KAAK,CAAC,IAAI,E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B,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAC5B,CAAC,CAAC;AA/FW,QAAA,YAAY,gBA+FvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DomainEntity } from 'domain-objects';
|
|
2
|
-
import { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
1
|
+
import type { DomainEntity } from 'domain-objects';
|
|
2
|
+
import type { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
3
3
|
/**
|
|
4
4
|
* .what = extracts resources from a plan's changes
|
|
5
5
|
* .why = needed for replanning during applyChanges
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DomainEntity } from 'domain-objects';
|
|
2
|
-
import { DeclastructDao } from '../../domain.objects/DeclastructDao';
|
|
3
|
-
import { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
1
|
+
import type { DomainEntity } from 'domain-objects';
|
|
2
|
+
import type { DeclastructDao } from '../../domain.objects/DeclastructDao';
|
|
3
|
+
import type { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
4
4
|
/**
|
|
5
5
|
* .what = gets the DAO and provider context for a given resource from available providers
|
|
6
6
|
* .why = enables automatic routing of operations to the correct provider with proper context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDisplayableDiff.js","sourceRoot":"","sources":["../../../src/domain.operations/plan/getDisplayableDiff.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"getDisplayableDiff.js","sourceRoot":"","sources":["../../../src/domain.operations/plan/getDisplayableDiff.ts"],"names":[],"mappings":";;;AAAA,mDAA4E;AAC5E,yCAAiC;AAEjC;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,EACjC,IAAI,EACJ,IAAI,GAIL,EAAiB,EAAE;IAClB,2BAA2B;IAC3B,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhD,4DAA4D;IA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B,CAAC,CAAC;AApCW,QAAA,kBAAkB,sBAoC7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeclastructChange } from '../../domain.objects/DeclastructChange';
|
|
1
|
+
import type { DeclastructChange } from '../../domain.objects/DeclastructChange';
|
|
2
2
|
/**
|
|
3
3
|
* .what = computes deterministic hash of changes
|
|
4
4
|
* .why = enables plan comparison and staleness detection
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DomainEntity } from 'domain-objects';
|
|
2
|
-
import { ContextLogTrail } from 'simple-log-methods';
|
|
3
|
-
import { ContextDeclastruct } from '../../domain.objects/ContextDeclastruct';
|
|
1
|
+
import { type DomainEntity } from 'domain-objects';
|
|
2
|
+
import type { ContextLogTrail } from 'simple-log-methods';
|
|
3
|
+
import type { ContextDeclastruct } from '../../domain.objects/ContextDeclastruct';
|
|
4
4
|
import { DeclastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
5
|
-
import { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
5
|
+
import type { DeclastructProvider } from '../../domain.objects/DeclastructProvider';
|
|
6
6
|
/**
|
|
7
7
|
* .what = generates a plan of changes required to achieve desired state
|
|
8
8
|
* .why = enables users to review infrastructure changes before applying them
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.planChanges = void 0;
|
|
4
|
+
const domain_objects_1 = require("domain-objects");
|
|
4
5
|
const DeclastructChange_1 = require("../../domain.objects/DeclastructChange");
|
|
5
6
|
const DeclastructPlan_1 = require("../../domain.objects/DeclastructPlan");
|
|
6
7
|
const asIsoTimestamp_1 = require("../../infra/asIsoTimestamp");
|
|
8
|
+
const colorizeAction_1 = require("../../infra/colorizeAction");
|
|
9
|
+
const withSpinner_1 = require("../../infra/withSpinner");
|
|
7
10
|
const computeChange_1 = require("./computeChange");
|
|
8
11
|
const getDaoByResource_1 = require("./getDaoByResource");
|
|
9
12
|
const hashChanges_1 = require("./hashChanges");
|
|
@@ -14,7 +17,6 @@ const hashChanges_1 = require("./hashChanges");
|
|
|
14
17
|
*/
|
|
15
18
|
const planChanges = async (input, context) => {
|
|
16
19
|
// log plan phase header
|
|
17
|
-
context.log.info('');
|
|
18
20
|
context.log.info('🔮 plan changes...');
|
|
19
21
|
context.log.info('');
|
|
20
22
|
// extract bottleneck for planning
|
|
@@ -22,29 +24,44 @@ const planChanges = async (input, context) => {
|
|
|
22
24
|
? context.bottleneck.onPlan
|
|
23
25
|
: context.bottleneck;
|
|
24
26
|
// compute change for each resource with real-time logging
|
|
25
|
-
const changes =
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
resource
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
const changes = [];
|
|
28
|
+
for (const resource of input.resources) {
|
|
29
|
+
const change = await bottleneck.schedule(async () => {
|
|
30
|
+
// find DAO and provider context for this resource
|
|
31
|
+
const { dao, context: providerContext } = (0, getDaoByResource_1.getDaoByResource)({
|
|
32
|
+
resource,
|
|
33
|
+
providers: input.providers,
|
|
34
|
+
});
|
|
35
|
+
// log the resource being planned
|
|
36
|
+
context.log.info(`○ ${(0, domain_objects_1.getUniqueIdentifierSlug)(resource)}`);
|
|
37
|
+
// fetch current remote state using provider context with spinner
|
|
38
|
+
const { result: remoteState, durationMs } = await (0, withSpinner_1.withSpinner)({
|
|
39
|
+
message: 'inflight',
|
|
40
|
+
operation: () => dao.get.byUnique(resource, providerContext),
|
|
41
|
+
});
|
|
42
|
+
// log done (replaces spinner)
|
|
43
|
+
const durationSec = (durationMs / 1000).toFixed(2);
|
|
44
|
+
context.log.info(` ├─ ✔ done in ${durationSec}s`);
|
|
45
|
+
// compute change
|
|
46
|
+
const computed = (0, computeChange_1.computeChange)({
|
|
47
|
+
desired: resource,
|
|
48
|
+
remote: remoteState,
|
|
49
|
+
});
|
|
50
|
+
// log decision
|
|
51
|
+
context.log.info(` └─ decision ${(0, colorizeAction_1.colorizeAction)(computed.action)}`);
|
|
52
|
+
// and the diff too, indented to align with tree
|
|
53
|
+
if (computed.state.difference) {
|
|
54
|
+
const indentedDiff = computed.state.difference
|
|
55
|
+
.split('\n')
|
|
56
|
+
.map((line) => ` ${line}`)
|
|
57
|
+
.join('\n');
|
|
58
|
+
context.log.info(indentedDiff);
|
|
59
|
+
}
|
|
44
60
|
context.log.info('');
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
return computed;
|
|
62
|
+
});
|
|
63
|
+
changes.push(change);
|
|
64
|
+
}
|
|
48
65
|
// log success message if everything is in sync
|
|
49
66
|
const allInSync = changes.every((change) => change.action === DeclastructChange_1.DeclastructChangeAction.KEEP);
|
|
50
67
|
if (allInSync) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planChanges.js","sourceRoot":"","sources":["../../../src/domain.operations/plan/planChanges.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"planChanges.js","sourceRoot":"","sources":["../../../src/domain.operations/plan/planChanges.ts"],"names":[],"mappings":";;;AAAA,mDAA4E;AAI5E,8EAAiF;AACjF,0EAAuE;AAEvE,+DAA4D;AAC5D,+DAA4D;AAC5D,yDAAsD;AACtD,mDAAgD;AAChD,yDAAsD;AACtD,+CAA4C;AAE5C;;;;GAIG;AACI,MAAM,WAAW,GAAG,KAAK,EAC9B,KAIC,EACD,OAA6C,EACnB,EAAE;IAC5B,wBAAwB;IACxB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAErB,kCAAkC;IAClC,MAAM,UAAU,GACd,QAAQ,IAAI,OA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clastructPlan } from '../../domain.objects/DeclastructPlan';
|
|
2
2
|
/**
|
|
3
3
|
* .what = validates that a plan hasn't become stale
|
|
4
4
|
* .why = prevents applying outdated changes to infrastructure
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeclastructChangeAction } from '../domain.objects/DeclastructChange';
|
|
2
|
+
/**
|
|
3
|
+
* .what = returns a colorized action label for CLI output
|
|
4
|
+
* .why = improves visual distinction between action types
|
|
5
|
+
* .note = uses pastel colors for a softer, zen aesthetic
|
|
6
|
+
*/
|
|
7
|
+
export declare const colorizeAction: (action: DeclastructChangeAction) => string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.colorizeAction = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const DeclastructChange_1 = require("../domain.objects/DeclastructChange");
|
|
9
|
+
/**
|
|
10
|
+
* .what = returns a colorized action label for CLI output
|
|
11
|
+
* .why = improves visual distinction between action types
|
|
12
|
+
* .note = uses pastel colors for a softer, zen aesthetic
|
|
13
|
+
*/
|
|
14
|
+
const colorizeAction = (action) => {
|
|
15
|
+
switch (action) {
|
|
16
|
+
case DeclastructChange_1.DeclastructChangeAction.KEEP:
|
|
17
|
+
return chalk_1.default.hex('#9ca3af')('[KEEP]'); // pastel gray
|
|
18
|
+
case DeclastructChange_1.DeclastructChangeAction.CREATE:
|
|
19
|
+
return chalk_1.default.hex('#86efac')('[CREATE]'); // pastel green
|
|
20
|
+
case DeclastructChange_1.DeclastructChangeAction.UPDATE:
|
|
21
|
+
return chalk_1.default.hex('#fde047')('[UPDATE]'); // pastel yellow
|
|
22
|
+
case DeclastructChange_1.DeclastructChangeAction.DESTROY:
|
|
23
|
+
return chalk_1.default.hex('#fca5a5')('[DESTROY]'); // pastel red
|
|
24
|
+
case DeclastructChange_1.DeclastructChangeAction.REPLACE:
|
|
25
|
+
return chalk_1.default.hex('#fca5a5')('[REPLACE]'); // pastel red, since it includes a destroy
|
|
26
|
+
default:
|
|
27
|
+
return `[${action}]`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.colorizeAction = colorizeAction;
|
|
31
|
+
//# sourceMappingURL=colorizeAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorizeAction.js","sourceRoot":"","sources":["../../src/infra/colorizeAction.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,2EAA8E;AAE9E;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAAC,MAA+B,EAAU,EAAE;IACxE,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,2CAAuB,CAAC,IAAI;YAC/B,OAAO,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc;QACvD,KAAK,2CAAuB,CAAC,MAAM;YACjC,OAAO,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe;QAC1D,KAAK,2CAAuB,CAAC,MAAM;YACjC,OAAO,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB;QAC3D,KAAK,2CAAuB,CAAC,OAAO;YAClC,OAAO,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa;QACzD,KAAK,2CAAuB,CAAC,OAAO;YAClC,OAAO,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,0CAA0C;QACtF;YACE,OAAO,IAAI,MAAM,GAAG,CAAC;IACzB,CAAC;AACH,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = wraps an async operation with a CLI spinner showing elapsed time
|
|
3
|
+
* .why = provides visual feedback during long-running operations
|
|
4
|
+
* .note = spinner renders on its own line below the action, cleared on completion
|
|
5
|
+
*/
|
|
6
|
+
export declare const withSpinner: <T>(input: {
|
|
7
|
+
message: string;
|
|
8
|
+
operation: () => Promise<T>;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
result: T;
|
|
11
|
+
durationMs: number;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withSpinner = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* .what = wraps an async operation with a CLI spinner showing elapsed time
|
|
6
|
+
* .why = provides visual feedback during long-running operations
|
|
7
|
+
* .note = spinner renders on its own line below the action, cleared on completion
|
|
8
|
+
*/
|
|
9
|
+
const withSpinner = async (input) => {
|
|
10
|
+
// spinner frames (braille pattern)
|
|
11
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
12
|
+
let frameIndex = 0;
|
|
13
|
+
const startMs = Date.now();
|
|
14
|
+
// track if we own the current line (no other output since last render)
|
|
15
|
+
let ownsCurrentLine = false; // start false since we haven't rendered yet
|
|
16
|
+
let isSpinnerWriting = false;
|
|
17
|
+
// intercept stdout to detect if other output occurred
|
|
18
|
+
const originalWrite = process.stdout.write.bind(process.stdout);
|
|
19
|
+
process.stdout.write = ((chunk, ...args) => {
|
|
20
|
+
// if this write is not from the spinner, mark that we lost ownership
|
|
21
|
+
if (!isSpinnerWriting) {
|
|
22
|
+
ownsCurrentLine = false;
|
|
23
|
+
}
|
|
24
|
+
return originalWrite(chunk, ...args);
|
|
25
|
+
});
|
|
26
|
+
// format elapsed time as human readable
|
|
27
|
+
const formatElapsed = (ms) => {
|
|
28
|
+
const seconds = ms / 1000;
|
|
29
|
+
if (seconds < 60)
|
|
30
|
+
return `${seconds.toFixed(1)}s`;
|
|
31
|
+
const minutes = Math.floor(seconds / 60);
|
|
32
|
+
const remainingSeconds = seconds % 60;
|
|
33
|
+
return `${minutes}m ${remainingSeconds.toFixed(0)}s`;
|
|
34
|
+
};
|
|
35
|
+
// render the current spinner state
|
|
36
|
+
const render = () => {
|
|
37
|
+
const elapsed = formatElapsed(Date.now() - startMs);
|
|
38
|
+
const frame = frames[frameIndex % frames.length];
|
|
39
|
+
const line = ` └─ ${frame} ${input.message} ${elapsed}`;
|
|
40
|
+
// mark that we're the ones writing
|
|
41
|
+
isSpinnerWriting = true;
|
|
42
|
+
if (ownsCurrentLine) {
|
|
43
|
+
// move up, clear line, write new frame, newline
|
|
44
|
+
process.stdout.write(`\x1b[A\r\x1b[K${line}\n`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// first render with trailing newline for whitespace
|
|
48
|
+
process.stdout.write(`${line}\n`);
|
|
49
|
+
ownsCurrentLine = true;
|
|
50
|
+
}
|
|
51
|
+
isSpinnerWriting = false;
|
|
52
|
+
frameIndex++;
|
|
53
|
+
};
|
|
54
|
+
// start spinner interval (80ms for smooth animation)
|
|
55
|
+
const interval = setInterval(render, 80);
|
|
56
|
+
render(); // render immediately
|
|
57
|
+
try {
|
|
58
|
+
// execute the operation
|
|
59
|
+
const result = await input.operation();
|
|
60
|
+
const durationMs = Date.now() - startMs;
|
|
61
|
+
// stop spinner
|
|
62
|
+
clearInterval(interval);
|
|
63
|
+
// restore original stdout.write
|
|
64
|
+
process.stdout.write = originalWrite;
|
|
65
|
+
// move up to spinner line, clear it
|
|
66
|
+
if (ownsCurrentLine) {
|
|
67
|
+
originalWrite('\x1b[A\r\x1b[K'); // move up + clear line
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
originalWrite('\n'); // newline if other output occurred
|
|
71
|
+
}
|
|
72
|
+
return { result, durationMs };
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
// stop spinner on error
|
|
76
|
+
clearInterval(interval);
|
|
77
|
+
// restore original stdout.write
|
|
78
|
+
process.stdout.write = originalWrite;
|
|
79
|
+
// move up to spinner line, clear it
|
|
80
|
+
if (ownsCurrentLine) {
|
|
81
|
+
originalWrite('\x1b[A\r\x1b[K');
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
originalWrite('\n');
|
|
85
|
+
}
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.withSpinner = withSpinner;
|
|
90
|
+
//# sourceMappingURL=withSpinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withSpinner.js","sourceRoot":"","sources":["../../src/infra/withSpinner.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,MAAM,WAAW,GAAG,KAAK,EAAK,KAGpC,EAA8C,EAAE;IAC/C,mCAAmC;IACnC,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAClE,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE3B,uEAAuE;IACvE,IAAI,eAAe,GAAG,KAAK,CAAC,CAAC,4CAA4C;IACzE,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,sDAAsD;IACtD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CACtB,KAA0B,EAC1B,GAAG,IAAe,EACT,EAAE;QACX,qEAAqE;QACrE,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,eAAe,GAAG,KAAK,CAAC;QA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AqD;IACrD,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,qBAAqB;IAE/B,IAAI,CAAC;QACH,wBAAwB;QACxB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,SAAS,EAAE,CAAC;QACvC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;QAExC,eAAe;QACf,aAAa,CAAC,QAAQ,CAAC,CAAC;QAExB,gCAAgC;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC;QAErC,oCAAoC;QACpC,IAAI,eAAe,EAAE,CAAC;YACpB,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAuB;QAC1D,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,mCAAmC;QAC1D,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,wBAAwB;QACxB,aAAa,CAAC,QAAQ,CAAC,CAAC;QAExB,gCAAgC;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC;QAErC,oCAAoC;QACpC,IAAI,eAAe,EAAE,CAAC;YACpB,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAjGW,QAAA,WAAW,eAiGtB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "declastruct",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "Add declarative control to any resource constructs. Declare, plan, and apply within an observable pit-of-success.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.4.1",
|
|
6
6
|
"repository": "ehmpathy/declastruct",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/declastruct",
|
|
8
8
|
"keywords": [
|
|
@@ -28,19 +28,20 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build:ts": "tsc -p ./tsconfig.build.json",
|
|
30
30
|
"commit:with-cli": "npx cz",
|
|
31
|
-
"fix:format:
|
|
32
|
-
"fix:format": "npm run fix:format:
|
|
33
|
-
"fix:lint": "
|
|
31
|
+
"fix:format:biome": "biome check --write src",
|
|
32
|
+
"fix:format": "npm run fix:format:biome",
|
|
33
|
+
"fix:lint": "biome check --write src",
|
|
34
34
|
"build:clean": "rm dist/ -rf",
|
|
35
35
|
"build:compile": "tsc -p ./tsconfig.build.json",
|
|
36
36
|
"build": "npm run build:clean && npm run build:compile",
|
|
37
37
|
"test:commits": "LAST_TAG=$(git describe --tags --abbrev=0 @^ 2> /dev/null || git rev-list --max-parents=0 HEAD) && npx commitlint --from $LAST_TAG --to HEAD --verbose",
|
|
38
|
-
"test:types": "tsc -p ./tsconfig.
|
|
39
|
-
"test:format
|
|
40
|
-
"test:format": "npm run test:format:prettier",
|
|
38
|
+
"test:types": "tsc -p ./tsconfig.json --noEmit",
|
|
39
|
+
"test:format": "npm run test:format:biome",
|
|
41
40
|
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
42
|
-
"test:
|
|
43
|
-
"test:lint": "
|
|
41
|
+
"test:format:biome": "biome format src",
|
|
42
|
+
"test:lint:biome": "biome check src --diagnostic-level=error",
|
|
43
|
+
"test:lint:biome:all": "biome check src",
|
|
44
|
+
"test:lint": "npm run test:lint:biome && npm run test:lint:deps",
|
|
44
45
|
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
45
46
|
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
46
47
|
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests",
|
|
@@ -55,7 +56,9 @@
|
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
58
|
"bottleneck": "2.19.5",
|
|
59
|
+
"chalk": "5.4.1",
|
|
58
60
|
"commander": "14.0.2",
|
|
61
|
+
"domain-objects": "0.31.3",
|
|
59
62
|
"helpful-errors": "1.5.3",
|
|
60
63
|
"jest-diff": "30.0.2",
|
|
61
64
|
"simple-log-methods": "0.6.2",
|
|
@@ -67,37 +70,27 @@
|
|
|
67
70
|
"domain-objects": "0.31.0"
|
|
68
71
|
},
|
|
69
72
|
"devDependencies": {
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@commitlint/
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@tsconfig/
|
|
76
|
-
"@
|
|
73
|
+
"@biomejs/biome": "2.3.8",
|
|
74
|
+
"@commitlint/cli": "19.5.0",
|
|
75
|
+
"@commitlint/config-conventional": "19.5.0",
|
|
76
|
+
"@swc/core": "1.15.3",
|
|
77
|
+
"@swc/jest": "0.2.39",
|
|
78
|
+
"@tsconfig/node20": "20.1.5",
|
|
79
|
+
"@tsconfig/strictest": "2.0.5",
|
|
80
|
+
"@types/jest": "30.0.0",
|
|
77
81
|
"@types/node": "22.15.29",
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "7.8.0",
|
|
79
|
-
"@typescript-eslint/parser": "7.8.0",
|
|
80
|
-
"babel-jest": "30.2.0",
|
|
81
|
-
"core-js": "3.26.1",
|
|
82
82
|
"cz-conventional-changelog": "3.3.0",
|
|
83
|
-
"declapract": "0.12.3",
|
|
84
|
-
"declapract-typescript-ehmpathy": "0.
|
|
85
|
-
"declastruct": "1.
|
|
86
|
-
"declastruct-github": "1.0.3",
|
|
83
|
+
"declapract": "^0.12.3",
|
|
84
|
+
"declapract-typescript-ehmpathy": "^0.43.7",
|
|
85
|
+
"declastruct": "^1.4.0",
|
|
86
|
+
"declastruct-github": "^1.0.3",
|
|
87
87
|
"depcheck": "1.4.3",
|
|
88
|
-
"
|
|
89
|
-
"eslint-config-airbnb-typescript": "18.0.0",
|
|
90
|
-
"eslint-config-prettier": "8.5.0",
|
|
91
|
-
"eslint-plugin-import": "2.26.0",
|
|
92
|
-
"eslint-plugin-prettier": "4.2.1",
|
|
93
|
-
"eslint-plugin-unused-imports": "4.1.4",
|
|
88
|
+
"esbuild-register": "3.6.0",
|
|
94
89
|
"husky": "8.0.3",
|
|
95
|
-
"jest": "
|
|
96
|
-
"prettier": "2.8.1",
|
|
90
|
+
"jest": "30.2.0",
|
|
97
91
|
"rhachet": "1.12.1",
|
|
98
92
|
"rhachet-roles-ehmpathy": "1.9.1",
|
|
99
93
|
"test-fns": "1.7.2",
|
|
100
|
-
"ts-jest": "29.4.5",
|
|
101
94
|
"tsx": "4.20.6",
|
|
102
95
|
"typescript": "5.4.5"
|
|
103
96
|
},
|