Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 2aca286

Browse files
authored
build: fix gulp setup not working with node v12 (#1142)
See angular/angular#33348 Fixes #1079
1 parent 06268b8 commit 2aca286

File tree

8 files changed

+1395
-1882
lines changed

8 files changed

+1395
-1882
lines changed

.circleci/config.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# To validate changes, use an online parser, eg.
1010
# http://yaml-online-parser.appspot.com/
1111

12-
var_1: &docker_image angular/ngcontainer:0.7.0
12+
var_1: &docker_image circleci/node:12.9.1
1313
var_2: &cache_key v2-ng-layout-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.7.0
1414

1515
# Settings common to each job
@@ -53,14 +53,22 @@ var_8: &docker-firefox-image
5353
# TODO(devversion): Temporarily use a image that includes Firefox 62 because the
5454
# ngcontainer image does include an old Firefox version that does not support headless.
5555
# See the PR that fixes this: https://github.com/angular/angular/pull/26435
56-
- image: circleci/node:10.12-browsers
56+
- image: circleci/node:12.9.1-browsers
5757

5858
# Attaches the release output which has been stored in the workspace to the current job.
5959
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6060
var_9: &attach_release_output
6161
attach_workspace:
6262
at: dist/releases
6363

64+
# Anchor that can be used to download and install Yarn globally in the bash environment.
65+
var_10: &yarn_download
66+
run:
67+
name: "Downloading and installing Yarn"
68+
command: |
69+
touch $BASH_ENV
70+
curl -o- -L https://yarnpkg.com/install.sh | PROFILE=$BASH_ENV bash -s -- --version "1.19.1"
71+
6472
# -----------------------------
6573
# Container version of CircleCI
6674
# -----------------------------
@@ -80,6 +88,7 @@ jobs:
8088
steps:
8189
- *checkout_code
8290
- *restore_cache
91+
- *yarn_download
8392
- *yarn_install
8493

8594
- run: yarn gulp :publish:build-releases
@@ -97,6 +106,7 @@ jobs:
97106
steps:
98107
- *checkout_code
99108
- *restore_cache
109+
- *yarn_download
100110
- *yarn_install
101111

102112
- run: ./scripts/circleci/run-local-browser-tests.sh
@@ -113,6 +123,7 @@ jobs:
113123
steps:
114124
- *checkout_code
115125
- *restore_cache
126+
- *yarn_download
116127
- *yarn_install
117128

118129
- run: ./scripts/circleci/run-browserstack-tests.sh
@@ -132,6 +143,7 @@ jobs:
132143
steps:
133144
- *checkout_code
134145
- *restore_cache
146+
- *yarn_download
135147
- *yarn_install
136148

137149
- run: ./scripts/circleci/run-saucelabs-tests.sh
@@ -144,6 +156,7 @@ jobs:
144156
steps:
145157
- *checkout_code
146158
- *restore_cache
159+
- *yarn_download
147160
- *yarn_install
148161

149162
- run: yarn gulp ci:ssr
@@ -157,6 +170,7 @@ jobs:
157170
steps:
158171
- *checkout_code
159172
- *restore_cache
173+
- *yarn_download
160174
- *yarn_install
161175

162176
- run: yarn gulp ci:prerender
@@ -169,6 +183,7 @@ jobs:
169183
steps:
170184
- *checkout_code
171185
- *restore_cache
186+
- *yarn_download
172187
- *yarn_install
173188

174189
- run: yarn gulp ci:hw
@@ -181,6 +196,7 @@ jobs:
181196
steps:
182197
- *checkout_code
183198
- *restore_cache
199+
- *yarn_download
184200
- *yarn_install
185201

186202
- run: yarn gulp ci:aot
@@ -193,6 +209,7 @@ jobs:
193209
steps:
194210
- *checkout_code
195211
- *restore_cache
212+
- *yarn_download
196213
- *yarn_install
197214

198215
- run: yarn gulp ci:lint
@@ -206,6 +223,7 @@ jobs:
206223
steps:
207224
- *checkout_code
208225
- *restore_cache
226+
- *yarn_download
209227
- *yarn_install
210228

211229
- run: yarn gulp ci:build-release-packages
@@ -251,6 +269,7 @@ jobs:
251269

252270
- *checkout_code
253271
- *restore_cache
272+
- *yarn_download
254273
- *yarn_install
255274
- *attach_release_output
256275

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
},
1111
"license": "MIT",
1212
"engines": {
13-
"node": ">= 5.4.1"
13+
"node": "^12.0.0",
14+
"yarn": ">= 1.19.1"
1415
},
1516
"scripts": {
1617
"demo:serve": "gulp serve:devapp",
@@ -49,7 +50,7 @@
4950
"@angular/platform-browser-dynamic": "^8.0.0-rc.5",
5051
"@angular/platform-server": "^8.0.0-rc.5",
5152
"@angular/router": "^8.0.0-rc.5",
52-
"@google-cloud/storage": "^1.7.0",
53+
"@firebase/app-types": "^0.3.2",
5354
"@types/chalk": "^0.4.31",
5455
"@types/fs-extra": "^4.0.5",
5556
"@types/glob": "^5.0.33",
@@ -66,8 +67,6 @@
6667
"cli-color": "^1.4.0",
6768
"dgeni": "^0.4.10",
6869
"dgeni-packages": "^0.26.12",
69-
"firebase": "^5.5.8",
70-
"firebase-admin": "^5.13.1",
7170
"firebase-tools": "^4.2.1",
7271
"fs-extra": "^3.0.1",
7372
"git-semver-tags": "^2.0.2",
@@ -122,5 +121,9 @@
122121
"tslint": "^5.11.0",
123122
"typescript": "~3.4.5",
124123
"uglify-js": "^2.8.14"
124+
},
125+
"// Gulp": "Overwrite graceful-fs to a version that does not rely on the 'natives' package. This fixes gulp for >= 10.13, more information: #28213",
126+
"resolutions": {
127+
"**/graceful-fs": "4.2.2"
125128
}
126129
}

