You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should implement some changes to package.json to bring it in line with our current standards:
Remove check-node-version package and pre* steps. The specific version of node to be used is handled in PR checks and in deploy steps via our reusable GitHub Actions. The only purpose for this is to prevent developers who are working locally from using the wrong version of node, but it adds overhead to every action taken on npm scripts, both locally and in CI. Let's simplify the config and reduce dependencies by removing it.
Add the --noEmit flag to tsc in the check-types script to ensure that no output is ever written when types are being checked.
Rename the lint script to eslint and remove the check-types call from the script. Running npm run eslint should only ever run the eslint check. Also rename the lint:watch command to eslint:watch.
Rename test to jest and test:watch to jest:watch.
Create a new test command that invokes check-types, eslint, stylelint, and jest. This is because the reusable GitHub Action for running node tests will run npm run test by default, and currently the only thing being checked by that command is Jest, so this change will ensure that all of the required tests are being run on PR checks (audit and build are run separately).
Update dist-tag to 6.7 for the version of WP dependencies that we're using. CI has already kept the actual versions of packages up-to-date but the command should reflect the current latest version of WP.
Downgrade React to 18.3 (current version in use by WP) and tell Dependabot not to upgrade it (see comment below).
Remove prop-types package (use TypeScript and default values in destructuring instead).
Remove react-dom package (only needed when creating a new React app on the frontend, can be added by implementers later if necessary).
Remove @alleyinteractive/create-entry package (invoked via npx, doesn't need to be in the project's devDependencies).
Remove all of the @types packages since referenced packages export their own types now.
Install ajv package (bug in wp-scripts causes builds to crash if this package doesn't exist - can be removed later if this is fixed by WP or in our build-tool package in block-editor-tools).
Remove .npmrc file forcing the use of legacy-peer-deps which is no longer needed.
Recompile package-lock.json after these changes are made (remove node_modules folder, remove package-lock.json, reinstall). Confirm this works on both macOS and on Linux systems (npm ci should succeed on both and scripts should succeed on both, including the new test command and the build command).
Use Case
Users of this package should get the latest set of node/JavaScript configuration.
The text was updated successfully, but these errors were encountered:
Description
We should implement some changes to package.json to bring it in line with our current standards:
check-node-version
package andpre*
steps. The specific version of node to be used is handled in PR checks and in deploy steps via our reusable GitHub Actions. The only purpose for this is to prevent developers who are working locally from using the wrong version of node, but it adds overhead to every action taken on npm scripts, both locally and in CI. Let's simplify the config and reduce dependencies by removing it.--noEmit
flag totsc
in thecheck-types
script to ensure that no output is ever written when types are being checked.lint
script toeslint
and remove thecheck-types
call from the script. Runningnpm run eslint
should only ever run the eslint check. Also rename thelint:watch
command toeslint:watch
.test
tojest
andtest:watch
tojest:watch
.test
command that invokescheck-types
,eslint
,stylelint
, andjest
. This is because the reusable GitHub Action for running node tests will runnpm run test
by default, and currently the only thing being checked by that command is Jest, so this change will ensure that all of the required tests are being run on PR checks (audit and build are run separately).dist-tag
to6.7
for the version of WP dependencies that we're using. CI has already kept the actual versions of packages up-to-date but the command should reflect the current latest version of WP.prop-types
package (use TypeScript and default values in destructuring instead).react-dom
package (only needed when creating a new React app on the frontend, can be added by implementers later if necessary).@alleyinteractive/create-entry
package (invoked via npx, doesn't need to be in the project's devDependencies).@types
packages since referenced packages export their own types now.ajv
package (bug in wp-scripts causes builds to crash if this package doesn't exist - can be removed later if this is fixed by WP or in ourbuild-tool
package inblock-editor-tools
)..npmrc
file forcing the use oflegacy-peer-deps
which is no longer needed.package-lock.json
after these changes are made (remove node_modules folder, remove package-lock.json, reinstall). Confirm this works on both macOS and on Linux systems (npm ci should succeed on both and scripts should succeed on both, including the new test command and the build command).Use Case
Users of this package should get the latest set of node/JavaScript configuration.
The text was updated successfully, but these errors were encountered: