Skip to content

Commit 10b6694

Browse files
Update l10n gulpfile comments
1 parent 09208b4 commit 10b6694

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

gulpfile.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ const ALL_LOCALES = ['ar-XB', 'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en',
6363
'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi', 'zh-CN',
6464
'zh-TW'];
6565

66+
// Default arguments to pass into Closure Compiler.
67+
const COMPILER_DEFAULT_ARGS = {
68+
compilation_level: OPTIMIZATION_LEVEL,
69+
language_out: 'ES5'
70+
};
71+
72+
// The external dependencies needed by FirebaseUI.
73+
const JS_DEPS = [
74+
'node_modules/material-design-lite/src/mdlComponentHandler.js',
75+
'node_modules/material-design-lite/src/button/button.js',
76+
'node_modules/material-design-lite/src/progress/progress.js',
77+
'node_modules/material-design-lite/src/spinner/spinner.js',
78+
'node_modules/material-design-lite/src/textfield/textfield.js',
79+
'node_modules/dialog-polyfill/dialog-polyfill.js'
80+
];
81+
6682
// Compiles the Closure templates into JavaScript.
6783
gulp.task('build-soy', () => new Promise((resolve, reject) => {
6884
closureBuilder.build({
@@ -80,12 +96,6 @@ gulp.task('build-soy', () => new Promise((resolve, reject) => {
8096
}, resolve);
8197
}));
8298

83-
// Default arguments to pass into Closure Compiler.
84-
const COMPILER_DEFAULT_ARGS = {
85-
compilation_level: OPTIMIZATION_LEVEL,
86-
language_out: 'ES5'
87-
};
88-
8999
/**
90100
* Invokes Closure Compiler.
91101
* @param {!Array<string>} srcs The JS sources to compile.
@@ -186,16 +196,6 @@ function buildFirebaseUiJs(locale) {
186196
repeatTaskForAllLocales('build-firebaseui-js-$', ['build-soy'],
187197
buildFirebaseUiJs);
188198

189-
// The external dependencies needed by FirebaseUI.
190-
const JS_DEPS = [
191-
'node_modules/material-design-lite/src/mdlComponentHandler.js',
192-
'node_modules/material-design-lite/src/button/button.js',
193-
'node_modules/material-design-lite/src/progress/progress.js',
194-
'node_modules/material-design-lite/src/spinner/spinner.js',
195-
'node_modules/material-design-lite/src/textfield/textfield.js',
196-
'node_modules/dialog-polyfill/dialog-polyfill.js'
197-
];
198-
199199
/**
200200
* Concatenates the core FirebaseUI JS with its external dependencies, and
201201
* cleans up comments and whitespace in the dependencies.
@@ -234,15 +234,20 @@ function makeDefaultFile(fileName) {
234234
}
235235
}
236236

237+
// Builds the final JS file for all supported languages.
237238
gulp.task('build-all-js', buildJsTasks, () => makeDefaultFile('firebaseui'));
239+
240+
// Builds the final JS file for the default language.
238241
gulp.task('build-js', ['build-js-' + DEFAULT_LOCALE],
239242
() => makeDefaultFile('firebaseui'));
240243

241-
// Bundles the FirebaseUI JS with its dependencies as a NPM module.
244+
// Bundles the FirebaseUI JS with its dependencies as a NPM module. This builds
245+
// the NPM module for all languages.
242246
repeatTaskForAllLocales(
243247
'build-npm-$', ['build-firebaseui-js-$'],
244248
(locale) => concatWithDeps(locale, 'npm', NPM_MODULE_WRAPPER));
245249

250+
// Builds the NPM module for the default language.
246251
gulp.task('build-npm', ['build-npm-' + DEFAULT_LOCALE],
247252
() => makeDefaultFile('npm'));
248253

@@ -271,8 +276,10 @@ function buildCss(isRtl) {
271276
.pipe(gulp.dest(DEST_DIR));
272277
}
273278

274-
// Concatenates and minifies the CSS sources.
279+
// Concatenates and minifies the CSS sources for LTR languages.
275280
gulp.task('build-css', () => buildCss(false));
281+
282+
// Concatenates and minifies the CSS sources for RTL languages.
276283
gulp.task('build-css-rtl', () => buildCss(true));
277284

278285
// Creates a webserver that serves all files from the root of the package.
@@ -285,11 +292,11 @@ gulp.task('serve', () => {
285292
// Deletes intermediate files.
286293
gulp.task('clean', () => fse.remove(TMP_DIR));
287294

288-
// Executes the basic tasks.
295+
// Executes the basic tasks for the default language.
289296
gulp.task('default', ['build-js', 'build-npm', 'build-css', 'build-css-rtl'],
290297
() => gulp.start('clean'));
291298

292-
// Builds everything.
299+
// Builds everything (JS for all languages, both LTR and RTL CSS).
293300
gulp.task('build-all',
294301
['build-all-js', 'build-npm', 'build-css', 'build-css-rtl'],
295302
() => gulp.start('clean'));

0 commit comments

Comments
 (0)