@tomflow/proflow-platform-cli 0.1.26 → 0.1.28
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/deployment/adapter.d.ts +7 -7
- package/dist/deployment/descriptor.d.ts +1 -1
- package/dist/deployment/descriptor.js +1 -1
- package/dist/src/cli.js +0 -0
- package/dist/src/install/pnpm-policy.d.ts +6 -2
- package/dist/src/install/pnpm-policy.js +36 -12
- package/dist/src/lifecycle/thin.js +9 -0
- package/package.json +47 -47
- package/proflow.module.json +1 -1
- package/CHANGELOG.md +0 -7
|
@@ -6,7 +6,7 @@ export declare const behaviorAdapter: {
|
|
|
6
6
|
readonly ok: true;
|
|
7
7
|
readonly status: "SUCCEEDED";
|
|
8
8
|
readonly moduleRef: "platform-cli";
|
|
9
|
-
readonly moduleVersion: "0.1.
|
|
9
|
+
readonly moduleVersion: "0.1.28";
|
|
10
10
|
};
|
|
11
11
|
observedEffects: never[];
|
|
12
12
|
}>;
|
|
@@ -16,7 +16,7 @@ export declare const behaviorAdapter: {
|
|
|
16
16
|
readonly ok: true;
|
|
17
17
|
readonly status: "SUCCEEDED";
|
|
18
18
|
readonly moduleRef: "platform-cli";
|
|
19
|
-
readonly moduleVersion: "0.1.
|
|
19
|
+
readonly moduleVersion: "0.1.28";
|
|
20
20
|
};
|
|
21
21
|
observedEffects: never[];
|
|
22
22
|
}>;
|
|
@@ -26,7 +26,7 @@ export declare const behaviorAdapter: {
|
|
|
26
26
|
ok: true;
|
|
27
27
|
status: "SUCCEEDED";
|
|
28
28
|
moduleRef: "platform-cli";
|
|
29
|
-
moduleVersion: "0.1.
|
|
29
|
+
moduleVersion: "0.1.28";
|
|
30
30
|
data: {
|
|
31
31
|
readonly setupStatus: "READY";
|
|
32
32
|
readonly runtimeStatus: "NOT_APPLICABLE";
|
|
@@ -40,7 +40,7 @@ export declare const behaviorAdapter: {
|
|
|
40
40
|
readonly ok: true;
|
|
41
41
|
readonly status: "SUCCEEDED";
|
|
42
42
|
readonly moduleRef: "platform-cli";
|
|
43
|
-
readonly moduleVersion: "0.1.
|
|
43
|
+
readonly moduleVersion: "0.1.28";
|
|
44
44
|
};
|
|
45
45
|
observedEffects: never[];
|
|
46
46
|
}>;
|
|
@@ -50,7 +50,7 @@ export declare const behaviorAdapter: {
|
|
|
50
50
|
ok: true;
|
|
51
51
|
status: "SUCCEEDED";
|
|
52
52
|
moduleRef: "platform-cli";
|
|
53
|
-
moduleVersion: "0.1.
|
|
53
|
+
moduleVersion: "0.1.28";
|
|
54
54
|
data: {
|
|
55
55
|
docs: string;
|
|
56
56
|
};
|
|
@@ -63,7 +63,7 @@ export declare const behaviorAdapter: {
|
|
|
63
63
|
readonly ok: true;
|
|
64
64
|
readonly status: "SUCCEEDED";
|
|
65
65
|
readonly moduleRef: "platform-cli";
|
|
66
|
-
readonly moduleVersion: "0.1.
|
|
66
|
+
readonly moduleVersion: "0.1.28";
|
|
67
67
|
};
|
|
68
68
|
observedEffects: never[];
|
|
69
69
|
}>;
|
|
@@ -73,7 +73,7 @@ export declare const behaviorAdapter: {
|
|
|
73
73
|
readonly ok: true;
|
|
74
74
|
readonly status: "SUCCEEDED";
|
|
75
75
|
readonly moduleRef: "platform-cli";
|
|
76
|
-
readonly moduleVersion: "0.1.
|
|
76
|
+
readonly moduleVersion: "0.1.28";
|
|
77
77
|
};
|
|
78
78
|
observedEffects: never[];
|
|
79
79
|
}>;
|
|
@@ -3,7 +3,7 @@ export declare const descriptor: {
|
|
|
3
3
|
readonly contractVersion: "1.0.0";
|
|
4
4
|
readonly moduleRef: "platform-cli";
|
|
5
5
|
readonly packageName: "@tomflow/proflow-platform-cli";
|
|
6
|
-
readonly moduleVersion: "0.1.
|
|
6
|
+
readonly moduleVersion: "0.1.28";
|
|
7
7
|
readonly kind: "cli";
|
|
8
8
|
readonly templateVersion: "1.0.0";
|
|
9
9
|
readonly platformCompatibility: ">=1.0.0 <2.0.0";
|
|
@@ -3,7 +3,7 @@ export const descriptor = {
|
|
|
3
3
|
contractVersion: "1.0.0",
|
|
4
4
|
moduleRef: "platform-cli",
|
|
5
5
|
packageName: "@tomflow/proflow-platform-cli",
|
|
6
|
-
moduleVersion: "0.1.
|
|
6
|
+
moduleVersion: "0.1.28",
|
|
7
7
|
kind: "cli",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
package/dist/src/cli.js
CHANGED
|
File without changes
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface PnpmPolicySnapshot {
|
|
2
|
+
keyPresent: boolean;
|
|
3
|
+
values: string[];
|
|
4
|
+
}
|
|
5
|
+
export declare function observeMinimumReleaseAgeExclude(root: string): Promise<PnpmPolicySnapshot>;
|
|
6
|
+
export declare function recordPnpmPolicyOwnership(root: string, before: PnpmPolicySnapshot): Promise<void>;
|
|
3
7
|
export declare function cleanOwnedPnpmPolicy(root: string): Promise<string[]>;
|
|
@@ -14,11 +14,11 @@ async function text(root) {
|
|
|
14
14
|
export async function observeMinimumReleaseAgeExclude(root) {
|
|
15
15
|
const source = await text(root);
|
|
16
16
|
if (!source)
|
|
17
|
-
return [];
|
|
17
|
+
return { keyPresent: false, values: [] };
|
|
18
18
|
const lines = source.split(/\r?\n/);
|
|
19
19
|
const start = lines.findIndex((line) => /^minimumReleaseAgeExclude:\s*$/.test(line));
|
|
20
20
|
if (start < 0)
|
|
21
|
-
return [];
|
|
21
|
+
return { keyPresent: false, values: [] };
|
|
22
22
|
const values = [];
|
|
23
23
|
for (let index = start + 1; index < lines.length; index += 1) {
|
|
24
24
|
const line = lines[index] ?? "";
|
|
@@ -28,35 +28,44 @@ export async function observeMinimumReleaseAgeExclude(root) {
|
|
|
28
28
|
if (match?.[1])
|
|
29
29
|
values.push(match[1]);
|
|
30
30
|
}
|
|
31
|
-
return values;
|
|
31
|
+
return { keyPresent: true, values };
|
|
32
32
|
}
|
|
33
33
|
export async function recordPnpmPolicyOwnership(root, before) {
|
|
34
34
|
const after = await observeMinimumReleaseAgeExclude(root);
|
|
35
|
-
const newlyIntroduced = after.filter((value) => !before.includes(value));
|
|
36
|
-
|
|
35
|
+
const newlyIntroduced = after.values.filter((value) => !before.values.includes(value));
|
|
36
|
+
const previous = await readOwnership(root);
|
|
37
|
+
const introducedKey = previous.introducedKey || (!before.keyPresent && after.keyPresent);
|
|
38
|
+
if (newlyIntroduced.length === 0 && !introducedKey)
|
|
37
39
|
return;
|
|
38
40
|
const introduced = [
|
|
39
|
-
...new Set([...
|
|
41
|
+
...new Set([...previous.introduced, ...newlyIntroduced]),
|
|
40
42
|
].sort();
|
|
41
43
|
await mkdir(join(root, ".proflow", "deployment"), { recursive: true });
|
|
42
|
-
await atomicWrite(ownershipFile(root), `${JSON.stringify({ contract: "proflow.pnpm-policy-ownership.v1", introduced }, null, 2)}\n`);
|
|
44
|
+
await atomicWrite(ownershipFile(root), `${JSON.stringify({ contract: "proflow.pnpm-policy-ownership.v1", introduced, introducedKey }, null, 2)}\n`);
|
|
43
45
|
}
|
|
44
|
-
async function
|
|
46
|
+
async function readOwnership(root) {
|
|
45
47
|
try {
|
|
46
48
|
const parsed = JSON.parse(await readFile(ownershipFile(root), "utf8"));
|
|
47
|
-
|
|
49
|
+
const introduced = typeof parsed === "object" &&
|
|
48
50
|
parsed !== null &&
|
|
49
51
|
Array.isArray(Reflect.get(parsed, "introduced"))
|
|
50
52
|
? Reflect.get(parsed, "introduced").filter((value) => typeof value === "string")
|
|
51
53
|
: [];
|
|
54
|
+
return {
|
|
55
|
+
introduced,
|
|
56
|
+
introducedKey: typeof parsed === "object" &&
|
|
57
|
+
parsed !== null &&
|
|
58
|
+
Reflect.get(parsed, "introducedKey") === true,
|
|
59
|
+
};
|
|
52
60
|
}
|
|
53
61
|
catch {
|
|
54
|
-
return [];
|
|
62
|
+
return { introduced: [], introducedKey: false };
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
export async function cleanOwnedPnpmPolicy(root) {
|
|
58
|
-
const
|
|
59
|
-
|
|
66
|
+
const ownership = await readOwnership(root);
|
|
67
|
+
const introduced = ownership.introduced;
|
|
68
|
+
if (introduced.length === 0 && !ownership.introducedKey)
|
|
60
69
|
return [];
|
|
61
70
|
const source = await text(root);
|
|
62
71
|
if (!source)
|
|
@@ -67,6 +76,21 @@ export async function cleanOwnedPnpmPolicy(root) {
|
|
|
67
76
|
const match = line.match(/^\s+-\s+['"]?([^'"]+)['"]?\s*$/);
|
|
68
77
|
return !match?.[1] || !owned.has(match[1]);
|
|
69
78
|
});
|
|
79
|
+
if (ownership.introducedKey) {
|
|
80
|
+
const keyIndex = next.findIndex((line) => /^minimumReleaseAgeExclude:\s*$/.test(line));
|
|
81
|
+
if (keyIndex >= 0) {
|
|
82
|
+
let hasValues = false;
|
|
83
|
+
for (let index = keyIndex + 1; index < next.length; index += 1) {
|
|
84
|
+
const line = next[index] ?? "";
|
|
85
|
+
if (/^\S/.test(line) && line.trim() !== "")
|
|
86
|
+
break;
|
|
87
|
+
if (/^\s+-\s+/.test(line))
|
|
88
|
+
hasValues = true;
|
|
89
|
+
}
|
|
90
|
+
if (!hasValues)
|
|
91
|
+
next.splice(keyIndex, 1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
70
94
|
await atomicWrite(join(root, policyFileName), next.join("\n"));
|
|
71
95
|
return introduced;
|
|
72
96
|
}
|
|
@@ -233,6 +233,15 @@ export async function startModulesThin(catalog, modules, workspaceRoot, reporter
|
|
|
233
233
|
});
|
|
234
234
|
const status = await dispatchModuleCommand(catalog, module, "status", context(workspaceRoot));
|
|
235
235
|
results.push(status);
|
|
236
|
+
reportProgress(reporter, {
|
|
237
|
+
command: "start",
|
|
238
|
+
phase: "status",
|
|
239
|
+
current: index + 1,
|
|
240
|
+
total: modulesInOrder.length,
|
|
241
|
+
moduleRef: module.moduleRef,
|
|
242
|
+
status: succeeded(status.result) ? "SUCCEEDED" : "FAILED",
|
|
243
|
+
message: `${module.moduleRef}`,
|
|
244
|
+
});
|
|
236
245
|
if (!succeeded(status.result)) {
|
|
237
246
|
blockers.push({ moduleRef: module.moduleRef, setupStatus: "FAILED" });
|
|
238
247
|
continue;
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
2
|
+
"name": "@tomflow/proflow-platform-cli",
|
|
3
|
+
"version": "0.1.28",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/src/index.js",
|
|
10
|
+
"./cli": "./dist/src/cli.js",
|
|
11
|
+
"./command": "./dist/src/command.js",
|
|
12
|
+
"./deployment/adapter": "./dist/deployment/adapter.js",
|
|
13
|
+
"./deployment/descriptor": "./dist/deployment/descriptor.js"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"platform": "./dist/src/cli.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"proflow.module.json",
|
|
21
|
+
"conformance.json",
|
|
22
|
+
"README.md",
|
|
23
|
+
"DOCS.md",
|
|
24
|
+
"SETUP.md"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "node --test tests/**/*.test.ts",
|
|
28
|
+
"typecheck": "tsc --noEmit"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@tomflow/proflow-module-contract": "^0.1.9"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@tomflow/proflow-deployment-conformance": "^0.1.7",
|
|
35
|
+
"@tomflow/proflow-module-template": "^0.1.7"
|
|
36
|
+
},
|
|
37
|
+
"description": "Thin Platform CLI for Module discovery, documentation, package synchronization and lifecycle orchestration.",
|
|
38
|
+
"keywords": [
|
|
39
|
+
"proflow",
|
|
40
|
+
"proflow-module",
|
|
41
|
+
"deployment-governance"
|
|
42
|
+
],
|
|
43
|
+
"proflow": {
|
|
44
|
+
"module": true,
|
|
45
|
+
"descriptor": "./dist/deployment/descriptor.js",
|
|
46
|
+
"manifest": "./proflow.module.json"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/proflow.module.json
CHANGED