pxt-core 7.5.26 → 7.5.27

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.
package/built/pxt.js CHANGED
@@ -104499,6 +104499,7 @@ var pxt;
104499
104499
  });
104500
104500
  res.generatedFiles["/codal.json"] = JSON.stringify(codalJson, null, 4) + "\n";
104501
104501
  pxt.debug(`codal.json: ${res.generatedFiles["/codal.json"]}`);
104502
+ res.codal = codalJson;
104502
104503
  }
104503
104504
  else if (isPlatformio) {
104504
104505
  const iniLines = compileService.platformioIni.slice();
@@ -113087,20 +113088,18 @@ var ts;
113087
113088
  function computeUsedParts(resp, filter) {
113088
113089
  if (!resp.usedSymbols || !pxt.appTarget.simulator || !pxt.appTarget.simulator.parts)
113089
113090
  return [];
113091
+ const parseParts = (partsRaw, ps) => {
113092
+ if (partsRaw) {
113093
+ const partsSplit = partsRaw.split(/[ ,]+/g);
113094
+ ps.push(...partsSplit.filter(p => !!p && ps.indexOf(p) < 0));
113095
+ }
113096
+ };
113090
113097
  let parts = [];
113098
+ let hiddenParts = [];
113091
113099
  Object.keys(resp.usedSymbols).forEach(symbol => {
113092
- let info = resp.usedSymbols[symbol];
113093
- if (info && info.attributes.parts) {
113094
- let partsRaw = info.attributes.parts;
113095
- if (partsRaw) {
113096
- let partsSplit = partsRaw.split(/[ ,]+/);
113097
- partsSplit.forEach(p => {
113098
- if (0 < p.length && parts.indexOf(p) < 0) {
113099
- parts.push(p);
113100
- }
113101
- });
113102
- }
113103
- }
113100
+ const info = resp.usedSymbols[symbol];
113101
+ parseParts(info === null || info === void 0 ? void 0 : info.attributes.parts, parts);
113102
+ parseParts(info === null || info === void 0 ? void 0 : info.attributes.hiddenParts, hiddenParts);
113104
113103
  });
113105
113104
  if (filter) {
113106
113105
  const builtinParts = pxt.appTarget.simulator.boardDefinition.onboardComponents;
@@ -113113,6 +113112,8 @@ var ts;
113113
113112
  }
113114
113113
  }
113115
113114
  }
113115
+ // apply hidden parts filter
113116
+ parts = parts.filter(p => hiddenParts.indexOf(p) < 0);
113116
113117
  //sort parts (so breadboarding layout is stable w.r.t. code ordering)
113117
113118
  parts.sort();
113118
113119
  parts = parts.reverse(); //not strictly necessary, but it's a little
@@ -130915,10 +130916,15 @@ var ts;
130915
130916
  if (pxtc.target.isNative)
130916
130917
  bin.procs = bin.procs.filter(p => p.inlineBody && !p.info.usedAsIface && !p.info.usedAsValue ? false : true);
