| 
									
										
										
										
											2019-06-01 00:56:07 +09:00
										 |  |  | To run tests | 
					
						
							|  |  |  | ------------ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Make sure your environment is set up with: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In a separate process, run the WebSockets server: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn ws-server` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Run the browser tests using Karma: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn test` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Run the node.js tests: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn test-node` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Run tslint: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn lint` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Run format with clang-format: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn format` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Run all checks (lint/format/browser test/test-node): | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `yarn ci` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Before Commit | 
					
						
							|  |  |  | ------------ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Please make sure you pass all following checks before commit | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-20 07:49:24 +01:00
										 |  |  | - yarn gulp lint (tslint) | 
					
						
							|  |  |  | - yarn gulp format (clang-format) | 
					
						
							|  |  |  | - yarn promisetest (promise a+ test) | 
					
						
							|  |  |  | - yarn bazel test //packages/zone.js/... (all tests) | 
					
						
							| 
									
										
										
										
											2019-06-01 00:56:07 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | Webdriver Test | 
					
						
							|  |  |  | -------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `zone.js` also supports running webdriver e2e tests. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1. run locally | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | yarn webdriver-start | 
					
						
							|  |  |  | yarn webdriver-http | 
					
						
							|  |  |  | yarn webdriver-test | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 2. run locally with sauce connect | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | // export SAUCE_USERNAME and SAUCE_ACCESS_KEY | 
					
						
							|  |  |  | export SAUCE_USERNAME=XXXX | 
					
						
							|  |  |  | export SAUCE_ACCESS_KEY=XXX | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY | 
					
						
							|  |  |  | yarn webdriver-http | 
					
						
							|  |  |  | yarn webdriver-sauce-test | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Releasing | 
					
						
							|  |  |  | --------- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | Releasing `zone.js` is a two step process. | 
					
						
							| 
									
										
										
										
											2019-08-01 13:41:37 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | 1. Create a PR which updates the changelog, and get it merged using normal merge process. | 
					
						
							|  |  |  | 2. Once the PR is merged check out the merge SHA of the PR and release `zone.js` from that SHA and tag it. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #### 1. Creating a PR for release
 | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2020-08-19 10:06:34 -07:00
										 |  |  | rm -rf node_modules && yarn install | 
					
						
							| 
									
										
										
										
											2020-08-15 08:47:09 +09:00
										 |  |  | export PREVIOUS_ZONE_TAG=`git tag -l 'zone.js-0.11.*' | tail -n1` | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | export VERSION=`(cd packages/zone.js; npm version patch --no-git-tag-version)` | 
					
						
							|  |  |  | export VERSION=${VERSION#v} | 
					
						
							|  |  |  | export TAG="zone.js-${VERSION}" | 
					
						
							|  |  |  | echo "Releasing zone.js version ${TAG}. Last release was ${PREVIOUS_ZONE_TAG}." | 
					
						
							|  |  |  | yarn gulp changelog:zonejs | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | Inspect the `packages/zone.js/CHANGELOG.md` for any issues and than commit it with this command. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Create a dry run build to make sure everything is ready. | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | yarn bazel --output_base=$(mktemp -d) run //packages/zone.js:npm_package.pack --workspace_status_command="echo BUILD_SCM_VERSION $VERSION" | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-27 10:29:01 +09:00
										 |  |  | If everything looks good, commit the changes and push them to your origin to create a PR. | 
					
						
							| 
									
										
										
										
											2019-07-25 23:50:39 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-01 00:56:07 +09:00
										 |  |  | ``` | 
					
						
							| 
									
										
										
										
											2020-10-27 10:29:01 +09:00
										 |  |  | git checkout -b "release_${TAG}" | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | git add packages/zone.js/CHANGELOG.md packages/zone.js/package.json | 
					
						
							| 
									
										
										
										
											2020-10-27 10:29:01 +09:00
										 |  |  | git commit -m "release: cut the ${TAG} release" | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | git push origin "release_${TAG}" | 
					
						
							| 
									
										
										
										
											2019-06-01 00:56:07 +09:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #### 2. Cutting a release
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Check out the SHA on master which has the changelog commit of the zone.js | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | git fetch upstream | 
					
						
							| 
									
										
										
										
											2020-08-19 10:06:34 -07:00
										 |  |  | git checkout upstream/master | 
					
						
							|  |  |  | rm -rf node_modules && yarn install | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | export VERSION=`(node -e "console.log(require('./packages/zone.js/package.json').version)")` | 
					
						
							|  |  |  | export TAG="zone.js-${VERSION}" | 
					
						
							|  |  |  | export SHA=`git log upstream/master --oneline -n 1000 | grep "release: cut the ${TAG} release" | cut -f 1 -d " "` | 
					
						
							| 
									
										
										
										
											2020-08-19 10:06:34 -07:00
										 |  |  | echo "Releasing '$VERSION' which will be tagged as '$TAG' from SHA '$SHA'." | 
					
						
							| 
									
										
										
										
											2020-10-27 10:29:01 +09:00
										 |  |  | git checkout ${SHA} | 
					
						
							| 
									
										
										
										
											2020-03-17 09:30:04 -07:00
										 |  |  | npm login --registry https://wombat-dressing-room.appspot.com | 
					
						
							|  |  |  | yarn bazel -- run --config=release -- //packages/zone.js:npm_package.publish --access public --tag latest | 
					
						
							| 
									
										
										
										
											2019-08-13 16:15:55 -07:00
										 |  |  | git tag ${TAG} ${SHA} | 
					
						
							|  |  |  | git push upstream ${TAG} | 
					
						
							|  |  |  | ``` |