-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from codesyntax/volto-18
update for volto 18
- Loading branch information
Showing
68 changed files
with
31,734 additions
and
1,487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const fs = require('fs'); | ||
const projectRootPath = __dirname; | ||
const { AddonRegistry } = require('@plone/registry/addon-registry'); | ||
|
||
let coreLocation; | ||
if (fs.existsSync(`${projectRootPath}/core`)) | ||
coreLocation = `${projectRootPath}/core`; | ||
else if (fs.existsSync(`${projectRootPath}/../../core`)) | ||
coreLocation = `${projectRootPath}/../../core`; | ||
|
||
const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`); | ||
|
||
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons | ||
const addonAliases = Object.keys(registry.packages).map((o) => [ | ||
o, | ||
registry.packages[o].modulePath, | ||
]); | ||
|
||
module.exports = { | ||
extends: `${coreLocation}/packages/volto/.eslintrc`, | ||
rules: { | ||
'import/no-unresolved': 1, | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
alias: { | ||
map: [ | ||
['@plone/volto', `${coreLocation}/packages/volto/src`], | ||
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`], | ||
['@plone/registry', `${coreLocation}/packages/registry/src`], | ||
[ | ||
'@codesyntax/volto-countup-block', | ||
'./packages/volto-countup-block/src', | ||
], | ||
...addonAliases, | ||
], | ||
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'], | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,47 @@ | ||
name: Code analysis checks | ||
on: [push] | ||
on: | ||
push: | ||
paths: | ||
- "*.js" | ||
- "*.json" | ||
- "*.yaml" | ||
- "packages/**" | ||
- ".github/workflows/code.yml" | ||
|
||
env: | ||
NODE_VERSION: 20.x | ||
|
||
jobs: | ||
codeanalysis: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Main checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Enable corepack | ||
run: corepack enable | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Linting | ||
run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: i18n | ||
on: | ||
push: | ||
paths: | ||
- "*.js" | ||
- "*.json" | ||
- "*.yaml" | ||
- "packages/**" | ||
- ".github/workflows/i18n.yml" | ||
|
||
env: | ||
NODE_VERSION: 20.x | ||
|
||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Main checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Enable corepack | ||
run: corepack enable | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: test i18n command | ||
run: make i18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Storybook | ||
on: | ||
push: | ||
paths: | ||
- "*.js" | ||
- "*.json" | ||
- "*.yaml" | ||
- "packages/**" | ||
- ".github/workflows/storybook.yml" | ||
|
||
env: | ||
NODE_VERSION: 20.x | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Enable corepack | ||
run: corepack enable | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Generate Storybook | ||
run: | | ||
make storybook-build | ||
- name: Deploy to GitHub pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
with: | ||
branch: gh-pages | ||
folder: .storybook-build |
Oops, something went wrong.