@marvalt/digivalt-core 0.2.33 → 0.2.35
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 +16 -0
- package/README.md +1 -0
- package/bin/init.cjs +46 -3
- package/dist/generators/wp-guard.d.ts +11 -0
- package/dist/generators.cjs +625 -506
- package/dist/generators.cjs.map +1 -1
- package/dist/generators.esm.js +625 -506
- package/dist/generators.esm.js.map +1 -1
- package/dist/index.cjs +625 -506
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +625 -506
- package/dist/index.esm.js.map +1 -1
- package/docs/AI-MASTER-PROMPT.md +1 -0
- package/package.json +3 -2
- package/template/DIGIVALT_SETUP.md +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.35] - 2026-09-23
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- WordPress generation rejects a payload that does not contain the configured front page, restores the previous `wordpress-data.json`, and returns failure so the build exits. A two-page multi-frontend payload that includes the front page still passes. Fixture mode (`VITE_IS_LOVABLE`) skips the check.
|
|
12
|
+
|
|
13
|
+
**Publish/deploy:** publish **`@marvalt/digivalt-core@0.2.35`**. Then bump consumer apps (including **digivalt-landing**, whose lockfile still pins 0.2.32) and redeploy. No WordPress plugin publish.
|
|
14
|
+
|
|
15
|
+
## [0.2.34] - 2026-09-22
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- `digivalt-init` reports the app's dependency lockfile in preflight, warns when `.gitignore` excludes `package-lock.json`, and gives a manual action when no supported lockfile exists.
|
|
19
|
+
- Cloudflare Pages setup and AI scaffold guidance now require committing the package-manager lockfile so deployments install the tested dependency tree.
|
|
20
|
+
- Init smoke coverage for missing and ignored lockfiles.
|
|
21
|
+
|
|
22
|
+
**Publish/deploy:** publish **`@marvalt/digivalt-core@0.2.34`**. Consumer apps should upgrade and rerun `npx digivalt-init`; no WordPress plugin publish is required.
|
|
23
|
+
|
|
8
24
|
## [0.2.33] - 2026-09-19
|
|
9
25
|
|
|
10
26
|
### Added
|
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ What init now does:
|
|
|
51
51
|
- refreshes `scripts/generate.ts` when it matches an older DigiVAlt-managed version
|
|
52
52
|
- warns instead of overwriting custom build logic or custom generator scripts
|
|
53
53
|
- warns when a local `wpRegistry.tsx` / `createAppRegistry` is present; use the published `/registry` helpers when practical
|
|
54
|
+
- reports a missing dependency lockfile or a `package-lock.json` excluded by `.gitignore`; commit the lockfile before Cloudflare Pages deployment
|
|
54
55
|
- reports stale legacy workarounds such as alias-link scripts and old root package generator imports
|
|
55
56
|
|
|
56
57
|
When to rerun it:
|
package/bin/init.cjs
CHANGED
|
@@ -51,6 +51,15 @@ const LEGACY_BUILD_MARKERS = [
|
|
|
51
51
|
'@marvalt/digivalt-core',
|
|
52
52
|
];
|
|
53
53
|
|
|
54
|
+
const LOCKFILE_NAMES = [
|
|
55
|
+
'package-lock.json',
|
|
56
|
+
'npm-shrinkwrap.json',
|
|
57
|
+
'pnpm-lock.yaml',
|
|
58
|
+
'yarn.lock',
|
|
59
|
+
'bun.lock',
|
|
60
|
+
'bun.lockb',
|
|
61
|
+
];
|
|
62
|
+
|
|
54
63
|
function getArgValue(flag) {
|
|
55
64
|
const index = args.indexOf(flag);
|
|
56
65
|
return index >= 0 ? args[index + 1] : undefined;
|
|
@@ -223,6 +232,24 @@ function findLocalRegistryFiles(srcDir) {
|
|
|
223
232
|
return matches;
|
|
224
233
|
}
|
|
225
234
|
|
|
235
|
+
function packageLockIsIgnored() {
|
|
236
|
+
const gitignore = readTextIfExists(path.join(targetDir, '.gitignore'));
|
|
237
|
+
if (!gitignore) return false;
|
|
238
|
+
|
|
239
|
+
let ignored = false;
|
|
240
|
+
for (const rawLine of gitignore.split(/\r?\n/)) {
|
|
241
|
+
const line = rawLine.trim();
|
|
242
|
+
if (!line || line.startsWith('#')) continue;
|
|
243
|
+
|
|
244
|
+
const negated = line.startsWith('!');
|
|
245
|
+
const pattern = (negated ? line.slice(1) : line).replace(/^\//, '');
|
|
246
|
+
if (pattern === 'package-lock.json') {
|
|
247
|
+
ignored = !negated;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return ignored;
|
|
251
|
+
}
|
|
252
|
+
|
|
226
253
|
function inspectTargetApp(targetPackageJsonPath, templateGenerateScript) {
|
|
227
254
|
const packageJson = readJson(targetPackageJsonPath);
|
|
228
255
|
const scripts = packageJson.scripts || {};
|
|
@@ -295,6 +322,8 @@ function inspectTargetApp(targetPackageJsonPath, templateGenerateScript) {
|
|
|
295
322
|
legacyRootImport: Boolean(generateScriptContent && generateScriptContent.includes("import { generators } from '@marvalt/digivalt-core';")),
|
|
296
323
|
legacyViteConfigs,
|
|
297
324
|
localRegistryFiles: findLocalRegistryFiles(path.join(targetDir, 'src')),
|
|
325
|
+
lockfiles: LOCKFILE_NAMES.filter((name) => fs.existsSync(path.join(targetDir, name))),
|
|
326
|
+
packageLockIgnored: packageLockIsIgnored(),
|
|
298
327
|
};
|
|
299
328
|
}
|
|
300
329
|
|
|
@@ -305,6 +334,7 @@ function printPreflight(status) {
|
|
|
305
334
|
console.log(`- scripts.build: ${status.buildState}`);
|
|
306
335
|
console.log(`- scripts.build:dev: ${status.buildDevState}`);
|
|
307
336
|
console.log(`- scripts/generate.ts: ${status.generateState}`);
|
|
337
|
+
console.log(`- dependency lockfile: ${status.lockfiles.length > 0 ? status.lockfiles.join(', ') : 'missing'}`);
|
|
308
338
|
|
|
309
339
|
if (status.legacyHackFiles.length > 0 || status.legacyPostinstall || status.legacyRootImport || status.legacyViteConfigs.length > 0) {
|
|
310
340
|
console.log('- legacy DigiVAlt wiring detected: yes');
|
|
@@ -477,6 +507,18 @@ function collectLegacyWarnings(status) {
|
|
|
477
507
|
`Local WordPress registry detected (${status.localRegistryFiles.join(', ')}). Prefer \`@marvalt/digivalt-core/registry\`; existing files were not overwritten.`
|
|
478
508
|
);
|
|
479
509
|
}
|
|
510
|
+
|
|
511
|
+
if (status.packageLockIgnored) {
|
|
512
|
+
report.warnings.push(
|
|
513
|
+
'`package-lock.json` is ignored by `.gitignore`. Remove that rule and commit the lockfile so Cloudflare Pages installs the tested dependency tree.'
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (status.lockfiles.length === 0) {
|
|
518
|
+
report.manualActions.push(
|
|
519
|
+
'Generate and commit a dependency lockfile before deploying (for npm: run `npm install` and commit `package-lock.json`).'
|
|
520
|
+
);
|
|
521
|
+
}
|
|
480
522
|
}
|
|
481
523
|
|
|
482
524
|
function printList(title, items) {
|
|
@@ -503,9 +545,10 @@ function printSummary() {
|
|
|
503
545
|
console.log('2. Copy `.env.local.example` to `.env.local`, fill secrets, and keep `.env.example` as the team-facing public template.');
|
|
504
546
|
console.log('3. Copy `.dev.vars.example` to `.dev.vars` if you need local Wrangler secrets.');
|
|
505
547
|
console.log('4. Confirm `wrangler.toml` matches your Cloudflare Pages project name.');
|
|
506
|
-
console.log('5.
|
|
507
|
-
console.log('6. Run `
|
|
508
|
-
console.log('7. Run `node scripts/deploy-
|
|
548
|
+
console.log('5. Commit your dependency lockfile so Cloudflare Pages installs the same dependency tree.');
|
|
549
|
+
console.log('6. Run `npm run build` to verify static generation now runs before `vite build`.');
|
|
550
|
+
console.log('7. Run `node scripts/deploy-secrets.js` when you are ready to sync allowed env vars to Cloudflare Pages.');
|
|
551
|
+
console.log('8. Run `node scripts/deploy-pages.js` (or `npm run deploy:pages`) to build and deploy via Wrangler.');
|
|
509
552
|
}
|
|
510
553
|
|
|
511
554
|
try {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type WordPressPayloadCheck = {
|
|
2
|
+
ok: true;
|
|
3
|
+
warnEmptyChrome: boolean;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
expectedSlug?: string;
|
|
7
|
+
pageCount: number;
|
|
8
|
+
receivedSlugs: string[];
|
|
9
|
+
};
|
|
10
|
+
/** Reject a WordPress payload that cannot be the app's front page. */
|
|
11
|
+
export declare function checkWordPressPayload(payload: unknown): WordPressPayloadCheck;
|