enablement-build-monorepo-version 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +14 -13
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -119,7 +119,8 @@ async function main(options) {
119
119
  const scanlist = [];
120
120
  const changedFolders = [];
121
121
 
122
- options.children.split(',').forEach((packageFolder)=>{
122
+ let children = options.children.replace(/\s/g,",");
123
+ children.split(',').forEach((packageFolder)=>{
123
124
  scanlist.push(new Promise((resolve, reject) => {
124
125
  hashElement(path.join(options.prefixPath,packageFolder), hashOptions).then(async hash => {
125
126
  // calculate latest folder hashes
@@ -166,11 +167,13 @@ async function main(options) {
166
167
  }
167
168
 
168
169
  let results = await compare(packageFolder, previous,current,dependencies,options);
169
- if(options.debug) console.log(JSON.stringify(results));
170
+ if(options.debug) console.log("COMPARE",JSON.stringify(results));
170
171
 
171
172
  for(let i=0;i<results.length;i++) {
172
- if(results[i].value.changed)
173
- changeList.push(results[i].value.name)
173
+ if(results[i].value.changed) {
174
+ changeList.push(results[i].value.name);
175
+ if(changedFolders.indexOf(results[i].value.packageFolder)<0) changedFolders.push(results[i].value.packageFolder);
176
+ }
174
177
  }
175
178
 
176
179
  for(let i=0;i<results.length;i++) {
@@ -180,9 +183,6 @@ async function main(options) {
180
183
  let safeName = results[i].value.name;
181
184
  safeName = safeName.replace(/-/g, '').replace(/_/g, '').replace(/\./g, '');
182
185
  if(results[i].value.changed) {
183
- if(changedFolders.indexOf(packageFolder)<0) {
184
- changedFolders.push(packageFolder);
185
- }
186
186
  console.log(`##vso[task.setvariable variable=${safeName};isoutput=true;]${results[i].value.version}`);
187
187
  if(options.saveVersion) {
188
188
  scanlist.push(updateVersion(packageFolder,results[i].value.name,results[i].value.version));
@@ -237,16 +237,17 @@ async function main(options) {
237
237
  }));
238
238
  });
239
239
 
240
- if(changedFolders.length>0) {
241
- console.log(`FOLDERS CHANGED - ${JSON.stringify(changedFolders)}`);
242
- changedFolders.map((packageFolder)=>{
243
- console.log(`##vso[task.setvariable variable=${packageFolder};isoutput=true]true`);
244
- });
245
- }
246
240
  Promise.all(scanlist).then(()=>{
247
241
  if(options.changed) {
248
242
  console.log(`CHANGED - ${JSON.stringify(changeList)}`);
249
243
  console.log(`##vso[task.setvariable variable=changed;isoutput=true]${JSON.stringify(changeList)}`);
244
+
245
+ if(changedFolders.length>0) {
246
+ if(options.debug) console.log(`FOLDERS CHANGED - ${JSON.stringify(changedFolders)}`);
247
+ changedFolders.map((packageFolder)=>{
248
+ console.log(`##vso[task.setvariable variable=${packageFolder};isoutput=true]true`);
249
+ });
250
+ }
250
251
  }
251
252
  mainResolve("DONE");
252
253
  },mainreject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enablement-build-monorepo-version",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "This detects changes in the children packages of a monorepo.",
5
5
  "type": "module",
6
6
  "module": "./index.mjs",