Skip to content

Commit 4cae6bb

Browse files
authored
Merge pull request #1 from BeAPI/feature/init-plugin
Add initial files
2 parents 27e5c5c + 0a8dad1 commit 4cae6bb

50 files changed

Lines changed: 28242 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.distignore‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/.git
2+
/.github
3+
/.wordpress-org
4+
/node_modules
5+
/src
6+
/tests
7+
8+
.distignore
9+
.editorconfig
10+
.eslintrc
11+
.gitattributes
12+
.gitignore
13+
.plugin-data
14+
.stylelintrc
15+
.wp-env.json
16+
CHANGELOG.md
17+
composer.json
18+
composer.lock
19+
grumphp.yml
20+
LICENSE.md
21+
package.json
22+
package-lock.json
23+
phpcs.xml.dist
24+
phpunit.xml.dist
25+
README.md
26+
webpack.config.js
27+
yarn.lock

‎.editorconfig‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[*.{yml,yaml}]
17+
indent_style = space
18+
indent_size = 2

‎.gitattributes‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/.git export-ignore
2+
/.github export-ignore
3+
/.wordpress-org export-ignore
4+
/src/ export-ignore -diff
5+
/vendor/ export-ignore -diff
6+
/node_modules export-ignore
7+
/tests export-ignore
8+
9+
/.distignore export-ignore
10+
/.editorconfig export-ignore
11+
/.eslintrc export-ignore
12+
/.gitattributes export-ignore
13+
/.gitignore export-ignore
14+
/.plugin-data export-ignore
15+
/.stylelintrc export-ignore
16+
/.wp-env.json export-ignore
17+
/.wp-env.test.json export-ignore
18+
/CHANGELOG.md export-ignore
19+
/composer.json export-ignore
20+
/composer.lock export-ignore -diff
21+
/eslint.config.cjs export-ignore -diff
22+
/grumphp.yml export-ignore
23+
/LICENSE.md export-ignore
24+
/package.json export-ignore
25+
/package-lock.json export-ignore -diff
26+
/phpcs.xml.dist export-ignore
27+
/phpunit.xml.dist export-ignore
28+
/README.md export-ignore
29+
/webpack.config.js export-ignore
30+
/yarn.lock export-ignore

‎.github/banner-github.png‎

25.7 KB
Loading
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Check plugin version and release files"
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
version-check:
9+
name: "Version bump, tag, and file checks"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v7
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Fetch tags
18+
run: git fetch --tags --prune origin
19+
20+
- name: Verify version bump and release files
21+
env:
22+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
23+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
24+
run: tests/bin/check-release-version.sh

‎.github/workflows/quality-js.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Javascript Quality Checks
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'src/**'
7+
- '.stylelintrc'
8+
- 'package.json'
9+
- 'package-lock.json'
10+
push:
11+
paths:
12+
- 'src/**'
13+
- '.stylelintrc'
14+
- 'package.json'
15+
- 'package-lock.json'
16+
branches:
17+
- main
18+
19+
# Cancels all previous workflow runs for pull requests that have not completed.
20+
concurrency:
21+
# The concurrency group contains the workflow name and the branch name for pull requests
22+
# or the commit hash for any other events.
23+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
checks:
28+
name: Lint JS and CSS
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout project
33+
uses: actions/checkout@v7
34+
35+
- name: Setup NodeJS
36+
uses: actions/setup-node@v7
37+
with:
38+
node-version-file: 'package.json'
39+
cache: 'npm'
40+
41+
- name: Install npm dependencies
42+
run: npm ci
43+
44+
- name: Run wp-script lint:js on src folder
45+
run: npm run lint:js src
46+
47+
- name: Run stylelint on SCSS
48+
run: npm run lint:css -- "src/**/*.scss"

