Skip to content

Commit 0136c54

Browse files
authored
Merge pull request #112 from MONEI/next
feat: improve payment method descriptions and add card brand icons
2 parents 49268d3 + 9f9c47a commit 0136c54

File tree

117 files changed

+27413
-3142
lines changed

Some content is hidden

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

117 files changed

+27413
-3142
lines changed

.eslintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Build outputs
2+
public/
3+
build/
4+
dist/
5+
6+
# Dependencies
7+
node_modules/
8+
vendor/
9+
10+
# Cache
11+
.phpcs.cache

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
},
6+
parserOptions: {
7+
ecmaVersion: 2020,
8+
sourceType: 'module',
9+
ecmaFeatures: {
10+
jsx: true,
11+
},
12+
},
13+
plugins: [ 'react-hooks' ],
14+
rules: {
15+
// Critical rules - only ban console.log, allow warn/error
16+
'no-console': [ 'error', { allow: [ 'warn', 'error' ] } ],
17+
18+
// React Hooks rules
19+
'react-hooks/rules-of-hooks': 'error',
20+
'react-hooks/exhaustive-deps': 'warn',
21+
},
22+
};

.github/workflows/code-quality.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Code Quality
2+
on: [push]
3+
4+
# Concurrency to prevent multiple jobs from running at the same time
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
code-quality:
11+
name: Code Quality Checks
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '7.4'
22+
coverage: none
23+
tools: composer
24+
25+
- name: Install Composer dependencies
26+
uses: ramsey/composer-install@v3
27+
with:
28+
composer-options: --dev --optimize-autoloader
29+
30+
- name: Enable Corepack
31+
run: corepack enable
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version-file: .nvmrc
37+
cache: yarn
38+
39+
- name: Install dependencies
40+
run: yarn install --immutable
41+
42+
- name: Check code formatting
43+
run: yarn format:check
44+
45+
- name: Lint JavaScript
46+
run: yarn lint:js
47+
48+
- name: Lint CSS
49+
run: yarn lint:css
50+
51+
- name: Lint PHP (PHPCS)
52+
run: yarn lint:php:phpcs
53+
54+
- name: Lint PHP (PHPStan)
55+
run: yarn lint:php:phpstan
56+
57+
- name: Build assets
58+
run: yarn build
Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
name: Create package
22
on:
3-
workflow_dispatch:
4-
inputs:
5-
PACKAGE_VERSION:
6-
description: 'Package Version'
7-
required: true
3+
workflow_dispatch:
4+
inputs:
5+
PACKAGE_VERSION:
6+
description: 'Package Version'
7+
required: true
88
jobs:
9-
tag:
10-
name: New package
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v3
15-
16-
- name: Install Composer dependencies
17-
uses: ramsey/composer-install@v3
18-
with:
19-
composer-options: --no-dev --optimize-autoloader
20-
21-
- name: Setup Node.js
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: '18'
25-
26-
- name: Enable Corepack
27-
run: corepack enable
28-
29-
- name: Install dependencies
30-
run: yarn install --immutable
31-
32-
- name: Build assets
33-
run: yarn build
34-
35-
- name: Exclude files listed in .distignore
36-
run: |
37-
if [ -f .distignore ]; then
38-
mkdir filtered
39-
rsync -av --exclude-from='.distignore' . ./filtered
40-
fi
41-
42-
- name: Create zip archive
43-
run: |
44-
cd filtered
45-
zip -r ../monei-${{ github.event.inputs.PACKAGE_VERSION }}.zip .
46-
47-
- name: Upload artifact
48-
uses: actions/upload-artifact@v4
49-
with:
50-
name: monei-${{ github.event.inputs.PACKAGE_VERSION }}
51-
path: monei-${{ github.event.inputs.PACKAGE_VERSION }}.zip
52-
9+
tag:
10+
name: New package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install Composer dependencies
17+
uses: ramsey/composer-install@v3
18+
with:
19+
composer-options: --no-dev --optimize-autoloader
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: .nvmrc
25+
cache: yarn
26+
27+
- name: Enable Corepack
28+
run: corepack enable
29+
30+
- name: Install dependencies
31+
run: yarn install --immutable
32+
33+
- name: Build assets
34+
run: yarn build
35+
36+
- name: Exclude files listed in .distignore
37+
run: |
38+
if [ -f .distignore ]; then
39+
mkdir filtered
40+
rsync -av --exclude-from='.distignore' . ./filtered
41+
fi
42+
43+
- name: Create zip archive
44+
run: |
45+
cd filtered
46+
zip -r ../monei-${{ github.event.inputs.PACKAGE_VERSION }}.zip .
47+
48+
- name: Upload artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: monei-${{ github.event.inputs.PACKAGE_VERSION }}
52+
path: monei-${{ github.event.inputs.PACKAGE_VERSION }}.zip

