@decocms/parity 0.33.17 → 0.33.18
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/cli.js +25 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -57662,6 +57662,7 @@ function localeSwitch(value) {
|
|
|
57662
57662
|
}
|
|
57663
57663
|
|
|
57664
57664
|
// src/cms/session.ts
|
|
57665
|
+
import { execFileSync } from "node:child_process";
|
|
57665
57666
|
import { existsSync as existsSync12, readFileSync as readFileSync15 } from "node:fs";
|
|
57666
57667
|
import { homedir as homedir3 } from "node:os";
|
|
57667
57668
|
import { delimiter, join as join17 } from "node:path";
|
|
@@ -57700,6 +57701,26 @@ function vtexCliInstalled(env = process.env) {
|
|
|
57700
57701
|
const dirs = (env.PATH ?? "").split(delimiter).filter(Boolean);
|
|
57701
57702
|
return dirs.some((dir) => existsSync12(join17(dir, "vtex")));
|
|
57702
57703
|
}
|
|
57704
|
+
function vtexContentPluginAdvice(run = (cmd, args) => execFileSync(cmd, args, { stdio: "pipe" })) {
|
|
57705
|
+
try {
|
|
57706
|
+
run("vtex", ["content", "--help"]);
|
|
57707
|
+
return null;
|
|
57708
|
+
} catch (err) {
|
|
57709
|
+
const output = [
|
|
57710
|
+
err?.stdout,
|
|
57711
|
+
err?.stderr,
|
|
57712
|
+
err instanceof Error ? err.message : ""
|
|
57713
|
+
].map((v) => v?.toString() ?? "").join(`
|
|
57714
|
+
`);
|
|
57715
|
+
if (!/Cannot find module ['"]vtex['"]/.test(output))
|
|
57716
|
+
return null;
|
|
57717
|
+
return [
|
|
57718
|
+
"`vtex content` cannot load — the content plugin resolves `vtex` from the wrong node_modules root (breaks under nvm-managed installs).",
|
|
57719
|
+
' ln -sfn "$(npm root -g)/vtex" ~/.local/share/vtex/node_modules/vtex'
|
|
57720
|
+
].join(`
|
|
57721
|
+
`);
|
|
57722
|
+
}
|
|
57723
|
+
}
|
|
57703
57724
|
function sessionState(expectedAccount, env = process.env, home = homedir3(), now = Date.now()) {
|
|
57704
57725
|
if (env.PARITY_CMS_TOKEN)
|
|
57705
57726
|
return { status: "env-token" };
|
|
@@ -57921,17 +57942,20 @@ async function cmsDoctorCommand(opts, call = callCms) {
|
|
|
57921
57942
|
if (!cfg)
|
|
57922
57943
|
return 1;
|
|
57923
57944
|
const session = describeSession(sessionState(process.env.PARITY_CMS_ACCOUNT));
|
|
57945
|
+
const pluginAdvice = vtexContentPluginAdvice();
|
|
57924
57946
|
try {
|
|
57925
57947
|
const types = await getContentTypes(cfg, call);
|
|
57926
57948
|
const drift = schemaDrift(types, opts.repo);
|
|
57927
57949
|
const propDrift = propertyDrift(types, opts.repo);
|
|
57928
57950
|
const blockingProps = propDrift.filter((d) => d.missingProps.length > 0);
|
|
57929
57951
|
if (opts.json) {
|
|
57930
|
-
console.log(JSON.stringify({ session, contentTypes: Object.keys(types), drift, propDrift }, null, 2));
|
|
57952
|
+
console.log(JSON.stringify({ session, contentPlugin: pluginAdvice, contentTypes: Object.keys(types), drift, propDrift }, null, 2));
|
|
57931
57953
|
return drift.some((d) => d.missingOnAccount.length > 0) || blockingProps.length > 0 ? 1 : 0;
|
|
57932
57954
|
}
|
|
57933
57955
|
if (session)
|
|
57934
57956
|
console.log(`${chalk7.green("✓")} ${session}`);
|
|
57957
|
+
if (pluginAdvice)
|
|
57958
|
+
console.log(`${chalk7.yellow("!")} ${pluginAdvice}`);
|
|
57935
57959
|
const blocking = drift.filter((d) => d.missingOnAccount.length > 0);
|
|
57936
57960
|
if (blocking.length === 0 && propDrift.length === 0) {
|
|
57937
57961
|
console.log(`${chalk7.green("✓")} every section the repo declares is published on the account`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.18",
|
|
4
4
|
"description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|