Skip to content

Commit e7b38a3

Browse files
christopherandersoncleemullins
authored andcommitted
build: add preview package support (#1490) (#1491)
* build: add preview package support * build: tweak logging * build: get preview version from argv * build: handle previewVersion not being set * build: streaming is GA now (cherry picked from commit ac06ba2)
1 parent b231a34 commit e7b38a3

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build-docs": "lerna run build-docs",
1515
"eslint": "eslint ./libraries/*/src/*.ts ./libraries/*/src/**/*.ts",
1616
"eslint-fix": "eslint ./libraries/*/src/*.ts ./libraries/*/src/**/*.ts --fix",
17-
"set-dependency-versions": "node tools/util/updateDependenciesInPackageJsons.js ./libraries ${Version} botframework-expressions botbuilder-lg botframework-streaming botbuilder botbuilder-ai botbuilder-dialogs botbuilder-core botbuilder-applicationinsights botbuilder-testing botframework-connector botframework-config botframework-schema testbot && node tools/util/updateDependenciesInPackageJsons.js ./transcripts ${Version} botbuilder botbuilder-ai botbuilder-dialogs",
17+
"set-dependency-versions": "node tools/util/updateDependenciesInPackageJsons.js ./libraries ${Version} ${PreviewPackageVersion} botframework-expressions botbuilder-lg botframework-streaming botbuilder botbuilder-ai botbuilder-dialogs botbuilder-core botbuilder-applicationinsights botbuilder-testing botframework-connector botframework-config botframework-schema testbot && node tools/util/updateDependenciesInPackageJsons.js ./transcripts ${Version} botbuilder botbuilder-ai botbuilder-dialogs",
1818
"update-versions": "lerna run set-version && npm run set-dependency-versions"
1919
},
2020
"dependencies": {

tools/util/updateDependenciesInPackageJsons.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ console.log('Started ' + (new Date()));
77
var myArgs = process.argv.slice(2);
88
var rootPath = myArgs[0];
99
var newVersion = myArgs[1];
10-
var dependencies = myArgs.slice(2);
10+
var previewVersion = myArgs[2] || process.env.PreviewPackageVersion;
11+
// This is a hack to deal with the inconsistencies between CI and daily builds right now
12+
if(previewVersion === 'botframework-expressions') {
13+
previewVersion = undefined;
14+
}
15+
var previewPackages = {
16+
'botbuilder-lg': true,
17+
'botframework-expressions': true
18+
}
19+
var dependencies = myArgs.slice(previewVersion ? 3 : 2);
1120
console.log('newVersion =', newVersion);
21+
console.log('previewVersion = ' + previewVersion);
1222
console.log('dependencies =');
1323
console.log(dependencies);
24+
console.log('Preview packages: ');
25+
console.log(JSON.stringify(previewPackages, null, ' '));
1426

1527
// Update versions for specified dependencies in package.json file
1628
function updateDependencies(filePath) {
@@ -20,10 +32,13 @@ function updateDependencies(filePath) {
2032
return console.log(err);
2133
}
2234

35+
console.log('Updating file: ' + filePath);
36+
2337
var result = '';
2438
dependencies.forEach(function (dependency) {
25-
var findString = new RegExp('("dependencies":)(.+?)("' + dependency + '":\\s*")([^\/"]+)', "gms")
26-
var replaceString = '$1$2$3' + newVersion;
39+
var findString = new RegExp('("dependencies":)(.+?)("' + dependency + '":\\s*")([^\/"]+)', 'gms')
40+
var replaceString = '$1$2$3' + ((previewVersion && previewPackages[dependency]) ? previewVersion : newVersion);
41+
console.log('Replace string: ' + replaceString);
2742
result = data.replace(findString, replaceString);
2843
data = result;
2944
});

0 commit comments

Comments
 (0)