Skip to content

Commit e305b59

Browse files
committed
Merge branch 'release/4.0.1' into v4
2 parents 4d2ac65 + 26b6c82 commit e305b59

24 files changed

+1659
-1230
lines changed

.github/workflows/build-and-deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ env:
44
on:
55
push:
66
branches:
7-
- v1
7+
- v4
88
paths:
99
- 'docs/**'
1010
pull_request:
1111
branches:
12-
- v1
12+
- v4
1313
paths:
1414
- 'docs/**'
1515
workflow_dispatch:
@@ -35,7 +35,7 @@ jobs:
3535
- name: rsync deployments
3636
uses: burnett01/rsync-deployments@4.1
3737
with:
38-
switches: -avzr --delete
38+
switches: -avzr
3939
path: ./dist/
4040
remote_path: ${{ secrets.NYS_DOCS_ROOT }}${{ env.DOCS_DEST_DIR }}
4141
remote_host: ${{ secrets.NYS_DEPLOY_REMOTE_HOST }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Create Release
2+
run-name: Create release for ${{ github.event.client_payload.version }}
3+
4+
on:
5+
repository_dispatch:
6+
types:
7+
- craftcms/new-release
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: ncipollo/release-action@v1
16+
with:
17+
body: ${{ github.event.client_payload.notes }}
18+
makeLatest: ${{ github.event.client_payload.latest }}
19+
name: ${{ github.event.client_payload.version }}
20+
prerelease: ${{ github.event.client_payload.prerelease }}
21+
tag: ${{ github.event.client_payload.tag }}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Units Changelog
22

3+
## 4.0.1 - 2023.04.24
4+
### Changed
5+
* Updated the docs to use VitePress `^1.0.0-alpha.29`
6+
* Allow for versioning of the docs
7+
8+
### Fixed
9+
* Fixed an issue that through a Typed Property Error exception when creating a Units field ([#41](https://github.com/nystudio107/craft-units/issues/41))
10+
* Add `allow-plugins` to `composer.json` to fix CI
11+
312
## 4.0.0 - 2022.05.17
413
### Added
514
* Initial Craft CMS 4 release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/quality-score.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-units/?branch=v1) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/coverage.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-units/?branch=v1) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/build.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-units/build-status/v1) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/code-intelligence.svg?b=v1)](https://scrutinizer-ci.com/code-intelligence)
1+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/quality-score.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-units/?branch=v4) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/coverage.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-units/?branch=v4) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/build.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-units/build-status/v4) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-units/badges/code-intelligence.svg?b=v4)](https://scrutinizer-ci.com/code-intelligence)
22

33
# Units plugin for Craft CMS 4.x
44

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-units",
33
"description": "Units is a plugin that can convert between any units of measure, and comes with a Field for content authors to use",
44
"type": "craft-plugin",
5-
"version": "4.0.0",
5+
"version": "4.0.1",
66
"keywords": [
77
"craft",
88
"cms",
@@ -29,6 +29,14 @@
2929
"craftcms/cms": "^4.0.0",
3030
"php-units-of-measure/php-units-of-measure": "^2.1.0"
3131
},
32+
"config": {
33+
"allow-plugins": {
34+
"craftcms/plugin-installer": true,
35+
"yiisoft/yii2-composer": true
36+
},
37+
"optimize-autoloader": true,
38+
"sort-packages": true
39+
},
3240
"autoload": {
3341
"psr-4": {
3442
"nystudio107\\units\\": "src/"

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/vendor
22
/node_modules
3+
/docs/.vitepress/dist
4+
/docs/.vitepress/cache

docs/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG TAG=14-alpine
22
FROM node:$TAG
33

4+
USER node
5+
46
WORKDIR /app/
57

68
CMD ["run build"]

docs/Makefile

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
1+
MAJOR_VERSION?=4
12
TAG?=14-alpine
2-
CONTAINER?=$(shell basename $(dir $(CURDIR)))-docs
3-
DOCKERRUN=docker container run \
4-
--name ${CONTAINER} \
5-
--rm \
6-
-p 3002:3002 \
7-
-t \
8-
-v `pwd`:/app \
9-
${CONTAINER}:${TAG}
10-
DOCSDEST?=../../../sites/nystudio107/web/docs/units
3+
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs
4+
DOCS_DEV_PORT?=400${MAJOR_VERSION}
5+
DOCS_DEST?=../../../sites/nystudio107/web/docs/code-field
6+
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG))
7+
IMAGE_NAME=${CONTAINER}:${TAG}
8+
DOCKER_RUN=docker container run --rm -it -v "${CURDIR}":/app
119

12-
.PHONY: docker build dev fix install lint clean npm
10+
.PHONY: build clean dev fix image-build image-check lint npm ssh
1311

14-
docker:
15-
docker build \
16-
. \
17-
-t ${CONTAINER}:${TAG} \
18-
--build-arg TAG=${TAG} \
19-
--no-cache
20-
build: clean docker install
21-
${DOCKERRUN} \
22-
run docs:build
23-
rm -rf ${DOCSDEST}
24-
mv ./docs/.vitepress/dist ${DOCSDEST}
25-
dev: docker install
26-
${DOCKERRUN} \
27-
run docs:dev
28-
fix: docker install
29-
${DOCKERRUN} \
30-
run docs:fix
31-
install: docker
32-
${DOCKERRUN} \
33-
install
34-
lint: docker install
35-
${DOCKERRUN} \
36-
run docs:lint
12+
# Perform a dist build via npm run docs:build
13+
build: image-check
14+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:build
15+
rm -rf ${DOCS_DEST}
16+
mv ./docs/.vitepress/dist ${DOCS_DEST}
17+
# Remove node_modules/ & package-lock.json
3718
clean:
3819
rm -rf node_modules/
3920
rm -f package-lock.json
40-
npm: docker
41-
${DOCKERRUN} \
42-
$(filter-out $@,$(MAKECMDGOALS))
21+
# Run the development server via npm run docs:dev
22+
dev: image-check
23+
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DOCS_DEV_PORT="${DOCS_DEV_PORT}" -p ${DOCS_DEV_PORT}:${DOCS_DEV_PORT} ${IMAGE_NAME} run docs:dev
24+
# Fix the docs with textlint via npm run docs:fix
25+
fix: image-check
26+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:fix
27+
# Build the Docker image & run npm install
28+
image-build:
29+
docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache
30+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install
31+
# Ensure the image has been created
32+
image-check:
33+
ifeq ($(IMAGE_INFO), [])
34+
image-check: image-build
35+
endif
36+
# Lint the docs with textlint via npm run docs:lint
37+
lint: image-check
38+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:lint
39+
# Run the passed in npm command
40+
npm: image-check
41+
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)
42+
# Open a shell inside of the container
43+
ssh: image-check
44+
${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME}
4345
%:
4446
@:
4547
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line

