diff --git a/.gitignore b/.gitignore index 7347fbe..7fbf691 100644 --- a/.gitignore +++ b/.gitignore @@ -3,20 +3,98 @@ logs *.log npm-debug.log* .DS_Store -cache -.nyc_output/ + coverage -cypress/videos -cypress/reports + +# Node node_modules +coverage +jsdoc +webpack-assets.json +webpack-stats.json +npm-debug.log +dist +junit.xml +eslint.xml +yarn-error.log build + +# Other +.DS_Store +.idea +lighthouse-report.html +.vscode/ +backend +.#* +*~ + +# Python +/api/.installed.cfg +/api/.mr.developer.cfg +/api/bin/ +/api/develop-eggs/ +/api/eggs/ +/api/include/ +/api/lib/ +/api/lib64/ +/api/notebook/env/ +/api/parts/ +/api/share/python-wheels/ +/api/src/ +/api/var/ +/api/venv/ +/bin/ +/lib/ +.Python +include +pip-selfcheck.json +pyvenv.cfg +share + +# locales +locales/*.json + +# Tests +/tests/bin +/tests/develop-eggs +/tests/parts +/tests/.installed.cfg +*.pyc +geckodriver.log +log.html +output.xml +report.html +selenium-screenshot-*.png +/selenium/ +cypress/videos/ +cypress/screenshots + +# Local environment setup +.env .env.local .env.development.local .env.test.local .env.production.local +# generic data omelette - +*.old +*~ src/addons src/develop +npm-cache +backend + +# build +public/critical.css +/cache + +# yarn 3 +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b5c5336 --- /dev/null +++ b/Makefile @@ -0,0 +1,67 @@ +# Yeoman Volto App development + +### Defensive settings for make: +# https://tech.davis-hansson.com/p/make/ +SHELL:=bash +.ONESHELL: +.SHELLFLAGS:=-xeu -o pipefail -O inherit_errexit -c +.SILENT: +.DELETE_ON_ERROR: +MAKEFLAGS+=--warn-undefined-variables +MAKEFLAGS+=--no-builtin-rules + +# Project settings + +DIR=$(shell basename $$(pwd)) +ADDON ?= "marine-frontend" + +# 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` + + +# Top-level targets +.PHONY: all +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 VERSIONS="plone.restapi=8.17.0 plone.rest=2.0.0a1 plone.app.vocabularies=4.3.0" -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi plone.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 VERSIONS="plone.restapi=8.17.0 plone.rest=2.0.0a1 plone.app.vocabularies=4.3.0" -e SITE=Plone -e ADDONS="plone.volto" -e ZCML="plone.volto.cors" plone + +.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 :)" + +.PHONY: install +install: ## Install the frontend + @echo "Install frontend" + $(MAKE) omelette + $(MAKE) preinstall + yarn install + +.PHONY: preinstall +preinstall: ## Preinstall task, checks if missdev (mrs-developer) is present and runs it + if [ -f $$(pwd)/mrs.developer.json ]; then make develop; fi + +.PHONY: develop +develop: ## Runs missdev in the local project (mrs.developer.json should be present) + npx -p mrs-developer missdev --config=jsconfig.json --output=addons --fetch-https + +.PHONY: omelette +omelette: ## Creates the omelette folder that contains a link to the installed version of Volto (a softlink pointing to node_modules/@plone/volto) + if [ ! -d omelette ]; then ln -sf node_modules/@plone/volto omelette; fi + +.PHONY: patches +patches: + /bin/bash patches/patchit.sh > /dev/null 2>&1 ||true \ No newline at end of file diff --git a/omelette b/omelette deleted file mode 120000 index 285517d..0000000 --- a/omelette +++ /dev/null @@ -1 +0,0 @@ -node_modules/@plone/volto \ No newline at end of file diff --git a/package.json b/package.json index 661b7b5..b9390dd 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,6 @@ ], "scripts": { "start": "razzle start", - "postinstall": "yarn omelette && yarn patches", - "omelette": "if [ ! -d omelette ]; then ln -sf node_modules/@plone/volto omelette; fi", - "patches": "/bin/bash patches/patchit.sh > /dev/null 2>&1 ||true", "build": "razzle build --noninteractive", "lint": "./node_modules/eslint/bin/eslint.js 'src/**/*.{js,jsx}'", "lint:fix": "./node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",