@justanarthur/payload-www 1.2.0 → 1.2.2
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 +3 -48
- package/dist/pages.js +0 -1
- package/dist/render-pages.js +0 -1
- package/dist/sitemap.js +0 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -80,41 +80,13 @@ async function generateAsyncImportmap(config, options) {
|
|
|
80
80
|
|
|
81
81
|
// src/cli/index.ts
|
|
82
82
|
register();
|
|
83
|
-
function printHelp() {
|
|
84
|
-
console.log(`payload-www generate:async-importmap
|
|
85
|
-
|
|
86
|
-
Generate an async-importMap.ts containing only the render-path dependencies
|
|
87
|
-
(blocks + collection/global renderers) used by the public render path.
|
|
88
|
-
|
|
89
|
-
Usage:
|
|
90
|
-
payload-www generate:async-importmap --config-path <path> --output <path>
|
|
91
|
-
|
|
92
|
-
Options:
|
|
93
|
-
--config-path <path> Path to the Payload config file (TS or JS).
|
|
94
|
-
Resolved relative to the current working directory.
|
|
95
|
-
--output <path> Output file path. Created if missing.
|
|
96
|
-
--package-name <name> Custom-package key for the render-dependency lookup.
|
|
97
|
-
Defaults to "@justanarthur/payload-www".
|
|
98
|
-
--help, -h Show this help.
|
|
99
|
-
|
|
100
|
-
Example:
|
|
101
|
-
payload-www generate:async-importmap \\
|
|
102
|
-
--config-path apps/www/payload.config.ts \\
|
|
103
|
-
--output apps/www/app/\\(payload\\)/admin/asyncImportMap.ts
|
|
104
|
-
`);
|
|
105
|
-
}
|
|
106
83
|
function parseArgs(argv) {
|
|
107
84
|
const args = {
|
|
108
85
|
configPath: "",
|
|
109
|
-
output: ""
|
|
110
|
-
help: false
|
|
86
|
+
output: ""
|
|
111
87
|
};
|
|
112
88
|
for (let i = 0;i < argv.length; i++) {
|
|
113
89
|
const a = argv[i];
|
|
114
|
-
if (a === "--help" || a === "-h") {
|
|
115
|
-
args.help = true;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
90
|
if (a === "--config-path") {
|
|
119
91
|
args.configPath = argv[++i] ?? "";
|
|
120
92
|
continue;
|
|
@@ -144,14 +116,8 @@ function parseArgs(argv) {
|
|
|
144
116
|
}
|
|
145
117
|
async function main() {
|
|
146
118
|
const args = parseArgs(process.argv.slice(2));
|
|
147
|
-
if (args.help) {
|
|
148
|
-
printHelp();
|
|
149
|
-
process.exit(0);
|
|
150
|
-
}
|
|
151
119
|
if (!args.configPath || !args.output) {
|
|
152
|
-
console.error(
|
|
153
|
-
`);
|
|
154
|
-
printHelp();
|
|
120
|
+
console.error("[payload-www] --config-path and --output are required.");
|
|
155
121
|
process.exit(1);
|
|
156
122
|
}
|
|
157
123
|
const cwd = process.cwd();
|
|
@@ -177,22 +143,11 @@ async function main() {
|
|
|
177
143
|
if (process.env.PAYLOAD_WWW_DEBUG === "1") {
|
|
178
144
|
const { writeFileSync } = await import("node:fs");
|
|
179
145
|
writeFileSync("/tmp/payload-config-dump.json", JSON.stringify(config, (k, v) => typeof v === "function" ? "[function]" : v, 2).slice(0, 200000));
|
|
180
|
-
const cfg = config;
|
|
181
|
-
console.error("[payload-www DEBUG] blocks:", cfg.blocks?.length ?? 0);
|
|
182
|
-
console.error("[payload-www DEBUG] collections:", cfg.collections?.length ?? 0);
|
|
183
|
-
console.error("[payload-www DEBUG] globals:", cfg.globals?.length ?? 0);
|
|
184
|
-
console.error("[payload-www DEBUG] keys:", Object.keys(config).slice(0, 30).join(","));
|
|
185
|
-
const firstBlock = cfg.blocks?.[0] ?? null;
|
|
186
|
-
if (firstBlock) {
|
|
187
|
-
console.error("[payload-www DEBUG] first block slug:", firstBlock.slug);
|
|
188
|
-
console.error("[payload-www DEBUG] first block custom:", JSON.stringify(firstBlock.custom));
|
|
189
|
-
}
|
|
190
146
|
}
|
|
191
|
-
|
|
147
|
+
await generateAsyncImportmap(config, {
|
|
192
148
|
output: path.isAbsolute(args.output) ? args.output : path.resolve(cwd, args.output),
|
|
193
149
|
...args.packageName ? { packageName: args.packageName } : {}
|
|
194
150
|
});
|
|
195
|
-
console.log(`[payload-www] wrote ${result.entries} entries to ${result.output}`);
|
|
196
151
|
}
|
|
197
152
|
main().catch((err) => {
|
|
198
153
|
console.error("[payload-www] unhandled error:");
|
package/dist/pages.js
CHANGED
|
@@ -432,7 +432,6 @@ function createCollectionPageExports({
|
|
|
432
432
|
fallback: doc,
|
|
433
433
|
siteDefaults
|
|
434
434
|
});
|
|
435
|
-
console.log("[www#generateMetadata]", { alternates, meta, locale, localesSlug, doc });
|
|
436
435
|
return { ...meta, alternates };
|
|
437
436
|
}
|
|
438
437
|
async function generateStaticParams(props) {
|
package/dist/render-pages.js
CHANGED
|
@@ -462,7 +462,6 @@ function createCollectionPageExports({
|
|
|
462
462
|
fallback: doc,
|
|
463
463
|
siteDefaults
|
|
464
464
|
});
|
|
465
|
-
console.log("[www#generateMetadata]", { alternates, meta, locale, localesSlug, doc });
|
|
466
465
|
return { ...meta, alternates };
|
|
467
466
|
}
|
|
468
467
|
async function generateStaticParams(props) {
|
package/dist/sitemap.js
CHANGED
|
@@ -276,7 +276,6 @@ function createCollectionPageExports({
|
|
|
276
276
|
fallback: doc,
|
|
277
277
|
siteDefaults
|
|
278
278
|
});
|
|
279
|
-
console.log("[www#generateMetadata]", { alternates, meta, locale, localesSlug, doc });
|
|
280
279
|
return { ...meta, alternates };
|
|
281
280
|
}
|
|
282
281
|
async function generateStaticParams(props) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justanarthur/payload-www",
|
|
3
3
|
"description": "Reusable Payload CMS website template — config builder, collections, globals, blocks, fields, access, hooks, metadata (JSON-LD, hreflang), page renderers, and test helpers.",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"files": [
|