build(aio): remove unnecessary -- from yarn commands (#19565)

Essentially backports ffceae0a0 and f7199aa8c to 4.4.x.

PR Close #19565
This commit is contained in:
George Kalpakas
2017-10-05 00:38:33 +03:00
committed by Chuck Jazdzewski
parent c9f8718d2a
commit 3232125650
10 changed files with 119 additions and 119 deletions

View File

@ -30,26 +30,26 @@ Here are the most important tasks you might need to use:
* `yarn docs-lint` - check that the doc gen code follows our style rules. * `yarn docs-lint` - check that the doc gen code follows our style rules.
* `yarn docs-test` - run the unit tests for the doc generation code. * `yarn docs-test` - run the unit tests for the doc generation code.
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `-- --local` to use your local version of Angular contained in the "dist" folder. * `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `--local` to use your local version of Angular contained in the "dist" folder.
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`. * `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
* `yarn generate-plunkers` - generate the plunker files that are used by the `live-example` tags in the docs. * `yarn generate-plunkers` - generate the plunker files that are used by the `live-example` tags in the docs.
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs. * `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
* `yarn example-e2e` - run all e2e tests for examples * `yarn example-e2e` - run all e2e tests for examples
- `yarn example-e2e -- --setup` - force webdriver update & other setup, then run tests - `yarn example-e2e --setup` - force webdriver update & other setup, then run tests
- `yarn example-e2e -- --filter=foo` - limit e2e tests to those containing the word "foo" - `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
- `yarn example-e2e -- --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder - `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
* `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer. * `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
## Using ServiceWorker locally ## Using ServiceWorker locally
Since abb36e3cb, running `yarn start -- --prod` will no longer set up the ServiceWorker, which Since abb36e3cb, running `yarn start --prod` will no longer set up the ServiceWorker, which
would require manually running `yarn sw-manifest` and `yarn sw-copy` (something that is not possible would require manually running `yarn sw-manifest` and `yarn sw-copy` (something that is not possible
with webpack serving the files from memory). with webpack serving the files from memory).
If you want to test ServiceWorker locally, you can use `yarn build` and serve the files in `dist/` If you want to test ServiceWorker locally, you can use `yarn build` and serve the files in `dist/`
with `yarn http-server -- dist -p 4200`. with `yarn http-server dist -p 4200`.
For more details see #16745. For more details see #16745.
@ -117,7 +117,7 @@ yarn serve-and-sync
``` ```
* Open a browser at https://localhost:4200/ and navigate to the document on which you want to work. * Open a browser at https://localhost:4200/ and navigate to the document on which you want to work.
You can automatically open the browser by using `yarn start -- -o` in the first terminal. You can automatically open the browser by using `yarn start -o` in the first terminal.
* Make changes to the page's associated doc or example files. Every time a file is saved, the doc will * Make changes to the page's associated doc or example files. Every time a file is saved, the doc will
be regenerated, the app will rebuild and the page will reload. be regenerated, the app will rebuild and the page will reload.

View File

@ -25,7 +25,7 @@ Here are a few essential commands for guide page authors.
1. `yarn setup` — installs packages; builds docs, plunkers, and zips. 1. `yarn setup` — installs packages; builds docs, plunkers, and zips.
1. `yarn docs-watch -- --watch-only` — watches for saved content changes and refreshes the browser. The (optional) `--watch-only` flag skips the initial docs rebuild. 1. `yarn docs-watch --watch-only` — watches for saved content changes and refreshes the browser. The (optional) `--watch-only` flag skips the initial docs rebuild.
1. `yarn start` — starts the doc viewer application so you can see your local changes in the browser. 1. `yarn start` — starts the doc viewer application so you can see your local changes in the browser.

View File

@ -26,7 +26,7 @@
"setup-local": "yarn aio-use-local && yarn example-use-local", "setup-local": "yarn aio-use-local && yarn example-use-local",
"postsetup-local": "yarn postsetup", "postsetup-local": "yarn postsetup",
"pretest-pwa-score-localhost": "yarn build", "pretest-pwa-score-localhost": "yarn build",
"test-pwa-score-localhost": "concurrently --kill-others --success first \"http-server dist -p 4200 --silent\" \"yarn test-pwa-score -- http://localhost:4200 90\"", "test-pwa-score-localhost": "concurrently --kill-others --success first \"http-server dist -p 4200 --silent\" \"yarn test-pwa-score http://localhost:4200 90\"",
"test-pwa-score": "node scripts/test-pwa-score", "test-pwa-score": "node scripts/test-pwa-score",
"example-e2e": "yarn example-check-local && node ./tools/examples/run-example-e2e", "example-e2e": "yarn example-check-local && node ./tools/examples/run-example-e2e",
"example-lint": "tslint -c \"content/examples/tslint.json\" \"content/examples/**/*.ts\" -e \"content/examples/styleguide/**/*.avoid.ts\"", "example-lint": "tslint -c \"content/examples/tslint.json\" \"content/examples/**/*.ts\" -e \"content/examples/styleguide/**/*.avoid.ts\"",

View File

@ -51,6 +51,6 @@ readonly relevantChangedFilesCount=$(git diff --name-only $TRAVIS_COMMIT_RANGE |
# Run PWA-score tests (unless the deployment is not public yet; # Run PWA-score tests (unless the deployment is not public yet;
# i.e. it could not be automatically verified). # i.e. it could not be automatically verified).
if [[ $httpCode -ne 202 ]] && [[ "$isHidden" != "true" ]]; then if [[ $httpCode -ne 202 ]] && [[ "$isHidden" != "true" ]]; then
yarn test-pwa-score -- "$DEPLOYED_URL" "$MIN_PWA_SCORE" yarn test-pwa-score "$DEPLOYED_URL" "$MIN_PWA_SCORE"
fi fi
) )

View File

@ -87,7 +87,7 @@ fi
cd "`dirname $0`/.." cd "`dirname $0`/.."
# Build the app # Build the app
yarn build -- --env=$deployEnv yarn build --env=$deployEnv
# Include any mode-specific files # Include any mode-specific files
cp -rf src/extra-files/$deployEnv/. dist/ cp -rf src/extra-files/$deployEnv/. dist/
@ -100,5 +100,5 @@ fi
firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$firebaseToken" firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$firebaseToken"
# Run PWA-score tests # Run PWA-score tests
yarn test-pwa-score -- "$deployedUrl" "$MIN_PWA_SCORE" yarn test-pwa-score "$deployedUrl" "$MIN_PWA_SCORE"
) )

View File

@ -106,7 +106,7 @@ function runE2eTests(appDir, outputFile) {
const config = loadExampleConfig(appDir); const config = loadExampleConfig(appDir);
const appBuildSpawnInfo = spawnExt('yarn', [config.build], { cwd: appDir }); const appBuildSpawnInfo = spawnExt('yarn', [config.build], { cwd: appDir });
const appRunSpawnInfo = spawnExt('yarn', [config.run, '--', '-s'], { cwd: appDir }, true); const appRunSpawnInfo = spawnExt('yarn', [config.run, '-s'], { cwd: appDir }, true);
let run = runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile); let run = runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
@ -125,12 +125,12 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
fs.appendFileSync(outputFile, emsg); fs.appendFileSync(outputFile, emsg);
return Promise.reject(emsg); return Promise.reject(emsg);
}) })
.then(function (data) { .then(function () {
let transpileError = false; let transpileError = false;
// Start protractor. // Start protractor.
const spawnInfo = spawnExt('yarn', ['protractor', '--', const spawnInfo = spawnExt('yarn', ['protractor',
PROTRACTOR_CONFIG_FILENAME, PROTRACTOR_CONFIG_FILENAME,
`--specs=${specFilename}`, `--specs=${specFilename}`,
'--params.appDir=' + appDir, '--params.appDir=' + appDir,
@ -140,19 +140,19 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
spawnInfo.proc.stderr.on('data', function (data) { spawnInfo.proc.stderr.on('data', function (data) {
transpileError = transpileError || /npm ERR! Exit status 100/.test(data.toString()); transpileError = transpileError || /npm ERR! Exit status 100/.test(data.toString());
}); });
return spawnInfo.promise.catch(function (err) { return spawnInfo.promise.catch(function () {
if (transpileError) { if (transpileError) {
const emsg = `${specFilename} failed to transpile.\n\n`; const emsg = `${specFilename} failed to transpile.\n\n`;
console.log(emsg); console.log(emsg);
fs.appendFileSync(outputFile, emsg); fs.appendFileSync(outputFile, emsg);
} }
return Promise.reject(emsg); return Promise.reject();
}); });
}) })
.then( .then(
function () { return finish(true); }, function () { return finish(true); },
function () { return finish(false); } function () { return finish(false); }
) );
function finish(ok) { function finish(ok) {
// Ugh... proc.kill does not work properly on windows with child processes. // Ugh... proc.kill does not work properly on windows with child processes.
@ -202,7 +202,7 @@ function reportStatus(status, outputFile) {
function spawnExt(command, args, options, ignoreClose = false) { function spawnExt(command, args, options, ignoreClose = false) {
let proc; let proc;
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
let descr = command + " " + args.join(' '); let descr = command + ' ' + args.join(' ');
console.log('running: ' + descr); console.log('running: ' + descr);
try { try {
proc = xSpawn.spawn(command, args, options); proc = xSpawn.spawn(command, args, options);

View File

@ -23,11 +23,11 @@ function next(error) {
let p = Promise.resolve(); let p = Promise.resolve();
if (process.argv.indexOf('--watch-only') === -1) { if (process.argv.indexOf('--watch-only') === -1) {
console.log('==================================================================='); console.log('================================================================');
console.log('Running initial doc generation'); console.log('Running initial doc generation');
console.log('-------------------------------------------------------------------'); console.log('----------------------------------------------------------------');
console.log('Skip the full doc-gen by running: `yarn docs-watch -- --watch-only`'); console.log('Skip the full doc-gen by running: `yarn docs-watch --watch-only`');
console.log('==================================================================='); console.log('================================================================');
const {Dgeni} = require('dgeni'); const {Dgeni} = require('dgeni');
var dgeni = new Dgeni([require('../angular.io-package')]); var dgeni = new Dgeni([require('../angular.io-package')]);
p = dgeni.generate(); p = dgeni.generate();

View File

@ -32,7 +32,7 @@ if [[ ${CI_MODE:-} == "aio" ]]; then
([[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]) && ([[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]) &&
[[ $TRAVIS_PULL_REQUEST != "false" ]]; then [[ $TRAVIS_PULL_REQUEST != "false" ]]; then
travisFoldStart "deploy.aio.pr-preview" travisFoldStart "deploy.aio.pr-preview"
yarn deploy-preview -- --skip-build yarn deploy-preview --skip-build
travisFoldEnd "deploy.aio.pr-preview" travisFoldEnd "deploy.aio.pr-preview"
fi fi
) )

View File

@ -13,6 +13,6 @@ source ${thisDir}/_travis-fold.sh
# Run example e2e tests # Run example e2e tests
travisFoldStart "test.aio.example-e2e" travisFoldStart "test.aio.example-e2e"
yarn example-e2e -- --setup --local --shard=${AIO_SHARD}/2 yarn example-e2e --setup --local --shard=${AIO_SHARD}/2
travisFoldEnd "test.aio.example-e2e" travisFoldEnd "test.aio.example-e2e"
) )

View File

@ -20,7 +20,7 @@ source ${thisDir}/_travis-fold.sh
# Run unit tests # Run unit tests
travisFoldStart "test.aio.unit" travisFoldStart "test.aio.unit"
yarn test -- --single-run yarn test --single-run
travisFoldEnd "test.aio.unit" travisFoldEnd "test.aio.unit"