Skip to content

Commit

Permalink
Merge branch 'release/4.0.9' into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Oct 8, 2024
2 parents 944f8d5 + abd1b35 commit ad0f935
Show file tree
Hide file tree
Showing 24 changed files with 2,994 additions and 795 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Deploy Docs
env:
DOCS_DEST_DIR: /recipe/
DOCS_DEST_DIR: /recipe/v4
on:
push:
branches:
Expand All @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node-version: [20.x]
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code Analysis

on:
pull_request: null
push:
branches:
- develop-v4
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 }}
114 changes: 5 additions & 109 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Recipe Changelog

## 4.0.9 - 2024.10.08
### Added
* Add `phpstan` and `ecs` code linting
* Add `code-analysis.yaml` GitHub action

## 4.0.8 - 2024.01.14
### Added
* Automate release generation via GitHub action
Expand Down Expand Up @@ -69,112 +74,3 @@
### Added

* Initial Craft CMS 4 compatibility

## 1.4.0 - 2021.10.05
### Added
* Added `.createRecipeMetaJsonLd()` to the Recipes field, to allow the creation of SEOmatic MetaJsonLd objects that can be manipulated and rendered on the page by SEOmatic
* Added **Recipe Equipment** ([#32](https://github.com/nystudio107/craft-recipe/issues/32))
* Added `recipeCategory` and `recipeCuisine` fields ([#50](https://github.com/nystudio107/craft-recipe/issues/50))
* Added the field `servesUnit` and a method called `getServes()` which is just concatenating the serves with its unit when it's not empty ([#37](https://github.com/nystudio107/craft-recipe/pull/37/))
* Added a Recipe Video field that can be accessed via `.getVideoUrl()` ([#50](https://github.com/nystudio107/craft-recipe/issues/50))
* Added `author` and `keywords` fields ([#50](https://github.com/nystudio107/craft-recipe/issues/50))

### Changed
* Switched over to using VitePress for the documentation

## 1.3.0 - 2021.03.05
### Added
* Added the ability to fetch nutritional information from ingredients using the [Edamam Nutrition Analysis API](https://developer.edamam.com/edamam-nutrition-api).
* Added plugin settings for configuring API credentials.
* Added a console controller action that generates nutritional information for all entries in a section using the API.
* Added docs buildchain

## 1.2.1 - 2021.01.28
### Added
* Added sodium content to nutrition facts template.
* Implemented `useFieldset` for Craft 3.6

### Changed
* Non-imperial units are converted to nice fractions too
* Nice fraction now has a space before it
* Changed fraction precision to `1`

## 1.2.0 - 2020.11.04
### Added
* Added support for importing recipes (including ingredients, directions and ratings) using Feed Me.

## 1.1.3 - 2020.05.25
### Fixed
* Add plural for grams and remove cups abbreviation
* Correct prefix of 0 for measurements and use 'cups' instead of c

## 1.1.2 - 2020.04.16
### Fixed
* Fixed Asset Bundle namespace case

## 1.1.1 - 2020.04.06
### Changed
* An error is no longer logged if there isn't a frontend template for the Nutrition Facts
* Updated missing translations

## 1.1.0 - 2020.04.03
### Added
* Added support for imperial pounds and metric kilograms
* Added support for passing in an image transform to `.getImageUrl()`

### Fixed
* Fixed errant display of the 1.66 quantity by rounding the mantissa so we can do a floating point comparison without weirdness, per: https://www.php.net/manual/en/language.types.float.php#113703
* Fix the abbreviations to be be the same whether singular or plural as per [Measurement Abbreviations](https://abbreviations.yourdictionary.com/articles/measurement-abbreviations.html)

## 1.0.11 - 2019.07.10
### Changed
* Add support for 2/3 fraction
* Fixed an issue where controls to add ratings didn't work when you switched tabs until you resized the window

## 1.0.10 - 2019.03.08
### Changed
* Fixed the Asset Sources settings to work with Craft 3.1

## 1.0.9 - 2019.03.08
### Changed
* Add 1/3 and 1/6 fractions
* Prevent error on no directions or ingredients

## 1.0.8 - 2019.03.08
### Changed
* Fixed an issue where tabs didn't work properly in the Field

## 1.0.7 - 2018.03.02
### Changed
* Fixed deprecation errors from Craft CMS 3 RC13

## 1.0.6 - 2018.02.01
### Added
* Renamed the composer package name to `craft-recipe`

## 1.0.5 - 2017.12.06
### Changed
* Updated to require craftcms/cms `^3.0.0-RC1`

## 1.0.4 - 2017.03.24
### Changed
* `hasSettings` -> `hasCpSettings` for Craft 3 beta 8 compatibility
* Modified config service calls for Craft 3 beta 8

## 1.0.3 - 2017.03.12
### Added
* Added `craft/cms` as a composer dependency
* Added code inspection typehinting for the plugin

## 1.0.2 - 2017.03.03
### Fixed
- Redirect to the Welcome message only when the `Recipe` plugin is installed

## 1.0.1 - 2017.02.15
### Fixed
- Fixed an issue that would cause you to be unable to choose an asset
- Merged the Field rules with parent

## 1.0.0 - 2017.02.10
### Added
- Initial release
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
The MIT License (MIT)
Copyright (c) 2017 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.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MAJOR_VERSION?=4
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
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/quality-score.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v1) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/coverage.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v1) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/build.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/build-status/v1) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/code-intelligence.svg?b=v1)](https://scrutinizer-ci.com/code-intelligence)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/quality-score.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v4) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/coverage.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v4) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/build.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/build-status/v4) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/code-intelligence.svg?b=v4)](https://scrutinizer-ci.com/code-intelligence)

# Recipe plugin for Craft CMS 4.x

A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support

![Screenshot](./docs/docs/resources/img/plugin-logo.png)

Related: [Recipe for Craft 2.x](https://github.com/nystudio107/recipe)

## Requirements

This plugin requires Craft CMS 4.0.0 or later.
Expand All @@ -21,8 +19,6 @@ To install Recipe, follow these steps:

You can also install Recipe via the **Plugin Store** in the Craft AdminCP.

Recipe works on Craft 4.x.

## Documentation

Click here -> [Recipe Documentation](https://nystudio107.com/plugins/recipe/documentation)
Expand Down
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-recipe",
"description": "A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support",
"type": "craft-plugin",
"version": "4.0.8",
"version": "4.0.9",
"keywords": [
"craft",
"cms",
Expand All @@ -25,6 +25,18 @@
"require": {
"craftcms/cms": "^4.0.0"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/feed-me": "^5.0.0",
"craftcms/phpstan": "dev-main",
"craftcms/rector": "dev-main",
"nystudio107/craft-seomatic": "^4.0.0"
},
"scripts": {
"phpstan": "phpstan --ansi --memory-limit=1G",
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --fix --ansi"
},
"config": {
"allow-plugins": {
"craftcms/plugin-installer": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MAJOR_VERSION?=4
TAG?=20-alpine
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs
DOCS_DEV_PORT?=400${MAJOR_VERSION}
DOCS_DEST?=../../../sites/nystudio107/web/docs/recipe
DOCS_DEST?=../../../sites/nystudio107/web/docs/recipe/v4
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG))
IMAGE_NAME=${CONTAINER}:${TAG}
DOCKER_RUN=docker container run --rm -it -v "${CURDIR}":/app
Expand Down
10 changes: 7 additions & 3 deletions docs/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {defineConfig} from 'vitepress';
export default defineConfig({
title: 'Recipe Plugin',
description: 'Documentation for the Recipe plugin',
base: '/docs/recipe/',
base: '/docs/recipe/v4/',
lang: 'en-US',
head: [
['meta', {content: 'https://github.com/nystudio107', property: 'og:see_also',}],
Expand All @@ -18,13 +18,16 @@ export default defineConfig({
],
logo: '/img/plugin-logo.svg',
editLink: {
pattern: 'https://github.com/nystudio107/craft-recipe/edit/develop/docs/docs/:path',
pattern: 'https://github.com/nystudio107/craft-recipe/edit/develop-v4/docs/docs/:path',
text: 'Edit this page on GitHub'
},
algolia: {
appId: 'ANVOBU7GYX',
apiKey: '66d1888afb505fa3d1b0342a487706ff',
indexName: 'recipe'
indexName: 'recipe',
searchParameters: {
facetFilters: ["version:v4"],
},
},
lastUpdatedText: 'Last Updated',
sidebar: [],
Expand All @@ -35,6 +38,7 @@ export default defineConfig({
{text: 'Issues', link: 'https://github.com/nystudio107/craft-recipe/issues'},
{
text: 'v4', items: [
{text: 'v5', link: 'https://nystudio107.com/docs/recipe/'},
{text: 'v4', link: '/'},
{text: 'v1', link: 'https://nystudio107.com/docs/recipe/v1/'},
],
Expand Down
10 changes: 4 additions & 6 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/quality-score.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v1) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/coverage.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v1) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/build.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/build-status/v1) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/code-intelligence.svg?b=v1)](https://scrutinizer-ci.com/code-intelligence)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/quality-score.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v4) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/coverage.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/?branch=v4) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/build.png?b=v4)](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/build-status/v4) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-recipe/badges/code-intelligence.svg?b=v4)](https://scrutinizer-ci.com/code-intelligence)

# Recipe plugin for Craft CMS
# Recipe plugin for Craft CMS 4.x

A comprehensive recipe FieldType for Craft CMS that includes metric/imperial conversion, portion calculation, and JSON-LD microdata support

Check warning on line 5 in docs/docs/index.md

View workflow job for this annotation

GitHub Actions / build (20.x)

"portion" is wordy or unneeded

![Screenshot](./resources/img/plugin-logo.png)

Related: [Recipe for Craft 2.x](https://github.com/nystudio107/recipe)

## Requirements

This plugin requires Craft CMS 3.0.0 or later or Craft CMS 4.0.0 or later.
This plugin requires Craft CMS 4.0.0 or later

## Installation

Expand Down Expand Up @@ -169,7 +167,7 @@ To do any further manipulation of the Recipe Image (perhaps a transform) you can

The Recipe field conceptually encompasses a single recipe. However, if you require multiple components in a recipe you can still use Recipe.

An example of a multiple component recipe might be a dish that requires a sauce that's prepared separately from the main dish.
An example of a multiple component recipe might be a dish that requires a sauce thats prepared separately from the main dish.

What you can do is create a Matrix field that contains a Recipe field.

Expand Down
Loading

0 comments on commit ad0f935

Please sign in to comment.