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

yarn to npm #291

Merged
merged 1 commit into from
Sep 8, 2024
Merged
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
6 changes: 3 additions & 3 deletions Build-and-run-32bit-Code---OSS-on-Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Every so often, you may need to debug an issue that only appears in the 32bit ve
1. Stop any running processes from the regular contributing guide.
1. Start a PowerShell session in the `vscode` directory that you cloned.
1. run `git clean -fdx` - remove downloaded election, remove `node_modules`, remove anything that isn't checked in to the repo
1. run `$env:npm_config_arch = 'ia32'` - let yarn know that you want to build the 32bit version
1. run `yarn` - install dependencies
1. run `yarn electron ia32` - download the 32bit of electron
1. run `$env:npm_config_arch = 'ia32'` - let npm know that you want to build the 32bit version
1. run `npm i` - install dependencies
1. run `npm run electron ia32` - download the 32bit of electron
1. run `.\scripts\code.bat` - start VS Code

You should be able to go into the About section and see that you're running the 32bit version of VS Code.
Expand Down
8 changes: 4 additions & 4 deletions Cross-Compiling-for-Debian-Based-Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Because cross-compiling isn't officially supported by the Visual Studio Code tea

*note the -L linker argument pointing to the absolute path of libx11 on the chroot/rootfs*

1. Tell `yarn` you want to cross-compile native modules for ARM:
1. Tell `npm` you want to cross-compile native modules for ARM:

