Skip to content

Commit

Permalink
build: move cldr dependency to npm (angular#33634)
Browse files Browse the repository at this point in the history
PR Close angular#33634
  • Loading branch information
josephperrott authored and atscott committed Nov 7, 2019
1 parent bca4376 commit 42d3949
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 226 deletions.
1 change: 0 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ gulp.task('changelog', loadTask('changelog'));
gulp.task('changelog:zonejs', loadTask('changelog-zonejs'));
gulp.task('check-env', () => {/* this is a noop because the env test ran already above */});
gulp.task('cldr:extract', loadTask('cldr', 'extract'));
gulp.task('cldr:download', loadTask('cldr', 'download'));
gulp.task('cldr:gen-closure-locale', loadTask('cldr', 'closure'));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"check-side-effects": "0.0.21",
"clang-format": "1.0.41",
"cldr": "4.10.0",
"cldr-data-downloader": "0.3.2",
"cldr-data": "33.0.0",
"cldrjs": "0.5.0",
"conventional-changelog": "^2.0.3",
"cors": "2.8.4",
Expand Down
13 changes: 0 additions & 13 deletions tools/gulp-tasks/cldr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/

const path = require('path');
const fs = require('fs');

module.exports = {
extract: gulp => done => {
if (!fs.existsSync(path.join(__dirname, 'cldr/cldr-data'))) {
throw new Error(`You must run "gulp cldr:download" before you can extract the data`);
}
const extract = require('./cldr/extract');
return extract(gulp, done);
},

download: gulp => done => {
const cldrDownloader = require('cldr-data-downloader');
const cldrDataFolder = path.join(__dirname, 'cldr/cldr-data');
if (!fs.existsSync(cldrDataFolder)) {
fs.mkdirSync(cldrDataFolder);
}
cldrDownloader(path.join(__dirname, 'cldr/cldr-urls.json'), cldrDataFolder, done);
},

closure: gulp => done => {
const {RELATIVE_I18N_DATA_FOLDER} = require('./cldr/extract');
// tslint:disable-next-line:no-console
Expand Down
84 changes: 0 additions & 84 deletions tools/gulp-tasks/cldr/cldr-data.js

This file was deleted.

22 changes: 0 additions & 22 deletions tools/gulp-tasks/cldr/cldr-urls.json

This file was deleted.

2 changes: 1 addition & 1 deletion tools/gulp-tasks/cldr/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const HEADER = `/**

// tslint:disable:no-console
module.exports = (gulp, done) => {
const cldrData = require('./cldr-data');
const cldrData = require('cldr-data');
const LOCALES = cldrData.availableLocales;

console.log(`Loading CLDR data...`);
Expand Down
Loading

0 comments on commit 42d3949

Please sign in to comment.