newspack-scripts 5.7.0 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js CHANGED
@@ -2,8 +2,4 @@ require( '@rushstack/eslint-patch/modern-module-resolution' );
2
2
 
3
3
  module.exports = {
4
4
  extends: [ './config/eslintrc.js' ],
5
- ignorePatterns: [ 'node_modules' ],
6
- rules: {
7
- '@typescript-eslint/no-var-requires': 'off',
8
- },
9
5
  };
package/.prettierrc.js ADDED
@@ -0,0 +1,5 @@
1
+ const baseConfig = require( './config/prettier.config.js' );
2
+
3
+ module.exports = {
4
+ ...baseConfig
5
+ };
@@ -25,14 +25,14 @@ if (
25
25
  if ( result.signal === 'SIGKILL' ) {
26
26
  utils.log(
27
27
  'The build failed because the process exited too early. ' +
28
- 'This probably means the system ran out of memory or someone called ' +
29
- '`kill -9` on the process.'
28
+ 'This probably means the system ran out of memory or someone called ' +
29
+ '`kill -9` on the process.'
30
30
  );
31
31
  } else if ( result.signal === 'SIGTERM' ) {
32
32
  utils.log(
33
33
  'The build failed because the process exited too early. ' +
34
- 'Someone might have called `kill` or `killall`, or the system could ' +
35
- 'be shutting down.'
34
+ 'Someone might have called `kill` or `killall`, or the system could ' +
35
+ 'be shutting down.'
36
36
  );
37
37
  }
38
38
  process.exit( 1 );
@@ -1,8 +1,6 @@
1
- module.exports = api => {
1
+ module.exports = ( api ) => {
2
2
  api.cache( true );
3
3
  return {
4
- presets: [
5
- '@wordpress/babel-preset-default',
6
- ],
4
+ presets: [ '@wordpress/babel-preset-default' ],
7
5
  };
8
6
  };
@@ -1,10 +1,3 @@
1
- const wpRecommended = require.resolve(
2
- '@wordpress/eslint-plugin/configs/recommended'
3
- );
4
- const reactRecommended = require.resolve(
5
- '@wordpress/eslint-plugin/configs/react'
6
- );
7
-
8
1
  /**
9
2
  * Assume `@wordpress/*` packages are available. This is because `@wordpress/scripts` is using
10
3
  * Dependency Extraction Webpack Plugin to use core WP packages instead of those from
@@ -23,17 +16,14 @@ module.exports = {
23
16
  extends: [
24
17
  'plugin:import/errors',
25
18
  'plugin:import/warnings',
26
- 'plugin:@typescript-eslint/eslint-recommended',
27
- 'plugin:@typescript-eslint/recommended',
28
- reactRecommended,
29
- wpRecommended,
19
+ 'plugin:@wordpress/eslint-plugin/recommended',
20
+ 'plugin:@wordpress/eslint-plugin/react',
30
21
  ],
31
22
  env: {
32
23
  browser: true,
33
24
  jest: true,
34
25
  },
35
26
  parser: '@typescript-eslint/parser',
36
- plugins: [ '@typescript-eslint' ],
37
27
  settings: {
38
28
  'import/resolver': {
39
29
  node: {
@@ -85,5 +75,6 @@ module.exports = {
85
75
  '@typescript-eslint/no-shadow': 'error',
86
76
  '@typescript-eslint/ban-ts-comment': 'warn',
87
77
  '@typescript-eslint/no-explicit-any': 'warn',
78
+ '@typescript-eslint/no-require-imports': 'off',
88
79
  },
89
80
  };
@@ -6,7 +6,7 @@ module.exports = ( ...args ) => {
6
6
  let config = { ...defaultConfig };
7
7
 
8
8
  // Merge config extensions into default config.
9
- args.forEach( extension => {
9
+ args.forEach( ( extension ) => {
10
10
  config = { ...config, ...extension };
11
11
  } );
12
12
 
@@ -1,7 +1,6 @@
1
1
  module.exports = {
2
- extends: [
3
- '@wordpress/stylelint-config',
4
- ],
2
+ extends: [ '@wordpress/stylelint-config' ],
3
+ ignoreFiles: [ 'dist/**', 'node_modules/**', 'release/**', 'scripts/**' ],
5
4
  rules: {
6
5
  'rule-empty-line-before': null,
7
6
  'at-rule-empty-line-before': null,
@@ -16,6 +15,7 @@ module.exports = {
16
15
  'alpha-value-notation': null,
17
16
  'color-function-notation': null,
18
17
  'selector-not-notation': null,
18
+ 'no-invalid-double-slash-comments': null,
19
19
  'function-no-unknown': [
20
20
  true,
21
21
  {
@@ -29,6 +29,5 @@ module.exports = {
29
29
  },
30
30
  ],
31
31
  'media-feature-range-notation': null,
32
- 'max-line-length': null,
33
32
  },
34
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newspack-scripts",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "newspack-scripts": "./bin/newspack-scripts.js"
@@ -8,63 +8,72 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@commitlint/cli": "^17.8.1",
12
- "@commitlint/config-conventional": "^17.8.1",
13
- "@rushstack/eslint-patch": "^1.10.3",
11
+ "@commitlint/cli": "^20.1.0",
12
+ "@commitlint/config-conventional": "^19.8.1",
13
+ "@rushstack/eslint-patch": "^1.14.1",
14
14
  "@semantic-release/changelog": "^6.0.3",
15
15
  "@semantic-release/git": "^10.0.1",
16
- "@testing-library/jest-dom": "^5.17.0",
17
- "@testing-library/react": "^13.4.0",
18
- "@typescript-eslint/parser": "^7.13.0",
19
- "@wordpress/a11y": "^4.0.0",
20
- "@wordpress/api-fetch": "^7.0.0",
21
- "@wordpress/base-styles": "^5.0.0",
22
- "@wordpress/block-editor": "^13.0.0",
23
- "@wordpress/blocks": "^13.0.0",
24
- "@wordpress/components": "^28.0.0",
25
- "@wordpress/compose": "^7.0.0",
26
- "@wordpress/data": "^10.0.0",
27
- "@wordpress/date": "^5.0.0",
28
- "@wordpress/dom-ready": "^4.0.0",
29
- "@wordpress/edit-post": "^8.0.0",
30
- "@wordpress/element": "^6.0.0",
31
- "@wordpress/escape-html": "^3.0.0",
32
- "@wordpress/eslint-plugin": "^19.0.0",
33
- "@wordpress/hooks": "^4.0.0",
34
- "@wordpress/html-entities": "^4.0.0",
35
- "@wordpress/i18n": "^5.0.0",
36
- "@wordpress/icons": "^10.0.0",
37
- "@wordpress/keycodes": "^4.0.0",
38
- "@wordpress/plugins": "^7.0.0",
39
- "@wordpress/prettier-config": "^4.1.0",
40
- "@wordpress/scripts": "^28.1.0",
41
- "@wordpress/stylelint-config": "^22.1.0",
42
- "@wordpress/url": "^4.0.0",
43
- "autoprefixer": "^10.4.19",
44
- "commitizen": "^4.3.0",
45
- "cross-spawn": "^7.0.3",
16
+ "@testing-library/jest-dom": "^6.9.0",
17
+ "@testing-library/react": "^16.3.0",
18
+ "@types/qs": "^6.14.0",
19
+ "@types/react": "^19.2.2",
20
+ "@typescript-eslint/parser": "^8.46.0",
21
+ "@wordpress/a11y": "^4.33.0",
22
+ "@wordpress/api-fetch": "^7.33.0",
23
+ "@wordpress/base-styles": "^6.9.0",
24
+ "@wordpress/block-editor": "^15.6.0",
25
+ "@wordpress/blocks": "^15.6.0",
26
+ "@wordpress/browserslist-config": "^6.33.0",
27
+ "@wordpress/components": "^30.6.0",
28
+ "@wordpress/compose": "^7.33.0",
29
+ "@wordpress/data": "^10.33.0",
30
+ "@wordpress/date": "^5.33.0",
31
+ "@wordpress/dom-ready": "^4.33.0",
32
+ "@wordpress/edit-post": "^8.33.0",
33
+ "@wordpress/element": "^6.33.0",
34
+ "@wordpress/escape-html": "^3.33.0",
35
+ "@wordpress/eslint-plugin": "^22.19.0",
36
+ "@wordpress/hooks": "^4.33.0",
37
+ "@wordpress/html-entities": "^4.33.0",
38
+ "@wordpress/i18n": "^6.6.0",
39
+ "@wordpress/icons": "^11.0.0",
40
+ "@wordpress/keycodes": "^4.33.0",
41
+ "@wordpress/plugins": "^7.33.0",
42
+ "@wordpress/prettier-config": "^4.33.0",
43
+ "@wordpress/scripts": "^30.26.0",
44
+ "@wordpress/stylelint-config": "^23.25.0",
45
+ "@wordpress/url": "^4.33.0",
46
+ "autoprefixer": "^10.4.21",
47
+ "commitizen": "^4.3.1",
48
+ "cross-spawn": "^7.0.6",
46
49
  "cz-conventional-changelog": "^3.3.0",
47
50
  "eslint": "^8.57.0",
48
- "eslint-config-prettier": "^8.10.0",
49
- "eslint-plugin-import": "^2.29.1",
50
- "eslint-plugin-jest": "^27.9.0",
51
- "eslint-plugin-react": "^7.34.2",
51
+ "eslint-config-prettier": "^10.1.8",
52
+ "eslint-plugin-import": "^2.32.0",
53
+ "eslint-plugin-jest": "^29.0.1",
54
+ "eslint-plugin-react": "^7.37.5",
55
+ "lint-staged": "^16.2.6",
52
56
  "lodash": "^4.17.21",
53
- "postcss": "^8.4.38",
54
- "postcss-focus-within": "^5.0.4",
57
+ "postcss": "^8.5.6",
58
+ "postcss-focus-within": "^9.0.1",
55
59
  "postcss-scss": "^4.0.9",
56
60
  "prettier": "npm:wp-prettier@^3.0.3",
57
- "semantic-release": "^22.0.0",
61
+ "qs": "^6.14.0",
62
+ "semantic-release": "^25.0.1",
58
63
  "semantic-release-version-bump": "^1.4.1",
59
- "stylelint": "^14.2.0",
60
- "typescript": "^5.4.5",
64
+ "stylelint": "^16.25.0",
65
+ "typescript": "^5.9.3",
61
66
  "yargs": "^17.7.2"
62
67
  },
63
68
  "overrides": {
64
- "history": "4.9.0",
65
- "path-to-regexp": "1.7.0"
69
+ "prettier": "$prettier"
66
70
  },
67
71
  "scripts": {
72
+ "lint": "npm run lint:js",
73
+ "lint:js": "./bin/newspack-scripts.js wp-scripts lint-js '**/{bin,config,scripts}/**/*.{js,jsx,ts,tsx}'",
74
+ "lint:js:staged": "./bin/newspack-scripts.js wp-scripts lint-js --ext .js,.jsx,.ts,.tsx",
75
+ "fix:js": "./bin/newspack-scripts.js wp-scripts lint-js --fix '**/{bin,config,scripts}/**/*.{js,jsx,ts,tsx}'",
76
+ "format:js": "./bin/newspack-scripts.js wp-scripts format '**/{bin,config,scripts}/**/*.{js,jsx,ts,tsx}'",
68
77
  "semantic-release": "semantic-release"
69
78
  },
70
79
  "release": {
@@ -129,7 +129,7 @@ const run = async () => {
129
129
  try {
130
130
  const gitBranch = await utils.getGitBranch();
131
131
 
132
- const result = await semanticRelease(
132
+ const result = await semanticRelease.default(
133
133
  getConfig( { gitBranchName: gitBranch } )
134
134
  );
135
135
 
@@ -1,3 +1,10 @@
1
+ /**
2
+ * DEPRECATION NOTICE: As of v5.8.0, this script is deprecated as @wordpress/eslint-plugin
3
+ * will perform TypeScript checks on .ts and .tsx files.
4
+ *
5
+ * This script and its dependencies will be removed in a future version of Newspack Scripts.
6
+ */
7
+
1
8
  'use strict';
2
9
 
3
10
  const spawn = require( 'cross-spawn' );