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

Replace npm with yarn #5555

Merged
merged 101 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
f5252df
enable using yarn
andrew-codes Oct 25, 2019
dfd6fbb
enable lerna and yarn workspaces
andrew-codes Oct 25, 2019
ad371e1
enabling test-unit script
andrew-codes Oct 25, 2019
ce87844
removal of all `check-deps` and `check-deps-pre`
andrew-codes Oct 28, 2019
10973ea
remove npm run all
andrew-codes Oct 28, 2019
7aa1780
use yarn in circle CI
andrew-codes Oct 28, 2019
c9161af
yarn in appveyor
andrew-codes Oct 28, 2019
b066afd
remove need for bin-upplaces using bin-up have a dev dependency on so…
andrew-codes Oct 28, 2019
9e58e9a
replace npm run with yarn in package files
andrew-codes Oct 29, 2019
597648c
replace explict paths to internal packages with yarn bin
andrew-codes Oct 29, 2019
63fba5b
remove unecessary link packages script and references
andrew-codes Oct 29, 2019
1888f34
properly require package for mocha
andrew-codes Oct 29, 2019
c5a9520
removing yarn test in this package as it was just a proxy for test-*
andrew-codes Oct 29, 2019
24ceb8a
yarn test in root now reflects what is run in circle ci
andrew-codes Oct 29, 2019
03034f3
relax yarn version requirement for circle ci
andrew-codes Oct 29, 2019
3ed6c3a
@packages/cli is really just cypress
andrew-codes Oct 29, 2019
62e5179
ensure postinstall is called before prebuild
andrew-codes Oct 29, 2019
87441b9
vscode config uses yarn
andrew-codes Oct 29, 2019
623e2d0
cannot rely on which node_modules dir a package is in
andrew-codes Oct 29, 2019
983bb4c
further relax yarn version for OSX build in circle ci
andrew-codes Oct 29, 2019
15ef184
resolve failing test
andrew-codes Oct 29, 2019
085a6bf
node version in mac build not sufficient
andrew-codes Oct 29, 2019
63e1ebc
preinstall script does not exist
andrew-codes Oct 29, 2019
c5326fc
upgrade mocha that was using --file
andrew-codes Oct 29, 2019
1692d3a
scope test runs to correct packages
andrew-codes Oct 29, 2019
d47de34
explictly close connections; otherwise script hangs after tests run
andrew-codes Oct 29, 2019
7c228ac
refactor so npm and npx commads can be created
andrew-codes Oct 31, 2019
87ccd8e
properly resolve socket.io-client node_module
andrew-codes Oct 31, 2019
d6e00f3
remove unnecessary arg in vscode debug config
andrew-codes Oct 31, 2019
2478549
another npm command found to be changed to yarn
andrew-codes Oct 31, 2019
1fba590
properly print colors to terminal
andrew-codes Oct 31, 2019
03c1ddc
add missing test scripts to packages that have partially have them
andrew-codes Oct 31, 2019
8377b59
properly patch package in yarn workspaces
andrew-codes Nov 1, 2019
3e61475
another package needing to postinstall
andrew-codes Nov 1, 2019
b63433d
use existing script over explicit lerna exec
andrew-codes Nov 1, 2019
2a6391d
patches must be copied to dist
andrew-codes Nov 1, 2019
a1da9e1
return to building on postinstall
andrew-codes Nov 1, 2019
d874928
do not hoist driver's packagesThere are too many places we need drive…
andrew-codes Nov 4, 2019
36c54d0
wait-on is used in circle-ci and needs to be a root dep
andrew-codes Nov 4, 2019
40874ae
update documentation based on new ergonomics
andrew-codes Nov 4, 2019
ab3013c
launcher has unit tests that should be runnable via top level task
andrew-codes Nov 4, 2019
902a5c7
more concise way to run build within cypress scope
andrew-codes Nov 4, 2019
909209c
fix for unit test that never seemed to work
andrew-codes Nov 4, 2019
44fddb8
bust cache based on yarn.lock changing
andrew-codes Nov 4, 2019
211e848
define intra-dependencies among packages
andrew-codes Nov 5, 2019
dc1a974
address `jquery.scrollto` mismatched jquery version
andrew-codes Nov 5, 2019
d9672f8
Merge remote-tracking branch 'origin' into issue-5477-replace-npm-wit…
andrew-codes Nov 5, 2019
a7b012e
add/remove deps from renovate
andrew-codes Nov 5, 2019
791695f
few misc yarn lock updates
andrew-codes Nov 5, 2019
874f0ea
hope that this may speed up build binary
andrew-codes Nov 5, 2019
a15d048
yarn pack prefix version with a `v`
andrew-codes Nov 5, 2019
6b835ba
auto-run `yarn install` when deps become out of date
andrew-codes Nov 5, 2019
cc9fe86
add clean top level task, remove prebuild
andrew-codes Nov 5, 2019
b3db251
address code review to undo formatting changes
andrew-codes Nov 12, 2019
d7267c2
favor default imports over deconstructing imports
andrew-codes Nov 12, 2019
752bf6e
favor @package resolution; pr feedback
andrew-codes Nov 12, 2019
dca376e
include a specific revision
andrew-codes Nov 12, 2019
4ff120c
properly cache yarn packagesfollowed guide: https://circleci.com/docs…
andrew-codes Nov 12, 2019
79e04a8
lower barrier for contributors to get started
andrew-codes Nov 12, 2019
c139c26
Merge remote-tracking branch 'origin/develop' into issue-5477-replace…
andrew-codes Nov 12, 2019
88d7bcc
updates required after merging latest development
andrew-codes Nov 13, 2019
6fa477a
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Nov 14, 2019
5ce1b22
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Nov 14, 2019
888b701
hidden dep on a specific type version in server
andrew-codes Nov 14, 2019
16e8e6c
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Nov 15, 2019
49c3427
update request to patched version
andrew-codes Nov 15, 2019
2b3a038
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Nov 18, 2019
94c943e
Merge remote-tracking branch 'origin' into issue-5477-replace-npm-wit…
andrew-codes Nov 26, 2019
8618912
Merge remote-tracking branch 'origin/develop' into issue-5477-replace…
andrew-codes Dec 23, 2019
11beb1d
missing commit from previous commit/merge
andrew-codes Dec 23, 2019
5aacbc3
do not force a higher version of yarn than the default on circleci
andrew-codes Dec 23, 2019
37335d6
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Dec 23, 2019
5abc8d6
exclude e2e.js helper from stop-only command
andrew-codes Dec 23, 2019
f78a10d
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
flotwig Dec 26, 2019
d198ed7
trying to bust node_modules cache.https://github.com/yarnpkg/yarn/iss…
andrew-codes Jan 8, 2020
234b699
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Jan 8, 2020
82e5154
incorrect quotation tick placement
andrew-codes Jan 8, 2020
170d75f
fix: properly postinstall parse-domain
andrew-codes Jan 8, 2020
cab0317
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Jan 14, 2020
9256aed
run all CI stages
flotwig Jan 15, 2020
7f50203
fix win-appveyor-build.js
flotwig Jan 15, 2020
3073633
Update CONTRIBUTING.md
andrew-codes Jan 15, 2020
aa66468
Update CONTRIBUTING.md
andrew-codes Jan 15, 2020
57adc67
Update CONTRIBUTING.md
andrew-codes Jan 15, 2020
ba748e9
Server package watching a specific test works correctly.
andrew-codes Jan 15, 2020
59c8fdf
PR feedback
andrew-codes Jan 15, 2020
78af04d
Correctly use yarn to pack (to get package size)
andrew-codes Jan 15, 2020
59f577e
correct size calculation
andrew-codes Jan 15, 2020
2b4f1fe
PR feedback
andrew-codes Jan 15, 2020
a4b6f5e
PR feedback
andrew-codes Jan 15, 2020
1f0e7d6
update readmes and testing commands from them
andrew-codes Jan 24, 2020
f4bf0fd
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Jan 24, 2020
f28525f
do not include this in default build
andrew-codes Jan 24, 2020
b82a3ec
yarn is now installed by default
andrew-codes Jan 24, 2020
fd74e5d
do not include server in `yarn` auto build
andrew-codes Jan 24, 2020
2888b26
a few more npm references changed to yarn
andrew-codes Jan 24, 2020
15d4af7
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Jan 24, 2020
4c53a15
Revert "run all CI stages"
flotwig Jan 27, 2020
25354ae
Merge remote-tracking branch 'origin/develop' into issue-5477-replace…
andrew-codes Feb 10, 2020
14177c7
Merge branch 'develop' into issue-5477-replace-npm-with-yarn
andrew-codes Feb 10, 2020
5ee5c32
Update circle.yml
andrew-codes Feb 10, 2020
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ cli/build
# Building app binary
scripts/support
package-lock.json
yarn.lock
binary-url.json

