@adobe/aem-cli 16.12.0 → 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 +31 -0
- package/CONTRIBUTING.md +14 -0
- package/README.md +35 -0
- package/eslint.config.js +2 -0
- package/package.json +7 -4
- package/packages/browser-injectables/README.md +66 -0
- package/packages/browser-injectables/eslint.config.js +76 -0
- package/packages/browser-injectables/package-lock.json +6990 -0
- package/packages/browser-injectables/package.json +26 -0
- package/packages/browser-injectables/scripts/copy-vendor.js +28 -0
- package/packages/browser-injectables/src/console-interceptor.js +81 -0
- package/packages/browser-injectables/web-test-runner.config.js +60 -0
- package/src/server/HelixProject.js +5 -0
- package/src/server/HelixServer.js +11 -0
- package/src/server/LiveReload.js +40 -3
- package/src/server/utils.js +16 -0
- package/src/up.cmd.js +6 -0
- package/src/up.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
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
|
+
|
|
1
32
|
# [16.12.0](https://github.com/adobe/helix-cli/compare/v16.11.3...v16.12.0) (2025-09-16)
|
|
2
33
|
|
|
3
34
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aem-cli",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.13.0",
|
|
4
4
|
"description": "AEM CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"check": "npm run lint && npm run test",
|
|
13
13
|
"test": "c8 mocha",
|
|
14
14
|
"test-ci-win": "mocha --reporter spec test -t 300000 --exit",
|
|
15
|
-
"lint": "eslint .",
|
|
16
|
-
"lint:fix": "eslint --fix .",
|
|
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
|
+
]);
|