Skip to content

Commit 63c8619

Browse files
authored
Merge pull request #102 from lightspeedwp/refactor/config-build-process
Refactor/config build process
2 parents 9e11b8e + c6c3dc4 commit 63c8619

Some content is hidden

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

57 files changed

+28365
-867
lines changed

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
>0.5%
2+
last 2 versions
3+
Firefox ESR
4+
not dead

.codeclimate.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.codecov.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.coderabbit.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-ZA"
3+
early_access: false
4+
commands:
5+
enabled: true
6+
linked_issues:
7+
enabled: true
8+
reviews:
9+
profile: "chill"
10+
request_changes_workflow: true
11+
high_level_summary: true
12+
poem: false
13+
review_status: true
14+
collapse_walkthrough: false
15+
auto_review:
16+
enabled: true
17+
drafts: false
18+
base_branches:
19+
- '.*'
20+
path_filters:
21+
- "!build/**"
22+
- "!node_modules/**"
23+
- "!vendor/**"
24+
path_instructions:
25+
- path: '**/*.php'
26+
instructions: |
27+
- Follow WordPress coding standards (WPCS) strictly
28+
- Use proper sanitization and validation for all inputs
29+
- Escape all outputs using esc_html, esc_attr, wp_kses_post
30+
- Use WordPress functions instead of native PHP where available
31+
- Add proper DocBlocks with @param, @return, @since tags
32+
- Use meaningful variable and function names with to_specials_ prefix
33+
- Follow WordPress naming conventions (snake_case for functions/variables)
34+
- path: 'classes/*.php'
35+
instructions: |
36+
- TO Specials specific: Focus on special deals and discount management
37+
- Validate special pricing and date ranges
38+
- Implement proper special expiration handling
39+
- Use WordPress meta fields for special deal data
40+
- Ensure pricing security and validation
41+
- Follow Tour Operator plugin integration patterns
42+
- Ensure proper class naming with TO_Specials_ prefix
43+
- path: 'includes/*.php'
44+
instructions: |
45+
- Check for proper WordPress security measures (nonces, capability checks)
46+
- Ensure functions are properly hooked to WordPress actions/filters
47+
- Validate special deal forms and pricing calculations
48+
- Review discount logic and availability checks
49+
- Use to_specials_ function prefix consistently
50+
- Implement proper special deal display and filtering
51+
- path: 'assets/**/*.{js,ts}'
52+
instructions: |
53+
- Follow WordPress JavaScript coding standards
54+
- Use WordPress script localization for strings and AJAX URLs
55+
- Ensure jQuery compatibility and proper enqueueing
56+
- Add proper error handling for special deal interactions
57+
- Implement client-side validation for booking forms
58+
- Use modern ES6+ syntax where appropriate
59+
- path: 'assets/**/*.{css,scss}'
60+
instructions: |
61+
- Follow WordPress CSS coding standards
62+
- Use semantic class naming with to-specials- prefix
63+
- Ensure responsive design for special deal displays
64+
- Check for accessibility compliance (WCAG 2.1)
65+
- Style pricing displays and call-to-action buttons effectively
66+
- Use CSS custom properties for maintainable theming
67+
- path: 'tests/**'
68+
instructions: |
69+
- Ensure test coverage for critical special deal functions
70+
- Test pricing calculations and discount applications
71+
- Test date-based availability and expiration logic
72+
- Follow WordPress testing best practices
73+
- Use PHPUnit for PHP tests and Playwright for E2E tests
74+
- path: '**/*.md'
75+
instructions: |
76+
- Keep documentation updated with code changes
77+
- Use clear examples for special deal integration
78+
- Document pricing and discount configuration
79+
- Include proper installation and configuration steps
80+
- Follow markdown linting rules
81+
- On Pull Requests check for updates to the changelog file
82+
chat:
83+
auto_reply: true

