Skip to content

Commit

Permalink
Merge pull request #6 from codesyntax/develop
Browse files Browse the repository at this point in the history
improve setup
  • Loading branch information
erral authored Mar 31, 2024
2 parents 28c70b0 + 6b7ab10 commit 8f22897
Show file tree
Hide file tree
Showing 48 changed files with 12,896 additions and 123 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 0 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ trim_trailing_whitespace = true
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cypress
node_modules
acceptance
48 changes: 48 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"extends": ["react-app", "prettier", "plugin:jsx-a11y/recommended"],
"plugins": ["prettier", "react-hooks", "jsx-a11y"],
"env": {
"es6": true,
"browser": true,
"node": true,
"mocha": true,
"jasmine": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"legacyDecorators": true
}
},
"rules": {
"import/no-unresolved": 0,
"no-alert": 1,
"no-console": 1,
"no-debugger": 1,
"prettier/prettier": [
"error",
{ "trailingComma": "all", "singleQuote": true }
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/react-in-jsx-scope": "off"
},
"globals": {
"root": true,
"__DEVELOPMENT__": true,
"__CLIENT__": true,
"__SERVER__": true,
"__DISABLE_SSR__": true,
"__DEVTOOLS__": true,
"__DEBUG__": true,
"__SSR__": true,
"__SENTRY__": true,
"cy": true,
"Cypress": true,
"jest": true,
"socket": true,
"webpackIsomorphicTools": true
}
}
52 changes: 52 additions & 0 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Acceptance tests
on: [push]

env:
ADDON_NAME: "volto-cookiebot"
ADDON_PATH: "volto-cookiebot"
VOLTO_VERSION: "17.0.0"

jobs:

acceptance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install Cypress
run: |
cd acceptance
yarn
- name: "Cypress: Acceptance tests"
uses: cypress-io/github-action@v6
env:
BABEL_ENV: production
CYPRESS_RETRIES: 2
with:
parallel: false
browser: chrome
working-directory: acceptance
spec: cypress/tests/*.js
install: false
start: |
docker compose -f ci.yml --profile prod up
wait-on: 'npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots-acceptance
path: acceptance/cypress/screenshots

# Upload Cypress videos
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-videos-acceptance
path: acceptance/cypress/videos
43 changes: 43 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changelog check
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main

env:
node-version: 18.x

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Fetch all history
fetch-depth: '0'

- name: Install pipx
run: pip install towncrier

# node setup
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
cache: 'yarn'

# node install
- name: Install dependencies
run: yarn

- name: Check for presence of a Change Log fragment (only pull requests)
run: |
# Fetch the pull request' base branch so towncrier will be able to
# compare the current branch with the base branch.
# Source: https://github.com/actions/checkout/#fetch-all-branches.
git fetch --no-tags origin main
towncrier check --compare-with origin/main
env:
BASE_BRANCH: ${{ github.base_ref }}
if: github.event_name == 'pull_request'
15 changes: 15 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Code analysis checks
on: [push]
jobs:
codeanalysis:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- name: Main checkout
uses: actions/checkout@v3

- name: Linting
run: make lint
25 changes: 0 additions & 25 deletions .github/workflows/release.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Unit Tests
on: [push]
jobs:
unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- name: Main checkout
uses: actions/checkout@v3

- name: Unit tests
run: make test-ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
build
.yarn/cache
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"trailingComma": "all",
"singleQuote": true,
"overrides": [
{
"files": "*.overrides",
"options": {
"parser": "less"
}
}
]
}
15 changes: 8 additions & 7 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
"publish": true
},
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs",
"tagName": "${version}",
"commitMessage": "Automated release ${version}",
"requireBranch": "main",
"changelog": "pipx run towncrier build --draft --yes --version 0.0.0",
"requireUpstream": false,
"requireCleanWorkingDir": false,
"git.requireCommits": true
"commitMessage": "Release ${version}",
"tagName": "${version}",
"tagAnnotation": "Release ${version}"
},
"github": {
"release": true,
"releaseName": "${version}",
"releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
"releaseNotes": "cat .changelog.draft"
},

"hooks": {
"after:bump": "npx auto-changelog --commit-limit false -p"
"after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}",
"after:release": "rm .changelog.draft"
}
}
32 changes: 32 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": [
"stylelint-config-idiomatic-order"
],
"plugins": [
"stylelint-prettier"
],
"overrides": [
{
"files": [
"**/*.less"
],
"customSyntax": "postcss-less"
},
{
"files": [
"**/*.overrides"
],
"customSyntax": "postcss-less"
},
{
"files": [
"**/*.scss"
],
"customSyntax": "postcss-scss"
}
],
"rules": {
"prettier/prettier": true,
"order/properties-alphabetical-order": null
}
}
Binary file added .yarn/install-state.gz
Binary file not shown.
783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.3.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.3.cjs
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Release Notes

<!-- You should *NOT* be adding new change log entries to this file.
You should create a file in the news directory instead.
For helpful instructions, please see:
https://6.docs.plone.org/contributing/index.html?highlight=towncrier#change-log-entry
-->

<!-- towncrier release notes start -->

## 0.5.0 (2023-11-02)

### Feature

- Add default language

## 0.4.0 (2023-01-26)

### Internal

- Packaging improvements

Loading

0 comments on commit 8f22897

Please sign in to comment.