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

Fixing builds and start command #149

Merged
merged 4 commits into from
Jun 27, 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
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mysqli, xmlwriter
Expand All @@ -28,13 +28,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
Expand All @@ -43,16 +43,16 @@ jobs:
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node -v)"
echo "DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_OUTPUT
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT

- name: Cache JS Dependencies
id: npm-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install JS Dependencies
run: npm install --legacy-peer-deps
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

Expand All @@ -29,16 +29,16 @@ jobs:
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node-v)"
echo "DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_OUTPUT
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT

- name: Cache Dependencies
id: npm-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
run: npm install --legacy-peer-deps
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
Expand All @@ -31,21 +31,21 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.2-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest --no-interaction

- name: PHPCS cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: tests/cache
key: ${{ runner.os }}-phpcs-7.2-${{ hashFiles('plugin.php') }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
Expand All @@ -38,13 +38,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
Expand All @@ -41,13 +41,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}-wp5.9

- name: Install PHP Dependencies
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ _Features without a checkmark are still work in progress._
### For development use

* Clone this repo into your plugins directory
* Install the dependencies:
* Ensure you have Composer v2 and Node v16 installed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to explicitly mention nvm use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomjn I'm going to update it all soon anyway, the specific tool people use to manage node versions is up to them

* Install the dependencies:
`composer install && npm install`
* Start the dev server:
* Start the dev server:
`npm run start`

## Design Decisions
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
"lint": "concurrently -n CSS,JS -c cyan.bold,yellow.bold \"npm run lint:css\" \"npm run lint:js\"",
"lint:css": "stylelint src/",
"lint:js": "eslint --ext .js,.jsx,.ts,.tsx src/",
"start": "webpack-dev-server --config=.config/webpack.config.dev.js",
"start": "webpack serve --config=.config/webpack.config.dev.js",
"build": "webpack --config=.config/webpack.config.prod.js",
"bump:patch": "bump patch --commit 'The v%s release' package.json package-lock.json README.md plugin.php",
"bump:minor": "bump minor --commit 'The v%s release' package.json package-lock.json README.md plugin.php",
"bump:major": "bump major --commit 'The v%s release' package.json package-lock.json README.md plugin.php"
},
"engines": {
"node": "16"
},
"dependencies": {
"@types/react-select": "^3.0.26",
"@wordpress/editor": "^9.24.3",
Expand Down