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

Feature: React Bidding Block #115

Merged
merged 11 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- run: echo "Building..."
- run: echo "${ACF_DEVELOP}" >> ./client-mu-plugins/goodbids/auth.json
- run: echo "$(< ./client-mu-plugins/goodbids/auth.json)"
- run: cd client-mu-plugins/goodbids && composer install --verbose
- run: cd client-mu-plugins/goodbids && npm install
- run: cd client-mu-plugins/goodbids && npm ci
- run: cd client-mu-plugins/goodbids && npm run build
- run: cd client-mu-plugins/goodbids && composer install --verbose

# @TODO: Add tests
# - run:
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
to-do:
react-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
HUSKY: 0
steps:
- run: echo "CI goes here"
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: cd client-mu-plugins/goodbids && npm ci

- name: Lint
run: cd client-mu-plugins/goodbids && npm run lint

- name: Format
run: cd client-mu-plugins/goodbids && npm run format

- name: Compile
run: cd client-mu-plugins/goodbids && npm run compile
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Dependencies
## Avoid any node_modules folders anywhere in the repo; see see https://docs.wpvip.com/how-tos/manage-dependencies/#version-management
node_modules

## Avoid package*.json files only at repo root
/package.json
/package-lock.json
Expand Down Expand Up @@ -63,3 +64,7 @@ vendor
# Sensitive data
auth.json
client-mu-plugins/vip-env-vars.local.php

# Vite
dist
build
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd client-mu-plugins/goodbids && npm run staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 18.19.0
12 changes: 12 additions & 0 deletions bin/format
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# bin/format: Check for formatting errors
#
# When to use:
# - When you want to check for formatting errors

set -e

cd "$(dirname "$0")/.."

cd client-mu-plugins/goodbids && npm run format
12 changes: 12 additions & 0 deletions bin/format-fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# bin/format-fix: Fix formatting errors
#
# When to use:
# - When you want to fix for formatting errors

set -e

cd "$(dirname "$0")/.."

cd client-mu-plugins/goodbids && npm run format:fix
18 changes: 18 additions & 0 deletions bin/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# bin/install: Install dependencies
#
# When to use:
# - When you want to install dependencies

set -e

cd "$(dirname "$0")/.."

# Install composer dev dependencies
composer install

# Install must-use plugin dependencies
cd client-mu-plugins/goodbids
composer install
npm install
12 changes: 12 additions & 0 deletions bin/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# bin/lint: Check for linting errors
#
# When to use:
# - When you want to check for linting errors

set -e

cd "$(dirname "$0")/.."

cd client-mu-plugins/goodbids && npm run lint
12 changes: 12 additions & 0 deletions bin/lint-fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# bin/lint-fix: Fix linting errors
#
# When to use:
# - When you want to fix linting errors

set -e

cd "$(dirname "$0")/.."

cd client-mu-plugins/goodbids && npm run lint:fix
13 changes: 13 additions & 0 deletions bin/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# bin/start: Start local dev with VIP CLI
#
# When to use:
# - When you want to run the WP server

set -e

cd "$(dirname "$0")/.."

vip dev-env --slug=goodbids start
echo "Don't forget to run bin/start-vite to start the Vite dev server"
12 changes: 12 additions & 0 deletions bin/start-vite
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# bin/start-vite: Start local Vite dev server
#
# When to use:
# - After running `bin/start` to start the WP server

set -e

cd "$(dirname "$0")/.."

cd client-mu-plugins/goodbids && npm run dev
12 changes: 12 additions & 0 deletions bin/stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# bin/start: Stop local dev with VIP CLI
#
# When to use:
# - When you want to stop the WP server

set -e

cd "$(dirname "$0")/.."

vip dev-env --slug=goodbids stop
3 changes: 2 additions & 1 deletion client-mu-plugins/goodbids/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
Expand All @@ -15,4 +16,4 @@ module.exports = {
{ allowConstantExport: true },
],
},
}
};
22 changes: 1 addition & 21 deletions client-mu-plugins/goodbids/.gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

dist
# Build files.
build
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
9 changes: 9 additions & 0 deletions client-mu-plugins/goodbids/.lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
'./**/*.{js,jsx,ts,tsx}': [
'eslint',
'prettier --check ./src/**/*.{js,jsx,ts,tsx}',
],
'./**/*.css': [
'prettier --check ./src/**/*.css',
],
};
22 changes: 22 additions & 0 deletions client-mu-plugins/goodbids/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
arrowParens: 'always',
bracketSameLine: false,
bracketSpacing: true,
htmlWhitespaceSensitivity: 'css',
printWidth: 80,
proseWrap: 'preserve',
semi: true,
singleQuote: true,
tabWidth: 4,
useTabs: true,
trailingComma: 'all',
overrides: [
{
files: ['*.yml', '*.json'],
options: {
useTabs: false,
tabWidth: 2,
},
},
],
};
Loading