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

Override React dependency of React Native #48990

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14]
node: [18]
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:

- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/pull-request-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: ${{ github.repository == 'WordPress/gutenberg' }}
strategy:
matrix:
node: ['14']
node: [18]

steps:
# Checkout defaults to using the branch which triggered the event, which
Expand All @@ -31,11 +31,9 @@ jobs:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-npm-pr-automation-cache-${{ hashFiles('**/package-lock.json') }}

# Changing into the action's directory and running `npm install` is much
# faster than a full project-wide `npm ci`.
# Only run `npm ci` in the package folder and ignore postinstall scripts.
- name: Install NPM dependencies
run: npm install
working-directory: packages/project-management-automation
run: npm ci -w @wordpress/project-management-automation --ignore-scripts

- uses: ./packages/project-management-automation
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['14']
node: [18]

steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
12 changes: 3 additions & 9 deletions bin/api-docs/update-api-docs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
const { join, relative, resolve, sep, dirname } = require( 'path' );
const { relative, resolve, sep, dirname } = require( 'path' );
const glob = require( 'fast-glob' );
const execa = require( 'execa' );
const { Transform } = require( 'stream' );
Expand Down Expand Up @@ -217,15 +217,9 @@ glob.stream( [
path = findDefaultSourcePath( dirname( file ) ),
] of tokens ) {
await execa(
`"${ join(
__dirname,
'..',
'..',
'node_modules',
'.bin',
'docgen'
) }"`,
'npx',
[
'docgen',
relative( ROOT_DIR, resolve( dirname( file ), path ) ),
`--output ${ output }`,
'--to-token',
Expand Down
3 changes: 1 addition & 2 deletions bin/packages/lint-staged-typecheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const execa = require( 'execa' );
require( './validate-typescript-version' );

const repoRoot = path.join( __dirname, '..', '..' );
const tscPath = path.join( repoRoot, 'node_modules', '.bin', 'tsc' );

// lint-staged passes full paths to staged changes
const changedFiles = process.argv.slice( 2 );
Expand All @@ -28,7 +27,7 @@ const changedPackages = _.uniq(
);

try {
execa.sync( tscPath, [ '--build', ...changedPackages ] );
execa.sync( 'npx', [ 'tsc', '--build', ...changedPackages ] );
} catch ( err ) {
console.error( err.stdout );
process.exitCode = 1;
Expand Down
7 changes: 2 additions & 5 deletions bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ async function runPerformanceTests( branches, options ) {
log( ` >> Branch: ${ branch }, Suite: ${ testSuite }` );
log( ' >> Starting the environment.' );
await runShellScript(
'../../tests/node_modules/.bin/wp-env start',
'npx wp-env start',
environmentDirectory
);
log( ' >> Running the test.' );
Expand All @@ -417,10 +417,7 @@ async function runPerformanceTests( branches, options ) {
runKey
);
log( ' >> Stopping the environment' );
await runShellScript(
'../../tests/node_modules/.bin/wp-env stop',
environmentDirectory
);
await runShellScript( 'npx wp-env stop', environmentDirectory );
}
}

Expand Down
10 changes: 5 additions & 5 deletions bin/test-create-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ if [ "$expected" -ne "$actual" ]; then
fi

status "Formatting files..."
../node_modules/.bin/wp-scripts format
npx wp-scripts format

status "Building block..."
../node_modules/.bin/wp-scripts build
npx wp-scripts build

status "Verifying build..."
expected=5
Expand All @@ -77,10 +77,10 @@ if [ "$expected" -ne "$actual" ]; then
fi

status "Linting CSS files..."
../node_modules/.bin/wp-scripts lint-style
npx wp-scripts lint-style

status "Linting JavaScript files..."
../node_modules/.bin/wp-scripts lint-js
npx wp-scripts lint-js

status "Creating a plugin zip file..."
../node_modules/.bin/wp-scripts plugin-zip
npx wp-scripts plugin-zip
6 changes: 3 additions & 3 deletions bin/validate-package-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const { red, yellow } = require( 'chalk' );
// @ts-ignore
const packageLock = require( '../package-lock' );

const dependencies = Object.entries( packageLock.dependencies );
for ( const [ name, dependency ] of dependencies ) {
const packages = Object.entries( packageLock.packages );
for ( const [ name, dependency ] of packages ) {
if ( dependency.resolved === false ) {
console.log(
`Invalid resolved dependency in package-lock.json.
Expand All @@ -38,6 +38,6 @@ To fix, try removing the node_modules directory and reverting package-lock.json,
}

if ( dependency.dependencies ) {
dependencies.push( ...Object.entries( dependency.dependencies ) );
packages.push( ...Object.entries( dependency.dependencies ) );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following guide is for setting up your local environment to contribute to th
## Prerequisites

- Node.js
Gutenberg is a JavaScript project and requires [Node.js](https://nodejs.org/). The project is built using Node.js v14, and npm v6. See the [LTS release schedule](https://github.com/nodejs/Release#release-schedule) for details.
Gutenberg is a JavaScript project and requires [Node.js](https://nodejs.org/). The project is built using Node.js v18, and npm v9. See the [LTS release schedule](https://github.com/nodejs/Release#release-schedule) for details.

We recommend using the [Node Version Manager](https://github.com/nvm-sh/nvm) (nvm) since it is the easiest way to install and manage node for macOS, Linux, and Windows 10 using WSL2. See [our Development Tools guide](/docs/getting-started/devenv/README.md#development-tools) or the Nodejs site for additional installation instructions.

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/create-block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ From your plugins directory, to create your block run:
npx @wordpress/create-block gutenpride --template @wordpress/create-block-tutorial-template
```

> Remember that you should use Node.js v14. Other versions may result in an error in the terminal. See [Node Development Tools](https://developer.wordpress.org/block-editor/getting-started/devenv/#node-development-tools) for more info.
> Remember that you should use Node.js v18. Other versions may result in an error in the terminal. See [Node Development Tools](https://developer.wordpress.org/block-editor/getting-started/devenv/#node-development-tools) for more info.

The [npx command](https://docs.npmjs.com/cli/v8/commands/npx) runs a command from a remote package, in this case our create-block package that will create a new directory called `gutenpride`, installs the necessary files, and builds the block plugin. If you want an interactive mode that prompts you for details, run the command without the `gutenpride` name.

Expand Down
20 changes: 10 additions & 10 deletions docs/getting-started/devenv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
```

Quit and restart terminal
Install Node.js v14.
Install Node.js v18.

```
nvm install 14
nvm install 18
```

**2. WordPress Development Site**
Expand Down Expand Up @@ -57,7 +57,7 @@ The tools are used to convert the JavaScript we are going to write into a format

For Mac and Linux, it is recommended to use the [Node Version Manager](https://github.com/nvm-sh/nvm) (nvm). Using `nvm` to install node allows installing specific versions, plus installs locally in your home directory and avoids any global permission issues.

For Windows, or alternative installs, you can [download a Nodejs installer](https://nodejs.org/en/download/) directly from the main Node.js website, v14 is recommended. Installers are available for Windows and Mac, and binaries available for Linux. See Node.js site for additional installation methods.
For Windows, or alternative installs, you can [download a Nodejs installer](https://nodejs.org/en/download/) directly from the main Node.js website, v18 is recommended. Installers are available for Windows and Mac, and binaries available for Linux. See Node.js site for additional installation methods.

Here are the quick instructions to install using nvm, see the [full installation instructions](https://github.com/nvm-sh/nvm#installing-and-updating) for additional details.

Expand All @@ -71,16 +71,16 @@ Note: On macOS, the required developer tools are not installed by default, if no

<img src="https://developer.wordpress.org/files/2020/07/git-install-prompt.png" alt="Mac git command requires command line developer tools" width="400" height="195"/>

After installing nvm, you need to use it to install Node.js, to install v14, run:
After installing nvm, you need to use it to install Node.js, to install v18, run:

```sh
nvm install 14
nvm install 18
```

If there is an error running the above command, for example a common error that occurs is:

```sh
$ nvm install 14
$ nvm install 18
zsh: command not found: nvm
```

Expand All @@ -93,20 +93,20 @@ On macOS Catalina, the default shell is zsh, to create the profile file type `to
After creating the profile file, re-run the install command:

```sh
nvm install 14
nvm install 18
```

The important part after installing is being able to use them in your terminal. Open a terminal command-line and type `node -v` and `npm -v` to confirm they are installed.

```sh
> node -v
v14.19.0
v18.14.2

> npm -v
6.14.16
9.6.0
```

Your versions may not match exactly, that is fine. The minimum version for Node.js is >= 12 and for npm >= 6.9, using v14 will be supported until upgrade is required.
Your versions may not match exactly, that is fine. The minimum version for Node.js is >= 18 and for npm >= 9, using v18 will be supported until upgrade is required.

## WordPress Development Site

Expand Down
2 changes: 2 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"command": {
"publish": {
"message": "chore(release): publish"
Expand Down
Loading