.devcontainer/Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM mcr.microsoft.com/devcontainers/php:1-8.2-bullseye
2+
3+
# Install additional PHP extensions needed for WordPress
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends \
6+
mysql-client \
7+
default-mysql-client \
8+
zip \
9+
unzip \
10+
git \
11+
curl \
12+
wget \
13+
vim \
14+
&& docker-php-ext-install \
15+
mysqli \
16+
pdo_mysql \
17+
gd \
18+
zip \
19+
exif \
20+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
21+
22+
# Install Composer
23+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
24+
25+
# Install Node.js
26+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
27+
&& apt-get install -y nodejs
28+
29+
# Install WordPress CLI
30+
RUN curl -O https://raw.githubusercontent.com/wp-cli/wp-cli/v2.8.1/utils/wp-completion.bash \
31+
&& curl -O https://raw.githubusercontent.com/wp-cli/wp-cli/v2.8.1/wp-cli.phar \
32+
&& chmod +x wp-cli.phar \
33+
&& mv wp-cli.phar /usr/local/bin/wp
34+
35+
# Install Playwright
36+
RUN npm install -g playwright @playwright/test
37+
38+
# Set up development environment
39+
WORKDIR /workspaces/to-specials
40+
41+
# Copy package files and install dependencies
42+
COPY package*.json ./
43+
RUN npm install
44+
45+
# Copy composer files and install dependencies
46+
COPY composer.json composer.lock* ./
47+
RUN composer install --no-dev --optimize-autoloader
48+
49+
EXPOSE 3000 8000 8080 9000

.devcontainer/devcontainer.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "TO Specials Plugin Development",
3+
"image": "mcr.microsoft.com/devcontainers/php:1-8.2-bullseye",
4+
"features": {
5+
"ghcr.io/devcontainers/features/node:1": {
6+
"version": "18"
7+
},
8+
"ghcr.io/devcontainers/features/git:1": {},
9+
"ghcr.io/devcontainers/features/github-cli:1": {},
10+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
11+
},
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-vscode.vscode-json",
16+
"github.copilot",
17+
"github.copilot-chat",
18+
"ms-playwright.playwright",
19+
"esbenp.prettier-vscode",
20+
"dbaeumer.vscode-eslint",
21+
"stylelint.vscode-stylelint",
22+
"junstyle.php-cs-fixer",
23+
"xdebug.php-pack",
24+
"coderabbit.coderabbit-vscode",
25+
"anthropic.claude-code",
26+
"editorconfig.editorconfig",
27+
"redhat.vscode-yaml",
28+
"streetsidesoftware.code-spell-checker"
29+
],
30+
"settings": {
31+
"php.validate.executablePath": "/usr/local/bin/php",
32+
"php.debug.executablePath": "/usr/local/bin/php",
33+
"files.eol": "\n",
34+
"files.insertFinalNewline": true,
35+
"files.trimTrailingWhitespace": true,
36+
"mcp.enableAllModels": true,
37+
"mcp.autoSelectModel": true,
38+
"mcp.modelPreference": "auto",
39+
"[markdown]": {
40+
"files.trimTrailingWhitespace": false
41+
},
42+
"[php]": {
43+
"editor.formatOnSave": true,
44+
"editor.tabSize": 4,
45+
"editor.insertSpaces": false
46+
},
47+
"[javascript]": {
48+
"editor.formatOnSave": true,
49+
"editor.tabSize": 2
50+
},
51+
"[css]": {
52+
"editor.formatOnSave": true,
53+
"editor.tabSize": 2
54+
}
55+
}
56+
}
57+
},
58+
"forwardPorts": [3000, 8000, 8080, 9000],
59+
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y wget unzip && composer install && npm install",
60+
"remoteUser": "vscode",
61+
"mounts": [
62+
"source=${localWorkspaceFolder},target=/workspaces/to-specials,type=bind,consistency=cached"
63+
],
64+
"workspaceFolder": "/workspaces/to-specials"
65+
}

.devcontainer/docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: '3.8'
2+
3+
services:
4+
wordpress:
5+
image: wordpress:latest
6+
ports:
7+
- "8080:80"
8+
environment:
9+
WORDPRESS_DB_HOST: db
10+
WORDPRESS_DB_USER: wordpress
11+
WORDPRESS_DB_PASSWORD: wordpress
12+
WORDPRESS_DB_NAME: wordpress
13+
volumes:
14+
- wordpress_data:/var/www/html
15+
- ../:/var/www/html/wp-content/plugins/to-specials
16+
depends_on:
17+
- db
18+
19+
db:
20+
image: mysql:8.0
21+
environment:
22+
MYSQL_DATABASE: wordpress
23+
MYSQL_USER: wordpress
24+
MYSQL_PASSWORD: wordpress
25+
MYSQL_ROOT_PASSWORD: rootpassword
26+
volumes:
27+
- db_data:/var/lib/mysql
28+
ports:
29+
- "3306:3306"
30+
31+
phpmyadmin:
32+
image: phpmyadmin/phpmyadmin
33+
ports:
34+
- "8000:80"
35+
environment:
36+
PMA_HOST: db
37+
PMA_USER: wordpress
38+
PMA_PASSWORD: wordpress
39+
depends_on:
40+
- db
41+
42+
volumes:
43+
wordpress_data:
44+
db_data:

0 commit comments

Comments
 (0)