Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paths for GHA, commands for acceptance, fix README references to commands #30

Merged
merged 8 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend_addon/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"__npm_package_name": "{{ cookiecutter.npm_package_name }}",
"__version_package": "1.0.0-alpha.0",
"__version_plone_volto": "{{ cookiecutter.volto_version }}",
"__version_plone_components": "1.7.0",
"__version_plone_components": "workspace:*",
"__version_plone_scripts": "^3.6.1",
"__version_mrs_developer": "^2.2.0",
"__version_pnpm": "9.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "*.js"
- "*.json"
- "*.yaml"
- "*.yml"
Copy link
Member Author

@sneridagh sneridagh Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericof why *.yaml? Did you want to point to .github/workflows/*.yml? if so, they are not triggering, I would point each related *.yml in each workflow. What do you think?

- "cypress/**"
- "packages/**"

Expand All @@ -19,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@{{ cookiecutter.__gha_version_checkout }}

- name: Use Node.js
- name: Use Node.js {{ "${{ env.NODE_VERSION }}" }}
uses: actions/setup-node@{{ cookiecutter.__gha_version_setup_node }}
with:
node-version: {{ "${{ env.NODE_VERSION }}" }}
Expand Down Expand Up @@ -59,8 +60,8 @@ jobs:
name: Start Servers
with:
run: |
make start-test-acceptance-server-ci &
make start-test-acceptance-frontend &
make ci-acceptance-backend-start &
make acceptance-frontend-prod-start &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
Expand All @@ -84,7 +85,7 @@ jobs:

log-output-if: failure

- run: make test-acceptance-headless
- run: make ci-acceptance-test

# Upload Cypress screenshots
- uses: actions/upload-artifact@{{ cookiecutter.__gha_version_upload_artifact }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "*.js"
- "*.json"
- "*.yaml"
- "*.yml"
- "packages/**"

env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "*.js"
- "*.json"
- "*.yaml"
- "*.yml"
- "packages/**"

env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "*.js"
- "*.json"
- "*.yaml"
- "*.yml"
- "packages/**"
- ".github/workflows/storybook.yml"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "*.js"
- "*.json"
- "*.yaml"
- "*.yml"
- "packages/**"

env:
Expand Down
1 change: 1 addition & 0 deletions frontend_addon/{{ cookiecutter.__folder_name }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ help: ## Show this help
install: ## Installs the add-on in a development environment
pnpm dlx mrs-developer missdev --no-config --fetch-https
pnpm i
pnpm pnpm build:deps

.PHONY: start
start: ## Starts Volto, allowing reloading of the add-on during development
Expand Down
46 changes: 26 additions & 20 deletions frontend_addon/{{ cookiecutter.__folder_name }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,27 @@ For this reason, it only works with pnpm and Volto 18 (currently in alpha).
Run `make help` to list the available commands.

```text
help Show this help
install Installs the dev environment using mrs-developer
i18n Sync i18n
format Format codebase
lint Lint Codebase
test Run unit tests
test-ci Run unit tests in CI
storybook-start Start Storybook server on port 6006
storybook-build Build Storybook
start-backend-docker Starts a Docker-based backend for developing
start-test-acceptance-frontend-dev Start acceptance frontend in dev mode
start-test-acceptance-frontend Start acceptance frontend in prod mode
start-test-acceptance-server Start acceptance server
test-acceptance Start Cypress in interactive mode
test-acceptance-headless Run cypress tests in headless mode for CI
help Show this help
install Installs the add-on in a development environment
start Starts Volto, allowing reloading of the add-on during development
build Build a production bundle for distribution of the project with the add-on
i18n Sync i18n
ci-i18n Check if i18n is not synced
format Format codebase
lint Lint, or catch and remove problems, in code base
release Release the add-on on npmjs.org
release-dry-run Dry-run the release of the add-on on npmjs.org
test Run unit tests
ci-test Run unit tests in CI
backend-docker-start Starts a Docker-based backend for development
storybook-start Start Storybook server on port 6006
storybook-build Build Storybook
acceptance-frontend-dev-start Start acceptance frontend in development mode
acceptance-frontend-prod-start Start acceptance frontend in production mode
acceptance-backend-start Start backend acceptance server
ci-acceptance-backend-start Start backend acceptance server in headless mode for CI
acceptance-test Start Cypress in interactive mode
ci-acceptance-test Run cypress tests in headless mode for CI
```

### Development environment set up
Expand All @@ -125,13 +131,13 @@ make install
Start the backend.

```shell
make backend-start-docker
make backend-docker-start
```

In a separate terminal session, start the frontend.

```shell
pnpm start
make start
```

### Lint code
Expand Down Expand Up @@ -173,19 +179,19 @@ Run each of these steps in separate terminal sessions.
In the first session, start the frontend in development mode.

```shell
make start-test-acceptance-frontend-dev
make acceptance-frontend-dev-start
```

In the second session, start the backend acceptance server.

```shell
make start-test-acceptance-server
make acceptance-backend-start
```

In the third session, start the Cypress interactive test runner.

```shell
make test-acceptance
make acceptance-test
```

## License
Expand Down
8 changes: 4 additions & 4 deletions frontend_addon/{{ cookiecutter.__folder_name }}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
],
"scripts": {
"preinstall": "npx only-allow pnpm",
"start": "pnpm build:deps && VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto start",
"start": "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": "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 -- --passWithNoTests",
Expand All @@ -29,8 +29,8 @@
"release": "pnpm --filter {{ cookiecutter.__npm_package_name }} release",
"release-major-alpha": "pnpm --filter {{ cookiecutter.__npm_package_name }} release-major-alpha",
"release-alpha": "pnpm --filter {{ cookiecutter.__npm_package_name }} release-alpha",
"storybook": "pnpm build:deps && VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto storybook dev -p 6006 -c $(pwd)/.storybook",
"build-storybook": "pnpm build:deps && VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto build-storybook -c $(pwd)/.storybook"
"storybook": "VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto storybook dev -p 6006 -c $(pwd)/.storybook",
"build-storybook": "VOLTOCONFIG=$(pwd)/volto.config.js pnpm --filter @plone/volto build-storybook -c $(pwd)/.storybook"
},
"dependencies": {
"@plone/volto": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft",
"pipx run towncrier build --yes --version ${version}",
"cp ../../README.md ./ && cp CHANGELOG.md ../../CHANGELOG.md",
"git add ../../CHANGELOG.md"
"python3 -c 'import json; data = json.load(open(\"../../package.json\")); data[\"version\"] = ${version}; json.dump(data, open(\"../../package.json\", \"w\"), indent=2)'",
ericof marked this conversation as resolved.
Show resolved Hide resolved
"git add ../../CHANGELOG.md ../../package.json"
],
"after:release": "rm .changelog.draft README.md"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: vars
run: |
echo 'BASE_TAG=sha-$(git rev-parse --short HEAD)' >> $GITHUB_OUTPUT
python3 -c 'import json; data = json.load(open("./mrs.developer.json")); print("VOLTO_VERSION=" + data["core"]["tag"])' >> $GITHUB_OUTPUT
python3 -c 'import json; data = json.load(open("./mrs.developer.json")); print("VOLTO_VERSION=" + data["core"].get("tag") or "latest")' >> $GITHUB_OUTPUT
ericof marked this conversation as resolved.
Show resolved Hide resolved
- name: Test vars
run: |
echo 'BASE_TAG={{"${{ steps.vars.outputs.BASE_TAG }}"}}'
Expand Down