src/apps/demo-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@angular/animations": "file:../../../node_modules/@angular/animations",
1616
"@angular/cdk": "file:../../../node_modules/@angular/cdk",
17-
"@angular/cli": "^8.0.0-rc.4",
17+
"@angular/cli": "^8.3.17",
1818
"@angular/common": "file:../../../node_modules/@angular/common",
1919
"@angular/compiler": "file:../../../node_modules/@angular/compiler",
2020
"@angular/core": "file:../../../node_modules/@angular/core",
@@ -30,9 +30,9 @@
3030
"zone.js": "file:../../../node_modules/zone.js"
3131
},
3232
"devDependencies": {
33-
"@angular-devkit/build-angular": "~0.800.0-rc.4",
33+
"@angular-devkit/build-angular": "~0.803.17",
3434
"@angular/compiler-cli": "file:../../../node_modules/@angular/compiler-cli",
35-
"@angular/language-service": "^8.0.0-rc.5",
35+
"@angular/language-service": "^8.2.13",
3636
"@types/jasmine": "~2.8.3",
3737
"@types/jasminewd2": "~2.0.2",
3838
"@types/node": "~6.0.60",

src/apps/hello-world/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@angular/animations": "file:../../../node_modules/@angular/animations",
1616
"@angular/cdk": "file:../../../node_modules/@angular/cdk",
17-
"@angular/cli": "^8.0.0-rc.4",
17+
"@angular/cli": "^8.3.17",
1818
"@angular/common": "file:../../../node_modules/@angular/common",
1919
"@angular/compiler": "file:../../../node_modules/@angular/compiler",
2020
"@angular/core": "file:../../../node_modules/@angular/core",
@@ -29,9 +29,9 @@
2929
"zone.js": "file:../../../node_modules/zone.js"
3030
},
3131
"devDependencies": {
32-
"@angular-devkit/build-angular": "~0.800.0-rc.4",
32+
"@angular-devkit/build-angular": "~0.803.17",
3333
"@angular/compiler-cli": "file:../../../node_modules/@angular/compiler-cli",
34-
"@angular/language-service": "^8.0.0-rc.5",
34+
"@angular/language-service": "^8.2.13",
3535
"typescript": "file:../../../node_modules/typescript"
3636
}
3737
}

