Skip to content

Commit

Permalink
Merge pull request #47 from m-lab/sandbox-roberto-update-ndt7-client
Browse files Browse the repository at this point in the history
Update ndt7-js client to v0.0.5
  • Loading branch information
robertodauria authored May 25, 2021
2 parents 7b7d75f + 9d9e55c commit 51b05c4
Show file tree
Hide file tree
Showing 4 changed files with 1,193 additions and 433 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 10
- 12
script:
- npm install -g firebase-tools gulp
- gulp copy_libs
Expand Down
31 changes: 22 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
var gulp = require('gulp');
var inject = require('gulp-inject');
var gettext = require('gulp-angular-gettext');
var npmDist = require('gulp-npm-dist');

gulp.task('inject', ['translations'], function() {
function inject(cb) {
gulp.src('www/index.html')
.pipe(inject(gulp.src('www/translations/scripts/*.js', {read: false}), {relative: true, name: 'translations'}))
.pipe(gulp.dest('www'));
});

gulp.task('translations', ['pot'], function () {
cb();
};

function translations(cb) {
return gulp.src('translations/languages/*.po')
.pipe(gettext.compile())
.pipe(gulp.dest('app/assets/translations/'));
});
cb();
};

gulp.task('pot', function () {
function pot(cb) {
return gulp.src([
'app/measure/*.js',
'app/measure/*.html',
Expand All @@ -25,10 +27,12 @@ gulp.task('pot', function () {
// options to pass to angular-gettext-tools...
}))
.pipe(gulp.dest('translations/source'));
});

cb();
};

// Copy dependencies to ./public/libs/
gulp.task('copy_libs', function() {
function copy_libs(cb) {
// Copy all the libraries under @bower_components to libraries/.
gulp.src([
"./node_modules/@bower_components/**/*.**",
Expand All @@ -48,4 +52,13 @@ gulp.task('copy_libs', function() {
"./node_modules/re-tree/re-tree.min.js",
])
.pipe(gulp.dest('./app/libraries'));
});

cb();
};

exports.translations = gulp.series(pot, translations);
exports.inject = gulp.series(translations, inject);
exports.copy_libs = copy_libs;
exports.pot = pot;

exports.default = copy_libs;
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"license": "MIT",
"devDependencies": {
"bower": "^1.8.8",
"gulp": "^3.9.1",
"gulp-angular-gettext": "^2.1.0",
"gulp-inject": "^4.1.0",
"gulp-npm-dist": "^1.0.2",
"gulp": "^4.0.2",
"gulp-angular-gettext": "^2.3.0",
"gulp-inject": "^5.0.5",
"gulp-serve": "^1.4.0",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
Expand All @@ -34,7 +33,7 @@
"@bower_components/html5-boilerplate": "h5bp/html5-boilerplate#^5.3.0",
"@bower_components/jquery": "jquery/jquery-dist#3.0.0",
"@bower_components/skel": "n33/skel#~3.0.1",
"@m-lab/ndt7": "0.0.5-beta.0",
"@m-lab/ndt7": "0.0.5",
"ng-device-detector": "^5.1.4",
"re-tree": "^0.1.7",
"ua-device-detector": "^1.1.8"
Expand Down
Loading

0 comments on commit 51b05c4

Please sign in to comment.