.github/workflows/main.yml

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
name: Deploy to WordPress.org
22
on:
3-
release:
4-
types: [published]
3+
release:
4+
types: [published]
55
jobs:
6-
tag:
7-
name: New release
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v3
6+
tag:
7+
name: New release
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
1212

13-
- name: Install Composer dependencies
14-
uses: ramsey/composer-install@v3
15-
with:
16-
composer-options: --no-dev --optimize-autoloader
13+
- name: Install Composer dependencies
14+
uses: ramsey/composer-install@v3
15+
with:
16+
composer-options: --no-dev --optimize-autoloader
1717

18-
- name: Setup Node.js
19-
uses: actions/setup-node@v3
20-
with:
21-
node-version: '18'
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: .nvmrc
22+
cache: yarn
2223

23-
- name: Enable Corepack
24-
run: corepack enable
24+
- name: Enable Corepack
25+
run: corepack enable
2526

26-
- name: Install dependencies
27-
run: yarn install --immutable
27+
- name: Install dependencies
28+
run: yarn install --immutable
2829

29-
- name: Build assets
30-
run: yarn build
30+
- name: Build assets
31+
run: yarn build
3132

32-
- name: WordPress Plugin Deploy
33-
id: deploy
34-
uses: 10up/action-wordpress-plugin-deploy@stable
35-
with:
36-
generate-zip: true
37-
env:
38-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
39-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
40-
SLUG: monei
33+
- name: WordPress Plugin Deploy
34+
id: deploy
35+
uses: 10up/action-wordpress-plugin-deploy@stable
36+
with:
37+
generate-zip: true
38+
env:
39+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
40+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
41+
SLUG: monei
4142

42-
- name: Upload Release
43-
uses: ncipollo/release-action@v1.14.0
44-
with:
45-
allowUpdates: true
46-
omitBodyDuringUpdate: true
47-
artifacts: ${{ steps.deploy.outputs.zip-path }}
48-
artifactContentType: 'application/zip'
49-
token: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Upload Release
44+
uses: ncipollo/release-action@v1.14.0
45+
with:
46+
allowUpdates: true
47+
omitBodyDuringUpdate: true
48+
artifacts: ${{ steps.deploy.outputs.zip-path }}
49+
artifactContentType: 'application/zip'
50+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ node_modules/
3232
# Authentication state files
3333
/tests/auth/*.json
3434
/tests/auth/
35+
.phpcs.cache
36+
37+
# Translation files
38+
*.mo

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
3+
# Run lint-staged to lint and fix files
4+
yarn lint-staged

.husky/pre-push

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
3+
# Protect master/main branch from direct pushes
4+
current_branch=$(git symbolic-ref --short HEAD)
5+
if [ "$current_branch" = "master" ] || [ "$current_branch" = "main" ]; then
6+
echo "❌ Direct pushes to master/main are not allowed!"
7+
echo "Please create a feature branch and submit a pull request."
8+
echo ""
9+
echo "To create a feature branch:"
10+
echo " git checkout -b feature/your-feature-name"
11+
exit 1
12+
fi
13+
14+
echo "✅ Branch check passed"

.lintstagedrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"*.php": [ "composer phpcbf --", "composer phpstan --" ],
3+
"*.{js,jsx}": [ "wp-scripts format", "wp-scripts lint-js --fix" ],
4+
"*.{css,scss}": [ "wp-scripts format", "wp-scripts lint-style --fix" ],
5+
"*.{json,yml,yaml,md}": [ "wp-scripts format" ]
6+
}

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"browsermcp": {
4+
"command": "npx",
5+
"args": [ "@browsermcp/mcp@latest" ]
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)