src/apps/universal-app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626
"@angular/platform-browser-dynamic": "file:../../../node_modules/@angular/platform-browser-dynamic",
2727
"@angular/platform-server": "file:../../../node_modules/@angular/platform-server",
2828
"@angular/router": "file:../../../node_modules/@angular/router",
29-
"@nguniversal/express-engine": "^8.0.0-rc.0",
29+
"@nguniversal/express-engine": "^8.1.1",
3030
"core-js": "^2.5.4",
3131
"express": "^4.16.2",
3232
"rxjs": "~6.5.2",
3333
"tslib": "^1.9.0",
3434
"zone.js": "~0.9.1"
3535
},
3636
"devDependencies": {
37-
"@angular-devkit/build-angular": "~0.800.0-rc.4",
38-
"@angular/cli": "~8.0.0-rc.4",
37+
"@angular-devkit/build-angular": "~0.803.17",
38+
"@angular/cli": "~8.3.17",
3939
"@angular/compiler-cli": "file:../../../node_modules/@angular/compiler-cli",
40-
"@angular/language-service": "~8.0.0-rc.5",
40+
"@angular/language-service": "~8.2.13",
4141
"@types/node": "~8.9.4",
4242
"@types/jasmine": "~2.8.8",
4343
"@types/jasminewd2": "~2.0.3",

src/lib/grid/auto/auto.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('grid auto parent directive', () => {
155155

156156
expectNativeEl(fixture).toHaveStyle({
157157
'display': 'grid',
158-
'grid-auto-flow': (platform.FIREFOX || platform.EDGE) ? 'row dense' : 'dense'
158+
'grid-auto-flow': platform.EDGE ? 'row dense' : 'dense'
159159
}, styler);
160160
});
161161

@@ -175,7 +175,7 @@ describe('grid auto parent directive', () => {
175175

176176
expectNativeEl(fixture).toHaveStyle({
177177
'display': 'grid',
178-
'grid-auto-flow': (platform.FIREFOX || platform.EDGE) ? 'row dense' : 'dense'
178+
'grid-auto-flow': platform.EDGE ? 'row dense' : 'dense'
179179
}, styler);
180180
});
181181

@@ -215,7 +215,7 @@ describe('grid auto parent directive', () => {
215215

216216
expectNativeEl(fixture).toHaveStyle({
217217
'display': 'grid',
218-
'grid-auto-flow': 'row dense'
218+
'grid-auto-flow': platform.FIREFOX ? 'dense' : 'row dense',
219219
}, styler);
220220
});
221221

@@ -235,7 +235,7 @@ describe('grid auto parent directive', () => {
235235

236236
expectNativeEl(fixture).toHaveStyle({
237237
'display': 'grid',
238-
'grid-auto-flow': 'row dense'
238+
'grid-auto-flow': platform.FIREFOX ? 'dense' : 'row dense'
239239
}, styler);
240240
});
241241

tools/gulp/tasks/universal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ task('prerender:bundle:rename', [], execTask(
5454

5555
/** Task that builds the universal-app in server mode */
5656
task('prerender:build', execTask(
57-
'npm', ['run', 'build:ssr:bundle'],
57+
'yarn', ['build:ssr:bundle'],
5858
{cwd: universalAppSource, failOnStderr: true}
5959
));
6060

6161
task('prerender:webpack', execTask(
62-
'npm', ['run', 'build:server'],
62+
'yarn', ['build:server'],
6363
{cwd: universalAppSource}
6464
));
6565

0 commit comments

Comments
 (0)