Skip to content

Commit

Permalink
At last
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Mar 20, 2024
1 parent aad83ed commit 87f46b5
Show file tree
Hide file tree
Showing 33 changed files with 183 additions and 270 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: './dev/core/packages/volto/.eslintrc',
extends: './core/packages/volto/.eslintrc',
rules: {
'import/no-unresolved': 1,
},
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
spec: cypress/tests/*.js
install: false
start: |
docker compose -f ci.yml --profile prod up
make start-test-acceptance-server
make start-test-acceptance-frontend
wait-on: 'npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000'

# Upload Cypress screenshots
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

env:
node-version: 18.x
node-version: 20.x

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- name: Main checkout
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
build
dev/core
dev/addons
core
File renamed without changes.
61 changes: 13 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,15 @@ RESET=`tput sgr0`
YELLOW=`tput setaf 3`

PLONE_VERSION=6
VOLTO_VERSION=17.0.0-alpha.1
DOCKER_IMAGE=plone/server-dev:${PLONE_VERSION}
DOCKER_IMAGE_ACCEPTANCE=plone/server-acceptance:${PLONE_VERSION}

ADDON_NAME='@kitconcept/volto-button-block'
ADDON_PATH='volto-button-block'
DEV_COMPOSE=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 ${DEV_COMPOSE}
ACCEPTANCE=${CMD} -p ${ADDON_PATH}-acceptance -f ${ACCEPTANCE_COMPOSE}

.PHONY: build-backend
build-backend: ## Build
@echo "$(GREEN)==> Build Backend Container $(RESET)"
${DOCKER_COMPOSE} build backend

.PHONY: start-backend
start-backend: ## Starts Docker backend
@echo "$(GREEN)==> Start Docker-based Plone Backend $(RESET)"
${DOCKER_COMPOSE} up backend -d

.PHONY: stop-backend
stop-backend: ## Stop Docker backend
@echo "$(GREEN)==> Stop Docker-based Plone Backend $(RESET)"
${DOCKER_COMPOSE} stop backend

.PHONY: build-addon
build-addon: ## Build Addon dev
@echo "$(GREEN)==> Build Addon development container $(RESET)"
${DOCKER_COMPOSE} build addon-dev

.PHONY: start-dev
start-dev: ## Starts Dev container
@echo "$(GREEN)==> Start Addon Development container $(RESET)"
${DOCKER_COMPOSE} up addon-dev

.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: install
install: ## Build
@echo "$(GREEN)==> Installs the dev environment $(RESET)"
pnpm exec missdev --no-config --fetch-https

.PHONY: help
help: ## Show this help.
Expand All @@ -78,23 +43,23 @@ i18n: ## Sync i18n

.PHONY: format
format: ## Format codebase
${DOCKER_COMPOSE} run addon-dev lint:fix
${DOCKER_COMPOSE} run addon-dev prettier:fix
${DOCKER_COMPOSE} run addon-dev stylelint:fix
pnpm lint:fix
pnpm prettier:fix
pnpm stylelint:fix

.PHONY: lint
lint: ## Lint Codebase
${DOCKER_COMPOSE} run addon-dev lint
${DOCKER_COMPOSE} run addon-dev prettier
${DOCKER_COMPOSE} run addon-dev stylelint --allow-empty-input
pnpm lint
pnpm prettier
pnpm stylelint --allow-empty-input

.PHONY: test
test: ## Run unit tests
${DOCKER_COMPOSE} run addon-dev test --watchAll
pnpm test

.PHONY: test-ci
test-ci: ## Run unit tests in CI
${DOCKER_COMPOSE} run -e CI=1 addon-dev test
CI=1 pnpm test

.PHONY: start-backend-docker
start-backend-docker: ## Starts a Docker-based backend
Expand Down
123 changes: 0 additions & 123 deletions dev/Makefile

This file was deleted.

47 changes: 0 additions & 47 deletions dev/package.json

This file was deleted.

17 changes: 17 additions & 0 deletions jest-addon.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
roots: ['../../../packages'],
testMatch: ['<rootDir>/../../../../**/?(*.)+(spec|test).[jt]s?(x)'],
collectCoverageFrom: [
'src/addons/**/src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
],
transformIgnorePatterns: ['node_modules/(?!(volto-slate|@plone/volto)/)'],
coverageThreshold: {
global: {
branches: 5,
functions: 5,
lines: 5,
statements: 5,
},
},
};
2 changes: 1 addition & 1 deletion mrs.developer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"core": {
"output": "dev",
"output": "./",
"package": "@plone/volto",
"url": "[email protected]:plone/volto.git",
"https": "https://github.com/plone/volto.git"
Expand Down
36 changes: 22 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kitconcept/volto-button-block",
"name": "@kitconcept/volto-button-block-dev",
"version": "2.3.1",
"description": "volto-button-block: Volto add-on that provides a configurable button as a block.",
"main": "src/index.js",
Expand All @@ -16,23 +16,31 @@
"access": "public"
},
"scripts": {
"init:quasar": "missdev --no-config --fetch-https",
"start": "pnpm build:deps && VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto start",
"start:prod": "pnpm --filter @plone/volto start:prod",
"build": "pnpm build:deps && VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto build",
"build:deps": "pnpm --filter @plone/registry --filter @plone/components build",
"start": "pnpm build:deps && pnpm --filter @plone/volto start",
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
"i18n": "pnpm --filter addons i18n",
"test": "RAZZLE_JEST_CONFIG=$(pwd)/jest-addon.config.js pnpm --filter @plone/volto test",
"lint": "eslint --max-warnings=0 'packages/**/src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "eslint --fix 'packages/**/src/**/*.{js,jsx,ts,tsx}'",
"prettier": "prettier --check 'packages/**/src/**/*.{js,jsx,ts,tsx}'",
"prettier:fix": "prettier --write 'packages/**/src/**/*.{js,jsx,ts,tsx}' ",
"stylelint": "stylelint 'packages/**/src/**/*.{css,scss,less}' --allow-empty-input",
"stylelint:fix": "stylelint 'packages/**/src/**/*.{css,scss,less}' --fix",
"dry-release": "release-it --dry-run",
"release": "release-it",
"release-major-alpha": "release-it major --preRelease=alpha",
"release-alpha": "release-it --preRelease=alpha"
"release": "pnpm --filter @kitconcept/volto-button-block release-it",
"release-major-alpha": "pnpm --filter @kitconcept/volto-button-block release-it major --preRelease=alpha",
"release-alpha": "pnpm --filter @kitconcept/volto-button-block release-it --preRelease=alpha"
},
"peerDependencies": {
"classnames": "2.2.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-intl": "3.8.0"
"dependencies": {
"@plone/volto": "workspace:*",
"@plone/registry": "workspace:*",
"@kitconcept/volto-button-block": "workspace:*"
},
"devDependencies": {
"@plone/scripts": "^3.6.1",
"release-it": "^17.1.1"
}
"mrs-developer": "^2.2.0"
},
"packageManager": "[email protected]"
}
2 changes: 2 additions & 0 deletions packages/volto-button-block/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ msgstr "Ausrichtung"
msgid "Button Block"
msgstr "Knopf"

#. Default: "Button text"
#: components/View
msgid "Button text"
msgstr ""

#. Default: "Center"
#: components/Widgets/AlignWidget
msgid "Center"
Expand Down
Loading

0 comments on commit 87f46b5

Please sign in to comment.