Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main crosswalk #39

Merged
merged 45 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
654020e
Starting the 24PetWatch converter
fe-lix- Sep 7, 2023
85e4038
What is in the repo
fe-lix- Oct 17, 2023
ac99466
Block to handle first set of columns
bohnertchris Oct 18, 2023
b14af90
Merge pull request #1 from hlxsites/bohnert-columns
fe-lix- Oct 18, 2023
d597fa8
Making the converter work against the Author
fe-lix- Oct 26, 2023
13f6519
Only adding columns with content
fe-lix- Oct 26, 2023
24f98f5
Making it work
fe-lix- Oct 26, 2023
e92a0fa
Merge pull request #3 from hlxsites/only-adding-columns-with-content
fe-lix- Oct 26, 2023
44eb6c4
Merge pull request #4 from hlxsites/making-converter-work-with-aem
fe-lix- Oct 26, 2023
7f4f1b4
wip
fe-lix- Oct 27, 2023
e49d395
wip
fe-lix- Oct 27, 2023
9aefe2e
Restructure the importer code
fe-lix- Oct 30, 2023
14b3361
Cleanup
fe-lix- Oct 30, 2023
3cd72f7
Footer is working
fe-lix- Oct 30, 2023
560b31b
Adding header
fe-lix- Oct 30, 2023
976c95e
WIP
fe-lix- Oct 30, 2023
3d2eb5f
WIP better
fe-lix- Oct 30, 2023
8083712
Remove console.out logging
bohnertchris Oct 31, 2023
7320453
Unnecessary fetch error message
bohnertchris Oct 31, 2023
4c8f0a9
Merge pull request #5 from hlxsites/header-footer
bohnertchris Oct 31, 2023
9cf3588
Merge branch 'main' into homepage
bohnertchris Oct 31, 2023
69f34e7
Can get button format info from section metadata
bohnertchris Oct 31, 2023
8d210f4
Add section metadata
bohnertchris Oct 31, 2023
46b5052
Remove redundant hr from teaser section
bohnertchris Oct 31, 2023
97f5409
Adding fstab
fe-lix- Nov 2, 2023
88c474b
Merge pull request #8 from hlxsites/configure-fstab
fe-lix- Nov 2, 2023
1dd4fea
Fixed problems with tables (mostly)
bohnertchris Nov 8, 2023
3340b39
More precise query for headers
bohnertchris Nov 8, 2023
6631d22
First carousel attempt
bohnertchris Nov 8, 2023
4c57964
Making the homepage style work
fe-lix- Nov 8, 2023
16990e8
Making the homepage style work
fe-lix- Nov 8, 2023
844da11
Merge branch 'main' into homepage
mhaack Nov 8, 2023
e9612f4
Carousel cleanup
bohnertchris Nov 9, 2023
07768bb
Showing correct header and footer
fe-lix- Nov 9, 2023
4b4e0ef
Enabling footer
fe-lix- Nov 9, 2023
a4c9b15
Correct handling of the header
fe-lix- Nov 9, 2023
3cf8905
Making the footer list better
fe-lix- Nov 9, 2023
434c139
Start of imageList for blog
bohnertchris Nov 9, 2023
82b432b
Fixing some small issues
fe-lix- Nov 10, 2023
426619a
Adding buttons
fe-lix- Nov 10, 2023
20a68e5
Making two types of buttons
fe-lix- Nov 10, 2023
1fe6466
Merge pull request #6 from hlxsites/homepage
fe-lix- Nov 13, 2023
8f4aaf2
Linting the document
fe-lix- Nov 14, 2023
c0b5e54
Using the correct fstab
fe-lix- Nov 15, 2023
3492e04
Eslint exception
fe-lix- Nov 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
helix-importer-ui

