Skip to content

Commit 0d40106

Browse files
committed
Build/Test Tools: Remove all npx commands.
Merges [63309] to the 7.1 branch. Developed in: #13108 Reviewed by: desrosj. Props adrianmoldovanwp, desrosj. See #65864. git-svn-id: https://develop.svn.wordpress.org/branches/7.1@63414 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c70675b commit 0d40106

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎Gruntfile.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,8 +2279,8 @@ module.exports = function(grunt) {
22792279
grunt.registerTask( 'qunit', 'Runs QUnit tests.', function() {
22802280
var done = this.async();
22812281
grunt.util.spawn( {
2282-
cmd: 'npx',
2283-
args: [ 'playwright', 'test', '--config', 'tests/qunit/playwright.config.js' ],
2282+
cmd: 'npm',
2283+
args: [ 'exec', '--no', '--', 'playwright', 'test', '--config', 'tests/qunit/playwright.config.js' ],
22842284
opts: { stdio: 'inherit' }
22852285
}, function( error, result, code ) {
22862286
if ( code !== 0 ) {
@@ -2363,15 +2363,15 @@ module.exports = function(grunt) {
23632363
grunt.registerTask( 'wp-packages:update', 'Update WordPress packages', function() {
23642364
const distTag = grunt.option('dist-tag') || 'latest';
23652365
grunt.log.writeln( `Updating WordPress packages (--dist-tag=${distTag})` );
2366-
spawn( 'npx', [ 'wp-scripts', 'packages-update', `--dist-tag=${distTag}` ], {
2366+
spawn( 'npm', [ 'exec', '--no', '--', 'wp-scripts', 'packages-update', `--dist-tag=${distTag}` ], {
23672367
cwd: __dirname,
23682368
stdio: 'inherit',
23692369
} );
23702370
} );
23712371

23722372
grunt.registerTask( 'browserslist:update', 'Update the local database of browser supports', function() {
2373-
grunt.log.writeln( `Updating browsers list` );
2374-
spawn( 'npx', [ 'update-browserslist-db@latest' ], {
2373+
grunt.log.writeln( 'Updating browsers list' );
2374+
spawn( 'npm', [ 'exec', '--no', '--', 'update-browserslist-db' ], {
23752375
cwd: __dirname,
23762376
stdio: 'inherit',
23772377
} );

‎package-lock.json‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"sinon-test": "~3.1.6",
7878
"source-map-loader": "5.0.0",
7979
"typescript": "6.0.3",
80+
"update-browserslist-db": "1.2.3",
8081
"uuid": "14.0.1",
8182
"wait-on": "9.0.10",
8283
"webpack": "5.108.4"

‎tests/qunit/playwright.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = defineConfig( {
1212
workers: 1,
1313
use: {
1414
headless: true,
15-
/* This avoids the need to run `npx playwright install` in CI. */
15+
/* The system Chrome channel avoids a browser download in CI. */
1616
channel: process.env.CI ? 'chrome' : undefined,
1717
},
1818
reporter: process.env.CI ? 'github' : 'list',

0 commit comments

Comments
 (0)