# Allows us to dynamically create eslint rules that override the default for Decaffeinate scripts
Expand Down
6 changes: 2 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"type": "node",
"request": "launch",
"name": "test: active",
"runtimeExecutable": "npm",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"run",
"test-debug-package"
],
"args": [
Expand All @@ -33,9 +32,8 @@
"request": "launch",
"name": "dev-debug",
"port": 5566,
"runtimeExecutable": "npm",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"run",
"dev-debug"
]
}
Expand Down
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
{
"label": "decaffeinate-bulk file",
"type": "shell",
"command": "npm run decaffeinate-bulk -- convert --file ${file}",
"command": "yarn decaffeinate-bulk convert --file ${file}",
"problemMatcher": []
},
{
"label": "decaffeinate-bulk multiple files",
"type": "shell",
"command": "npm run decaffeinate-bulk -- convert --file ${file} ${file}",
"command": "yarn decaffeinate-bulk convert --file ${file} ${file}",
"problemMatcher": []
},
{
"label": "decaffeinate-bulk dir",
"type": "shell",
"command": "npm run decaffeinate-bulk -- --dir ${fileDirname} convert",
"command": "yarn decaffeinate-bulk --dir ${fileDirname} convert",
"problemMatcher": []
}
]
Expand Down
16 changes: 8 additions & 8 deletions .vscode/terminals.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,58 @@
"focus": true,
"onlySingle": true,
"execute": true,
"command": "npm run cypress:open"
"command": "yarn cypress:open"
},
{
"name": "cypress run",
"focus": true,
"onlySingle": true,
"execute": false,
"command": "npm run cypress:run -- --project ../project"
"command": "yarn cypress:run --project ../project"
},
{
"name": "packages/server test-watch",
"focus": true,
"onlySingle": true,
"execute": false,
"cwd": "[cwd]/packages/server",
"command": "npm run test-watch -- [file]"
"command": "yarn test-watch [file]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem to work:

  1. open a server test, like test/integration/websockets_spec
  2. use the terminals: run single command to run test-watch
  3. observe:
➜ +28s issue-5477-replace-npm-with-yarn/packages/server (issue-5477-replace-npm-with-yarn) yarn test-watch /home/flotwig/Projects/cypress/issue-5477-replace-npm-with-yarn/packages/server/test/integration/websockets_spec.coffee
yarn run v1.19.1
$ ./test/support/watch test /home/flotwig/Projects/cypress/issue-5477-replace-npm-with-yarn/packages/server/test/integration/websockets_spec.coffee
Error: no test specified /home/flotwig/Projects/cypress/issue-5477-replace-npm-with-yarn/packages/server/test/integration/websockets_spec.coffee

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-e2e does seem to work though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch! It looks like ./test/support/watch it is calling npm run test instead of npm run test-unit with the provided filename.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is resolved now.

},
{
"name": "packages/server test-e2e",
"focus": true,
"onlySingle": true,
"execute": false,
"cwd": "[cwd]/packages/server",
"command": "npm run test-e2e -- --spec [fileBasename]"
"command": "yarn test-e2e --spec [fileBasename]"
},
{
"name": "packages/runner watch",
"focus": true,
"onlySingle": true,
"cwd": "[cwd]/packages/runner",
"command": "npm run watch"
"command": "yarn watch"
},
{
"name": "packages/driver cypress open",
"focus": true,
"onlySingle": true,
"cwd": "[cwd]/packages/driver",
"command": "npm run cypress:open"
"command": "yarn cypress:open"
},
{
"name": "packages/desktop-gui cypress open",
"focus": true,
"onlySingle": true,
"cwd": "[cwd]/packages/desktop-gui",
"command": "npm run cypress:open"
"command": "yarn cypress:open"
},
{
"name": "packages/desktop-gui watch",
"focus": true,
"onlySingle": true,
"cwd": "[cwd]/packages/desktop-gui",
"command": "npm run watch"
"command": "yarn watch"
}
]
}
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

