-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/1.1.5' into v1
- Loading branch information
Showing
31 changed files
with
6,046 additions
and
1,954 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Code Analysis | ||
|
||
on: | ||
pull_request: null | ||
push: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
jobs: | ||
code_analysis: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
actions: | ||
- | ||
name: 'PHPStan' | ||
run: composer phpstan | ||
- | ||
name: 'Coding Standards' | ||
run: composer fix-cs | ||
name: ${{ matrix.actions.name }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache Composer dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/composer-cache | ||
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | ||
- name: Setup PHP | ||
id: setup-php | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
extensions: 'ctype,curl,dom,iconv,imagick,intl,json,mbstring,openssl,pcre,pdo,reflection,spl,zip' | ||
ini-values: post_max_size=256M, max_execution_time=180, memory_limit=512M | ||
tools: composer:v2 | ||
- name: Install Composer dependencies | ||
run: composer install --no-interaction --no-ansi --no-progress | ||
- run: ${{ matrix.actions.run }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Create Release | ||
run-name: Create release for ${{ github.event.client_payload.version }} | ||
|
||
on: | ||
repository_dispatch: | ||
types: | ||
- craftcms/new-release | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
body: ${{ github.event.client_payload.notes }} | ||
makeLatest: ${{ github.event.client_payload.latest }} | ||
name: ${{ github.event.client_payload.version }} | ||
prerelease: ${{ github.event.client_payload.prerelease }} | ||
tag: ${{ github.event.client_payload.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 nystudio107 | ||
Copyright (c) nystudio107 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
MAJOR_VERSION?=3 | ||
PLUGINDEV_PROJECT_DIR?=/Users/andrew/webdev/sites/plugindev/cms_v${MAJOR_VERSION}/ | ||
VENDOR?=nystudio107 | ||
PROJECT_PATH?=${VENDOR}/$(shell basename $(CURDIR)) | ||
|
||
.PHONY: dev docs release | ||
|
||
# Start up the buildchain dev server | ||
dev: | ||
# Start up the docs dev server | ||
docs: | ||
${MAKE} -C docs/ dev | ||
# Run code quality tools, tests, and build the buildchain & docs in preparation for a release | ||
release: --code-quality --code-tests --buildchain-clean-build --docs-clean-build | ||
# The internal targets used by the dev & release targets | ||
--buildchain-clean-build: | ||
--code-quality: | ||
${MAKE} -C ${PLUGINDEV_PROJECT_DIR} -- ecs check vendor/${PROJECT_PATH}/src --fix | ||
${MAKE} -C ${PLUGINDEV_PROJECT_DIR} -- phpstan analyze -c vendor/${PROJECT_PATH}/phpstan.neon | ||
--code-tests: | ||
--docs-clean-build: | ||
${MAKE} -C docs/ clean | ||
${MAKE} -C docs/ image-build | ||
${MAKE} -C docs/ fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/vendor | ||
/node_modules | ||
/docs/.vitepress/dist | ||
/docs/.vitepress/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,47 @@ | ||
TAG?=14-alpine | ||
CONTAINER?=$(shell basename $(dir $(CURDIR)))-docs | ||
DOCKERRUN=docker container run \ | ||
--name ${CONTAINER} \ | ||
--rm \ | ||
-p 3002:3002 \ | ||
-t \ | ||
-v `pwd`:/app \ | ||
${CONTAINER}:${TAG} | ||
DOCSDEST?=../../../sites/nystudio107/web/docs/icalendar | ||
MAJOR_VERSION?=1 | ||
TAG?=20-alpine | ||
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs | ||
DOCS_DEV_PORT?=400${MAJOR_VERSION} | ||
DOCS_DEST?=../../../sites/nystudio107/web/docs/icalendar/v1 | ||
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG)) | ||
IMAGE_NAME=${CONTAINER}:${TAG} | ||
DOCKER_RUN=docker container run --rm -it -v "${CURDIR}":/app | ||
|
||
.PHONY: docker build dev fix install lint clean npm | ||
.PHONY: build clean dev fix image-build image-check lint npm ssh | ||
|
||
docker: | ||
docker build \ | ||
. \ | ||
-t ${CONTAINER}:${TAG} \ | ||
--build-arg TAG=${TAG} \ | ||
--no-cache | ||
build: clean docker install | ||
${DOCKERRUN} \ | ||
run docs:build | ||
rm -rf ${DOCSDEST} | ||
mv ./docs/.vitepress/dist ${DOCSDEST} | ||
dev: docker install | ||
${DOCKERRUN} \ | ||
run docs:dev | ||
fix: docker install | ||
${DOCKERRUN} \ | ||
run docs:fix | ||
install: docker | ||
${DOCKERRUN} \ | ||
install | ||
lint: docker install | ||
${DOCKERRUN} \ | ||
run docs:lint | ||
clean: docker | ||
# Perform a dist build via npm run docs:build | ||
build: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:build | ||
rm -rf ${DOCS_DEST} | ||
mv ./docs/.vitepress/dist ${DOCS_DEST} | ||
# Remove node_modules/ & package-lock.json | ||
clean: | ||
rm -rf node_modules/ | ||
rm -f package-lock.json | ||
npm: docker | ||
${DOCKERRUN} \ | ||
$(filter-out $@,$(MAKECMDGOALS)) | ||
# Run the development server via npm run docs:dev | ||
dev: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DOCS_DEV_PORT="${DOCS_DEV_PORT}" -p ${DOCS_DEV_PORT}:${DOCS_DEV_PORT} ${IMAGE_NAME} run docs:dev | ||
# Fix the docs with textlint via npm run docs:fix | ||
fix: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:fix | ||
# Build the Docker image & run npm install | ||
image-build: | ||
docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install | ||
# Ensure the image has been created | ||
image-check: | ||
ifeq ($(IMAGE_INFO), []) | ||
image-check: image-build | ||
endif | ||
# Lint the docs with textlint via npm run docs:lint | ||
lint: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:lint | ||
# Run the passed in npm command | ||
npm: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) | ||
# Open a shell inside of the container | ||
ssh: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME} | ||
%: | ||
@: | ||
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# `icalendar` docs | ||
|
||
This buildchain is a self-contained build system for the `icalendar` documentation. | ||
|
||
## Overview | ||
|
||
The buildchain uses [VitePress](https://vitepress.dev/) via a Docker container to facilitate writing the docs as [markdown](https://vitepress.dev/guide/markdown), linting them via [textlint](https://textlint.github.io/), building them as HTML files with bundled assets, and publishing them automatically via a [GitHub action](https://docs.github.com/en/actions). | ||
|
||
It also uses a [Rollup](https://rollupjs.org/) [sitemap plugin](https://github.com/aminnairi/rollup-plugin-sitemap) to generate a `sitemap.xml` for the generated docs. | ||
|
||
The markdown sources for the docs and assets are in the `docs/docs/` directory. | ||
|
||
The built distribution docs are created via the `build-and-deploy-docs.yaml` | ||
|
||
## Prerequisites | ||
|
||
To run the buildchain for development purposes: | ||
|
||
- You must have [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or the equivalent) installed | ||
|
||
## Commands | ||
|
||
This buildchain uses `make` as an interface to the buildchain. The following commands are available from the `buildchain/` directory: | ||
|
||
- `make image-build` - Build the Docker image & run `npm install`. This command must be run once before using the Docker container. | ||
- `make dev` - Start Vite HMR dev server while writing/editing the docs. Click on the link displayed in the terminal to open the docs up | ||
- `make lint` - Run `textlint` on the docs, reporting on any errors and warnings | ||
- `make fix` - Run `textlint` on the docs, automatically fixing any errors, and reporting any warnings | ||
- `make clean` - Remove `node_modules/` and `package-lock.json` to start clean (need to run `make image-build` after doing this, see below) | ||
- `make npm XXX` - Run an `npm` command inside the container, e.g.: `make npm run lint` or `make npm install` | ||
- `make ssh` - Open up a shell session into the buildchain Docker container | ||
- `make build` - Do a local distribution build of the docs; normally not needed since they are built & deployed via GitHub action | ||
|
||
## Docs versioning | ||
|
||
Each major version of the plugin corresponds to a major version of Craft. | ||
|
||
Each major version of the plugin has separate documentation that needs to be updated when changes span plugin versions. | ||
|
||
The latest version of the docs that correspond to the latest version of the plugin is always the root of the docs tree, with older versions appearing in sub-directories: | ||
|
||
``` | ||
│ index.html | ||
├── v4 | ||
│ └── index.html | ||
├── v3 | ||
│ └── index.html | ||
``` | ||
|
||
The docs are entirely separate, but linked to eachother via a version menu, configured in the `docs/docs/.vitepress/config.ts` file. | ||
|
||
## Algolia Docsearch | ||
|
||
The docs uses [Algolia Docsearch](https://docsearch.algolia.com/) to index them, and allow for easy searching via a search field with auto-complete. | ||
|
||
Algolia Docsearch is configured in the `docs/docs/.vitepress/config.ts` file. | ||
|
||
## textlint | ||
|
||
The buildchain uses [textlint](https://textlint.github.io/) to automatically fix errors on build, and also issue writing style warnings. | ||
|
||
`textlint` automatically uses any rules added to the `docs/package.json` file, which can be overridden or customized via the `docs/.textlintrc.js` file. | ||
|
||
See the [textlint docs](https://textlint.github.io/docs/getting-started.html) for details. | ||
|
||
## Overriding environment variables | ||
|
||
The `Makefile` contains sane defaults for most things, but you can override them via environment variables if you need to. | ||
|
||
For instance, if you want to change the `DOCS_DEST` environment variable to change where `make build` builds the docs locally, you can set it before running any buildchain `make` commands: | ||
```bash | ||
env DOCS_DEST=../path/to/some/dir make build | ||
``` | ||
...or use any other method for [setting environment variables](https://www.twilio.com/blog/how-to-set-environment-variables.html). This environment variable needs to be set in the shell where you run the buildchain's various `make` commands from, so setting it in your project's `.env` file won't work. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.