Skip to content

Commit 2cda74f

Browse files
committed
Tools: Update packages, switch from yarn to npm
1 parent 76fd1bd commit 2cda74f

18 files changed

Lines changed: 30486 additions & 14073 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
1717
with:
1818
node-version-file: '.nvmrc'
19-
cache: yarn
19+
cache: npm
2020

2121
- name: Set PHP version
2222
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
@@ -31,10 +31,10 @@ jobs:
3131
3232
- name: Install JS dependencies
3333
run: |
34-
yarn
34+
npm install
3535
3636
- name: Build
37-
run: yarn workspaces run build
37+
run: npm run build --workspaces
3838

3939
- name: Ignore .gitignore
4040
run: |

‎.github/workflows/linters.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
2121
with:
2222
node-version-file: '.nvmrc'
23-
cache: yarn
23+
cache: npm
2424

2525
- name: Install JS dependencies
2626
run: |
27-
yarn
27+
npm install
2828
2929
- name: Set PHP version
3030
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
@@ -39,8 +39,8 @@ jobs:
3939
4040
- name: Lint JavaScript and Styles
4141
run: |
42-
yarn workspaces run lint:js --quiet
43-
yarn workspaces run lint:css
42+
npm run lint:js --workspaces -- --quiet
43+
npm run lint:css --workspaces
4444
4545
- name: Lint PHP
4646
run: |

‎.github/workflows/unit-tests.yml‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ jobs:
3737
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
3838
with:
3939
node-version-file: '.nvmrc'
40-
cache: yarn
40+
cache: npm
4141

4242
- name: Install JS dependencies
4343
run: |
44-
yarn
44+
npm install
4545
4646
- name: Build
47-
run: yarn workspaces run build
47+
run: npm run build --workspaces
4848

4949
- name: Install WordPress
5050
run: |
5151
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
52-
yarn wp-env start --update
53-
yarn wp-env run tests-cli wp core version
54-
yarn wp-env run tests-cli wp plugin list
52+
npm run wp-env start --update
53+
npm run wp-env run tests-cli wp core version
54+
npm run wp-env run tests-cli wp plugin list
5555
5656
- name: Running multisite unit tests
57-
run: yarn test:php
57+
run: npm run test:php
5858
if: ${{ success() || failure() }}
5959

6060
unit-js:
@@ -70,7 +70,7 @@ jobs:
7070
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
7171
with:
7272
node-version-file: '.nvmrc'
73-
cache: yarn
73+
cache: npm
7474

7575
- name: Set PHP version
7676
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
@@ -85,13 +85,13 @@ jobs:
8585
8686
- name: Install JS dependencies
8787
run: |
88-
yarn
88+
npm
8989
9090
- name: Build
91-
run: yarn workspaces run build
91+
run: npm run build --workspaces
9292

9393
- name: Run unit tests on theme data store
94-
run: yarn workspace wporg-pattern-directory-theme test:unit
94+
run: npm run test:unit --workspace=wporg-pattern-directory-theme
9595

9696
- name: Run unit tests on the pattern creator
97-
run: yarn workspace wporg-pattern-creator test:unit
97+
run: npm run test:unit --workspace=wporg-pattern-creator

‎.stylelintrc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"extends" : "@wordpress/stylelint-config/scss",
2+
"extends" : "@wordpress/stylelint-config/scss-stylistic",
33
"rules" : {
4-
"max-line-length": 115,
4+
"@stylistic/max-line-length": 115,
55
"no-descending-specificity": null,
66
"rule-empty-line-before" : [ "always-multi-line", {
77
"except" : [ "first-nested", "after-single-line-comment" ]

‎bin/index.sh‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,46 @@ set -e
55

66
# Install dependencies
77
composer update
8-
yarn
8+
npm install
99

1010
# Build the project
11-
yarn workspaces run build
11+
npm run build --workspaces
1212

1313
# Setup the environment
14-
yarn wp-env start --update
14+
npm run wp-env start --update
1515

1616
# Update wp configs
17-
yarn wp-env run cli wp config set JETPACK_DEV_DEBUG true
18-
yarn wp-env run cli wp config set WPORG_SANDBOXED true
17+
npm run wp-env run cli wp config set JETPACK_DEV_DEBUG true
18+
npm run wp-env run cli wp config set WPORG_SANDBOXED true
1919

2020
# Create the table for locales
21-
yarn wp-env run cli wp db import wp-content/uploads/data/wporg_locales.sql
21+
npm run wp-env run cli wp db import wp-content/uploads/data/wporg_locales.sql
2222

2323
# Activate plugins
24-
yarn wp-env run cli wp plugin activate wordpress-importer
25-
yarn wp-env run cli wp plugin activate gutenberg
26-
yarn wp-env run cli wp plugin activate pattern-directory/bootstrap.php
27-
yarn wp-env run cli wp plugin activate pattern-creator
24+
npm run wp-env run cli wp plugin activate wordpress-importer
25+
npm run wp-env run cli wp plugin activate gutenberg
26+
npm run wp-env run cli wp plugin activate pattern-directory/bootstrap.php
27+
npm run wp-env run cli wp plugin activate pattern-creator
2828

2929
# Activate theme
30-
yarn wp-env run cli wp theme activate pattern-directory
30+
npm run wp-env run cli wp theme activate pattern-directory
3131

3232
# Change permalinks
33-
yarn wp-env run cli wp rewrite structure '/%postname%/'
33+
npm run wp-env run cli wp rewrite structure '/%postname%/'
3434

3535
# Set up site title
36-
yarn wp-env run cli wp option update blogname "Pattern Directory"
37-
yarn wp-env run cli wp option update blogdescription "Add a beautifully designed, ready to go layout to any WordPress site with a simple copy/paste."
36+
npm run wp-env run cli wp option update blogname "Pattern Directory"
37+
npm run wp-env run cli wp option update blogdescription "Add a beautifully designed, ready to go layout to any WordPress site with a simple copy/paste."
3838

3939
# Create the default pages
40-
yarn wp-env run cli wp post create --post_type=page --post_status='publish' --post_name='front-page' --post_title='Pattern Directory'
41-
yarn wp-env run cli wp post create --post_type=page --post_status='publish' --post_name='archives' --post_title='Archives'
40+
npm run wp-env run cli wp post create --post_type=page --post_status='publish' --post_name='front-page' --post_title='Pattern Directory'
41+
npm run wp-env run cli wp post create --post_type=page --post_status='publish' --post_name='archives' --post_title='Archives'
4242

43-
yarn wp-env run cli wp option update show_on_front 'page'
44-
yarn wp-env run cli wp option update page_on_front 4
45-
yarn wp-env run cli wp option update page_for_posts 5
46-
yarn wp-env run cli wp option update posts_per_page 18
43+
npm run wp-env run cli wp option update show_on_front 'page'
44+
npm run wp-env run cli wp option update page_on_front 4
45+
npm run wp-env run cli wp option update page_for_posts 5
46+
npm run wp-env run cli wp option update posts_per_page 18
4747

4848
# Import content
49-
yarn wp-env run cli wp import --authors=create --skip=image_resize wp-content/uploads/data/exports/pattern-dir.000.xml
50-
yarn wp-env run cli wp import --authors=create --skip=image_resize wp-content/uploads/data/exports/pattern-dir.001.xml
49+
npm run wp-env run cli wp import --authors=create --skip=image_resize wp-content/uploads/data/exports/pattern-dir.000.xml
50+
npm run wp-env run cli wp import --authors=create --skip=image_resize wp-content/uploads/data/exports/pattern-dir.001.xml

0 commit comments

Comments
 (0)