@adobe/aem-cli 16.19.10 → 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,19 @@
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
+
10
+ ## [16.19.11](https://github.com/adobe/helix-cli/compare/v16.19.10...v16.19.11) (2026-05-26)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deps:** update external major ([#2730](https://github.com/adobe/helix-cli/issues/2730)) ([486e6b4](https://github.com/adobe/helix-cli/commit/486e6b4c5de0d1964fc905906324c58b9a2f91d2))
16
+
1
17
  ## [16.19.10](https://github.com/adobe/helix-cli/compare/v16.19.9...v16.19.10) (2026-05-25)
2
18
 
3
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aem-cli",
3
- "version": "16.19.10",
3
+ "version": "16.19.12",
4
4
  "description": "AEM CLI",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -67,7 +67,7 @@
67
67
  "http-proxy-agent": "9.0.0",
68
68
  "https-proxy-agent": "9.0.0",
69
69
  "ignore": "7.0.5",
70
- "ini": "6.0.0",
70
+ "ini": "7.0.0",
71
71
  "isomorphic-git": "1.37.6",
72
72
  "jose": "6.2.3",
73
73
  "mime": "4.1.0",
@@ -96,13 +96,13 @@
96
96
  "esmock": "2.7.5",
97
97
  "husky": "9.1.7",
98
98
  "junit-report-builder": "5.1.2",
99
- "lint-staged": "16.4.0",
99
+ "lint-staged": "17.0.4",
100
100
  "mocha": "11.7.5",
101
101
  "mocha-multi-reporters": "1.5.1",
102
102
  "nock": "13.5.6",
103
103
  "semantic-release": "25.0.3",
104
104
  "semantic-release-discord-bot": "^1.1.0",
105
- "sinon": "21.1.2"
105
+ "sinon": "22.0.0"
106
106
  },
107
107
  "lint-staged": {
108
108
  "*.js": "eslint"
@@ -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.56.0",
5424
- "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0.tgz",
5425
- "integrity": "sha512-X5Q1b8lOdWIE4KAoHpW3SE8HvUB+ZZsUoN64ZhjnN8dOb1UpujxBtENGiZFE+9F/yhzJwYa+ca3u43FeLbboHA==",
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.56.0"
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.56.0",
5443
- "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0.tgz",
5444
- "integrity": "sha512-1SXl7pMfemAMSDn5rkPeZljxOCYAmQnYLBTExuh6E8USHXGSX3dx6lYZN/xPpTz1vimXmPA9CDnILvmJaB8aSQ==",
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 && npx playwright install",
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
- let htmlContent = await readFile(contentFilePath, 'utf-8');
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 || '');
@@ -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);