docs/docs/.vitepress/config.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/docs/.vitepress/config.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import {defineConfig} from 'vitepress'
2+
3+
export default defineConfig({
4+
title: 'Units Plugin',
5+
description: 'Documentation for the Units plugin',
6+
base: '/docs/units/',
7+
lang: 'en-US',
8+
head: [
9+
['meta', {content: 'https://github.com/nystudio107', property: 'og:see_also',}],
10+
['meta', {content: 'https://twitter.com/nystudio107', property: 'og:see_also',}],
11+
['meta', {content: 'https://youtube.com/nystudio107', property: 'og:see_also',}],
12+
['meta', {content: 'https://www.facebook.com/newyorkstudio107', property: 'og:see_also',}],
13+
],
14+
themeConfig: {
15+
socialLinks: [
16+
{icon: 'github', link: 'https://github.com/nystudio107'},
17+
{icon: 'twitter', link: 'https://twitter.com/nystudio107'},
18+
],
19+
logo: '/img/plugin-logo.svg',
20+
editLink: {
21+
pattern: 'https://github.com/nystudio107/craft-units/edit/develop/docs/docs/:path',
22+
text: 'Edit this page on GitHub'
23+
},
24+
algolia: {
25+
appId: 'TVGT09IBL5',
26+
apiKey: 'd2d2de61619265d05d80bf26ad24f9b4',
27+
indexName: 'nystudio107-units'
28+
},
29+
lastUpdatedText: 'Last Updated',
30+
sidebar: [],
31+
nav: [
32+
{text: 'Home', link: 'https://nystudio107.com/plugins/units'},
33+
{text: 'Store', link: 'https://plugins.craftcms.com/units'},
34+
{text: 'Changelog', link: 'https://nystudio107.com/plugins/units/changelog'},
35+
{text: 'Issues', link: 'https://github.com/nystudio107/craft-units/issues'},
36+
{
37+
text: 'v4', items: [
38+
{text: 'v4', link: '/'},
39+
{text: 'v3', link: 'https://nystudio107.com/docs/units/v3/'},
40+
],
41+
},
42+
]
43+
},
44+
});

0 commit comments

Comments
 (0)