```bash
export npm_config_arch=arm
Expand All @@ -42,7 +42,7 @@ Because cross-compiling isn't officially supported by the Visual Studio Code tea
1. Build VS Code and create a .deb file (for easier installation on the target device) as usual:

```bash
yarn
yarn run gulp vscode-linux-arm-min
yarn run gulp vscode-linux-arm-build-deb
npm i
npm run gulp vscode-linux-arm-min
npm run gulp vscode-linux-arm-build-deb
```
2 changes: 1 addition & 1 deletion Dealing-with-Test-Flakiness.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Here are some strategies for dealing with flakiness:
./scripts/test-integration.sh --build

# Smoke tests
yarn smoketest --build <install dir>
npm run smoketest --build <install dir>
```
- **Check the logs**: Log files (client and server) are available in Azure Pipelines for all tests except the unit tests as artifacts on the build. Look for the "n published" link under Related on the build summary page.
- If the logs don't provide any useful information, try improving the assert failure message to provide more information about the state when the test failed. You might need to wrap a timeout failure in a try/catch and add an `assert.fail` within the catch block.
Expand Down
23 changes: 11 additions & 12 deletions How-to-Contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ After cloning and building the repo, check out the [issues list](https://github.

## Prerequisites

In order to download necessary tools, clone the repository, and install dependencies via `yarn`, you need network access.
In order to download necessary tools, clone the repository, and install dependencies via `npm i`, you need network access.

You'll need the following tools:

- [Git](https://git-scm.com)
- [Node.JS](https://nodejs.org/en/), **x64**, version `>=18.15.x and <19`
- [Yarn 1](https://classic.yarnpkg.com/en/), version `>=1.10.1 and <2`, follow the [installation guide](https://classic.yarnpkg.com/en/docs/install)
- [Python](https://www.python.org/downloads/) (required for node-gyp; check the [node-gyp readme](https://github.com/nodejs/node-gyp#installation) for the currently supported Python versions)
- **Note:** Python will be automatically installed for Windows users through installing `windows-build-tools` npm module (see below)
- A C/C++ compiler tool chain for your platform:
Expand All @@ -38,9 +37,9 @@ You'll need the following tools:
* Building deb and rpm packages requires `fakeroot` and `rpm`; run: `sudo apt-get install fakeroot rpm`

### Troubleshooting
In case of issues, try deleting the contents of `~/.node-gyp` (alternatively `~/.cache/node-gyp` for Linux, `~/Library/Caches/node-gyp/` for macOS, or `%USERPROFILE%\AppData\Local\node-gyp` for Windows) first and then run `yarn cache clean` and then try again.
In case of issues, try deleting the contents of `~/.node-gyp` (alternatively `~/.cache/node-gyp` for Linux, `~/Library/Caches/node-gyp/` for macOS, or `%USERPROFILE%\AppData\Local\node-gyp` for Windows) first and then run `npm cache clean -f` and then try again.

> If you are on Windows or Linux 64 bit systems and would like to compile to 32 bit, you'll need to set the `npm_config_arch` environment variable to `ia32` before running `yarn`. This will compile all native node modules for a 32 bit architecture. Similarly, when cross-compiling for ARM, set `npm_config_arch` to `arm`.
> If you are on Windows or Linux 64 bit systems and would like to compile to 32 bit, you'll need to set the `npm_config_arch` environment variable to `ia32` before running `npm i`. This will compile all native node modules for a 32 bit architecture. Similarly, when cross-compiling for ARM, set `npm_config_arch` to `arm`.

> **Note:** For more information on how to install NPM modules globally on UNIX systems without resorting to `sudo`, refer to [this guide](http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/).

Expand Down Expand Up @@ -103,17 +102,17 @@ Manage any merge conflicts, commit them, and then push them to your fork.

### Build

Install and build all of the dependencies using `Yarn`:
Install and build all of the dependencies using `npm`:

```
cd vscode
yarn
npm i
```

Then you have two options:

- If you want to build from inside VS Code, you can open the `vscode` folder and start the build task with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> (<kbd>CMD</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> on macOS). The build task will stay running in the background even if you close VS Code. If you happen to close VS Code and open it again, just resume the build by pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> (<kbd>CMD</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd>) again. You can kill it by running the `Kill Build VS Code` task or pressing <kbd>Ctrl</kbd>+<kbd>D</kbd> in the task terminal.
- If you want to build from a terminal, run `yarn watch`. This will run both the core watch task and watch-extension tasks in a single terminal.
- If you want to build from a terminal, run `npm run watch`. This will run both the core watch task and watch-extension tasks in a single terminal.

The incremental builder will do an initial full build and will display a message that includes the phrase "Finished compilation" once the initial build is complete. The builder will watch for file changes and compile those changes incrementally, giving you a fast, iterative coding experience.

Expand All @@ -122,7 +121,7 @@ The incremental builder will do an initial full build and will display a message
- **Windows:** If you have installed Visual Studio 2017 as your build tool, you need to open **x64 Native Tools Command Prompt for VS 2017**. Do not confuse it with *VS2015 x64 Native Tools Command Prompt*, if installed.
- **Linux:** You may hit a ENOSPC error when running the build. To get around this follow instructions in the [Common Questions](https://code.visualstudio.com/docs/setup/linux#_common-questions).

If the build step fails, or if the built version fails to run (see next section), run `git clean -xfd` in your `vscode` folder, then re-run `yarn`.
If the build step fails, or if the built version fails to run (see next section), run `git clean -xfd` in your `vscode` folder, then re-run `npm i`.

#### Errors and Warnings
Errors and warnings will show in the console while developing VS Code. If you use VS Code to develop VS Code, errors and warnings are shown in the status bar at the bottom left of the editor. You can view the error list using `View | Errors and Warnings` or pressing <kbd>Ctrl</kbd>+<kbd>P</kbd> and then <kbd>!</kbd> (<kbd>CMD</kbd>+<kbd>P</kbd> and <kbd>!</kbd> on macOS).
Expand Down Expand Up @@ -153,13 +152,13 @@ Running on Electron with extensions run in NodeJS:
.\scripts\code-cli.bat
```

👉 **Tip!** If you receive an error stating that the app is not a valid Electron app, it probably means you didn't run `yarn watch` first.
👉 **Tip!** If you receive an error stating that the app is not a valid Electron app, it probably means you didn't run `npm run watch` first.

#### VS Code for the Web

Extensions and UI run in the browser.

👉 Besides `yarn watch` also run `yarn watch-web` to build the web bits for the built-in extensions.
👉 Besides `npm run watch` also run `npm run watch-web` to build the web bits for the built-in extensions.

##### macOS and Linux

Expand Down Expand Up @@ -223,7 +222,7 @@ We also have automated UI tests. The [smoke test README](https://github.com/Micr
Run the tests directly from a terminal by running `./scripts/test.sh` from the `vscode` folder (`scripts\test` on Windows). The [test README](https://github.com/Microsoft/vscode/blob/main/test/README.md) has complete details on how to run and debug tests, as well as how to produce coverage reports.

### Linting
We use [eslint](https://eslint.org/) for linting our sources. You can run eslint across the sources by calling `yarn eslint` from a terminal or command prompt. You can also run `yarn eslint` as a VS Code task by pressing <kbd>Ctrl</kbd>+<kbd>P</kbd> (<kbd>CMD</kbd>+<kbd>P</kbd> on macOS) and entering `task eslint`.
We use [eslint](https://eslint.org/) for linting our sources. You can run eslint across the sources by calling `npm run eslint` from a terminal or command prompt. You can also run `npm run eslint` as a VS Code task by pressing <kbd>Ctrl</kbd>+<kbd>P</kbd> (<kbd>CMD</kbd>+<kbd>P</kbd> on macOS) and entering `task eslint`.

To lint the source as you make changes you can install the [eslint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).

Expand Down Expand Up @@ -267,7 +266,7 @@ These `gulp` tasks are available:
* `vscode-[platform]`: Builds a packaged version for `[platform]`.
* `vscode-[platform]-min`: Builds a packaged and minified version for `[platform]`.

👉 **Tip!** Run `gulp` via `yarn` to avoid potential out of memory issues, for example `yarn gulp vscode-linux-x64`
👉 **Tip!** Run `gulp` via `npm` to avoid potential out of memory issues, for example `npm run gulp vscode-linux-x64`

See also: [Cross-Compiling for Debian-based Linux](https://github.com/Microsoft/vscode/wiki/Cross-Compiling-for-Debian-Based-Linux)

Expand Down