Skip to content

Commit

Permalink
Merge branch 'main' into semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
kptdobe committed Sep 13, 2023
2 parents 9f225be + fb42f76 commit 22d9eb3
Show file tree
Hide file tree
Showing 50 changed files with 1,689 additions and 11,641 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"root": true,
"extends": "airbnb-base",
"env": {
"browser": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"allowImportExportEverywhere": true,
"sourceType": "module",
"requireConfigFile": false
},
"rules": {
"no-param-reassign": [2, { "props": false }],
"linebreak-style": ["error", "unix"],
"import/extensions": ["error", {
"js": "always"
}],
"no-unused-expressions": "off"
},
"plugins": [
"html"
],
"ignorePatterns": ["coverage"]
}
19 changes: 19 additions & 0 deletions .github/workflows/branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test on branches
on:
push:
branches-ignore:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- run: npm run lint
- run: npm run test
- run: npm run build
11 changes: 7 additions & 4 deletions dist/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function decorateButtons(element) {
const twoup = a.parentElement.parentElement;
if (!a.querySelector('img')) {
if (up.childNodes.length === 1 && (up.tagName === 'P' || up.tagName === 'DIV')) {
a.className = 'button primary'; // default
a.className = 'button'; // default
up.classList.add('button-container');
}
if (
Expand Down Expand Up @@ -579,7 +579,9 @@ async function loadBlock(block) {
const decorationComplete = new Promise((resolve) => {
(async () => {
try {
const mod = await import(`../blocks/${blockName}/${blockName}.js`);
const mod = await import(
`${window.hlx.codeBasePath}/blocks/${blockName}/${blockName}.js`
);
if (mod.default) {
await mod.default(block);
}
Expand All @@ -597,6 +599,7 @@ async function loadBlock(block) {
}
block.dataset.blockStatus = 'loaded';
}
return block;
}

/**
Expand Down Expand Up @@ -643,7 +646,7 @@ function decorateBlocks(main) {
* @param {Element} header header element
* @returns {Promise}
*/
function loadHeader(header) {
async function loadHeader(header) {
const headerBlock = buildBlock('header', '');
header.append(headerBlock);
decorateBlock(headerBlock);
Expand All @@ -655,7 +658,7 @@ function loadHeader(header) {
* @param footer footer element
* @returns {Promise}
*/
function loadFooter(footer) {
async function loadFooter(footer) {
const footerBlock = buildBlock('footer', '');
footer.append(footerBlock);
decorateBlock(footerBlock);
Expand Down
Loading

0 comments on commit 22d9eb3

Please sign in to comment.