-
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.
- Loading branch information
Showing
89 changed files
with
31,454 additions
and
12,669 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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-featured-block', | ||
'./packages/volto-featured-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 |
Oops, something went wrong.