@adobe/aem-cli 16.5.2 → 16.5.4
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 +14 -0
- package/package.json +6 -6
- package/src/import.cmd.js +7 -1
- package/src/import.js +8 -1
- package/src/server/HelixImportProject.js +20 -0
- package/src/server/HelixImportServer.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [16.5.4](https://github.com/adobe/helix-cli/compare/v16.5.3...v16.5.4) (2024-06-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency @adobe/helix-shared-indexer to v2.0.28 ([3d4308c](https://github.com/adobe/helix-cli/commit/3d4308cd60f84d7964fbcd645d4fdb29520c9498))
|
|
7
|
+
|
|
8
|
+
## [16.5.3](https://github.com/adobe/helix-cli/compare/v16.5.2...v16.5.3) (2024-06-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* support importing pages with authentication in importer ([aac442d](https://github.com/adobe/helix-cli/commit/aac442d4759a783695b21d41fbc0613177ca8d2d))
|
|
14
|
+
|
|
1
15
|
## [16.5.2](https://github.com/adobe/helix-cli/compare/v16.5.1...v16.5.2) (2024-06-17)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aem-cli",
|
|
3
|
-
"version": "16.5.
|
|
3
|
+
"version": "16.5.4",
|
|
4
4
|
"description": "AEM CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@adobe/helix-log": "6.0.3",
|
|
43
43
|
"@adobe/helix-shared-config": "10.5.3",
|
|
44
44
|
"@adobe/helix-shared-git": "3.0.12",
|
|
45
|
-
"@adobe/helix-shared-indexer": "2.0.
|
|
45
|
+
"@adobe/helix-shared-indexer": "2.0.28",
|
|
46
46
|
"camelcase": "8.0.0",
|
|
47
47
|
"chalk-template": "1.1.0",
|
|
48
48
|
"chokidar": "3.6.0",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"express": "4.19.2",
|
|
54
54
|
"faye-websocket": "0.11.4",
|
|
55
55
|
"fs-extra": "11.2.0",
|
|
56
|
-
"glob": "10.4.
|
|
56
|
+
"glob": "10.4.2",
|
|
57
57
|
"glob-to-regexp": "0.4.1",
|
|
58
58
|
"hast-util-select": "6.0.2",
|
|
59
59
|
"http-proxy-agent": "7.0.2",
|
|
60
60
|
"https-proxy-agent": "7.0.4",
|
|
61
61
|
"ignore": "5.3.1",
|
|
62
62
|
"ini": "4.1.3",
|
|
63
|
-
"isomorphic-git": "1.
|
|
63
|
+
"isomorphic-git": "1.26.0",
|
|
64
64
|
"livereload-js": "4.0.2",
|
|
65
65
|
"node-fetch": "3.3.2",
|
|
66
66
|
"open": "10.1.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"rehype-parse": "9.0.0",
|
|
71
71
|
"semver": "7.6.2",
|
|
72
72
|
"shelljs": "0.8.5",
|
|
73
|
-
"unified": "11.0.
|
|
73
|
+
"unified": "11.0.5",
|
|
74
74
|
"uuid": "10.0.0",
|
|
75
75
|
"yargs": "17.7.2"
|
|
76
76
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@semantic-release/git": "10.0.1",
|
|
83
83
|
"c8": "10.1.2",
|
|
84
84
|
"eslint": "8.57.0",
|
|
85
|
-
"esmock": "2.6.
|
|
85
|
+
"esmock": "2.6.6",
|
|
86
86
|
"husky": "9.0.11",
|
|
87
87
|
"junit-report-builder": "3.2.1",
|
|
88
88
|
"lint-staged": "15.2.7",
|
package/src/import.cmd.js
CHANGED
|
@@ -40,6 +40,11 @@ export default class ImportCommand extends AbstractServerCommand {
|
|
|
40
40
|
return this;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
withHeadersFile(value) {
|
|
44
|
+
this._headersFile = value;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
async setupImporterUI() {
|
|
44
49
|
const importerFolder = path.join(this.directory, this._importerSubPath);
|
|
45
50
|
await fse.ensureDir(importerFolder);
|
|
@@ -86,7 +91,8 @@ export default class ImportCommand extends AbstractServerCommand {
|
|
|
86
91
|
.withCwd(this.directory)
|
|
87
92
|
.withLogger(this._logger)
|
|
88
93
|
.withKill(this._kill)
|
|
89
|
-
.withAllowInsecure(this._allowInsecure)
|
|
94
|
+
.withAllowInsecure(this._allowInsecure)
|
|
95
|
+
.withHeadersFile(this._headersFile);
|
|
90
96
|
this.log.info(chalk`{yellow ___ ________ ___ __}`);
|
|
91
97
|
this.log.info(chalk`{yellow / | / ____/ |/ / (_)___ ___ ____ ____ _____/ /____ _____}`);
|
|
92
98
|
this.log.info(chalk`{yellow / /| | / __/ / /|_/ / / / __ \`__ \\/ __ \\/ __ \\/ ___/ __/ _ \\/ ___/}`);
|
package/src/import.js
CHANGED
|
@@ -74,12 +74,18 @@ export default function up() {
|
|
|
74
74
|
type: 'string',
|
|
75
75
|
default: undefined,
|
|
76
76
|
})
|
|
77
|
+
.option('headers-file', {
|
|
78
|
+
alias: 'headersFile',
|
|
79
|
+
describe: 'Location of a custom .json file containing headers to be used with all proxy requests',
|
|
80
|
+
type: 'string',
|
|
81
|
+
default: undefined,
|
|
82
|
+
})
|
|
77
83
|
.group(['port', 'addr', 'stop-other', 'tls-cert', 'tls-key'], 'Server options')
|
|
78
84
|
.option('cache', {
|
|
79
85
|
describe: 'Path to local folder to cache the responses',
|
|
80
86
|
type: 'string',
|
|
81
87
|
})
|
|
82
|
-
.group(['open', 'no-open', 'cache', 'ui-repo', 'skip-ui'], 'AEM Importer Options')
|
|
88
|
+
.group(['open', 'no-open', 'cache', 'ui-repo', 'skip-ui', 'headers-file'], 'AEM Importer Options')
|
|
83
89
|
.option('allow-insecure', {
|
|
84
90
|
alias: 'allowInsecure',
|
|
85
91
|
describe: 'Whether to allow insecure requests to the server',
|
|
@@ -111,6 +117,7 @@ export default function up() {
|
|
|
111
117
|
.withCache(argv.cache)
|
|
112
118
|
.withSkipUI(argv.skipUI)
|
|
113
119
|
.withUIRepo(argv.uiRepo)
|
|
120
|
+
.withHeadersFile(argv.headersFile)
|
|
114
121
|
.run();
|
|
115
122
|
},
|
|
116
123
|
};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
import fs from 'fs-extra';
|
|
12
13
|
import { HelixImportServer } from './HelixImportServer.js';
|
|
13
14
|
import { BaseProject } from './BaseProject.js';
|
|
14
15
|
|
|
@@ -28,9 +29,28 @@ export class HelixImportProject extends BaseProject {
|
|
|
28
29
|
return this._allowInsecure;
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
withHeadersFile(value) {
|
|
33
|
+
this._headersFile = value;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get headersFile() {
|
|
38
|
+
return this._headersFile;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get cliHeaders() {
|
|
42
|
+
return this._cliHeaders;
|
|
43
|
+
}
|
|
44
|
+
|
|
31
45
|
async start() {
|
|
32
46
|
this.log.debug('Launching AEM import server for importing content...');
|
|
33
47
|
await super.start();
|
|
48
|
+
try {
|
|
49
|
+
this._cliHeaders = (this._headersFile) ? await fs.readJSON(this._headersFile) : {};
|
|
50
|
+
} catch (error) {
|
|
51
|
+
this.log.error(`Failed to read headers file: ${error.message}`);
|
|
52
|
+
await this.doStop();
|
|
53
|
+
}
|
|
34
54
|
return this;
|
|
35
55
|
}
|
|
36
56
|
|
|
@@ -63,6 +63,11 @@ export class HelixImportServer extends BaseServer {
|
|
|
63
63
|
return url.toString();
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
async _updateHeaders(headers) {
|
|
67
|
+
// merge the headers defined with the CLI with those from the request
|
|
68
|
+
Object.assign(headers, await this._project.cliHeaders);
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
async _doProxyRequest(ctx, url, host, req, res) {
|
|
67
72
|
ctx.log.debug(`Proxy ${req.method} request to ${url}`);
|
|
68
73
|
|
|
@@ -100,6 +105,7 @@ export class HelixImportServer extends BaseServer {
|
|
|
100
105
|
delete headers.connection;
|
|
101
106
|
delete headers.host;
|
|
102
107
|
delete headers.referer;
|
|
108
|
+
await this._updateHeaders(headers);
|
|
103
109
|
|
|
104
110
|
const ret = await getFetch(ctx.config.allowInsecure)(url, {
|
|
105
111
|
method: req.method,
|