‎.github/workflows/quality-php.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: PHP Quality Checks
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'composer.json'
7+
- 'blockparty-button-icon.php'
8+
- 'classes/**'
9+
- 'phpcs.xml.dist'
10+
push:
11+
paths:
12+
- 'composer.json'
13+
- 'blockparty-button-icon.php'
14+
- 'classes/**'
15+
- 'phpcs.xml.dist'
16+
branches:
17+
- main
18+
19+
# Cancels all previous workflow runs for pull requests that have not completed.
20+
concurrency:
21+
# The concurrency group contains the workflow name and the branch name for pull requests
22+
# or the commit hash for any other events.
23+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
checks:
28+
name: Codesniffer
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout project
33+
uses: actions/checkout@v7
34+
35+
- name: Setup PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: 8.1
39+
extensions: mbstring, intl
40+
41+
- name: Validate composer file
42+
run: composer validate
43+
44+
- name: Install composer dependencies
45+
run: composer install
46+
47+
- name: Run codesniffer
48+
run: composer cs

‎.github/workflows/release.yml‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: "Release new TAG"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-and-release:
12+
name: "Release new TAG"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v7
17+
with:
18+
fetch-depth: 0
19+
fetch-tags: true
20+
21+
- name: Fetch tags
22+
run: git fetch --tags --prune origin
23+
24+
- id: set-vars
25+
name: "Set variable from .plugin-data file"
26+
run: |
27+
{
28+
echo 'pluginData<<EOF'
29+
cat ./.plugin-data
30+
echo 'EOF'
31+
} >> "$GITHUB_OUTPUT"
32+
33+
- id: check-version
34+
name: "Check version does not exists"
35+
run: |
36+
# Get the version from .plugin-data file.
37+
VERSION=${{ fromJson(steps.set-vars.outputs.pluginData).version }}
38+
39+
echo "Get Branch tag"
40+
if git rev-parse "$VERSION" >/dev/null 2>&1; then
41+
echo "Tag already exists, stop now";
42+
exit 1;
43+
fi
44+
45+
if git ls-remote --exit-code --tags origin "refs/tags/${VERSION}" >/dev/null 2>&1; then
46+
echo "Remote tag already exists, stop now";
47+
exit 1;
48+
fi
49+
50+
- id: build-node
51+
name: Setup NodeJS
52+
uses: actions/setup-node@v7
53+
with:
54+
node-version-file: 'package.json'
55+
cache: 'npm'
56+
- run: npm ci
57+
- run: npm run build
58+
59+
- id: build-php
60+
name: "Build project PHP"
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: 8.1
64+
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs
65+
66+
- id: commit-and-push
67+
name: "Commit and push new TAG"
68+
run: |
69+
# Get the version from .plugin-data file.
70+
VERSION=${{ fromJson(steps.set-vars.outputs.pluginData).version }}
71+
72+
echo "Copy .distignore to .gitignore"
73+
cp .distignore .gitignore
74+
75+
echo "Configure git"
76+
git config --local user.email "$(git log --format='%ae' HEAD^!)"
77+
git config --local user.name "$(git log --format='%an' HEAD^!)"
78+
79+
echo "Creating branch"
80+
git checkout -b "release/${VERSION}"
81+
82+
echo "Creating tag ${VERSION}"
83+
git add .
84+
git add -u
85+
git commit -m "Release version ${VERSION}"
86+
git tag ${VERSION}
87+
git push --tags

‎.gitignore‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Coverage directory used by tools like istanbul
9+
coverage
10+
11+
# Compiled binary addons (https://nodejs.org/api/addons.html)
12+
build/
13+
14+
# Dependency directories
15+
node_modules/
16+
vendor/
17+
18+
# Optional npm cache directory
19+
.npm
20+
21+
# Optional eslint cache
22+
.eslintcache
23+
24+
# Output of `npm pack`
25+
*.tgz
26+
27+
# Output of `wp-scripts plugin-zip`
28+
*.zip
29+
30+
# dotenv environment variables file
31+
.env
32+
33+
# Composer
34+
composer.lock

‎.plugin-data‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "1.0.0",
3+
"slug": "blockparty-button-icon"
4+
}

0 commit comments

Comments
 (0)