@adobe/aem-cli 16.10.45 → 16.10.46

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,10 @@
1
+ ## [16.10.46](https://github.com/adobe/helix-cli/compare/v16.10.45...v16.10.46) (2025-08-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **2576:** provide a way to dump all headers ([#2577](https://github.com/adobe/helix-cli/issues/2577)) ([38c2275](https://github.com/adobe/helix-cli/commit/38c2275a8ceec531aa9f4abb4d3cafe66c15a222))
7
+
1
8
  ## [16.10.45](https://github.com/adobe/helix-cli/compare/v16.10.44...v16.10.45) (2025-08-26)
2
9
 
3
10
 
package/README.md CHANGED
@@ -17,22 +17,7 @@ Install `aem` as a global command. You need Node 12.11 or newer.
17
17
  npm install -g @adobe/aem-cli
18
18
  ```
19
19
 
20
- ### Migrating from older version
21
-
22
- Starting with version 15.0.0, this tool is named `aem` and published as `@adobe/aem-cli`. If you previously had installed this tool under its old name `hlx` aka `@adobe/helix-cli` you might get an error like:
23
-
24
- ```
25
- npm error EEXIST: file already exists
26
- npm error File exists: /opt/homebrew/bin/hlx
27
- npm error Remove the existing file and try again, or run npm
28
- ```
29
-
30
- To solve, first uninstall the old version, then try again:
31
-
32
- ```
33
- npm uninstall -g @adobe/helix-cli
34
- npm install -g @adobe/aem-cli
35
- ```
20
+ If this fails with `File exists: /opt/homebrew/bin/hlx`, please [see here](#npm-install-fails-with-file-exists-opthomebrewbinhlx).
36
21
 
37
22
  ## Quick Start
38
23
 
@@ -204,3 +189,25 @@ aem up
204
189
  ```
205
190
 
206
191
  This will make Node.js trust the server certificate and `aem up` should work.
