From 4e785e30a7d3de668ed917953af28ec86d4dfe5a Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 12 Nov 2020 22:31:18 +1300 Subject: [PATCH] Package builds: avoid building dependency-extraction-webpack-plugin (https://github.com/woocommerce/woocommerce-admin/pull/5598) * fix starter pack * fixes * revert lock * fixup package.json --- plugins/woocommerce-admin/bin/packages/build.js | 7 ++++++- .../woocommerce-admin/bin/starter-pack/._eslintrc | 3 --- .../bin/starter-pack/._eslintrc.js | 12 ++++++++++++ .../bin/starter-pack/._prettierrc.json | 1 + .../bin/starter-pack/_package.json | 2 +- .../bin/starter-pack/starter-pack.js | 3 ++- plugins/woocommerce-admin/package-lock.json | 14 +++++++------- .../package.json | 4 +--- 8 files changed, 30 insertions(+), 16 deletions(-) delete mode 100644 plugins/woocommerce-admin/bin/starter-pack/._eslintrc create mode 100644 plugins/woocommerce-admin/bin/starter-pack/._eslintrc.js create mode 100644 plugins/woocommerce-admin/bin/starter-pack/._prettierrc.json diff --git a/plugins/woocommerce-admin/bin/packages/build.js b/plugins/woocommerce-admin/bin/packages/build.js index 93a9d20fdfc..80f3294b4e8 100755 --- a/plugins/woocommerce-admin/bin/packages/build.js +++ b/plugins/woocommerce-admin/bin/packages/build.js @@ -263,6 +263,11 @@ if ( files.length ) { } else { process.stdout.write( chalk.inverse( '>> Building packages \n' ) ); buildDependencyExtractionAssets(); - getPackages().forEach( buildPackage ); + getPackages() + .filter( + ( package ) => + ! /dependency-extraction-webpack-plugin/.test( package ) + ) + .forEach( buildPackage ); process.stdout.write( '\n' ); } diff --git a/plugins/woocommerce-admin/bin/starter-pack/._eslintrc b/plugins/woocommerce-admin/bin/starter-pack/._eslintrc deleted file mode 100644 index d66099e534c..00000000000 --- a/plugins/woocommerce-admin/bin/starter-pack/._eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": [ "plugin:@woocommerce/eslint-plugin/recommended" ] -} diff --git a/plugins/woocommerce-admin/bin/starter-pack/._eslintrc.js b/plugins/woocommerce-admin/bin/starter-pack/._eslintrc.js new file mode 100644 index 00000000000..661ed1128f7 --- /dev/null +++ b/plugins/woocommerce-admin/bin/starter-pack/._eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + extends: [ 'plugin:@woocommerce/eslint-plugin/recommended' ], + rules: { + // temporary conversion to warnings until the below are all handled. + '@wordpress/i18n-translator-comments': 'warn', + '@wordpress/valid-sprintf': 'warn', + 'jsdoc/check-tag-names': [ + 'error', + { definedTags: [ 'jest-environment' ] }, + ], + }, +}; diff --git a/plugins/woocommerce-admin/bin/starter-pack/._prettierrc.json b/plugins/woocommerce-admin/bin/starter-pack/._prettierrc.json new file mode 100644 index 00000000000..235376574a9 --- /dev/null +++ b/plugins/woocommerce-admin/bin/starter-pack/._prettierrc.json @@ -0,0 +1 @@ +"@wordpress/prettier-config" diff --git a/plugins/woocommerce-admin/bin/starter-pack/_package.json b/plugins/woocommerce-admin/bin/starter-pack/_package.json index 136e954bb2c..0bc0aff6def 100644 --- a/plugins/woocommerce-admin/bin/starter-pack/_package.json +++ b/plugins/woocommerce-admin/bin/starter-pack/_package.json @@ -22,6 +22,6 @@ "devDependencies": { "@wordpress/scripts": "^12.2.1", "@woocommerce/eslint-plugin": "1.0.0-beta.0", - "@woocommerce/dependency-extraction-webpack-plugin": "1.0.0-beta.0" + "@woocommerce/dependency-extraction-webpack-plugin": "1.0.0" } } diff --git a/plugins/woocommerce-admin/bin/starter-pack/starter-pack.js b/plugins/woocommerce-admin/bin/starter-pack/starter-pack.js index 95d55597ff0..02957e44850 100644 --- a/plugins/woocommerce-admin/bin/starter-pack/starter-pack.js +++ b/plugins/woocommerce-admin/bin/starter-pack/starter-pack.js @@ -9,7 +9,8 @@ const files = [ '_webpack.config.js', '_main.php', '_package.json', - '._eslintrc', + '._eslintrc.js', + '._prettierrc.json', ]; const maybeThrowError = ( error ) => { if ( error ) throw error; diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 271c457681b..3dfe71a270d 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -68,7 +68,7 @@ "@testing-library/jest-dom": "5.11.4", "@testing-library/react": "11.1.1", "@testing-library/react-hooks": "3.4.2", - "@testing-library/user-event": "12.2.2", + "@testing-library/user-event": "12.1.10", "@woocommerce/components": "file:packages/components", "@woocommerce/csv-export": "file:packages/csv-export", "@woocommerce/currency": "file:packages/currency", @@ -7640,9 +7640,9 @@ } }, "node_modules/@testing-library/user-event": { - "version": "12.2.2", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.2.2.tgz", - "integrity": "sha512-mTYL9LrwiSeyorStUOMuRGQDn1ca40tIhuv//o/K3lY8wBEp+9Im90MFVx5i3u7zCPmavn3uWZs/10chsbI8Tg==", + "version": "12.1.10", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.1.10.tgz", + "integrity": "sha512-StlNdKHp2Rpb7yrny/5/CGpz8bR3jLa1Ge59ODGU6TmAhkrxSpvR6tCD1gaMFkkjEUWkmmye8BaXsZPcaiJ6Ug==", "dev": true, "dependencies": { "@babel/runtime": "^7.10.2" @@ -46230,9 +46230,9 @@ } }, "@testing-library/user-event": { - "version": "12.2.2", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.2.2.tgz", - "integrity": "sha512-mTYL9LrwiSeyorStUOMuRGQDn1ca40tIhuv//o/K3lY8wBEp+9Im90MFVx5i3u7zCPmavn3uWZs/10chsbI8Tg==", + "version": "12.1.10", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-12.1.10.tgz", + "integrity": "sha512-StlNdKHp2Rpb7yrny/5/CGpz8bR3jLa1Ge59ODGU6TmAhkrxSpvR6tCD1gaMFkkjEUWkmmye8BaXsZPcaiJ6Ug==", "dev": true, "requires": { "@babel/runtime": "^7.10.2" diff --git a/plugins/woocommerce-admin/packages/dependency-extraction-webpack-plugin/package.json b/plugins/woocommerce-admin/packages/dependency-extraction-webpack-plugin/package.json index 3224944725f..d7d226bddb9 100644 --- a/plugins/woocommerce-admin/packages/dependency-extraction-webpack-plugin/package.json +++ b/plugins/woocommerce-admin/packages/dependency-extraction-webpack-plugin/package.json @@ -16,9 +16,7 @@ "bugs": { "url": "https://github.com/woocommerce/woocommerce-admin/issues" }, - "main": "build/index.js", - "module": "build-module/index.js", - "react-native": "src/index", + "main": "src/index.js", "dependencies": { "@wordpress/dependency-extraction-webpack-plugin": "^2.8.0" },