@tomflow/proflow-platform-cli 0.1.0 → 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ # @tomflow/proflow-platform-cli
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Read installed package versions directly from the Workspace `node_modules` package manifest so postcondition checks cannot reuse stale Node module-resolution cache entries after an in-process package upgrade.
@@ -5,7 +5,7 @@ export declare const behaviorAdapter: {
5
5
  ok: boolean;
6
6
  status: "SUCCEEDED";
7
7
  moduleRef: "platform-cli";
8
- moduleVersion: "0.1.0";
8
+ moduleVersion: "0.1.1";
9
9
  data?: {} | null;
10
10
  };
11
11
  observedEffects: never[];
@@ -16,7 +16,7 @@ export declare const behaviorAdapter: {
16
16
  ok: boolean;
17
17
  status: "SUCCEEDED";
18
18
  moduleRef: "platform-cli";
19
- moduleVersion: "0.1.0";
19
+ moduleVersion: "0.1.1";
20
20
  data?: {} | null;
21
21
  };
22
22
  observedEffects: never[];
@@ -27,7 +27,7 @@ export declare const behaviorAdapter: {
27
27
  ok: boolean;
28
28
  status: "SUCCEEDED";
29
29
  moduleRef: "platform-cli";
30
- moduleVersion: "0.1.0";
30
+ moduleVersion: "0.1.1";
31
31
  data?: {} | null;
32
32
  };
33
33
  observedEffects: never[];
@@ -38,7 +38,7 @@ export declare const behaviorAdapter: {
38
38
  ok: boolean;
39
39
  status: "SUCCEEDED";
40
40
  moduleRef: "platform-cli";
41
- moduleVersion: "0.1.0";
41
+ moduleVersion: "0.1.1";
42
42
  data?: {} | null;
43
43
  };
44
44
  observedEffects: never[];
@@ -49,7 +49,7 @@ export declare const behaviorAdapter: {
49
49
  ok: boolean;
50
50
  status: "SUCCEEDED";
51
51
  moduleRef: "platform-cli";
52
- moduleVersion: "0.1.0";
52
+ moduleVersion: "0.1.1";
53
53
  data?: {} | null;
54
54
  };
55
55
  observedEffects: never[];
@@ -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.0";
6
+ readonly moduleVersion: "0.1.1";
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.0",
6
+ moduleVersion: "0.1.1",
7
7
  kind: "cli",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
@@ -1,7 +1,5 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { createRequire } from "node:module";
3
- import { dirname, join } from "node:path";
4
- import { pathToFileURL } from "node:url";
2
+ import { join } from "node:path";
5
3
  import { PlatformError } from "../errors.js";
6
4
  import { readWorkspacePackageManagerSelection, systemPackageCommandRunner, } from "../install/package-manager.js";
7
5
  import { atomicWrite } from "../paths.js";
@@ -92,35 +90,21 @@ async function observeInstalledVersion(workspaceRoot, packageName) {
92
90
  !hasOwn(manifest.devDependencies, packageName))) {
93
91
  return undefined;
94
92
  }
95
- const require = createRequire(pathToFileURL(join(workspaceRoot, "package.json")));
96
- let entry;
97
93
  try {
98
- entry = require.resolve(packageName);
94
+ const raw = await readFile(join(workspaceRoot, "node_modules", ...packageName.split("/"), "package.json"), "utf8");
95
+ const parsed = JSON.parse(raw);
96
+ if (typeof parsed === "object" &&
97
+ parsed !== null &&
98
+ !Array.isArray(parsed) &&
99
+ Reflect.get(parsed, "name") === packageName &&
100
+ typeof Reflect.get(parsed, "version") === "string") {
101
+ return Reflect.get(parsed, "version");
102
+ }
103
+ return undefined;
99
104
  }
100
105
  catch {
101
106
  return undefined;
102
107
  }
103
- let current = dirname(entry);
104
- for (;;) {
105
- try {
106
- const raw = await readFile(join(current, "package.json"), "utf8");
107
- const parsed = JSON.parse(raw);
108
- if (typeof parsed === "object" &&
109
- parsed !== null &&
110
- !Array.isArray(parsed) &&
111
- Reflect.get(parsed, "name") === packageName &&
112
- typeof Reflect.get(parsed, "version") === "string") {
113
- return Reflect.get(parsed, "version");
114
- }
115
- }
116
- catch {
117
- // keep walking to the package root
118
- }
119
- const parent = dirname(current);
120
- if (parent === current)
121
- return undefined;
122
- current = parent;
123
- }
124
108
  }
125
109
  async function readWorkspaceManifest(workspaceRoot) {
126
110
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-platform-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,8 +24,8 @@
24
24
  "@tomflow/proflow-module-contract": "^0.1.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@tomflow/proflow-deployment-conformance": "^0.1.0",
28
- "@tomflow/proflow-module-template": "^0.1.0"
27
+ "@tomflow/proflow-deployment-conformance": "^0.1.1",
28
+ "@tomflow/proflow-module-template": "^0.1.1"
29
29
  },
30
30
  "description": "Deterministic platform-level deployment discovery, planning, lifecycle and verification CLI.",
31
31
  "keywords": [
@@ -3,7 +3,7 @@
3
3
  "contractVersion": "1.0.0",
4
4
  "moduleRef": "platform-cli",
5
5
  "packageName": "@tomflow/proflow-platform-cli",
6
- "moduleVersion": "0.1.0",
6
+ "moduleVersion": "0.1.1",
7
7
  "kind": "cli",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",