@cmdop/project-check 4.0.0 → 4.0.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/README.md CHANGED
@@ -19,7 +19,7 @@ Check a Node.js project's CMDOP SDK configuration before running your first mach
19
19
  Install the utility in a separate tools directory:
20
20
 
21
21
  ```sh
22
- npm install --save-exact @cmdop/project-check@4.0.0
22
+ npm install --save-exact @cmdop/project-check@4.0.1
23
23
  ```
24
24
 
25
25
  From that directory, point the CLI at your application:
@@ -40,7 +40,7 @@ The check reads local runtime prerequisites, package-manager and lockfile compat
40
40
  | `different_version` | The installed manifest reports another version. |
41
41
  | Other status or blocked diagnostic | Resolve the reported metadata or environment problem first. |
42
42
 
43
- The CLI rejects unsuitable project metadata rather than trying to repair or install anything automatically. A successful diagnostic is not an SDK import, integrity, login or machine connection check.
43
+ The CLI rejects unsuitable project metadata rather than trying to repair or install anything automatically. Version 4.0.1 applies the shared bounded UTF-8 manifest reader to both project and installed SDK metadata, refusing invalid UTF-8 and manifests larger than 256 KiB. A successful diagnostic is not an SDK import, integrity, login or machine connection check.
44
44
 
45
45
  If the SDK is missing, review the suggested install command and run it yourself in the application directory:
46
46
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": 1,
3
3
  "contract_version": "0.1.0",
4
- "package_version": "4.0.0",
4
+ "package_version": "4.0.1",
5
5
  "brand": {
6
6
  "name": "CMDOP"
7
7
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdop/project-check",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Offline CLI to check Node.js CMDOP SDK metadata and create a TypeScript starter",
@@ -30,6 +30,10 @@
30
30
  "LICENSE"
31
31
  ],
32
32
  "homepage": "https://cmdop.ai",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/commandoperator/promo-packs.git"
36
+ },
33
37
  "publishConfig": {
34
38
  "access": "public"
35
39
  }
@@ -29,7 +29,7 @@ const writable = (path) => { try { accessSync(path, constants.W_OK); return true
29
29
 
30
30
  // Inspect only a bounded, ordinary project manifest. Do not follow a final symlink.
31
31
  const MAX_MANIFEST_BYTES = 256 * 1024;
32
- function readProjectManifest(path) {
32
+ export function readProjectManifest(path) {
33
33
  const initial = lstatSync(path);
34
34
  if (!initial.isFile() || initial.size > MAX_MANIFEST_BYTES) throw Error("Invalid manifest");
35
35
  const fd = openSync(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
@@ -3,7 +3,7 @@
3
3
  import { readFileSync, lstatSync, statSync, realpathSync, readdirSync } from "node:fs";
4
4
  import { resolve, dirname, join, relative, isAbsolute, sep } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
- import { evaluate, runtimeFacts, writeSdkStarter } from "./launcher.mjs";
6
+ import { evaluate, runtimeFacts, writeSdkStarter, readProjectManifest } from "./launcher.mjs";
7
7
 
8
8
  const root = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
9
9
  const profile = () => JSON.parse(readFileSync(join(root, "catalog/project-check.json"), "utf8"));
@@ -20,7 +20,7 @@ function manifest(target, relativeName) {
20
20
  if (!inside(target, actual) || actual !== path) return { status: "unsafe_path" };
21
21
  const stat = lstatSync(path);
22
22
  if (!stat.isFile() || stat.size > 262144) return { status: "unreadable" };
23
- const data = JSON.parse(readFileSync(path, "utf8"));
23
+ const data = readProjectManifest(path);
24
24
  if (!data || typeof data !== "object" || Array.isArray(data)) return { status: "invalid" };
25
25
  return { status: "present", data };
26
26
  } catch (err) {