@adobe/aem-cli 16.19.11 → 16.19.12
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
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [16.19.12](https://github.com/adobe/helix-cli/compare/v16.19.11...v16.19.12) (2026-06-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* extract main innerHTML for .plain.html fallback and improve test fixture ([e49ca05](https://github.com/adobe/helix-cli/commit/e49ca059f67da164ff20ad549dbd40590797f911))
|
|
7
|
+
* **lint:** fix curly brace style and install missing dependencies ([e138bf0](https://github.com/adobe/helix-cli/commit/e138bf00f1da5c2c8f542fe56a3a8a86ee63a70c))
|
|
8
|
+
* properly serve .plain.html requests for documents in local content directory ([89d12d5](https://github.com/adobe/helix-cli/commit/89d12d574e7e8a143f32973c4f319f814d814099))
|
|
9
|
+
|
|
1
10
|
## [16.19.11](https://github.com/adobe/helix-cli/compare/v16.19.10...v16.19.11) (2026-05-26)
|
|
2
11
|
|
|
3
12
|
|
package/package.json
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"@web/test-runner": "0.20.2",
|
|
19
19
|
"@web/test-runner-junit-reporter": "0.8.0",
|
|
20
20
|
"@web/test-runner-mocha": "0.9.0",
|
|
21
|
-
"@web/test-runner-playwright": "0.11.1"
|
|
21
|
+
"@web/test-runner-playwright": "0.11.1",
|
|
22
|
+
"playwright": "1.60.0"
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
"node_modules/@adobe/eslint-config-helix": {
|
|
@@ -5420,13 +5421,13 @@
|
|
|
5420
5421
|
}
|
|
5421
5422
|
},
|
|
5422
5423
|
"node_modules/playwright": {
|
|
5423
|
-
"version": "1.
|
|
5424
|
-
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.
|
|
5425
|
-
"integrity": "sha512-
|
|
5424
|
+
"version": "1.60.0",
|
|
5425
|
+
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.60.0.tgz",
|
|
5426
|
+
"integrity": "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA==",
|
|
5426
5427
|
"dev": true,
|
|
5427
5428
|
"license": "Apache-2.0",
|
|
5428
5429
|
"dependencies": {
|
|
5429
|
-
"playwright-core": "1.
|
|
5430
|
+
"playwright-core": "1.60.0"
|
|
5430
5431
|
},
|
|
5431
5432
|
"bin": {
|
|
5432
5433
|
"playwright": "cli.js"
|
|
@@ -5439,9 +5440,9 @@
|
|
|
5439
5440
|
}
|
|
5440
5441
|
},
|
|
5441
5442
|
"node_modules/playwright-core": {
|
|
5442
|
-
"version": "1.
|
|
5443
|
-
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.
|
|
5444
|
-
"integrity": "sha512-
|
|
5443
|
+
"version": "1.60.0",
|
|
5444
|
+
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.60.0.tgz",
|
|
5445
|
+
"integrity": "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA==",
|
|
5445
5446
|
"dev": true,
|
|
5446
5447
|
"license": "Apache-2.0",
|
|
5447
5448
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"lint": "eslint .",
|
|
9
9
|
"test": "web-test-runner",
|
|
10
10
|
"test:watch": "web-test-runner --watch",
|
|
11
|
-
"postinstall": "npm run copy-vendor
|
|
11
|
+
"postinstall": "npm run copy-vendor",
|
|
12
12
|
"copy-vendor": "node scripts/copy-vendor.js"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"@web/test-runner": "0.20.2",
|
|
19
19
|
"@web/test-runner-playwright": "0.11.1",
|
|
20
20
|
"@web/test-runner-junit-reporter": "0.8.0",
|
|
21
|
-
"@web/test-runner-mocha": "0.9.0"
|
|
21
|
+
"@web/test-runner-mocha": "0.9.0",
|
|
22
|
+
"playwright": "1.60.0"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"livereload-js": "4.0.2"
|
|
@@ -459,7 +459,26 @@ export class HelixServer extends BaseServer {
|
|
|
459
459
|
try {
|
|
460
460
|
if (contentFilePath.endsWith('.html')) {
|
|
461
461
|
// readFile throws EISDIR for directories and ENOENT for missing files
|
|
462
|
-
|
|
462
|
+
// .plain.html is a virtual URL convention — AEM never stores .plain.html files,
|
|
463
|
+
// so always read the corresponding .html file and serve the <main> fragment.
|
|
464
|
+
const isPlainFallback = contentFilePath.endsWith('.plain.html');
|
|
465
|
+
const servedFilePath = isPlainFallback
|
|
466
|
+
? `${contentFilePath.slice(0, -'.plain.html'.length)}.html`
|
|
467
|
+
: contentFilePath;
|
|
468
|
+
let htmlContent = await readFile(servedFilePath, 'utf-8');
|
|
469
|
+
if (isPlainFallback) {
|
|
470
|
+
if (liveReload) {
|
|
471
|
+
liveReload.registerFile(ctx.requestId, servedFilePath);
|
|
472
|
+
}
|
|
473
|
+
const fragment = utils.extractMainContent(htmlContent);
|
|
474
|
+
res.set({
|
|
475
|
+
'content-type': 'text/html; charset=utf-8',
|
|
476
|
+
'access-control-allow-origin': '*',
|
|
477
|
+
});
|
|
478
|
+
res.send(fragment);
|
|
479
|
+
log.debug(`${pfx}served from ${CONTENT_DIR}/: ${ctx.path}`);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
463
482
|
const absolutePageUrl = absolutePageUrlFromRequest(req, ctx);
|
|
464
483
|
if (this._project.metadataSheet) {
|
|
465
484
|
this._project.metadataSheet.setCookie(req.headers.cookie || '');
|
package/src/server/utils.js
CHANGED
|
@@ -19,11 +19,14 @@ import { fileURLToPath } from 'url';
|
|
|
19
19
|
import cookie from 'cookie';
|
|
20
20
|
import { unified } from 'unified';
|
|
21
21
|
import rehypeParse from 'rehype-parse';
|
|
22
|
+
import { select } from 'hast-util-select';
|
|
23
|
+
import { toHtml } from 'hast-util-to-html';
|
|
22
24
|
import { getFetch } from '../fetch-utils.js';
|
|
23
25
|
|
|
24
26
|
// Load console interceptor script at startup
|
|
25
27
|
// eslint-disable-next-line no-underscore-dangle
|
|
26
28
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
const htmlParser = unified().use(rehypeParse);
|
|
27
30
|
const CONSOLE_INTERCEPTOR = readFileSync(
|
|
28
31
|
path.join(__dirname, '../../packages/browser-injectables/src/console-interceptor.js'),
|
|
29
32
|
'utf-8',
|
|
@@ -787,6 +790,21 @@ window.LiveReloadOptions = {
|
|
|
787
790
|
const fullHead = headHtml + metaTags;
|
|
788
791
|
return `<html><head>${fullHead}</head><body><header></header><main>${content}</main><footer></footer></body></html>`;
|
|
789
792
|
},
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Extracts the innerHTML of the <main> element from a full HTML document.
|
|
796
|
+
* Returns the original content unchanged if no <main> is found.
|
|
797
|
+
* @param {string} html full HTML document
|
|
798
|
+
* @returns {string} innerHTML of <main>, or original html if no <main> present
|
|
799
|
+
*/
|
|
800
|
+
extractMainContent(html) {
|
|
801
|
+
const ast = htmlParser.parse(html);
|
|
802
|
+
const main = select('main', ast);
|
|
803
|
+
if (!main) {
|
|
804
|
+
return html;
|
|
805
|
+
}
|
|
806
|
+
return main.children.map((child) => toHtml(child)).join('');
|
|
807
|
+
},
|
|
790
808
|
};
|
|
791
809
|
|
|
792
810
|
export default Object.freeze(utils);
|