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

code review #4

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
342f5b1
initial commit
ptesei Mar 30, 2024
56c0fe2
feat menu dropdown
ptesei Mar 30, 2024
24a2bba
enable interactivity build
ptesei Mar 30, 2024
3c87c06
viewscript as module
ptesei Mar 30, 2024
6292122
add body styles
ptesei Mar 30, 2024
3992087
add banner and doc
ptesei Apr 5, 2024
6692837
rebuild
ptesei Apr 5, 2024
12fce46
add screeshots
ptesei Apr 5, 2024
b980ef9
add readme and licence
ptesei Apr 6, 2024
d7401a3
refactor wordpress org
ptesei Apr 6, 2024
7ec16a7
add screenshots
ptesei Apr 6, 2024
91b3160
add code quality tools
ptesei Apr 6, 2024
350a1a4
feat update build
ptesei Apr 6, 2024
e9619f5
fix coding standard
ptesei Apr 6, 2024
e317a0e
update php version
ptesei Apr 6, 2024
c12fff7
update node version
ptesei Apr 6, 2024
e25e447
Merge pull request #2 from mosne/develop
ptesei Apr 6, 2024
34c4d51
add comments
ptesei Apr 7, 2024
ec7edc7
Merge pull request #3 from mosne/develop
ptesei Apr 7, 2024
212f396
update text
ptesei Apr 7, 2024
e76aaea
fix path
ptesei Apr 7, 2024
9c3428a
update test
ptesei Apr 7, 2024
ba432d5
Merge pull request #5 from mosne/develop
ptesei Apr 7, 2024
9cfe58b
fix banner
ptesei Apr 7, 2024
9f415d7
Merge branch 'develop'
ptesei Apr 7, 2024
030c809
fixed readme
ptesei Apr 10, 2024
7e90ec8
add esc attr and direc access avoidance
ptesei May 12, 2024
47817d3
fix the fix
ptesei May 30, 2024
cbffd49
Merge pull request #6 from mosne/fix-evaluations
ptesei May 30, 2024
b40aa9e
fix cs
ptesei May 30, 2024
e3198fe
bump version 0.1.1
ptesei May 30, 2024
4bed6cb
update
ptesei May 30, 2024
bb6bebd
fix cs
ptesei May 31, 2024
732e1cf
Merge pull request #7 from mosne/fix-evaluations
ptesei May 31, 2024
0fe4df0
update release git flow
ptesei Jun 1, 2024
96eef57
Merge pull request #9 from mosne/ver/0.1.1
ptesei Jun 1, 2024
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
25 changes: 25 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/.git
/.github
/.wordpress-org
/node_modules
/src

.distignore
.editorconfig
.gitattributes
.gitignore
.plugin-data
.wp-env.json
CHANGELOG.md
composer.json
composer.lock
grumphp.yml
LICENSE.md
package.json
package-lock.json
phpcs.xml.dist
phpunit.xml.dist
psalm.xml.dist
README.md
webpack.config.js
yarn.lock
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/.git export-ignore
/.github export-ignore
/vendor/ export-ignore -diff
/node_modules export-ignore

/.distignore export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.plugin-data export-ignore
/.wp-env.json export-ignore
/composer.json export-ignore
/composer.lock export-ignore -diff
/grumphp.yml export-ignore
/LICENSE.md export-ignore
/package.json export-ignore
/package-lock.json export-ignore -diff
/phpcs.xml.dist export-ignore
/psalm.xml.dist export-ignore
/README.md export-ignore
/webpack.config.js export-ignore
/yarn.lock export-ignore
Empty file added .github/.gitkeep
Empty file.
38 changes: 38 additions & 0 deletions .github/workflows/pull-request-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Check plugin version and tags"
on:
pull_request:
branches:
- main

jobs:
version-check:
name: "Check version doesn't not already exists."
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: set-vars
name: "Set variables from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: version-check
name: "Check version in .plugin-data is not existing"
run: |
# Check version from .plugin-data
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag aleady exists please update the .plugin-data file to good version";
exit 1;
fi
34 changes: 34 additions & 0 deletions .github/workflows/quality-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Javascript Quality Checks

on:
pull_request:
push:
branches:
- main

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
checks:
name: Lint JS
runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'

- name: Install npm dependencies
run: yarn install --frozen-lockfile

- name: Run wp-script lint:js on src folder
run: yarn run lint:js src
38 changes: 38 additions & 0 deletions .github/workflows/quality-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHP Quality Checks

on:
pull_request:
push:
branches:
- main

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
checks:
name: Codesniffer
runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl

- name: Validate composer file
run: composer validate

- name: Install composer dependencies
run: composer install

- name: Run codesniffer
run: composer cs
90 changes: 90 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Release new TAG

on:
push:
branches:
- main

jobs:
build-and-release:
name: "Release new TAG"
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: set-vars
name: "Set variable from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: check-version
name: "Check version does not exists"
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

echo "Get Branch tag"
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag already exists, stop now";
exit 1;
fi

- id: build-js
name: "Build project JS"
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: yarn install --frozen-lockfile
- run: yarn run build

- id: build-php
name: "Build project PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- run: composer install --prefer-dist --no-dev -o

- id: commit-and-push
name: "Commit and push new TAG"
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

echo "Copy .distignore to .gitignore"
cp .distignore .gitignore

echo "Configure git"
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"

echo "Creating branch"
git checkout -b release/${VERSION}

echo "Creating tag ${VERSION}"
git add .
git add -u
git commit -m "Release version ${VERSION}"
git tag ${VERSION}
git push --tags

- id: regenerate-satis
env:
BUDDY_SATIS_WEBHOOK: ${{ secrets.BUDDY_SATIS_WEBHOOK }}
name: "Launch the Satis regeneration"
run: |
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
SLUG=${{fromJson(steps.set-vars.outputs.pluginData).slug}}

curl --get \
--data-urlencode "comment=Update plugin ${SLUG} with version ${VERSION}" \
$BUDDY_SATIS_WEBHOOK
33 changes: 33 additions & 0 deletions .github/workflows/wordpressorg-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Publish New Release on WordPress.org"
on:
release:
types: [ published ]

jobs:
wordpress-release:
name: "New release on WordPress.org"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- id: set-vars
name: "Set variables from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: deploy
name: "WordPress.org Plugin Deploy"
if: "! github.event.release.prerelease"
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: ${{fromJson(steps.set-vars.outputs.pluginData).slug}}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Directories/files that may be generated by this project
/build/
/vendor/
/node_modules/
.nvmrc
package-lock.json

# Directories/files that may appear in your environment
*.log
.cache

# Operating system specific files
.DS_Store
Thumbs.db

# Local overrides
.wp-env.override.json
phpcs.xml
psalm.xml
4 changes: 4 additions & 0 deletions .plugin-data
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "0.1.1",
"slug": "mosne-dark-palette"
}
Loading
Loading