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

Replace gulp build with wp-scripts. #916

Merged
merged 42 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2dc3d2b
Add wp-scripts as dev dependency.
peterwilsoncc Jul 26, 2022
59564db
Replace Gulp build process with wp-scripts.
peterwilsoncc Aug 1, 2022
24a3d4e
Update assets as required following switch to wp-scripts.
peterwilsoncc Aug 1, 2022
a0465ac
Customize CSS Filename.
peterwilsoncc Aug 1, 2022
9545488
Futher update build config.
peterwilsoncc Aug 2, 2022
01ddfed
Include `.min` suffix in built files to match legacy names.
peterwilsoncc Aug 2, 2022
ffb4da1
Coding standards fixes for wp-scripts.
peterwilsoncc Aug 2, 2022
740bdee
Configure stylelint for WP Scripts.
peterwilsoncc Aug 2, 2022
b9a8bb5
CS Fixes: Match wp-scripts stylelint rules.
peterwilsoncc Aug 2, 2022
5aec855
Add package.json linting.
peterwilsoncc Aug 2, 2022
7b91951
CS: package.json.
peterwilsoncc Aug 2, 2022
feb0cca
Remove markdown linting: unsuitable for our requirements.
peterwilsoncc Aug 2, 2022
252cf70
Global linting command.
peterwilsoncc Aug 2, 2022
5145ea7
Update JS linting to use wp-scripts.
peterwilsoncc Aug 2, 2022
9b83e67
Bump node version.
peterwilsoncc Aug 2, 2022
f83fa65
Re-add packages for building docs.
peterwilsoncc Aug 2, 2022
2063c23
Custom release script.
peterwilsoncc Aug 2, 2022
52cd3c3
Install node-wp-i18n & reinstate makepot command.
peterwilsoncc Aug 2, 2022
55d7975
Modify release script.
peterwilsoncc Aug 2, 2022
eb89066
Annotate ES Lints
peterwilsoncc Aug 2, 2022
4fcdff5
Remove gulp config files.
peterwilsoncc Aug 2, 2022
0b8d0cb
Update new file name for release.
peterwilsoncc Aug 2, 2022
67e4026
Locally define functions from document.
peterwilsoncc Aug 2, 2022
67299fc
Merge branch 'develop' into fix/892-update-build-scripts
peterwilsoncc Aug 4, 2022
f36242a
Remove wp-scripts default tests scripts.
peterwilsoncc Aug 4, 2022
d976ff1
Ignore built docs directory from linting.
peterwilsoncc Aug 4, 2022
630e18c
Only format CSS and JS.
peterwilsoncc Aug 4, 2022
f06d95f
Auto format tests for WP JS coding standards.
peterwilsoncc Aug 4, 2022
da8d98d
Prevent Jest eslint rules triggering false positives.
peterwilsoncc Aug 4, 2022
52e633b
Ignore false positives in script.
peterwilsoncc Aug 4, 2022
5d94b4b
Document return type for cypress config.
peterwilsoncc Aug 4, 2022
fc21fd1
Plugin needs to be in a JS file.
peterwilsoncc Aug 5, 2022
ba42566
Import document as required.
peterwilsoncc Aug 5, 2022
d1570dd
Do not combine assets’ PHP files.
peterwilsoncc Aug 5, 2022
104ba23
Force name of admin-pull-table CSS file.
peterwilsoncc Aug 5, 2022
9302842
Use generated file to determine dependencies.
peterwilsoncc Aug 5, 2022
4cd3fc8
Deal with document oddities.
peterwilsoncc Aug 5, 2022
175d87a
Merge branch 'develop' into fix/892-update-build-scripts
peterwilsoncc Aug 5, 2022
5c81b78
Update workflows using PHP or WP versions.
peterwilsoncc Aug 3, 2022
0b53814
Fix reversed media query.
peterwilsoncc Aug 16, 2022
ab52f12
Delete correct directory when rebuilding docs.
peterwilsoncc Aug 16, 2022
1765ffe
Switch from deprecated `complete` to `always`.
peterwilsoncc Aug 18, 2022
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
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
release/*
dist/*
docs-built/*
vendor/*
gulp-tasks/*
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "@10up/eslint-config"
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"settings": {
"import/core-modules": [ "jquery", "underscore" ]
},
"rules": {
"import/no-extraneous-dependencies": ["error", {"packageDir": ["./", "./node_modules/@wordpress/scripts"] }]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.2'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@ jobs:
node-version: 16
- name: npm install
run: npm install
- name: eslint
uses: icrawl/action-eslint@v1
- name: Generate linting report
run: npm run lint:js -- --output-file eslint-report.json --format json
continue-on-error: true
- name: Annotate code linting results
uses: ataylorme/[email protected]
with:
custom-glob: assets/js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint-report.json'
- name: Update summary
run: |
npm_config_yes=true npx github:10up/eslint-json-to-md --path ./eslint-report.json --output ./eslint-report.md
cat eslint-report.md >> $GITHUB_STEP_SUMMARY
if: ${{ failure() }}
phpcs:
name: phpcs
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,4 +74,4 @@ jobs:
- name: PHPCS check
uses: chekalsky/phpcs-action@v1
with:
phpcs_bin_path: './vendor/bin/phpcs . --runtime-set testVersion 5.6-'
phpcs_bin_path: './vendor/bin/phpcs . --runtime-set testVersion 7.4-'
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# We claim to support from 5.6+ but WP Mock only supports 7.1+
php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
php: [ '7.4', '8.0', '8.1' ]
os: [ ubuntu-latest ]

steps:
Expand Down
33 changes: 33 additions & 0 deletions .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": "@wordpress/npm-package-json-lint-config",
"rules": {
"description-format": [
"error",
{
"requireCapitalFirstLetter": true,
"requireEndingPeriod": true
}
],
"prefer-no-devDependencies": "error",
"require-publishConfig": "error",
"require-repository-directory": "error",
"valid-values-publishConfig": [
"error",
[
{
"access": "public"
}
]
]
},
"overrides": [
{
"patterns": [ "./package.json" ],
"rules": {
"require-publishConfig": "off",
"require-repository-directory": "off",
"prefer-no-devDependencies": "off"
}
}
]
}
6 changes: 6 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
release/*
dist/*
docs-built/*
vendor/*
gulp-tasks/*
17 changes: 17 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "@wordpress/stylelint-config/scss",
"rules": {
"font-family-no-missing-generic-family-keyword": [
true,
{
"ignoreFontFamilies": [
"dashicons"
]
}
],
"font-weight-notation": "named-where-possible",
"no-descending-specificity": null,
"selector-class-pattern": null,
"selector-id-pattern": null
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The `develop` branch is the development branch which means it contains the next

1. Branch: Starting from `develop`, create a release branch named `release/X.Y.Z` for your changes.
1. Version bump: Bump the version number in `distributor.php`, `package.json`, and `readme.txt` if it does not already reflect the version being released. In `distributor.php` update both the plugin "Version:" property and the plugin `DT_VERSION` constant.
1. New files: Ensure any new files, especially in the vendor folder, are correctly included in `gulp-tasks/copy.js`.
1. New files: Ensure any new files, especially in the vendor folder, are correctly included in `webpack.config.release.js`.
1. Changelog: Add/update the changelog in `CHANGELOG.md`.
1. Props: Update `CREDITS.md` file with any new contributors, confirm maintainers are accurate.
1. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different.
Expand Down
4 changes: 0 additions & 4 deletions assets/css/admin-distributed-post.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@
cursor: pointer;
text-decoration: underline;
}

.open-distributor-help {
cursor: pointer;
}
2 changes: 1 addition & 1 deletion assets/css/admin-edit-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}

.dt-unlinked {
opacity: .3;
opacity: 0.3;
}

.manage-column.column-distributor img {
Expand Down
60 changes: 31 additions & 29 deletions assets/css/admin-external-connection.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

.dt-roles-allowed legend {
font-size: 14px;
font-weight: 700;
font-weight: bold;
margin-bottom: 4px;
}

#dt_external_connection_details .dt-roles-allowed label {
font-weight: 400;
font-weight: normal;
vertical-align: top;
}

Expand All @@ -30,7 +30,6 @@
font-weight: bold;
}


#dt_external_connection_details label {
font-size: 14px;
font-weight: bold;
Expand Down Expand Up @@ -78,45 +77,45 @@
font-style: italic;
}

.endpoint-errors li:before {
content: '-';
.endpoint-errors li::before {
content: "-";
margin-right: 5px;
}

.misc-pub-visibility {
display: none;
}

.endpoint-result[data-endpoint-state="loading"]:before {
content: ' ';
.endpoint-result[data-endpoint-state="loading"]::before {
content: " ";
vertical-align: middle;
top: -.25em;
top: -0.25em;
border-radius: 50%;
width: .8em;
width: 0.8em;
margin-right: 8px;
height: .8em;
height: 0.8em;
display: inline-block;
font-size: 9px;
position: relative;
text-indent: -9999em;
border-top: .5em solid #cfcfcf;
border-right: .5em solid #cfcfcf;
border-bottom: .5em solid #cfcfcf;
border-left: .5em solid #666;
border-top: 0.5em solid #cfcfcf;
border-right: 0.5em solid #cfcfcf;
border-bottom: 0.5em solid #cfcfcf;
border-left: 0.5em solid #666;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation: load8 1.1s infinite linear;
animation: load8 1.1s infinite linear;
}

.endpoint-result[data-endpoint-state="error"]:before,
.endpoint-result[data-endpoint-state="warning"]:before,
.endpoint-result[data-endpoint-state="valid"]:before {
content: ' ';
.endpoint-result[data-endpoint-state="error"]::before,
.endpoint-result[data-endpoint-state="warning"]::before,
.endpoint-result[data-endpoint-state="valid"]::before {
content: " ";
display: inline-block;
border-radius: 50%;
background-color: #ff0000;
background-color: #f00;
width: 10px;
height: 10px;
border: 1px solid #999;
Expand All @@ -126,11 +125,11 @@
margin-right: 5px;
}

.endpoint-result[data-endpoint-state="valid"]:before {
.endpoint-result[data-endpoint-state="valid"]::before {
background-color: #62ff00;
}

.endpoint-result[data-endpoint-state="warning"]:before {
.endpoint-result[data-endpoint-state="warning"]::before {
background-color: #ffe000;
}

Expand All @@ -143,21 +142,25 @@
}

@-webkit-keyframes load8 {

0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}

@keyframes load8 {

0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
Expand All @@ -172,33 +175,32 @@
color: #a00;
margin-left: 1em;
text-decoration: none;
}

&:hover {
color: #f00;
text-decoration: none;
}
.delete-link:hover {
color: #f00;
text-decoration: none;
}

#poststuff #post-body.columns-2 {
margin-right: 0;
}

#side-sortables {
display: none
display: none;
}

.oauth-connection-established .message-header {
font-size: 16px;
color: green;
color: #008000;
font-weight: bold;
}

input[type="text"].error-required,
input[type="password"].error-required {
border: 2px solid red;
border: 2px solid #f00;
}


.post-new-php .external-connection-setup,
.post-new-php .connection-field-wrap,
.post-new-php .dt-roles-allowed,
Expand Down
6 changes: 3 additions & 3 deletions assets/css/admin-external-connections.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.network-connections-notice {
margin-bottom: .5em;
margin-bottom: 0.5em;
font-style: italic;
}

.connection-status {
content: ' ';
content: " ";
display: inline-block;
border-radius: 50%;
background-color: #ff0000;
background-color: #f00;
width: 10px;
height: 10px;
border: 1px solid #999;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

&.dt-loading {

& #posts-filter,
& .subsubsub {
opacity: .5;
#posts-filter,
.subsubsub {
opacity: 0.5;
pointer-events: none;
cursor: default;
}
}

& .dt-pull-post-type {
.dt-pull-post-type {
display: flex;
align-items: center;

& .dt-as-draft {
.dt-as-draft {
padding-left: 10px;
}
}
Expand Down
Loading