-
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
0 parents
commit a5a20cf
Showing
46 changed files
with
15,898 additions
and
0 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 @@ | ||
node_modules |
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,34 @@ | ||
# EditorConfig Configurtaion file, for more details see: | ||
# http://EditorConfig.org | ||
# EditorConfig is a convention description, that could be interpreted | ||
# by multiple editors to enforce common coding conventions for specific | ||
# file types | ||
|
||
# top-most EditorConfig file: | ||
# Will ignore other EditorConfig files in Home directory or upper tree level. | ||
root = true | ||
|
||
|
||
[*] # For All Files | ||
# Unix-style newlines with a newline ending every file | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
# Set default charset | ||
charset = utf-8 | ||
# Indent style default | ||
indent_style = space | ||
|
||
[*.{py,cfg,ini}] | ||
# 4 space indentation | ||
indent_size = 4 | ||
|
||
[*.{html,dtml,pt,zpt,xml,zcml,js,jsx,json,less,css,yaml,yml}] | ||
# 2 space indentation | ||
indent_size = 2 | ||
|
||
[{Makefile,.gitmodules}] | ||
# Tab indentation (no size specified, but view as 4 spaces) | ||
indent_style = tab | ||
indent_size = unset | ||
tab_width = unset |
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,3 @@ | ||
cypress | ||
node_modules | ||
acceptance |
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,49 @@ | ||
{ | ||
"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", | ||
"jsx-a11y/label-has-associated-control": "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 | ||
} | ||
} |
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,27 @@ | ||
.vscode/ | ||
.history | ||
logs | ||
*.log | ||
npm-debug.log* | ||
.DS_Store | ||
*.swp | ||
yarn-error.log | ||
|
||
node_modules | ||
build | ||
dist | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
.changelog.draft | ||
|
||
# yarn 3 | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
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,2 @@ | ||
CHANGELOG.md | ||
README.md |
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,12 @@ | ||
{ | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"overrides": [ | ||
{ | ||
"files": "*.overrides", | ||
"options": { | ||
"parser": "less" | ||
} | ||
} | ||
] | ||
} |
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,19 @@ | ||
{ | ||
"hooks": { | ||
"after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}", | ||
"after:release": "rm .changelog.draft" | ||
}, | ||
"git": { | ||
"changelog": "pipx run towncrier build --draft --yes --version 0.0.0", | ||
"requireUpstream": false, | ||
"requireCleanWorkingDir": false, | ||
"commitMessage": "Release ${version}", | ||
"tagName": "${version}", | ||
"tagAnnotation": "Release ${version}" | ||
}, | ||
"github": { | ||
"release": true, | ||
"releaseName": "${version}", | ||
"releaseNotes": "cat .changelog.draft" | ||
} | ||
} |
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,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 | ||
} | ||
} |
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,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.3.cjs |
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,9 @@ | ||
# 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 --> |
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,151 @@ | ||
# Yeoman Volto App development | ||
|
||
### Defensive settings for make: | ||
# https://tech.davis-hansson.com/p/make/ | ||
SHELL:=bash | ||
.ONESHELL: | ||
.SHELLFLAGS:=-eu -o pipefail -c | ||
.SILENT: | ||
.DELETE_ON_ERROR: | ||
MAKEFLAGS+=--warn-undefined-variables | ||
MAKEFLAGS+=--no-builtin-rules | ||
|
||
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
# Recipe snippets for reuse | ||
|
||
# We like colors | ||
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects | ||
RED=`tput setaf 1` | ||
GREEN=`tput setaf 2` | ||
RESET=`tput sgr0` | ||
YELLOW=`tput setaf 3` | ||
|
||
PLONE_VERSION=6 | ||
VOLTO_VERSION=17.0.0 | ||
|
||
ADDON_NAME='volto-form-counter' | ||
ADDON_PATH='volto-form-counter' | ||
COMPOSE_FILE=dockerfiles/docker-compose.yml | ||
ACCEPTANCE_COMPOSE=acceptance/docker-compose.yml | ||
CMD=CURRENT_DIR=${CURRENT_DIR} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} VOLTO_VERSION=${VOLTO_VERSION} PLONE_VERSION=${PLONE_VERSION} docker compose | ||
DOCKER_COMPOSE=${CMD} -p ${ADDON_PATH} -f ${COMPOSE_FILE} | ||
DEV_COMPOSE=COMPOSE_PROFILES=dev ${DOCKER_COMPOSE} | ||
LIVE_COMPOSE=COMPOSE_PROFILES=dev ${DOCKER_COMPOSE} | ||
ACCEPTANCE=${CMD} -p ${ADDON_PATH}-acceptance -f ${ACCEPTANCE_COMPOSE} | ||
|
||
.PHONY: build-backend | ||
build-backend: ## Build | ||
@echo "$(GREEN)==> Build Backend Container $(RESET)" | ||
${DEV_COMPOSE} build backend | ||
|
||
.PHONY: start-backend | ||
start-backend: ## Starts Docker backend | ||
@echo "$(GREEN)==> Start Docker-based Plone Backend $(RESET)" | ||
${DEV_COMPOSE} up backend -d | ||
|
||
.PHONY: stop-backend | ||
stop-backend: ## Stop Docker backend | ||
@echo "$(GREEN)==> Stop Docker-based Plone Backend $(RESET)" | ||
${DEV_COMPOSE} stop backend | ||
|
||
.PHONY: build-live | ||
build-live: ## Build Addon live | ||
@echo "$(GREEN)==> Build Addon development container $(RESET)" | ||
${LIVE_COMPOSE} build addon-live | ||
|
||
.PHONY: build-addon | ||
build-addon: ## Build Addon dev | ||
@echo "$(GREEN)==> Build Addon development container $(RESET)" | ||
${DEV_COMPOSE} build addon-dev | ||
|
||
.PHONY: start-dev | ||
start-dev: ## Starts Dev container | ||
@echo "$(GREEN)==> Start Addon Development container $(RESET)" | ||
${DEV_COMPOSE} up addon-dev backend | ||
|
||
.PHONY: dev | ||
dev: ## Develop the addon | ||
@echo "$(GREEN)==> Start Development Environment $(RESET)" | ||
make build-backend | ||
make start-backend | ||
make build-addon | ||
make start-dev | ||
|
||
.PHONY: help | ||
help: ## Show this help. | ||
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)" | ||
|
||
## Setup the local environment | ||
.PHONY: install | ||
install: ## Install the local environment, Cypress, build acceptance containers | ||
yarn | ||
make install-acceptance | ||
|
||
# Dev Helpers | ||
.PHONY: i18n | ||
i18n: ## Sync i18n | ||
@echo "$(YELLOW)==> Do not forget to setup the local environment (make install) $(RESET)" | ||
yarn i18n | ||
|
||
.PHONY: format | ||
format: ## Format codebase | ||
${DEV_COMPOSE} run --rm addon-dev lint:fix | ||
${DEV_COMPOSE} run --rm addon-dev prettier:fix | ||
${DEV_COMPOSE} run --rm addon-dev stylelint:fix | ||
|
||
.PHONY: lint | ||
lint: ## Lint Codebase | ||
${DEV_COMPOSE} run --rm addon-dev lint | ||
${DEV_COMPOSE} run --rm addon-dev prettier | ||
${DEV_COMPOSE} run --rm addon-dev stylelint --allow-empty-input | ||
|
||
.PHONY: test | ||
test: ## Run unit tests | ||
${DEV_COMPOSE} run --rm addon-dev test --watchAll | ||
|
||
.PHONY: test-ci | ||
test-ci: ## Run unit tests in CI | ||
${DEV_COMPOSE} run -e CI=1 addon-dev test | ||
|
||
## Acceptance | ||
.PHONY: install-acceptance | ||
install-acceptance: ## Install Cypress, build acceptance containers | ||
(cd acceptance && yarn) | ||
${ACCEPTANCE} --profile dev --profile prod build | ||
|
||
.PHONY: start-test-acceptance-server | ||
start-test-acceptance-server: ## Start acceptance server (for use it in while developing) | ||
${ACCEPTANCE} --profile dev up | ||
|
||
.PHONY: start-test-acceptance-server-prod | ||
start-test-acceptance-server-prod: ## Start acceptance server in prod (used by CI) | ||
${ACCEPTANCE} --profile prod up -d | ||
|
||
.PHONY: test-acceptance | ||
test-acceptance: ## Start Cypress (for use it while developing) | ||
(cd acceptance && ./node_modules/.bin/cypress open) | ||
|
||
.PHONY: test-acceptance-headless | ||
test-acceptance-headless: ## Run cypress tests in CI | ||
(cd acceptance && ./node_modules/.bin/cypress run) | ||
|
||
.PHONY: stop-test-acceptance-server | ||
stop-test-acceptance-server: ## Stop acceptance server (for use it while finished developing) | ||
${ACCEPTANCE} --profile dev down | ||
|
||
.PHONY: status-test-acceptance-server | ||
status-test-acceptance-server: ## Status of Acceptance Server (for use it while developing) | ||
${ACCEPTANCE} ps | ||
|
||
.PHONY: debug-frontend | ||
debug-frontend: ## Run bash in the Frontend container (for debug infrastructure purposes) | ||
${DEV_COMPOSE} run --entrypoint bash addon-dev | ||
|
||
.PHONY: pull-backend-image | ||
pull-backend-image: ## Pulls and updates the backend image (for use it while developing) | ||
docker pull ghcr.io/voltoform-counter:latest | ||
|
||
.PHONY: release | ||
release: ## Release a version of the add-on | ||
yarn release |
Oops, something went wrong.