Move from yarn to npm

This commit is contained in:
Fedor Indutny
2024-06-24 13:14:32 -07:00
committed by GitHub
parent 59b27974f0
commit 2478bf1bd3
17 changed files with 53620 additions and 26702 deletions
+16 -17
View File
@@ -52,13 +52,12 @@ Install the [Xcode Command-Line Tools](http://osxdaily.com/2014/02/12/install-co
Now, run these commands in your preferred terminal in a good directory for development:
```
npm install --global yarn # Make sure you have have `yarn`
git clone https://github.com/signalapp/Signal-Desktop.git
cd Signal-Desktop
yarn install --frozen-lockfile # Install and build dependencies (this will take a while)
yarn generate # Generate final JS and CSS assets
yarn test # A good idea to make sure tests run first
yarn start # Start Signal!
npm install --legacy-peer-deps # Install and build dependencies (this will take a while)
npm run generate # Generate final JS and CSS assets
npm test # A good idea to make sure tests run first
npm start # Start Signal!
```
You'll need to restart the application regularly to see your changes, as there
@@ -68,14 +67,14 @@ is no automatic restart mechanism. Alternatively, keep the developer tools open
(Windows & Linux).
Also, note that the assets loaded by the application are not necessarily the same files
youre touching. You may not see your changes until you run `yarn generate` on the
youre touching. You may not see your changes until you run `npm run generate` on the
command-line like you did during setup. You can make it easier on yourself by generating
the latest built assets when you change a file. Run each of these in their own terminal
instance while you make changes - they'll run until you stop them:
```
yarn dev:transpile # recompiles when you change .ts files
yarn dev:sass # recompiles when you change .scss files
npm run dev:transpile # recompiles when you change .ts files
npm run dev:sass # recompiles when you change .scss files
```
### webpack
@@ -85,7 +84,7 @@ You can run a development server for these parts of the app with the
following command:
```
yarn dev
npm run dev
```
In order for the app to make requests to the development server you must set
@@ -93,7 +92,7 @@ the `SIGNAL_ENABLE_HTTP` environment variable to a truthy value. On Linux and
macOS, that simply looks like this:
```
SIGNAL_ENABLE_HTTP=1 yarn start
SIGNAL_ENABLE_HTTP=1 npm start
```
## Setting up standalone
@@ -158,7 +157,7 @@ For example, to create an 'alice' profile, put a file called `local-alice.json`
Then you can start up the application a little differently to load the profile:
```
NODE_APP_INSTANCE=alice yarn run start
NODE_APP_INSTANCE=alice npm start
```
This changes the `userData` directory from `%appData%/Signal` to `%appData%/Signal-aliceProfile`.
@@ -174,15 +173,15 @@ Please write tests! Our testing framework is
[mocha](http://mochajs.org/) and our assertion library is
[chai](http://chaijs.com/api/assert/).
The easiest way to run all tests at once is `yarn test`, which will run them on the
The easiest way to run all tests at once is `npm test`, which will run them on the
command line. You can run the client-side tests in an interactive session with
`NODE_ENV=test yarn run start`.
`NODE_ENV=test npm start`.
## Pull requests
So you wanna make a pull request? Please observe the following guidelines.
- First, make sure that your `yarn ready` run passes - it's very similar to what our
- First, make sure that your `npm run ready` run passes - it's very similar to what our
Continuous Integration servers do to test the app.
- Please do not submit pull requests for translation fixes.
- Never use plain strings right in the source code - pull them from `messages.json`!
@@ -261,8 +260,8 @@ will go to your new development desktop app instead of your phone.
To test changes to the build system, build a release using
```
yarn generate
yarn build
npm run generate
npm run build
```
Then, run the tests using `yarn test-release`.
Then, run the tests using `npm run test-release`.