Skip to content

Commit 5a4f243

Browse files
new setup
1 parent 20599c9 commit 5a4f243

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+33221
-12371
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 49 deletions
This file was deleted.

.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const fs = require('fs');
2+
const projectRootPath = __dirname;
3+
const { AddonRegistry } = require('@plone/registry/addon-registry');
4+
5+
let coreLocation;
6+
if (fs.existsSync(`${projectRootPath}/core`))
7+
coreLocation = `${projectRootPath}/core`;
8+
else if (fs.existsSync(`${projectRootPath}/../../core`))
9+
coreLocation = `${projectRootPath}/../../core`;
10+
11+
const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`);
12+
13+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
14+
const addonAliases = Object.keys(registry.packages).map((o) => [
15+
o,
16+
registry.packages[o].modulePath,
17+
]);
18+
19+
module.exports = {
20+
extends: `${coreLocation}/packages/volto/.eslintrc`,
21+
rules: {
22+
'import/no-unresolved': 1,
23+
},
24+
settings: {
25+
'import/resolver': {
26+
alias: {
27+
map: [
28+
['@plone/volto', `${coreLocation}/packages/volto/src`],
29+
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
30+
['@plone/registry', `${coreLocation}/packages/registry/src`],
31+
[
32+
'@kitconcept/volto-quote-block',
33+
'./packages/volto-quote-block/src',
34+
],
35+
...addonAliases,
36+
],
37+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
38+
},
39+
},
40+
},
41+
};

.github/workflows/acceptance.yml

Lines changed: 77 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,101 @@
11
name: Acceptance tests
2-
on: [push]
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "cypress/**"
9+
- "packages/**"
10+
- ".github/workflows/acceptance.yml"
311

412
env:
5-
ADDON_NAME: "@kitconcept/volto-quote-block"
6-
ADDON_PATH: "volto-quote-block"
7-
VOLTO_VERSION: "17.15.3"
13+
NODE_VERSION: 22
14+
CYPRESS_RETRIES: 2
815

916
jobs:
1017

1118
acceptance:
1219
runs-on: ubuntu-latest
1320
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1622

17-
- name: Set up Docker Buildx
18-
uses: docker/setup-buildx-action@v2
23+
- name: Use Node.js ${{ env.NODE_VERSION }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- name: Enable corepack
29+
run: npm i -g corepack@latest && corepack enable
1930

20-
- name: Install Cypress
31+
- name: Get pnpm store directory
32+
shell: bash
2133
run: |
22-
cd acceptance
23-
yarn
24-
25-
- name: "Cypress: Acceptance tests"
26-
uses: cypress-io/github-action@v6
27-
env:
28-
BABEL_ENV: production
29-
CYPRESS_RETRIES: 2
34+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
35+
36+
- uses: actions/cache@v4
37+
name: Setup pnpm cache
38+
with:
39+
path: ${{ env.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Cache Cypress Binary
45+
id: cache-cypress-binary
46+
uses: actions/cache@v4
47+
with:
48+
path: ~/.cache/Cypress
49+
key: binary-${{ env.NODE_VERSION }}-${{ hashFiles('pnpm-lock.yaml') }}
50+
51+
- name: Install dependencies
52+
run: make install
53+
54+
- name: Install Cypress if not in cache
55+
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
56+
working-directory: core/packages/volto
57+
run: make cypress-install
58+
59+
- uses: JarvusInnovations/background-action@v1
60+
name: Start Servers
3061
with:
31-
parallel: false
32-
browser: chrome
33-
working-directory: acceptance
34-
spec: cypress/tests/*.js
35-
install: false
36-
start: |
37-
docker compose -f ci.yml --profile prod up
38-
wait-on: 'npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000'
62+
run: |
63+
make ci-acceptance-backend-start &
64+
make acceptance-frontend-prod-start &
65+
# your step-level and job-level environment variables are available to your commands as-is
66+
# npm install will count towards the wait-for timeout
67+
# whenever possible, move unrelated scripts to a different step
68+
# to background multiple processes: add & to the end of the command
69+
70+
wait-on: |
71+
http-get://localhost:55001/plone
72+
http://localhost:3000
73+
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
74+
# See wait-on section below for all resource types and prefixes
75+
76+
tail: true # true = stderr,stdout
77+
# This will allow you to monitor the progress live
78+
79+
log-output-resume: stderr
80+
# Eliminates previosuly output stderr log entries from post-run output
81+
82+
wait-for: 10m
83+
84+
log-output: stderr,stdout # same as true
85+
86+
log-output-if: failure
87+
88+
- run: make ci-acceptance-test
3989

4090
# Upload Cypress screenshots
41-
- uses: actions/upload-artifact@v3
91+
- uses: actions/upload-artifact@v4
4292
if: failure()
4393
with:
4494
name: cypress-screenshots-acceptance
4595
path: acceptance/cypress/screenshots
4696

4797
# Upload Cypress videos
48-
- uses: actions/upload-artifact@v3
98+
- uses: actions/upload-artifact@v4
4999
if: failure()
50100
with:
51101
name: cypress-videos-acceptance

.github/workflows/changelog.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,53 @@ on:
66
- main
77

88
env:
9-
node-version: 20.x
9+
NODE_VERSION: 22
10+
ADDON_NAME: volto-quote-block
1011

1112
jobs:
1213
build:
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1617
with:
1718
# Fetch all history
1819
fetch-depth: '0'
1920

2021
- name: Install pipx
2122
run: pip install towncrier
2223

23-
# node setup
24-
- name: Use Node.js ${{ env.node-version }}
25-
uses: actions/setup-node@v3
24+
- name: Use Node.js
25+
uses: actions/setup-node@v4
2626
with:
27-
node-version: ${{ env.node-version }}
28-
cache: 'yarn'
27+
node-version: ${{ env.NODE_VERSION }}
28+
29+
- name: Enable corepack
30+
run: npm i -g corepack@latest && corepack enable
31+
32+
- name: Get pnpm store directory
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
36+
37+
- uses: actions/cache@v4
38+
name: Setup pnpm cache
39+
with:
40+
path: ${{ env.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
2944
30-
# node install
3145
- name: Install dependencies
32-
run: yarn
46+
run: |
47+
make install
3348
3449
- name: Check for presence of a Change Log fragment (only pull requests)
3550
run: |
3651
# Fetch the pull request' base branch so towncrier will be able to
3752
# compare the current branch with the base branch.
3853
# Source: https://github.com/actions/checkout/#fetch-all-branches.
39-
git fetch --no-tags origin main
40-
towncrier check --compare-with origin/main
54+
git fetch --no-tags origin ${BASE_BRANCH}
55+
towncrier check --dir packages/${ADDON_NAME}
4156
env:
4257
BASE_BRANCH: ${{ github.base_ref }}
4358
if: github.event_name == 'pull_request'

.github/workflows/code.yml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,47 @@
11
name: Code analysis checks
2-
on: [push]
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "packages/**"
9+
- ".github/workflows/code.yml"
10+
11+
env:
12+
NODE_VERSION: 22
13+
314
jobs:
415
codeanalysis:
516
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
node-version: [20.x]
917

1018
steps:
1119
- name: Main checkout
12-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
21+
22+
- name: Use Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
27+
- name: Enable corepack
28+
run: npm i -g corepack@latest && corepack enable
29+
30+
- name: Get pnpm store directory
31+
shell: bash
32+
run: |
33+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
34+
35+
- uses: actions/cache@v4
36+
name: Setup pnpm cache
37+
with:
38+
path: ${{ env.STORE_PATH }}
39+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-
42+
43+
- name: Install dependencies
44+
run: make install
1345

1446
- name: Linting
1547
run: make lint

.github/workflows/i18n.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: i18n
2+
on:
3+
push:
4+
paths:
5+
- "*.js"
6+
- "*.json"
7+
- "*.yaml"
8+
- "packages/**"
9+
- ".github/workflows/i18n.yml"
10+
11+
env:
12+
NODE_VERSION: 22
13+
14+
jobs:
15+
unit:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Main checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Use Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
27+
- name: Enable corepack
28+
run: npm i -g corepack@latest && corepack enable
29+
30+
- name: Get pnpm store directory
31+
shell: bash
32+
run: |
33+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
34+
35+
- uses: actions/cache@v4
36+
name: Setup pnpm cache
37+
with:
38+
path: ${{ env.STORE_PATH }}
39+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-
42+
43+
- name: Install dependencies
44+
run: make install
45+
46+
- name: test i18n command
47+
run: make i18n

0 commit comments

Comments
 (0)