@adobe/aem-cli 16.11.3 → 16.13.0

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,61 @@
1
+ # [16.13.0](https://github.com/adobe/helix-cli/compare/v16.12.0...v16.13.0) (2025-09-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add package-lock.json for browser-injectables ([cc55ce9](https://github.com/adobe/helix-cli/commit/cc55ce93d009d897008c28d34d8f249bada9c942))
7
+ * address PR review comments ([dd3ad77](https://github.com/adobe/helix-cli/commit/dd3ad77a612e2a152967e3c433a12426ec6cd3b2))
8
+ * **browser-injectables:** Potential fix for code scanning alert no. 37: Log injection ([5bf707a](https://github.com/adobe/helix-cli/commit/5bf707a9ae35112ef12aa14eb996d23c0b5fafae))
9
+ * install Playwright dependencies in CI instead of skipping WebKit ([0d32a82](https://github.com/adobe/helix-cli/commit/0d32a8276c06d1d5b05549856682ae519f75b6fb))
10
+ * Potential fix for code scanning alert no. 40: Unused variable, import, function or class ([3dcd827](https://github.com/adobe/helix-cli/commit/3dcd827fbe606976a20a26eaf2a61df2bdfa00e3))
11
+ * remove ai workaround ([ec01627](https://github.com/adobe/helix-cli/commit/ec01627ff30582ebfed1f3622f23bf01aaa154df))
12
+ * remove duplicate console-log-forwarding.test.html file ([e2c95cf](https://github.com/adobe/helix-cli/commit/e2c95cff3e38d22da636f5d88bf808e5245b9aab))
13
+ * resolve all ESLint issues in browser log forwarding implementation ([e5dc3cc](https://github.com/adobe/helix-cli/commit/e5dc3cce5c3b1c5a1fff0bcbdc55fee40b901c08))
14
+ * skip WebKit browser tests on Linux CI ([d6dbd2e](https://github.com/adobe/helix-cli/commit/d6dbd2eb5b2883c8d22ab69c525a5a398465ff83))
15
+ * upload browser coverage reports to codecov ([9c5267c](https://github.com/adobe/helix-cli/commit/9c5267c2428465dbe206e1843ad58aea0d65b226))
16
+ * use @esm-bundle/chai for browser-compatible assertions ([4857fe8](https://github.com/adobe/helix-cli/commit/4857fe854be067fd5a82f4779ab47a574224dd3a))
17
+ * use correct @eslint/config-helpers version (0.3.0) ([7d0cb82](https://github.com/adobe/helix-cli/commit/7d0cb822c658e961d076bbdfb31d2a94d004f352))
18
+ * use createRequire for ESM compatibility in LiveReload.js ([319cd98](https://github.com/adobe/helix-cli/commit/319cd988c147fd7634e8d675d126a659eb6d0ac1))
19
+
20
+
21
+ ### Features
22
+
23
+ * add remaining browser log forwarding implementation files ([55033a7](https://github.com/adobe/helix-cli/commit/55033a79a47cddefbc784e738944d87dae0ae33e))
24
+ * **test:** add web-test-runner for browser testing ([2a19ec1](https://github.com/adobe/helix-cli/commit/2a19ec1012e12696aaf9f07784cc22338095128f))
25
+ * **up:** add browser console log forwarding to terminal ([c8c6402](https://github.com/adobe/helix-cli/commit/c8c6402249c82f74a06451229bafdeb3ccb1f7a3))
26
+
27
+
28
+ ### Reverts
29
+
30
+ * use node modules to serve livereload ([5957400](https://github.com/adobe/helix-cli/commit/5957400e32d238f415a57a646181f39bd97517f4))
31
+
32
+ # [16.12.0](https://github.com/adobe/helix-cli/compare/v16.11.3...v16.12.0) (2025-09-16)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * address PR review comments ([a14cabc](https://github.com/adobe/helix-cli/commit/a14cabc8aaa21525ded5bd9b4c021baf87da07f3))
38
+ * address PR review comments for git worktree support ([4532cac](https://github.com/adobe/helix-cli/commit/4532cac0327e32b3aca045aa99e4279ba7b15d26)), closes [#2583](https://github.com/adobe/helix-cli/issues/2583)
39
+ * comprehensive test setup improvements for git submodules and worktrees ([2715b95](https://github.com/adobe/helix-cli/commit/2715b9578831544ed0b42e93fdd87b2922f6d953))
40
+ * ensure test directories exist before running git init ([c29542c](https://github.com/adobe/helix-cli/commit/c29542c5cd6c17e7a5e2691d7d4189c07a9d6914))
41
+ * handle case where initGit is called from within target directory ([ad4ccde](https://github.com/adobe/helix-cli/commit/ad4ccde34e97afafdeac0c51b3c8e3ddefee7e3f))
42
+ * handle Windows file locking in git worktree tests ([b271662](https://github.com/adobe/helix-cli/commit/b2716624e3fd28031d01b45cf86556d22e4e0f9f))
43
+ * improve initGit error handling and ensure directory creation ([76514d0](https://github.com/adobe/helix-cli/commit/76514d088bc21bc51a379d292ca42bdde280d184))
44
+ * increase Windows CI test timeout to 60 seconds ([149176a](https://github.com/adobe/helix-cli/commit/149176a2b642aee4efcb6e2d1de0a188cc789e12))
45
+ * inline git init to avoid directory change issues ([72fe216](https://github.com/adobe/helix-cli/commit/72fe216f1355369eb2d82bc4356aa4a3aef07cb4))
46
+ * prevent worktree name collisions in tests ([73b3cbf](https://github.com/adobe/helix-cli/commit/73b3cbfffcd6693163193f2031a344a2d2361d67))
47
+ * properly configure Windows CI tests with increased timeout ([59f3a61](https://github.com/adobe/helix-cli/commit/59f3a6175af1c236c34ad1a54639cf7700fbd230))
48
+ * resolve linting errors in test file ([ed31cca](https://github.com/adobe/helix-cli/commit/ed31cca0f82df047dca5e17b6ad6cba38f32f4c2))
49
+ * revert to using initGit helper for consistent test setup ([b517cb3](https://github.com/adobe/helix-cli/commit/b517cb3e2487b180b4b3cdaf2e3949c3984e461f))
50
+ * split statements to separate lines for linting ([068d91c](https://github.com/adobe/helix-cli/commit/068d91cfc36ef1cc6353ae9ad17b05de6e119734))
51
+ * split test runs to identify hanging test ([8a7dd86](https://github.com/adobe/helix-cli/commit/8a7dd862ca4024a25daac0b37105d9f468a113c3))
52
+ * use process.chdir instead of shell.cd for more reliable directory handling ([a31c327](https://github.com/adobe/helix-cli/commit/a31c327cb96add05d665ee9b00117d2be50150e4))
53
+
54
+
55
+ ### Features
56
+
57
+ * add git worktree support with dynamic port selection ([cb763bd](https://github.com/adobe/helix-cli/commit/cb763bd004344d2a5361d675c8028efa2279ae1a))
58
+
1
59
  ## [16.11.3](https://github.com/adobe/helix-cli/compare/v16.11.2...v16.11.3) (2025-09-13)
2
60
 
3
61
 
package/CONTRIBUTING.md CHANGED
@@ -28,6 +28,20 @@ For other contributors, a maintainer of the project has to approve the pull requ
28
28
  3. Use `npm run check` to make sure your code can run the tests and adheres to the style guide
29
29
  4. Create a pull request from your branch
30
30
 
31
+ ## Testing Browser Features
32
+
33
+ Browser-specific features are tested separately in `packages/browser-injectables/`. These tests:
34
+ - Run in real browsers via Playwright
35
+ - Are isolated from main CLI tests
36
+ - Only run in CI when browser code changes
37
+
38
+ To run browser tests locally:
39
+ ```bash
40
+ cd packages/browser-injectables
41
+ npm install
42
+ npm test
43
+ ```
44
+
31
45
  In your pull request, outline:
32
46
 
33
47
  * What the changes intend
package/README.md CHANGED
@@ -56,6 +56,24 @@ $ aem up
56
56
  The `--open` argument takes a path, eg `--open=/products/`, will cause the browser to be openend
57
57
  at the specific location. Disable with `--no-open'.`
58
58
 
59
+ ### browser console log forwarding
60
+
61
+ The `--forward-browser-logs` flag enables forwarding of browser console messages (log, error, warn, info) to the terminal. This is particularly useful for debugging client-side issues without having to open the browser's developer tools.
62
+
63
+ ```
64
+ $ aem up --forward-browser-logs
65
+ ```
66
+
67
+ When enabled, browser console messages will appear in your terminal with the following format:
68
+ ```
69
+ [Browser:error] 2025-07-27T10:30:45.123Z http://localhost:3000/script.js:42 Error message here
70
+ ```
71
+
72
+ This feature is especially helpful when:
73
+ - Debugging JavaScript errors in a headless environment
74
+ - Monitoring client-side behavior during development
75
+ - Working with AI coding assistants that need visibility into both server and client logs
76
+
59
77
  ### setting up a self-signed cert for using https
60
78
 
61
79
  1. create the certificate
@@ -142,6 +160,7 @@ If present, `ALL_PROXY` is used as fallback if there is no other match.
142
160
  | `--addr` | `AEM_ADDR` | `127.0.0.1` | Development server bind address |
143
161
  | `--livereload` | `AEM_LIVERELOAD` | `true` | Enable automatic reloading of modified sources in browser. |
144
162
  | `--no-livereload` | `AEM_NO_LIVERELOAD` | `false` | Disable live-reload. |
163
+ | `--forward-browser-logs` | `AEM_FORWARD_BROWSER_LOGS` | `false` | Forward browser console logs to terminal. |
145
164
  | `--open` | `AEM_OPEN` | `/` | Open a browser window at specified path after server start. |
146
165
  | `--no-open` | `AEM_NO_OPEN` | `false` | Disable automatic opening of browser window. |
147
166
  | `--tls-key` | `AEM_TLS_KEY` | undefined | Path to .key file (for enabling TLS) |
@@ -165,6 +184,22 @@ Read the full AEM Importer [documentation](https://github.com/adobe/helix-import
165
184
  You can use `npm run check` to run the tests and check whether your code adheres
166
185
  to the aem-cli coding style.
167
186
 
187
+ ### Browser Injectables
188
+
189
+ Browser-injected scripts (LiveReload and console log forwarding) are maintained in a separate sub-project at `packages/browser-injectables/`. This isolation keeps browser testing dependencies separate from the main CLI.
190
+
191
+ #### Development
192
+ - Injectable scripts are in `packages/browser-injectables/src/`
193
+ - No build step required - scripts are used directly
194
+ - Browser tests run only when injectable code changes
195
+
196
+ #### Testing Browser Injectables
197
+ ```bash
198
+ cd packages/browser-injectables
199
+ npm install
200
+ npm test
201
+ ```
202
+
168
203
  # Troubleshooting
169
204
 
170
205
  ## `aem up` fails with `unable to get local issuer certificate`
package/eslint.config.js CHANGED
@@ -22,6 +22,8 @@ export default defineConfig([
22
22
  'test/tmp/*',
23
23
  'tmp/*',
24
24
  'coverage',
25
+ // Browser-injectables has its own eslint config, so ignore it
26
+ 'packages/browser-injectables/**',
25
27
  ]),
26
28
  {
27
29
  extends: [recommended],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aem-cli",
3
- "version": "16.11.3",
3
+ "version": "16.13.0",
4
4
  "description": "AEM CLI",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -11,9 +11,9 @@
11
11
  "scripts": {
12
12
  "check": "npm run lint && npm run test",
13
13
  "test": "c8 mocha",
14
- "test-ci-win": "npx mocha --reporter xunit test --reporter-options output=junit/test.xml -t 5000",
15
- "lint": "eslint .",
16
- "lint:fix": "eslint --fix .",
14
+ "test-ci-win": "mocha --reporter spec test -t 300000 --exit",
15
+ "lint": "eslint . && (cd packages/browser-injectables 2>/dev/null && npm run lint || true)",
16
+ "lint:fix": "eslint --fix . && (cd packages/browser-injectables 2>/dev/null && npx eslint --fix . || true)",
17
17
  "semantic-release": "semantic-release",
18
18
  "semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
19
19
  "prepare": "husky"
@@ -23,7 +23,10 @@
23
23
  "recursive": "true",
24
24
  "reporter": "mocha-multi-reporters",
25
25
  "reporter-options": "configFile=.mocha-multi.json",
26
- "loader": "esmock"
26
+ "loader": "esmock",
27
+ "exclude": [
28
+ "test/browser/**"
29
+ ]
27
30
  },
28
31
  "repository": {
29
32
  "type": "git",
@@ -0,0 +1,66 @@
1
+ # AEM CLI Browser Injectables
2
+
3
+ This sub-project contains browser scripts injected by the AEM CLI development server.
4
+
5
+ ## Purpose
6
+
7
+ This package isolates browser-specific code and testing infrastructure from the main AEM CLI, keeping dependencies like Playwright and web-test-runner separate from the core CLI functionality.
8
+
9
+ ## Scripts
10
+
11
+ ### LiveReload (`vendor/livereload.js`)
12
+ Provides automatic browser refresh when files change during development. This is a vendored copy of the `livereload-js` library.
13
+
14
+ ### Console Interceptor (`src/console-interceptor.js`)
15
+ Intercepts browser console methods (log, error, warn, info) and forwards them via WebSocket to the development server, allowing browser console output to appear in the terminal.
16
+
17
+ ## Structure
18
+
19
+ ```
20
+ packages/browser-injectables/
21
+ ├── src/
22
+ │ └── console-interceptor.js # Browser console interception script
23
+ ├── vendor/
24
+ │ └── livereload.js # Vendored copy of livereload-js
25
+ ├── test/
26
+ │ ├── console-log-forwarding.test.js
27
+ │ └── livereload-integration.test.js
28
+ ├── scripts/
29
+ │ └── copy-vendor.js # Copies livereload.js from node_modules
30
+ └── web-test-runner.config.js # Browser test configuration
31
+ ```
32
+
33
+ ## Development
34
+
35
+ Scripts are written as self-contained, browser-compatible JavaScript without requiring a build step.
36
+
37
+ ### Installing Dependencies
38
+ ```bash
39
+ cd packages/browser-injectables
40
+ npm install
41
+ ```
42
+
43
+ This will:
44
+ 1. Install all dependencies
45
+ 2. Copy livereload.js to the vendor directory
46
+ 3. Install Playwright browsers for testing
47
+
48
+ ### Testing
49
+ ```bash
50
+ npm test # Run all browser tests
51
+ npm test:watch # Run tests in watch mode
52
+ ```
53
+
54
+ Tests run in real browsers (Chromium, Firefox, WebKit) via Playwright and web-test-runner.
55
+
56
+ ## Integration with Main Project
57
+
58
+ The main AEM CLI references these scripts directly:
59
+ - `src/server/utils.js` reads `console-interceptor.js` at startup
60
+ - `src/server/LiveReload.js` serves `vendor/livereload.js`
61
+
62
+ No build process is required - the scripts are used as-is.
63
+
64
+ ## CI/CD
65
+
66
+ Browser injectable tests run conditionally in the main CI workflow when files in this directory change. This keeps the test overhead minimal while ensuring proper coverage.
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ import { defineConfig, globalIgnores } from '@eslint/config-helpers';
13
+ import { recommended, source, test } from '@adobe/eslint-config-helix';
14
+
15
+ export default defineConfig([
16
+ globalIgnores([
17
+ 'vendor/**',
18
+ 'node_modules/**',
19
+ 'coverage/**',
20
+ 'coverage-browser/**',
21
+ 'web-test-runner.config.js',
22
+ ]),
23
+ {
24
+ extends: [recommended],
25
+ },
26
+ {
27
+ files: ['src/**/*.js'],
28
+ extends: [source],
29
+ languageOptions: {
30
+ globals: {
31
+ // Browser globals needed for injected scripts
32
+ window: 'readonly',
33
+ document: 'readonly',
34
+ WebSocket: 'readonly',
35
+ location: 'readonly',
36
+ },
37
+ },
38
+ rules: {
39
+ // Allow console for browser debugging
40
+ 'no-console': 'off',
41
+ // Allow var for ES5 compatibility in injected scripts
42
+ 'no-var': 'off',
43
+ 'vars-on-top': 'off',
44
+ // Allow function expressions for ES5 compatibility
45
+ 'prefer-arrow-callback': 'off',
46
+ 'func-names': 'off',
47
+ // Allow arguments object for ES5
48
+ 'prefer-rest-params': 'off',
49
+ // Allow non-shorthand for ES5
50
+ 'object-shorthand': 'off',
51
+ 'prefer-destructuring': 'off',
52
+ },
53
+ },
54
+ {
55
+ files: ['test/**/*.js'],
56
+ extends: [test],
57
+ languageOptions: {
58
+ globals: {
59
+ // Browser globals for tests
60
+ window: 'readonly',
61
+ document: 'readonly',
62
+ location: 'readonly',
63
+ },
64
+ },
65
+ },
66
+ {
67
+ files: ['scripts/**/*.js'],
68
+ extends: [source],
69
+ rules: {
70
+ // Allow __dirname in Node.js scripts
71
+ 'no-underscore-dangle': 'off',
72
+ // Allow console in build scripts
73
+ 'no-console': 'off',
74
+ },
75
+ },
76
+ ]);