@adobe/aem-cli 16.1.6 → 16.2.1
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 +5 -5
- package/src/server/utils.js +4 -1
- package/src/up.cmd.js +30 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [16.2.1](https://github.com/adobe/helix-cli/compare/v16.2.0...v16.2.1) (2024-01-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **cache:** proper root filename handling for subfolders ([#2305](https://github.com/adobe/helix-cli/issues/2305)) ([e7e2d34](https://github.com/adobe/helix-cli/commit/e7e2d3423b371846f87b23e93cbb25c37197899f))
|
|
7
|
+
|
|
8
|
+
# [16.2.0](https://github.com/adobe/helix-cli/compare/v16.1.6...v16.2.0) (2024-01-23)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **up:** check if the site is on helix 5, and use aem.page as preview host if that's the case ([adc2837](https://github.com/adobe/helix-cli/commit/adc2837a242af82582a7d382c966520bcfd90677))
|
|
14
|
+
|
|
1
15
|
## [16.1.6](https://github.com/adobe/helix-cli/compare/v16.1.5...v16.1.6) (2024-01-21)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aem-cli",
|
|
3
|
-
"version": "16.1
|
|
3
|
+
"version": "16.2.1",
|
|
4
4
|
"description": "AEM CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@adobe/fetch": "4.1.1",
|
|
42
42
|
"@adobe/helix-log": "6.0.1",
|
|
43
|
-
"@adobe/helix-shared-config": "10.3.
|
|
44
|
-
"@adobe/helix-shared-git": "3.0.
|
|
45
|
-
"@adobe/helix-shared-indexer": "2.0.
|
|
43
|
+
"@adobe/helix-shared-config": "10.3.9",
|
|
44
|
+
"@adobe/helix-shared-git": "3.0.5",
|
|
45
|
+
"@adobe/helix-shared-indexer": "2.0.19",
|
|
46
46
|
"camelcase": "8.0.0",
|
|
47
47
|
"chalk-template": "1.1.0",
|
|
48
48
|
"chokidar": "3.5.3",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@adobe/eslint-config-helix": "2.0.5",
|
|
79
|
-
"@adobe/helix-shared-dom": "2.0.
|
|
79
|
+
"@adobe/helix-shared-dom": "2.0.4",
|
|
80
80
|
"@adobe/helix-testutils": "0.4.15",
|
|
81
81
|
"@semantic-release/changelog": "6.0.3",
|
|
82
82
|
"@semantic-release/git": "10.0.1",
|
package/src/server/utils.js
CHANGED
|
@@ -139,7 +139,10 @@ window.LiveReloadOptions = {
|
|
|
139
139
|
computePathForCache(url, directory) {
|
|
140
140
|
const u = new URL(url);
|
|
141
141
|
const { pathname, search } = u;
|
|
142
|
-
let fileName = pathname.substring(1)
|
|
142
|
+
let fileName = pathname.substring(1);
|
|
143
|
+
if (fileName.endsWith('/') || fileName === '') {
|
|
144
|
+
fileName += 'index.html';
|
|
145
|
+
}
|
|
143
146
|
if (search) {
|
|
144
147
|
let qs = search.substring(1); // remove leading '?'
|
|
145
148
|
if (fileName.length + qs.length > 255) {
|
package/src/up.cmd.js
CHANGED
|
@@ -100,11 +100,39 @@ export default class UpCommand extends AbstractServerCommand {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
async verifyUrl(gitUrl, inref) {
|
|
103
|
+
// check if the site is on helix5
|
|
104
|
+
// https://admin.hlx.page/sidekick/adobe/www-aem-live/main/config.json
|
|
105
|
+
// {
|
|
106
|
+
// "host": "aem.live",
|
|
107
|
+
// "liveHost": "main--www-aem-live--adobe.aem.live",
|
|
108
|
+
// "plugins": [
|
|
109
|
+
// {
|
|
110
|
+
// "id": "doc",
|
|
111
|
+
// "title": "Documentation",
|
|
112
|
+
// "url": "https://www.aem.live/docs/"
|
|
113
|
+
// }
|
|
114
|
+
// ],
|
|
115
|
+
// "previewHost": "main--www-aem-live--adobe.aem.page",
|
|
116
|
+
// "project": "Helix Website (AEM Live)",
|
|
117
|
+
// "testProperty": "header";
|
|
118
|
+
// }
|
|
119
|
+
const configUrl = `https://admin.hlx.page/sidekick/${gitUrl.repo}/${gitUrl.owner}/${inref}/config.json`;
|
|
120
|
+
const configResp = await getFetch()(configUrl);
|
|
121
|
+
let previewHostBase = 'hlx.page';
|
|
122
|
+
if (configResp.ok) {
|
|
123
|
+
// this is best effort for now
|
|
124
|
+
const config = await configResp.json();
|
|
125
|
+
const { previewHost } = config;
|
|
126
|
+
if (previewHost && previewHost.endsWith('.aem.page')) {
|
|
127
|
+
previewHostBase = 'aem.page';
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
103
131
|
let ref = inref;
|
|
104
132
|
|
|
105
133
|
// replace `/` by `-` in ref.
|
|
106
134
|
ref = ref.replace(/\//g, '-');
|
|
107
|
-
this._url = `https://${ref}--${gitUrl.repo}--${gitUrl.owner}
|
|
135
|
+
this._url = `https://${ref}--${gitUrl.repo}--${gitUrl.owner}.${previewHostBase}`;
|
|
108
136
|
// check length limit
|
|
109
137
|
if (this._url.split('.')
|
|
110
138
|
.map((part) => part.replace(/^https:\/\//, ''))
|
|
@@ -125,7 +153,7 @@ export default class UpCommand extends AbstractServerCommand {
|
|
|
125
153
|
this.log.warn(chalk`Unable to verify {yellow main} branch via {blue ${fstabUrl}} (${resp.status}). Maybe not pushed yet?`);
|
|
126
154
|
} else {
|
|
127
155
|
this.log.warn(chalk`Unable to verify {yellow ${ref}} branch on {blue ${fstabUrl}} (${resp.status}). Fallback to {yellow main} branch.`);
|
|
128
|
-
this._url = `https://main--${gitUrl.repo}--${gitUrl.owner}
|
|
156
|
+
this._url = `https://main--${gitUrl.repo}--${gitUrl.owner}.${previewHostBase}`;
|
|
129
157
|
}
|
|
130
158
|
}
|
|
131
159
|
}
|