/scripts/alloy*.js
/tools/actions/
2 changes: 1 addition & 1 deletion blocks/footer/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default async function decorate(block) {
block.textContent = '';

// fetch footer content
const footerPath = cfg.footer || '/footer';
const footerPath = cfg.footer || '/fragments/footer/master';
const resp = await fetch(`${footerPath}.plain.html`, window.location.pathname.endsWith('/footer') ? { cache: 'reload' } : {});

if (resp.ok) {
Expand Down
2 changes: 1 addition & 1 deletion blocks/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default async function decorate(block) {
const navMeta = getMetadata('nav');
block.textContent = '';

const navPath = navMeta ? new URL(navMeta).pathname : '/nav';
const navPath = navMeta ? new URL(navMeta).pathname : '/fragments/header/master';
const resp = await fetch(`${navPath}.plain.html`);

if (resp.ok) {
Expand Down
8 changes: 8 additions & 0 deletions paths.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mappings:
- /content/24petwatch/us/en:/
- /content/experience-fragments/24petwatch/us/en/site/:/fragments/

includes:
- /content/24petwatch/us/en
- /content/experience-fragments/24petwatch/us/en/site/header
- /content/experience-fragments/24petwatch/us/en/site/footer
8 changes: 4 additions & 4 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,20 @@ main .section {
}

/* section metadata */
main .section.teal-bg {
main .section.teal-bg, main .section.teal {
background-color: #007680;
color: white;
}

main .section.gray-bg {
main .section.gray-bg, main .section.lightcool {
background-color: #e7e9ea;
}

main .section.light-gray-bg {
main .section.light-gray-bg, main .section.lightergray {
background-color: #FBFBFB;
}

main .section.warm-white-bg {
main .section.warm-white-bg, main .section.cream {
background-color: #fff1d6;
}

Expand Down
4 changes: 4 additions & 0 deletions tools/actions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
.aio
dist/
*/node_modules/
55 changes: 55 additions & 0 deletions tools/actions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Build

Each action supports the default `npm run` commands to `build`, `test` and `serve`.

To build the action run

```
npm run build
```

This will build in development mode. To build for production use

```
npm run build -- --mode production
```

## Development

To run the tests run

```
npm run test
```

To run the action locally run

```
npm run serve
```

That will build the action code inside an express app, with [src/express.js](src/express.js) as entry point watching any changes. In parallel it will run the webpack output in a self-restarting node process.

The express app listens on port 3030 and handles incoming requests for *.html and *.md files, applying the import.js transformations.

The app uses [dotenv](https://www.npmjs.com/package/dotenv) to read environment configurations for `AEM_HOST`, `AEM_USER`, `AEM_PASSWORD` and `AEM_WCMMODE`.

The node process can be debugged using for example the Chrome developer tools. Source maps are available.

To test the converter run:

```
curl http://localhost:3030/index.md?wcmmode=disabled
```

## Deployment

The actions built and deployed by a [github workflow](../../.github/workflows/deploy-action-convert.yaml). Each branch with changes to any of the files used by the action will automatically trigger a deployment to a package named after the branch.

To deploy the action manually use the App Builder CLI. The [Getting Started guide for AIO Runtime](https://developer.adobe.com/runtime/docs/guides/getting-started/setup/#creating-a-namespace-and-retrieving-the-credentials) provides detailed steps to setup a local environment.

It is recommended to deploy the current work-in-progress into a separate package, e.g. using your username. Remember, the branch name will be used by the automated deployment. To change the package name, modify the [app.config.yaml](./app.config.yaml).

```
aio app deploy
```
17 changes: 17 additions & 0 deletions tools/actions/app.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
application:
hooks:
pre-app-build: ./bundle-actions.js
runtimeManifest:
packages:
main:
license: Apache-2.0
actions:
convert:
function: convert/dist/main.js
web: 'yes'
runtime: 'nodejs:16'
inputs:
LOG_LEVEL: debug
annotations:
require-adobe-auth: false
final: true
58 changes: 58 additions & 0 deletions tools/actions/bundle-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env node
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

// this script is used instead of individual webpack-config.js configurations per action,
// as these would require additional dependencies (e.g. loaders) to be installed as dev
// dependency on the application level.

import * as url from 'node:url';
import * as path from 'node:path';
import { fork } from 'node:child_process';
import { existsSync } from 'node:fs';
import { readdir } from 'node:fs/promises';

// read all directories, for those that have a webpack executable, run it with --mode production

const webpackArgs = ['--mode', 'production'];
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
const children = await readdir(dirname, { withFileTypes: true });

await Promise.all(children.map(async (child) => {
if (child.isDirectory) {
const childDir = path.resolve(dirname, child.name);
const webpackScript = path.resolve(childDir, 'node_modules/.bin/webpack');
if (existsSync(webpackScript)) {
return new Promise((resolve, reject) => {
// run the webpack script in the childDir
// eslint-disable-next-line no-console
console.log(`Bundling ${child.name} ... `);
const webpackProcess = fork(webpackScript, webpackArgs, { cwd: childDir, silent: true });
webpackProcess.on('error', (err) => reject(err));
webpackProcess.on('exit', (code) => {
if (code > 0) {
reject(code);
} else {
resolve();
}
});
})
.catch((err) => {
// eslint-disable-next-line no-console
console.log(`Failed bundling ${child.name}.`);
throw err;
});
}
}

return Promise.resolve();
}));
3 changes: 3 additions & 0 deletions tools/actions/convert/converter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
env:
publicURL: https://www.24petwatch.com/
aemURL: https://author-p33903-e122205.adobeaemcloud.com/
Loading
Loading