204 changes: 114 additions & 90 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

35 changes: 16 additions & 19 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ We build the NPM package and binary on all major platforms (Linux, Mac, Windows)
providers. In order to set the version while building we have to set the environment variable
with the new version on each CI provider *before starting the build*.

Use the script command below to to do this.

```shell
npm run set-next-ci-version
```
Use script command `yarn set-next-ci-version` to do this.

## Building

Expand All @@ -27,7 +23,7 @@ npm run set-next-ci-version
Building a new NPM package is very quick.

- Increment the version in the root `package.json`
- `cd cli && npm run build`
- `yarn build --scope cypress`

The steps above:

Expand All @@ -48,22 +44,22 @@ First, you need to build, zip and upload the application binary to the Cypress s
You can use a single command to do all tasks at once:

```shell
npm run binary-deploy
yarn binary-deploy
```

Or you can specify each command separately:

```shell
npm run binary-build
npm run binary-zip
npm run binary-upload
yarn binary-build
yarn binary-zip
yarn binary-upload
```

You can pass options to each command to avoid answering questions, for example

```shell
npm run binary-deploy -- --platform darwin --version 0.20.0
npm run binary-upload -- --platform darwin --version 0.20.0 --zip cypress.zip
yarn binary-deploy --platform darwin --version 0.20.0
yarn binary-upload --platform darwin --version 0.20.0 --zip cypress.zip
```

