Skip to content

Commit

Permalink
Sdk Version fix (#58)
Browse files Browse the repository at this point in the history
* Sending real sdk version from the SDK

* clientversion

* file name
  • Loading branch information
laliconfigcat authored May 31, 2022
1 parent a5ae664 commit f341b8e
Show file tree
Hide file tree
Showing 7 changed files with 4,822 additions and 193 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ webpack.config.js
deploy.sh
update-samples.sh
.github/
gulpfile.js
34 changes: 34 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var gulp = require('gulp');
var replace = require('gulp-replace');
var fs = require('fs');

const OUT_DIST = 'dist';
const OUT_ESM = 'lib/esm';
const OUT_LEGACY = 'lib';

function updateVersion(dst, file){

const VERSION = JSON.parse(fs.readFileSync('./package.json')).version;

return gulp.src(dst + '/' + file)
.pipe(replace('CONFIGCAT_SDK_VERSION', VERSION))
.pipe(gulp.dest(dst));
}

function updateVersion_dist(){
return updateVersion(OUT_DIST, 'configcat.js');
}

function updateVersion_esm(){
return updateVersion(OUT_ESM, 'Version.js');
}

function updateVersion_legacy(){
return updateVersion(OUT_LEGACY, 'Version.js');
}

exports.tsc = gulp.series(
gulp.parallel(updateVersion_esm, updateVersion_legacy));

exports.webpack = gulp.series(
gulp.parallel(updateVersion_dist));
Loading

0 comments on commit f341b8e

Please sign in to comment.