Skip to content

Commit

Permalink
MWPW-166682 Migrate to Helix 5 (#17)
Browse files Browse the repository at this point in the history
* MWPW-166682 Migrate to Helix 5

* update sidekick tools
  • Loading branch information
meganthecoder authored Feb 12, 2025
1 parent a5cde5b commit f52f350
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Resolves: [MWPW-NUMBER](https://jira.corp.adobe.com/browse/MWPW-NUMBER)

**Test URLs:**
- Before: https://main--bacom-blog--adobecom.hlx.page/?martech=off
- After: https://<branch>--bacom-blog--adobecom.hlx.page/?martech=off
- Before: https://main--da-bacom-blog--adobecom.aem.live/?martech=off
- After: https://<branch>--da-bacom-blog--adobecom.aem.live/?martech=off
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please carefully review the [contributing doc](/CONTRIBUTING.md) before beginnin

## Developing
1. Install the [Helix CLI](https://github.com/adobe/helix-cli): `sudo npm install -g @adobe/helix-cli`
2. Run `hlx up` this repo's folder. (opens your browser at `http://localhost:3000`)
2. Run `aem up` this repo's folder. (opens your browser at `http://localhost:3000`)
3. Open this repo's folder in your favorite editor and start coding.

### Husky Pre-Commit
Expand All @@ -18,7 +18,7 @@ git commit -m "First" --no-verify
```

## Testing Milo Changes on Bacom Blog Pages
1. Run 'hlx up' in this folder to ensure the bacom site is running locally.
1. Run 'aem up' in this folder to ensure the bacom site is running locally.
2. Make changes in milo, and then from the milo folder, run `npm run libs`.
3. Milo will run at:
```
Expand Down
2 changes: 1 addition & 1 deletion blog/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function setLibs(location) {
if (!['.aem.', '.hlx.', '.stage.', 'local'].some((i) => hostname.includes(i))) return '/libs';
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
return branch.includes('--') ? `https://${branch}.aem.live/libs` : `https://${branch}--milo--adobecom.aem.live/libs`;
}

export const LIBS = setLibs(window.location);
Expand Down
2 changes: 1 addition & 1 deletion head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
if (!['.aem.', '.hlx.', '.stage.', 'local'].some((i) => hostname.includes(i))) return '/libs';
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
return branch.includes('--') ? `https://${branch}.aem.live/libs` : `https://${branch}--milo--adobecom.aem.live/libs`;
})();

const miloStyles = document.createElement('link');
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 @@ -6,7 +6,7 @@ import { setLibs, buildAutoBlocks } from '../../blog/scripts/scripts.js';
describe('Libs', () => {
it('Default Libs', () => {
const libs = setLibs(window.location);
expect(libs).to.equal('https://main--milo--adobecom.hlx.live/libs');
expect(libs).to.equal('https://main--milo--adobecom.aem.live/libs');
});

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

it('Supports local milolibs query param', () => {
Expand All @@ -42,7 +42,7 @@ describe('Libs', () => {
search: '?milolibs=awesome--milo--forkedowner',
};
const libs = setLibs(location);
expect(libs).to.equal('https://awesome--milo--forkedowner.hlx.live/libs');
expect(libs).to.equal('https://awesome--milo--forkedowner.aem.live/libs');
});
});

Expand Down
36 changes: 18 additions & 18 deletions test/tools/locale-nav/locale-selector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,57 @@ const locales = [
code: 'uk',
path: '/uk/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/uk/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/uk/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/uk/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/uk/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/uk/blog/',
},
{
code: 'au',
path: '/au/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/au/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/au/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/au/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/au/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/au/blog/',
},
{
code: 'de',
path: '/de/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/de/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/de/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/de/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/de/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/de/blog/',
},
{
code: 'fr',
path: '/fr/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/fr/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/fr/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/fr/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/fr/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/fr/blog/',
},
{
code: 'kr',
path: '/kr/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/kr/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/kr/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/kr/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/kr/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/kr/blog/',
},
{
code: 'ja',
path: '/ja/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/ja/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/ja/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/ja/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/ja/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/ja/blog/',
},
{
code: 'en',
path: '/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/blog/',
},
{
code: 'langstore/en',
path: '/langstore/en/blog/index',
edit: 'https://da.live/edit#/adobecom/da-bacom-blog/langstore/en/blog/index',
preview: 'https://main--da-bacom-blog--adobecom.hlx.page/langstore/en/blog/',
live: 'https://main--da-bacom-blog--adobecom.hlx.live/langstore/en/blog/',
preview: 'https://main--da-bacom-blog--adobecom.aem.page/langstore/en/blog/',
live: 'https://main--da-bacom-blog--adobecom.aem.live/langstore/en/blog/',
},
];

Expand Down Expand Up @@ -114,8 +114,8 @@ describe('Locale Selector', () => {
expect(currentLocale).to.exist;
expect(currentLocale.querySelector('span').textContent).to.equal('en');
expect(currentLocale.querySelector('.edit').href).to.equal('https://da.live/edit#/adobecom/da-bacom-blog/blog/index');
expect(currentLocale.querySelector('.preview').href).to.equal('https://main--da-bacom-blog--adobecom.hlx.page/blog/');
expect(currentLocale.querySelector('.live').href).to.equal('https://main--da-bacom-blog--adobecom.hlx.live/blog/');
expect(currentLocale.querySelector('.preview').href).to.equal('https://main--da-bacom-blog--adobecom.aem.page/blog/');
expect(currentLocale.querySelector('.live').href).to.equal('https://main--da-bacom-blog--adobecom.aem.live/blog/');
});

it('handle search', async () => {
Expand Down
4 changes: 2 additions & 2 deletions tools/locale-nav/locale-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ async function fetchStatus({ org, repo }, locPath) {
code,
path: locPath,
edit: `${EDIT_URL}${org}/${repo}${editPath}`,
preview: `https://main--${repo}--${org}.hlx.page${locPath}`,
live: `https://main--${repo}--${org}.hlx.live${locPath}`,
preview: `https://main--${repo}--${org}.aem.page${locPath}`,
live: `https://main--${repo}--${org}.aem.live${locPath}`,
};
});

Expand Down
12 changes: 6 additions & 6 deletions tools/sidekick/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@
"id": "locales",
"title": "Locales",
"environments": ["da-edit"],
"icon": "https://main--da-bacom-blog--adobecom.hlx.live/media/media_1c385be465401986f20e49857dc80f772c7f77d09.png",
"icon": "https://main--da-bacom-blog--adobecom.aem.live/media/media_1c385be465401986f20e49857dc80f772c7f77d09.png",
"path": "/tools/locale-nav/locale-nav.html"
},
{
"containerId": "tools",
"id": "localize-2",
"title": "Localize (V2)",
"environments": [ "edit" ],
"url": "https://main--bacom-blog--adobecom.hlx.page/tools/loc?milolibs=locui",
"url": "https://main--da-bacom-blog--adobecom.aem.live/tools/loc?milolibs=locui",
"passReferrer": true,
"passConfig": true,
"includePaths": [ "**.xlsx**" ]
Expand All @@ -82,7 +82,7 @@
"id": "floodgate",
"title": "Floodgate",
"environments": [ "edit" ],
"url": "https://main--bacom-blog--adobecom.hlx.page/tools/floodgate?milolibs=floodgateui",
"url": "https://main--da-bacom-blog--adobecom.aem.live/tools/floodgate?milolibs=floodgateui",
"passReferrer": true,
"passConfig": true,
"includePaths": [ "**.xlsx**" ]
Expand All @@ -92,7 +92,7 @@
"title": "Tag Selector",
"id": "tag-selector",
"environments": ["edit"],
"url": "https://main--bacom-blog--adobecom.hlx.live/tools/tag-selector",
"url": "https://main--da-bacom-blog--adobecom.aem.live/tools/tag-selector",
"isPalette": true,
"paletteRect": "top: 150px; left: 7%; height: 675px; width: 85vw;"
},
Expand All @@ -101,13 +101,13 @@
"id": "bulk",
"title": "Bulk operations",
"environments": [ "edit", "dev", "preview", "live" ],
"url": "https://main--bacom-blog--adobecom.hlx.page/tools/bulk"
"url": "https://main--da-bacom-blog--adobecom.aem.live/tools/bulk"
},
{
"id": "da-tags",
"title": "Tag Browser",
"environments": ["da-edit"],
"icon": "https://main--da-bacom-blog--adobecom.hlx.live/media/media_16dd3261cd73df7adf30ed02b31d7d58ada82a3f0.png",
"icon": "https://main--da-bacom-blog--adobecom.aem.live/media/media_16dd3261cd73df7adf30ed02b31d7d58ada82a3f0.png",
"path": "/tools/tags.html"
}
]
Expand Down

0 comments on commit f52f350

Please sign in to comment.