@markw65/monkeyc-optimizer 1.0.4 → 1.0.8

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/build/util.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 0 && (module.exports = {isWin,appSupport,connectiq,getSdkPath,globa,last_modified,first_modified,pushUnique,spawnByLine,readByLine,promiseAll,copyRecursiveAsNeeded});
1
+ 0 && (module.exports = {globa,last_modified,first_modified,pushUnique,spawnByLine,readByLine,promiseAll,copyRecursiveAsNeeded});
2
2
  /******/ (() => { // webpackBootstrap
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
@@ -3978,13 +3978,9 @@ __webpack_require__.r(__webpack_exports__);
3978
3978
 
3979
3979
  // EXPORTS
3980
3980
  __webpack_require__.d(__webpack_exports__, {
3981
- "appSupport": () => (/* binding */ appSupport),
3982
- "connectiq": () => (/* binding */ connectiq),
3983
3981
  "copyRecursiveAsNeeded": () => (/* binding */ copyRecursiveAsNeeded),
3984
3982
  "first_modified": () => (/* binding */ first_modified),
3985
- "getSdkPath": () => (/* binding */ getSdkPath),
3986
3983
  "globa": () => (/* binding */ globa),
3987
- "isWin": () => (/* binding */ isWin),
3988
3984
  "last_modified": () => (/* binding */ last_modified),
3989
3985
  "promiseAll": () => (/* binding */ promiseAll),
3990
3986
  "pushUnique": () => (/* binding */ pushUnique),
@@ -4012,18 +4008,9 @@ const external_readline_namespaceObject = require("readline");
4012
4008
 
4013
4009
 
4014
4010
 
4015
- const isWin = process.platform == "win32";
4016
-
4017
- const appSupport = isWin
4018
- ? `${process.env.APPDATA}`.replace(/\\/g, "/")
4019
- : `${process.env.HOME}/Library/Application Support`;
4020
-
4021
- const connectiq = `${appSupport}/Garmin/ConnectIQ`;
4022
-
4023
- function getSdkPath() {
4024
- return promises_namespaceObject.readFile(connectiq + "/current-sdk.cfg")
4025
- .then((contents) => contents.toString().replace(/^\s*(.*?)\s*$/s, "$1"));
4026
- }
4011
+ // Write it this way so that webpack.DefinePlugin doesn't
4012
+ // recognize global.lastModifiedSource.
4013
+ global["lastModifiedSource" + ""] = 0;
4027
4014
 
4028
4015
  function globa(pattern, options) {
4029
4016
  return new Promise((resolve, reject) => {
@@ -4109,14 +4096,17 @@ function readByLine(file, lineHandler) {
4109
4096
  async function promiseAll(promises, parallelism) {
4110
4097
  parallelism = parallelism || 4;
4111
4098
  const serializer = [];
4099
+ const results = [];
4100
+ const capture = (r, i) => (results[i] = r);
4112
4101
  promises.forEach((p, i) => {
4102
+ const cap = () => p.then((r) => capture(r, i));
4113
4103
  if (serializer.length < parallelism) {
4114
- serializer.push(p);
4104
+ serializer.push(cap());
4115
4105
  } else {
4116
- serializer[i % parallelism].then(() => p);
4106
+ serializer[i % parallelism] = serializer[i % parallelism].then(cap);
4117
4107
  }
4118
4108
  });
4119
- return Promise.all(serializer);
4109
+ return Promise.all(serializer).then(() => results);
4120
4110
  }
4121
4111
 
4122
4112
  async function copyRecursiveAsNeeded(source, target, filter) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@markw65/monkeyc-optimizer",
3
3
  "type": "module",
4
- "version": "1.0.4",
4
+ "version": "1.0.8",
5
5
  "description": "Source to source optimizer for Garmin Monkey C code",
6
6
  "main": "build/optimizer.cjs",
7
7
  "exports": {
@@ -13,7 +13,8 @@
13
13
  "build-debug": "webpack --mode development",
14
14
  "build-release": "webpack --mode production",
15
15
  "prepack": "webpack --mode production",
16
- "test": "echo \"Error: no test specified\" && exit 1"
16
+ "test": "npm run test-remote",
17
+ "test-remote": "node ./test/test.js --product=pick-one --github"
17
18
  },
18
19
  "files": [
19
20
  "build/optimizer.cjs",
@@ -23,7 +24,7 @@
23
24
  "author": "markw65",
24
25
  "license": "MIT",
25
26
  "dependencies": {
26
- "@markw65/prettier-plugin-monkeyc": "^1.0.10"
27
+ "@markw65/prettier-plugin-monkeyc": "^1.0.14"
27
28
  },
28
29
  "devDependencies": {
29
30
  "eslint": "^8.12.0",