@cmssy/cli 19.3.2 → 19.5.0
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/index.js +19 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2215,7 +2215,7 @@ async function runLink(options, deps) {
|
|
|
2215
2215
|
// src/types-command.ts
|
|
2216
2216
|
import { mkdirSync as mkdirSync5, readFileSync as readFileSync8, readdirSync, writeFileSync as writeFileSync7 } from "fs";
|
|
2217
2217
|
import { dirname as dirname4, relative, resolve as resolvePath } from "path";
|
|
2218
|
-
import { DEFAULT_CMSSY_API_URL } from "@cmssy/core";
|
|
2218
|
+
import { DEFAULT_CMSSY_API_URL, createRetryingFetch } from "@cmssy/core";
|
|
2219
2219
|
|
|
2220
2220
|
// src/model-types.ts
|
|
2221
2221
|
var TEXTUAL = /* @__PURE__ */ new Set([
|
|
@@ -2473,9 +2473,10 @@ async function refusalReason(response) {
|
|
|
2473
2473
|
return said.length > 0 ? said.join("; ") : void 0;
|
|
2474
2474
|
}
|
|
2475
2475
|
async function request(deps, endpoint, query, variables) {
|
|
2476
|
+
const doFetch = createRetryingFetch("build", deps.fetch, "cmssy types");
|
|
2476
2477
|
let response;
|
|
2477
2478
|
try {
|
|
2478
|
-
response = await
|
|
2479
|
+
response = await doFetch(endpoint, {
|
|
2479
2480
|
method: "POST",
|
|
2480
2481
|
headers: { "content-type": "application/json" },
|
|
2481
2482
|
body: JSON.stringify({ query, variables })
|
|
@@ -2516,7 +2517,9 @@ function ancestors(from) {
|
|
|
2516
2517
|
function exportedNames(declarations) {
|
|
2517
2518
|
const source = declarations.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/^\s*\/\/.*$/gm, " ");
|
|
2518
2519
|
const found = /* @__PURE__ */ new Set();
|
|
2519
|
-
for (const [, clause] of source.matchAll(
|
|
2520
|
+
for (const [, clause] of source.matchAll(
|
|
2521
|
+
/export\s+(?:type\s+)?\{([^}]*)\}/g
|
|
2522
|
+
)) {
|
|
2520
2523
|
for (const entry of (clause ?? "").split(",")) {
|
|
2521
2524
|
const parts = entry.trim().split(/\s+as\s+/);
|
|
2522
2525
|
const name = (parts[1] ?? parts[0] ?? "").trim();
|
|
@@ -2575,8 +2578,16 @@ function describeDrift(previous, next) {
|
|
|
2575
2578
|
if (added.length) lines.push(`+ ${label}: ${added.join(", ")}`);
|
|
2576
2579
|
if (removed.length) lines.push(`- ${label}: ${removed.join(", ")}`);
|
|
2577
2580
|
};
|
|
2578
|
-
report(
|
|
2579
|
-
|
|
2581
|
+
report(
|
|
2582
|
+
"models",
|
|
2583
|
+
declared(body(previous), models),
|
|
2584
|
+
declared(body(next), models)
|
|
2585
|
+
);
|
|
2586
|
+
report(
|
|
2587
|
+
"fields",
|
|
2588
|
+
declared(body(previous), fields),
|
|
2589
|
+
declared(body(next), fields)
|
|
2590
|
+
);
|
|
2580
2591
|
return lines.length ? lines : ["the generated output differs"];
|
|
2581
2592
|
}
|
|
2582
2593
|
function resolve4(value, fromEnv, variable) {
|
|
@@ -2731,7 +2742,8 @@ async function runTypes(options, deps) {
|
|
|
2731
2742
|
previous === null ? `cmssy: ${shown} is missing - run \`cmssy types\` and commit it` : `cmssy: ${shown} is out of date with the "${workspace}" workspace`
|
|
2732
2743
|
);
|
|
2733
2744
|
if (previous !== null) {
|
|
2734
|
-
for (const line of describeDrift(previous, source))
|
|
2745
|
+
for (const line of describeDrift(previous, source))
|
|
2746
|
+
deps.log(` ${line}`);
|
|
2735
2747
|
}
|
|
2736
2748
|
deps.log(" run `cmssy types` and commit the result");
|
|
2737
2749
|
return 1;
|
|
@@ -2745,9 +2757,7 @@ async function runTypes(options, deps) {
|
|
|
2745
2757
|
deps.log(
|
|
2746
2758
|
`cmssy: wrote ${shown} - ${models.length} model${models.length === 1 ? "" : "s"}, ${fieldCount} field${fieldCount === 1 ? "" : "s"}`
|
|
2747
2759
|
);
|
|
2748
|
-
deps.log(
|
|
2749
|
-
` ${models.map((model) => model.slug).join(", ")}`
|
|
2750
|
-
);
|
|
2760
|
+
deps.log(` ${models.map((model) => model.slug).join(", ")}`);
|
|
2751
2761
|
return operationsStatus;
|
|
2752
2762
|
} catch (error) {
|
|
2753
2763
|
if (error instanceof CliError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/cli",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.5.0",
|
|
4
4
|
"description": "The cmssy CLI: `cmssy init` wires cmssy into an existing Next.js, Astro or React Router app; `cmssy link` connects it to a workspace and verifies the editor wiring.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"esbuild": "^0.27.7",
|
|
31
|
-
"@cmssy/core": "19.
|
|
31
|
+
"@cmssy/core": "19.5.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^20.0.0",
|