192
+
193
+ ## `npm install` fails with `File exists: /opt/homebrew/bin/hlx`
194
+
195
+ If you try to install `@adobe/aem-cli`:
196
+
197
+ ```
198
+ > npm install -g @adobe/aem-cli
199
+ ...
200
+ npm error EEXIST: file already exists
201
+ npm error File exists: /opt/homebrew/bin/hlx
202
+ npm error Remove the existing file and try again, or run npm
203
+ ```
204
+
205
+ This can happen when you previously had installed this tool under its old package name [@adobe/helix-cli](https://www.npmjs.com/package/@adobe/helix-cli). Starting with version 15.0.0, this tool was renamed `aem` and published as `@adobe/aem-cli`. The previous `@adobe/helix-cli` has been deprecated. However, the new package still provides the command line binary under the old name `hlx` in addition to `aem`, for backwards compatibility, which can lead to the npm install error.
206
+
207
+ To solve, first uninstall the old version, then install again with the new name:
208
+
209
+ ```
210
+ npm uninstall -g @adobe/helix-cli
211
+ npm install -g @adobe/aem-cli
212
+ ```
213
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aem-cli",
3
- "version": "16.10.45",
3
+ "version": "16.10.46",
4
4
  "description": "AEM CLI",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/import.cmd.js CHANGED
@@ -24,6 +24,7 @@ export default class ImportCommand extends AbstractServerCommand {
24
24
  super(logger);
25
25
  this._importerSubPath = 'tools/importer';
26
26
  this._allowInsecure = true;
27
+ this._dumpHeaders = false;
27
28
  }
28
29
 
29
30
  withAllowInsecure(value) {
@@ -59,6 +60,11 @@ export default class ImportCommand extends AbstractServerCommand {
59
60
  return this;
60
61
  }
61
62
 
63
+ withDumpHeaders(value) {
64
+ this._dumpHeaders = value;
65
+ return this;
66
+ }
67
+
62
68
  /**
63
69
  * Ensure the UI branch the caller specified (or defaulted to) is the one being used.
64
70
  * @param uiFolder
@@ -136,7 +142,8 @@ export default class ImportCommand extends AbstractServerCommand {
136
142
  .withLogger(this._logger)
137
143
  .withKill(this._kill)
138
144
  .withAllowInsecure(this._allowInsecure)
139
- .withHeadersFile(this._headersFile);
145
+ .withHeadersFile(this._headersFile)
146
+ .withDumpHeaders(this._dumpHeaders);
140
147
  this.log.info(chalk`{yellow ___ ________ ___ __}`);
141
148
  this.log.info(chalk`{yellow / | / ____/ |/ / (_)___ ___ ____ ____ _____/ /____ _____}`);
142
149
  this.log.info(chalk`{yellow / /| | / __/ / /|_/ / / / __ \`__ \\/ __ \\/ __ \\/ ___/ __/ _ \\/ ___/}`);
package/src/import.js CHANGED
@@ -80,6 +80,12 @@ export default function up() {
80
80
  type: 'string',
81
81
  default: undefined,
82
82
  })
83
+ .option('dump-headers', {
84
+ alias: 'dumpHeaders',
85
+ describe: 'Dump request headers to console for debugging',
86
+ type: 'boolean',
87
+ default: false,
88
+ })
83
89
  .group(['port', 'addr', 'stop-other', 'tls-cert', 'tls-key'], 'Server options')
84
90
  .option('cache', {
85
91
  describe: 'Path to local folder to cache the responses',
@@ -118,6 +124,7 @@ export default function up() {
118
124
  .withSkipUI(argv.skipUI)
119
125
  .withUIRepo(argv.uiRepo)
120
126
  .withHeadersFile(argv.headersFile)
127
+ .withDumpHeaders(argv.dumpHeaders)
121
128
  .run();
122
129
  },
123
130
  };
@@ -18,6 +18,7 @@ export class HelixImportProject extends BaseProject {
18
18
  super(HelixImportServer);
19
19
 
20
20
  this._allowInsecure = true;
21
+ this._dumpHeaders = false;
21
22
  }
22
23
 
23
24
  withAllowInsecure(value) {
@@ -42,6 +43,15 @@ export class HelixImportProject extends BaseProject {
42
43
  return this._cliHeaders;
43
44
  }
44
45
 
46
+ withDumpHeaders(value) {
47
+ this._dumpHeaders = value;
48
+ return this;
49
+ }
50
+
51
+ get dumpHeaders() {
52
+ return this._dumpHeaders;
53
+ }
54
+
45
55
  async start() {
46
56
  this.log.debug('Launching AEM import server for importing content...');
47
57
  await super.start();
@@ -108,6 +108,17 @@ export class HelixImportServer extends BaseServer {
108
108
  delete headers['accept-encoding'];
109
109
  await this._updateHeaders(headers);
110
110
 
111
+ // Dump headers if dump mode is enabled
112
+ if (this._project.dumpHeaders) {
113
+ ctx.log.info('=== REQUEST HEADERS ===');
114
+ ctx.log.info(`Request URL: ${url}`);
115
+ ctx.log.info(`Request Method: ${req.method}`);
116
+ Object.entries(headers).forEach(([key, value]) => {
117
+ ctx.log.info(`${key}: ${value}`);
118
+ });
119
+ ctx.log.info('=======================');
120
+ }
121
+
111
122
  const ret = await getFetch(ctx.config.allowInsecure)(url, {
112
123
  method: req.method,
113
124
  headers,
@@ -186,8 +197,8 @@ export class HelixImportServer extends BaseServer {
186
197
  host = new URL(host).origin;
187
198
  const url = this._makeProxyURL(ctx.url, host);
188
199
  await this._doProxyRequest(ctx, url, host, req, res);
189
- // codecov:ignore:start
190
- /* c8 ignore start */
200
+ // codecov:ignore:start
201
+ /* c8 ignore start */
191
202
  } catch (err) {
192
203
  log.error(`Failed to proxy AEM request ${ctx.path}: ${err.message}`);
193
204
  res.status(502).send(`Failed to proxy AEM request: ${err.message}`);