ic-mops 2.4.0 → 2.5.1

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 (48) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/api/network.ts +12 -4
  3. package/bun.lock +1082 -78
  4. package/bundle/cli.tgz +0 -0
  5. package/commands/add.ts +4 -1
  6. package/commands/build.ts +7 -12
  7. package/commands/install/install-dep.ts +5 -3
  8. package/commands/publish.ts +8 -8
  9. package/commands/remove.ts +5 -2
  10. package/commands/sources.ts +3 -2
  11. package/commands/sync.ts +13 -16
  12. package/commands/test/test.ts +3 -3
  13. package/commands/update.ts +13 -7
  14. package/commands/watch/error-checker.ts +3 -8
  15. package/commands/watch/warning-checker.ts +3 -8
  16. package/dist/api/network.js +11 -4
  17. package/dist/commands/add.js +4 -1
  18. package/dist/commands/build.js +5 -10
  19. package/dist/commands/install/install-dep.js +3 -3
  20. package/dist/commands/publish.js +8 -8
  21. package/dist/commands/remove.js +5 -2
  22. package/dist/commands/sources.js +3 -2
  23. package/dist/commands/sync.js +9 -14
  24. package/dist/commands/test/test.js +3 -3
  25. package/dist/commands/update.js +9 -4
  26. package/dist/commands/watch/error-checker.js +3 -8
  27. package/dist/commands/watch/warning-checker.js +3 -8
  28. package/dist/environments/web/cli.js +9 -0
  29. package/dist/helpers/find-changelog-entry.js +1 -1
  30. package/dist/integrity.js +9 -3
  31. package/dist/mops.js +3 -0
  32. package/dist/package.json +3 -5
  33. package/dist/parallel.js +9 -1
  34. package/dist/resolve-packages.js +4 -4
  35. package/dist/tests/build.test.js +3 -1
  36. package/dist/tests/helpers.js +8 -1
  37. package/dist/vessel.d.ts +1 -1
  38. package/dist/vessel.js +3 -2
  39. package/environments/web/cli.ts +12 -0
  40. package/helpers/find-changelog-entry.ts +3 -1
  41. package/integrity.ts +12 -3
  42. package/mops.ts +7 -0
  43. package/package.json +5 -7
  44. package/parallel.ts +16 -5
  45. package/resolve-packages.ts +6 -4
  46. package/tests/build.test.ts +4 -1
  47. package/tests/helpers.ts +9 -1
  48. package/vessel.ts +5 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## Next
4
4
 
5
+ ## 2.5.1
6
+ - Fix `mops test` and `mops watch` breaking when dependency paths contain spaces
7
+ - Fix `mops sync` incorrectly reporting version-pinned dependencies as missing/unused
8
+ - Fix `mops update --lock ignore` not respecting the lock option during intermediate installs
9
+ - Fix `mops update` crashing with unhandled error when GitHub API is unavailable
10
+ - Fix `mops add` writing dependency to config even when GitHub download fails
11
+ - Fix GitHub dependency install crashing the entire process instead of reporting the error
12
+ - Fix version comparison treating short version strings (e.g. `1.0`) as equal to longer ones (e.g. `1.0.5`)
13
+ - Fix `mops remove` not cleaning up transitive dependencies of GitHub packages
14
+ - Fix corrupted `mops.lock` file causing an unhandled crash instead of a helpful error message
15
+ - Fix `mops sources` resolving package config from wrong directory in some contexts
16
+ - Harden lock file integrity check against package ID prefix collisions
17
+ - `mops build` now reports invalid canister names instead of silently ignoring them
18
+ - Document `baseDir`, `readme`, and `dfx` fields in `[package]` config
19
+
20
+ ## 2.5.0
21
+ - Add support for `MOPS_REGISTRY_HOST` and `MOPS_REGISTRY_CANISTER_ID` environment variables for custom registry endpoints
22
+ - Fix `mops build` crashing with `__wbindgen_malloc` error in bundled CLI distribution
23
+ - Fix `parallel()` swallowing errors from concurrent tasks (e.g. `mops publish` uploads), which could hang or leave failures unreported
24
+
5
25
  ## 2.4.0
6
26
  - Support `[build].outputDir` config in `mops.toml` for custom build output directory
7
27
  - Fix `mops build --output` CLI option being silently ignored
package/api/network.ts CHANGED
@@ -1,22 +1,30 @@
1
1
  export function getNetwork() {
2
- return globalThis.MOPS_NETWORK || "ic";
2
+ return process.env["MOPS_NETWORK"] || globalThis.MOPS_NETWORK || "ic";
3
3
  }
4
4
 
5
5
  export function getEndpoint(network: string) {
6
+ let endpoint: { host: string; canisterId: string };
6
7
  if (network === "staging") {
7
- return {
8
+ endpoint = {
8
9
  host: "https://icp-api.io",
9
10
  canisterId: "2d2zu-vaaaa-aaaak-qb6pq-cai",
10
11
  };
11
12
  } else if (network === "ic") {
12
- return {
13
+ endpoint = {
13
14
  host: "https://icp-api.io",
14
15
  canisterId: "oknww-riaaa-aaaam-qaf6a-cai",
15
16
  };
16
17
  } else {
17
- return {
18
+ endpoint = {
18
19
  host: "http://127.0.0.1:4943",
19
20
  canisterId: "2d2zu-vaaaa-aaaak-qb6pq-cai",
20
21
  };
21
22
  }
23
+
24
+ const hostOverride = process.env["MOPS_REGISTRY_HOST"]?.trim();
25
+ const canisterOverride = process.env["MOPS_REGISTRY_CANISTER_ID"]?.trim();
26
+ return {
27
+ host: hostOverride || endpoint.host,
28
+ canisterId: canisterOverride || endpoint.canisterId,
29
+ };
22
30
  }