From 7eaf6c808d3df8b2f7e424502ffcbc6c84a16036 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 20 May 2024 16:44:45 +0200 Subject: [PATCH 1/3] Small fixes for commands --- frontend_addon/{{ cookiecutter.__folder_name }}/Makefile | 6 +++++- .../{{ cookiecutter.__folder_name }}/package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile b/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile index ec2f718..0ad1a32 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile @@ -48,6 +48,10 @@ build: ## Build a production bundle for distribution of the project with the add i18n: ## Sync i18n pnpm --filter $(ADDON_NAME) i18n +.PHONY: ci-i18n +ci-i18n: ## Check if i18n is not synced + pnpm i18n && git diff -G'^[^\"POT]' --exit-code + .PHONY: format format: ## Format codebase pnpm lint:fix @@ -58,7 +62,7 @@ format: ## Format codebase lint: ## Lint, or catch and remove problems, in code base pnpm lint pnpm prettier - pnpm stylelint + pnpm stylelint --allow-empty-input .PHONY: release release: ## Release the add-on on npmjs.org diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/package.json b/frontend_addon/{{ cookiecutter.__folder_name }}/package.json index a85d9a2..4fa0896 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/package.json +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/package.json @@ -18,7 +18,7 @@ "build": "pnpm build:deps && VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto build", "build:deps": "pnpm --filter @plone/registry --filter @plone/components build", "i18n": "pnpm --filter {{ cookiecutter.npm_package_name }} i18n", - "test": "RAZZLE_JEST_CONFIG=$(pwd)/jest-addon.config.js pnpm --filter @plone/volto test", + "test": "RAZZLE_JEST_CONFIG=$(pwd)/jest-addon.config.js pnpm --filter @plone/volto test -- --passWithNoTests", "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}'", From 1f555666599304ab91a6abb81d49aa906637c066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Andrei?= Date: Mon, 20 May 2024 18:28:44 -0400 Subject: [PATCH 2/3] frontend_addon: Fix ci-i18n --- frontend_addon/{{ cookiecutter.__folder_name }}/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile b/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile index 0ad1a32..0487e1d 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/Makefile @@ -50,7 +50,7 @@ i18n: ## Sync i18n .PHONY: ci-i18n ci-i18n: ## Check if i18n is not synced - pnpm i18n && git diff -G'^[^\"POT]' --exit-code + pnpm --filter $(ADDON_NAME) i18n && git diff -G'^[^\"POT]' --exit-code .PHONY: format format: ## Format codebase From b35e60487c46ce9e8249a9f0d595b8f66fd10bdd Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 21 May 2024 15:57:31 +0200 Subject: [PATCH 3/3] Fix tests --- .github/workflows/frontend_addon.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/frontend_addon.yml b/.github/workflows/frontend_addon.yml index 7c1e9f3..c247ab7 100644 --- a/.github/workflows/frontend_addon.yml +++ b/.github/workflows/frontend_addon.yml @@ -74,13 +74,8 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - - uses: pnpm/action-setup@v3 - name: Install pnpm - with: - version: 9 - # We don't want to install until later, - # when the cache and Cypress are in place - run_install: false + - name: Enable corepack + run: corepack enable - name: Get pnpm store directory shell: bash @@ -110,7 +105,7 @@ jobs: - name: Run unit tests working-directory: frontend_addon/volto-addon run: | - make test-ci + make ci-test - name: Run i18n tests working-directory: frontend_addon/volto-addon