generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed files accordingly with latest volto version
- Loading branch information
Showing
13 changed files
with
643 additions
and
165 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 @@ | ||
module.exports = require('@plone/volto/babel'); |
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,96 @@ | ||
# https://docs.npmjs.com/using-npm/developers.html#keeping-files-out-of-your-package | ||
|
||
# Directories | ||
api/ | ||
bin/ | ||
build/ | ||
lib/ | ||
g-api/ | ||
tests/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Cypress | ||
cypress/ | ||
|
||
# Tests | ||
__tests__/ | ||
*.snap | ||
|
||
# Files | ||
.travis.yml | ||
requirements-docs.txt | ||
requirements-tests.txt | ||
yarn.lock | ||
.dockerignore | ||
.gitattributes | ||
.yarnrc | ||
.nvmrc | ||
changelogupdater.js | ||
pip-selfcheck.json | ||
Dockerfile | ||
CNAME | ||
entrypoint.sh | ||
Jenkinsfile | ||
Makefile | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
styleguide.config | ||
.vscode | ||
packages |
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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
SHELL=/bin/bash | ||
|
||
DIR=$(shell basename $$(pwd)) | ||
ADDON ?= "@eeacms/volto-pdf-viewer" | ||
|
||
# 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` | ||
|
||
ifeq ($(wildcard ./project),) | ||
NODE_MODULES = "../../../node_modules" | ||
else | ||
NODE_MODULES = "./project/node_modules" | ||
endif | ||
|
||
project: | ||
npm install -g yo | ||
npm install -g @plone/generator-volto | ||
npm install -g mrs-developer | ||
yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive | ||
ln -sf $$(pwd) project/src/addons/ | ||
cp .project.eslintrc.js .eslintrc.js | ||
cd project && yarn | ||
@echo "-------------------" | ||
@echo "$(GREEN)Volto project is ready!$(RESET)" | ||
@echo "$(RED)Now run: cd project && yarn start$(RESET)" | ||
|
||
all: project | ||
|
||
.PHONY: start-test-backend | ||
start-test-backend: ## Start Test Plone Backend | ||
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)" | ||
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e SITE=plone -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING | ||
|
||
.PHONY: start-backend-docker | ||
start-backend-docker: ## Starts a Docker-based backend | ||
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)" | ||
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone | ||
|
||
.PHONY: test | ||
test: ## Run jest tests | ||
docker pull plone/volto-addon-ci:alpha | ||
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" -e CI="true" plone/volto-addon-ci:alpha | ||
|
||
.PHONY: test-update | ||
test-update: ## Update jest tests snapshots | ||
docker pull plone/volto-addon-ci:alpha | ||
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" -e CI="true" plone/volto-addon-ci:alpha yarn test src/addons/${DIR}/src --watchAll=false -u | ||
|
||
.PHONY: stylelint | ||
stylelint: ## Stylelint | ||
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' | ||
|
||
.PHONY: stylelint-overrides | ||
stylelint-overrides: | ||
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' | ||
|
||
.PHONY: stylelint-fix | ||
stylelint-fix: ## Fix stylelint | ||
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix | ||
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix | ||
|
||
.PHONY: prettier | ||
prettier: ## Prettier | ||
$(NODE_MODULES)/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}' | ||
|
||
.PHONY: prettier-fix | ||
prettier-fix: ## Fix prettier | ||
$(NODE_MODULES)/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}' | ||
|
||
.PHONY: lint | ||
lint: ## ES Lint | ||
$(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}' | ||
|
||
.PHONY: lint-fix | ||
lint-fix: ## Fix ES Lint | ||
$(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}' | ||
|
||
.PHONY: i18n | ||
i18n: ## i18n | ||
rm -rf build/messages | ||
NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon | ||
|
||
.PHONY: cypress-run | ||
cypress-run: ## Run cypress integration tests | ||
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run | ||
|
||
.PHONY: cypress-open | ||
cypress-open: ## Open cypress integration tests | ||
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open | ||
|
||
.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 :)" | ||
:)" |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { defineConfig } = require('cypress'); | ||
|
||
module.exports = defineConfig({ | ||
viewportWidth: 1280, | ||
defaultCommandTimeout: 8888, | ||
chromeWebSecurity: false, | ||
reporter: 'junit', | ||
video: true, | ||
retries: { | ||
runMode: 8, | ||
openMode: 0, | ||
}, | ||
reporterOptions: { | ||
mochaFile: 'cypress/reports/cypress-[hash].xml', | ||
jenkinsMode: true, | ||
toConsole: true, | ||
}, | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// e2e testing node events setup code | ||
require('@cypress/code-coverage/task')(on, config); | ||
require('cypress-fail-fast/plugin')(on, config); | ||
return config; | ||
}, | ||
baseUrl: 'http://localhost:3000', | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
19 changes: 8 additions & 11 deletions
19
cypress/integration/block-basics.js → cypress/e2e/01-block-basics.cy.js
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
Oops, something went wrong.