130917
130918
  if (opts.target.isNative) {
130918
- if (opts.extinfo.yotta)
130919
- bin.writeFile("yotta.json", JSON.stringify(opts.extinfo.yotta, null, 2));
130920
- if (opts.extinfo.platformio)
130921
- bin.writeFile("platformio.json", JSON.stringify(opts.extinfo.platformio, null, 2));
130919
+ // collect various output files from all variants
130920
+ [...(opts.otherMultiVariants || []), opts].forEach(({ extinfo }) => {
130921
+ if (extinfo.yotta)
130922
+ bin.writeFile("yotta.json", JSON.stringify(extinfo.yotta, null, 2));
130923
+ if (extinfo.codal)
130924
+ bin.writeFile("codal.json", JSON.stringify(extinfo.codal, null, 2));
130925
+ if (extinfo.platformio)
130926
+ bin.writeFile("platformio.json", JSON.stringify(extinfo.platformio, null, 2));
130927
+ });
130922
130928
  if (opts.target.nativeType == pxtc.NATIVE_TYPE_VM)
130923
130929
  pxtc.vmEmit(bin, opts);
130924
130930
  else
@@ -9862,10 +9862,15 @@ var ts;
9862
9862
  if (pxtc.target.isNative)
9863
9863
  bin.procs = bin.procs.filter(p => p.inlineBody && !p.info.usedAsIface && !p.info.usedAsValue ? false : true);
9864
9864
  if (opts.target.isNative) {
9865
- if (opts.extinfo.yotta)
9866
- bin.writeFile("yotta.json", JSON.stringify(opts.extinfo.yotta, null, 2));
9867
- if (opts.extinfo.platformio)
9868
- bin.writeFile("platformio.json", JSON.stringify(opts.extinfo.platformio, null, 2));
9865
+ // collect various output files from all variants
9866
+ [...(opts.otherMultiVariants || []), opts].forEach(({ extinfo }) => {
9867
+ if (extinfo.yotta)
9868
+ bin.writeFile("yotta.json", JSON.stringify(extinfo.yotta, null, 2));
9869
+ if (extinfo.codal)
9870
+ bin.writeFile("codal.json", JSON.stringify(extinfo.codal, null, 2));
9871
+ if (extinfo.platformio)
9872
+ bin.writeFile("platformio.json", JSON.stringify(extinfo.platformio, null, 2));
9873
+ });
9869
9874
  if (opts.target.nativeType == pxtc.NATIVE_TYPE_VM)
9870
9875
  pxtc.vmEmit(bin, opts);
9871
9876
  else
package/built/pxtlib.js CHANGED
@@ -6813,6 +6813,7 @@ var pxt;
6813
6813
  });
6814
6814
  res.generatedFiles["/codal.json"] = JSON.stringify(codalJson, null, 4) + "\n";
6815
6815
  pxt.debug(`codal.json: ${res.generatedFiles["/codal.json"]}`);
6816
+ res.codal = codalJson;
6816
6817
  }
6817
6818
  else if (isPlatformio) {
6818
6819
  const iniLines = compileService.platformioIni.slice();
@@ -15401,20 +15402,18 @@ var ts;
15401
15402
  function computeUsedParts(resp, filter) {
15402
15403
  if (!resp.usedSymbols || !pxt.appTarget.simulator || !pxt.appTarget.simulator.parts)
15403
15404
  return [];
15405
+ const parseParts = (partsRaw, ps) => {
15406
+ if (partsRaw) {
15407
+ const partsSplit = partsRaw.split(/[ ,]+/g);
15408
+ ps.push(...partsSplit.filter(p => !!p && ps.indexOf(p) < 0));
15409
+ }
15410
+ };
15404
15411
  let parts = [];
15412
+ let hiddenParts = [];
15405
15413
  Object.keys(resp.usedSymbols).forEach(symbol => {
15406
- let info = resp.usedSymbols[symbol];
15407
- if (info && info.attributes.parts) {
15408
- let partsRaw = info.attributes.parts;
15409
- if (partsRaw) {
15410
- let partsSplit = partsRaw.split(/[ ,]+/);
15411
- partsSplit.forEach(p => {
15412
- if (0 < p.length && parts.indexOf(p) < 0) {
15413
- parts.push(p);
15414
- }
15415
- });
15416
- }
15417
- }
15414
+ const info = resp.usedSymbols[symbol];
15415
+ parseParts(info === null || info === void 0 ? void 0 : info.attributes.parts, parts);
15416
+ parseParts(info === null || info === void 0 ? void 0 : info.attributes.hiddenParts, hiddenParts);
15418
15417
  });
15419
15418
  if (filter) {
15420
15419
  const builtinParts = pxt.appTarget.simulator.boardDefinition.onboardComponents;
@@ -15427,6 +15426,8 @@ var ts;
15427
15426
  }
15428
15427
  }
15429
15428
  }
15429
+ // apply hidden parts filter
15430
+ parts = parts.filter(p => hiddenParts.indexOf(p) < 0);
15430
15431
  //sort parts (so breadboarding layout is stable w.r.t. code ordering)
15431
15432
  parts.sort();
15432
15433
  parts = parts.reverse(); //not strictly necessary, but it's a little