Skip to content

Commit

Permalink
Revert "hlx5 update (#41)" (#42)
Browse files Browse the repository at this point in the history
This reverts commit 1b95772.
  • Loading branch information
Ruchika4 authored Jan 9, 2025
1 parent 1b95772 commit 7e1a058
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export const [setLibs, getLibs] = (() => {
(prodLibs, location) => {
libs = (() => {
const { hostname, search } = location || window.location;
if (!(hostname.includes('.hlx.') || hostname.includes('.aem') || hostname.includes('local'))) return prodLibs;
if (!(hostname.includes('.hlx.') || hostname.includes('local'))) return prodLibs;
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.aem.live/libs` : `https://${branch}--milo--adobecom.aem.live/libs`;
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
})();
return libs;
}, () => libs,
Expand Down
6 changes: 3 additions & 3 deletions test/scripts/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { setLibs } from '../../scripts/utils.js';
describe('Libs', () => {
it('Default Libs', () => {
const libs = setLibs('/libs');
expect(libs).to.equal('https://main--milo--adobecom.aem.live/libs');
expect(libs).to.equal('https://main--milo--adobecom.hlx.live/libs');
});

it('Does not support milolibs query param on prod', () => {
Expand All @@ -22,7 +22,7 @@ describe('Libs', () => {
search: '?milolibs=foo',
};
const libs = setLibs('/libs', location);
expect(libs).to.equal('https://foo--milo--adobecom.aem.live/libs');
expect(libs).to.equal('https://foo--milo--adobecom.hlx.live/libs');
});

it('Supports local milolibs query param', () => {
Expand All @@ -40,6 +40,6 @@ describe('Libs', () => {
search: '?milolibs=awesome--milo--forkedowner',
};
const libs = setLibs('/libs', location);
expect(libs).to.equal('https://awesome--milo--forkedowner.aem.live/libs');
expect(libs).to.equal('https://awesome--milo--forkedowner.hlx.live/libs');
});
});
10 changes: 5 additions & 5 deletions tools/sidekick/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
{
"id": "library",
"title": "Library",
"previewHost": "main--news--adobecom.aem.page",
"liveHost": "main--news--adobecom.aem.live",
"environments": [ "edit" ],
"environments": [
"edit"
],
"isPalette": true,
"passConfig": true,
"paletteRect": "top: auto; bottom: 20px; left: 20px; height: 398px; width: 360px;",
Expand All @@ -24,7 +24,7 @@
"id": "localize",
"title": "Localize",
"environments": [ "edit" ],
"url": "https://main--milo--adobecom.aem.page/tools/loc/index.html?project=news--adobecom",
"url": "https://main--milo--adobecom.hlx.page/tools/loc/index.html?project=news--adobecom",
"passReferrer": true,
"includePaths": [ "**/:x**" ]
},
Expand All @@ -33,7 +33,7 @@
"id": "localize-2",
"title": "Localize (V2)",
"environments": [ "edit" ],
"url": "https://main--news--adobecom.aem.page/tools/loc?milolibs=locui",
"url": "https://main--news--adobecom.hlx.page/tools/loc?milolibs=locui",
"passReferrer": true,
"passConfig": true,
"includePaths": [ "**.xlsx**" ]
Expand Down

0 comments on commit 7e1a058

Please sign in to comment.