Skip to content

Commit

Permalink
Improve project-less setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Mar 22, 2024
1 parent a0791fc commit bd88836
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 52 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Acceptance tests
on: [push]

env:
ADDON_NAME: "@kitconcept/volto-button-block"
ADDON_PATH: "volto-button-block"
VOLTO_VERSION: "17.0.0-alpha.1"

jobs:

acceptance:
Expand Down Expand Up @@ -47,10 +42,7 @@ jobs:
key: binary-20.x-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
run: |
pnpm i
make install
pnpm i
run: make install

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -91,23 +83,6 @@ jobs:

- run: make test-acceptance-headless

# - name: "Cypress: Acceptance tests"
# uses: cypress-io/github-action@v6
# env:
# BABEL_ENV: production
# CYPRESS_RETRIES: 2
# with:
# # working-directory: core/packages/volto
# # project: ../../../.
# # config-file: ../../../cypress.config.js
# browser: chrome
# spec: cypress/tests/**/*.{js,jsx,ts,tsx}
# install: false
# start: |
# make start-test-acceptance-server-ci
# make start-test-acceptance-frontend
# wait-on: 'npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000'

# Upload Cypress screenshots
- uses: actions/upload-artifact@v4
if: failure()
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on: [push]
jobs:
codeanalysis:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- name: Main checkout
Expand Down Expand Up @@ -38,10 +35,7 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm i
make install
pnpm i
run: make install

- name: Linting
run: make lint
5 changes: 1 addition & 4 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm i
make install
pnpm i
run: make install

- name: test i18n command
run: make i18n
5 changes: 1 addition & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm i
make install
pnpm i
run: make install

- name: Unit tests
run: make test-ci
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*stylelint*
public-hoist-pattern[]=*cypress*
public-hoist-pattern[]=*process*
public-hoist-pattern[]=*parcel*
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ help: ## Show this help

# Dev Helpers
.PHONY: install
install: ## Installs the dev environment using mrs-developer
@echo "$(GREEN)==> Installs the dev environment $(RESET)"
pnpm exec missdev --no-config --fetch-https
install: ## Install task, checks if missdev (mrs-developer) is present and runs it
pnpm dlx mrs-developer missdev --no-config --fetch-https
pnpm i

.PHONY: i18n
i18n: ## Sync i18n
Expand Down Expand Up @@ -83,8 +83,8 @@ start-test-acceptance-server-ci: ## Start acceptance server in CI mode (no termi

.PHONY: test-acceptance
test-acceptance: ## Start Cypress in interactive mode
pnpm --filter @plone/volto exec cypress open --config-file $(CURRENT_DIR)/cypress.config.js --config specPattern=$(CURRENT_DIR)'/cypress/tests/**/*.{js,jsx,ts,tsx}'
pnpm exec cypress open --config-file $(CURRENT_DIR)/cypress.config.js --config specPattern=$(CURRENT_DIR)'/cypress/tests/**/*.{js,jsx,ts,tsx}'

.PHONY: test-acceptance-headless
test-acceptance-headless: ## Run cypress tests in headless mode for CI
pnpm --filter @plone/volto exec cypress run --config-file $(CURRENT_DIR)/cypress.config.js --config specPattern=$(CURRENT_DIR)'/cypress/tests/**/*.{js,jsx,ts,tsx}'
pnpm exec cypress run --config-file $(CURRENT_DIR)/cypress.config.js --config specPattern=$(CURRENT_DIR)'/cypress/tests/**/*.{js,jsx,ts,tsx}'
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"@kitconcept/volto-button-block": "workspace:*"
},
"devDependencies": {
"@plone/scripts": "^3.6.1",
"mrs-developer": "^2.2.0"
},
"packageManager": "[email protected]"
Expand Down
15 changes: 13 additions & 2 deletions packages/volto-button-block/src/components/Data.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ const messages = defineMessages({
});

const ButtonData = (props) => {
const { data, block, onChangeBlock, schemaEnhancer } = props;
const {
block,
blocksConfig,
data,
schemaEnhancer,
onChangeBlock,
navRoot,
contentType,
} = props;
const intl = useIntl();
const schema = schemaEnhancer
? schemaEnhancer(ButtonSchema({ ...props, intl }), props)
Expand All @@ -27,9 +35,12 @@ const ButtonData = (props) => {
[id]: value,
});
}}
onChangeBlock={onChangeBlock}
formData={data}
fieldIndex={data.index}
block={block}
blocksConfig={blocksConfig}
navRoot={navRoot}
contentType={contentType}
/>
);
};
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd88836

Please sign in to comment.