If something goes wrong, see the debug messages using the `DEBUG=cypress:binary ...` environment
Expand All @@ -76,7 +72,7 @@ Because we had many problems reliably zipping the built binary, for now we need
If you are using a Mac you can build the linux binary if you have docker installed.

```shell
npm run binary-build-linux
yarn binary-build-linux
```

## Publishing
Expand Down Expand Up @@ -121,11 +117,12 @@ In the following instructions, "X.Y.Z" is used to denote the version of Cypress
2. Use the `move-binaries` script to move the binaries for `<commit sha>` from `beta` to the `desktop` folder
for `<new target version>`
```shell
npm run move-binaries -- --sha <commit sha> --version <new target version>
yarn move-binaries --sha <commit sha> --version <new target version>
```
3. Publish the new NPM package under the `dev` tag. The unique link to the package file `cypress.tgz` is the one already tested above. You can publish to the NPM registry straight from the URL:
3. Publish the new NPM package under the dev tag. The unique link to the package file `cypress.tgz`
is the one already tested above. You can publish to the NPM registry straight from the URL:
```shell
npm publish https://cdn.../npm/X.Y.Z/<long sha>/cypress.tgz --tag dev
yarn publish https://cdn.../npm/X.Y.Z/<long sha>/cypress.tgz --tag dev
```
4. Double-check that the new version has been published under the `dev` tag using `npm info cypress` or [available-versions](https://github.com/bahmutov/available-versions). Example output:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Double-check that the new version has been published under the `dev` tag using `npm info cypress` or [available-versions](https://github.com/bahmutov/available-versions). Example output:
4. Double-check that the new version has been published under the `dev` tag using `yarn info cypress` or [available-versions](https://github.com/bahmutov/available-versions). Example output:

```shell
Expand All @@ -140,11 +137,11 @@ In the following instructions, "X.Y.Z" is used to denote the version of Cypress
7. Update and publish the changelog and any release-specific documentation changes in [cypress-documentation](https://github.com/cypress-io/cypress-documentation).
8. Make the new NPM version the "latest" version by updating the dist-tag `latest` to point to the new version:
```shell
npm dist-tag add [email protected]
yarn dist-tag add [email protected]
```
9. Run `binary-release` to update the download the server's manifest, set the next CI version, and create an empty version commit:
8. Run `binary-release` to update the download server's manifest, set the next CI version, and create an empty version commit:
```shell
npm run binary-release -- --version X.Y.Z --commit
yarn run binary-release --version X.Y.Z --commit
```
10. If needed, push out any updated changes to the links manifest to [`on.cypress.io`](https://github.com/cypress-io/cypress-services/tree/develop/packages/on).
11. If needed, deploy the updated [`cypress-example-kitchensink`][cypress-example-kitchensink] to `example.cypress.io` by following [these instructions under "Deployment"](./packages/example/README.md).
Expand Down
38 changes: 14 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ branches:
only:
- master
- develop
- issue-5477-replace-npm-with-yarn
- /win*/

# https://www.appveyor.com/docs/lang/nodejs-iojs/
Expand Down Expand Up @@ -40,63 +41,52 @@ platform:
# with installing over cached folder
# https://github.com/npm/npm/issues/17747
# cache:
# - node_modules
# - node_modules -> yarn.lock
# - '%LOCALAPPDATA%/Yarn -> yarn.lock'
# # todo: cache node_modules in each package

# Install scripts. (runs after repo cloning)
install:
- ps: Install-Product node $env:nodejs_version $env:platform
# upgrade npm
- npm install -g npm@6
- npm install -g @bahmutov/print-env@1
- yarn global add @bahmutov/print-env@1
# Output useful info for debugging.
- node --version
- node --print process.arch
- npm --version
- npm run check-next-dev-version
- yarn --version
- yarn check-next-dev-version
# prints all public variables relevant to the build
- print-env Platform
- npm run check-node-version
- yarn check-node-version
- print-env APPVEYOR
# prints if we have sensitive variables that start with a prefix GH
# which are used to trigger other projects
- has-env GH
# clean cache to prevent install permission issues
- npm cache clean --force
# install root modules only, and retry automatically if install fails
- npm run preinstall
- npm install --ignore-scripts || npm install --ignore-scripts || npm install --ignore-scripts
- yarn cache clean
- yarn || yarn || yarn
- .\node_modules\.bin\print-arch
# because we skipped scripts, we need to do
# everything from "postinstall" script as commands
- npm run link
# install every package one by one
# try to do several attempts, because on AppVeyor random install errors happen
- npm run all install -- --serial || npm run all install -- --serial || npm run all install -- --serial
# - npm prune
# - npm run all prune -- --serial
- npm run all build -- --serial

# Post-install test scripts.
test_script:
# Output useful info for debugging.
# beware of echo-ing environment variables that may have batch syntax (e.g. commit messages)
- node --version
- npm --version
- yarn --version
- 7z
- cd packages/launcher && node index.js && cd ../..
# make sure mocha runs
- npm run test-mocha
- yarn test-mocha
# make sure our snapshots are compared correctly
# - npm run test-mocha-snapshot
# the other larger tests
- echo Building Windows NPM package %NEXT_DEV_VERSION%
- npm --no-git-tag-version version %NEXT_DEV_VERSION%
- cd cli
- npm install
- npm run build
- yarn
- yarn build
- cd build
- npm pack
- yarn pack
- cd ../..

- node ./scripts/win-appveyor-build.js
Expand Down
Loading