ic-mops 1.8.1 → 1.9.0

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 (47) hide show
  1. package/.DS_Store +0 -0
  2. package/.dockerignore +3 -0
  3. package/CHANGELOG.md +4 -0
  4. package/bun.lock +1278 -0
  5. package/bundle/bench/bench-canister.mo +109 -101
  6. package/bundle/bench/user-bench.mo +6 -6
  7. package/bundle/cli.js +1793 -909
  8. package/bundle/cli.tgz +0 -0
  9. package/bundle/declarations/main/main.did +6 -0
  10. package/bundle/declarations/main/main.did.d.ts +6 -0
  11. package/bundle/declarations/main/main.did.js +6 -0
  12. package/bundle/package.json +1 -1
  13. package/bundle/templates/src/lib.mo +13 -13
  14. package/bundle/templates/test/lib.test.mo +2 -2
  15. package/bundle/xhr-sync-worker.js +59 -0
  16. package/cli.ts +28 -0
  17. package/commands/docs-coverage.ts +110 -0
  18. package/commands/docs.ts +47 -20
  19. package/commands/publish.ts +11 -1
  20. package/declarations/main/main.did +6 -0
  21. package/declarations/main/main.did.d.ts +6 -0
  22. package/declarations/main/main.did.js +6 -0
  23. package/dist/cli.js +25 -0
  24. package/dist/commands/bench-replica.js +5 -2
  25. package/dist/commands/docs-coverage.d.ts +8 -0
  26. package/dist/commands/docs-coverage.js +86 -0
  27. package/dist/commands/docs.d.ts +9 -3
  28. package/dist/commands/docs.js +34 -17
  29. package/dist/commands/publish.js +10 -1
  30. package/dist/commands/replica.js +8 -7
  31. package/dist/commands/test/mmf1.js +14 -12
  32. package/dist/commands/test/reporters/compact-reporter.js +50 -63
  33. package/dist/commands/test/reporters/files-reporter.js +5 -14
  34. package/dist/commands/test/reporters/silent-reporter.js +10 -10
  35. package/dist/commands/test/reporters/verbose-reporter.js +7 -23
  36. package/dist/commands/watch/deployer.js +10 -7
  37. package/dist/commands/watch/error-checker.js +4 -4
  38. package/dist/commands/watch/formatter.js +7 -4
  39. package/dist/commands/watch/generator.js +9 -7
  40. package/dist/commands/watch/tester.js +7 -5
  41. package/dist/commands/watch/warning-checker.js +8 -6
  42. package/dist/declarations/main/main.did +6 -0
  43. package/dist/declarations/main/main.did.d.ts +6 -0
  44. package/dist/declarations/main/main.did.js +6 -0
  45. package/dist/package.json +13 -11
  46. package/package.json +15 -13
  47. package/tsconfig.json +2 -1
@@ -3,12 +3,14 @@ import { readConfig } from '../../mops.js';
3
3
  import { testWithReporter } from '../test/test.js';
4
4
  import { SilentReporter } from '../test/reporters/silent-reporter.js';
5
5
  export class Tester {
6
+ verbose = false;
7
+ status = 'pending';
8
+ errorChecker;
9
+ reporter = new SilentReporter(false);
10
+ aborted = false;
11
+ controller = new AbortController();
12
+ currentRun;
6
13
  constructor({ verbose, errorChecker }) {
7
- this.verbose = false;
8
- this.status = 'pending';
9
- this.reporter = new SilentReporter(false);
10
- this.aborted = false;
11
- this.controller = new AbortController();
12
14
  this.verbose = verbose;
13
15
  this.errorChecker = errorChecker;
14
16
  }
@@ -8,13 +8,15 @@ import { sources } from '../sources.js';
8
8
  import { parallel } from '../../parallel.js';
9
9
  import { globMoFiles } from './globMoFiles.js';
10
10
  export class WarningChecker {
11
+ verbose = false;
12
+ canisters = {};
13
+ status = 'pending';
14
+ warnings = [];
15
+ errorChecker;
16
+ aborted = false;
17
+ controllers = new Map();
18
+ currentRun;
11
19
  constructor({ verbose, canisters, errorChecker }) {
12
- this.verbose = false;
13
- this.canisters = {};
14
- this.status = 'pending';
15
- this.warnings = [];
16
- this.aborted = false;
17
- this.controllers = new Map();
18
20
  this.verbose = verbose;
19
21
  this.canisters = canisters;
20
22
  this.errorChecker = errorChecker;
@@ -218,6 +218,7 @@ type PackageSummary =
218
218
  type PackageQuality =
219
219
  record {
220
220
  depsStatus: DepsStatus;
221
+ docsCoverage: float64;
221
222
  hasDescription: bool;
222
223
  hasDocumentation: bool;
223
224
  hasKeywords: bool;
@@ -249,6 +250,7 @@ type PackageDetails =
249
250
  dependents: vec PackageSummary__1;
250
251
  deps: vec PackageSummary__1;
251
252
  devDeps: vec PackageSummary__1;
253
+ docsCoverage: float64;
252
254
  downloadTrend: vec DownloadsSnapshot;
253
255
  downloadsInLast30Days: nat;
254
256
  downloadsInLast7Days: nat;
@@ -308,10 +310,12 @@ type PackageConfigV3 =
308
310
  type PackageChanges =
309
311
  record {
310
312
  curBenchmarks: Benchmarks__1;
313
+ curDocsCoverage: float64;
311
314
  deps: vec DepChange;
312
315
  devDeps: vec DepChange;
313
316
  notes: text;
314
317
  prevBenchmarks: Benchmarks__1;
318
+ prevDocsCoverage: float64;
315
319
  tests: TestsChanges;
316
320
  };
317
321
  type Main =
@@ -379,11 +383,13 @@ type Main =
379
383
  removeOwner: (PackageName__1, principal) -> (Result_3);
380
384
  restore: (nat) -> ();
381
385
  search: (Text, opt nat, opt nat) -> (vec PackageSummary, PageCount) query;
386
+ setStorageControllers: () -> ();
382
387
  setUserProp: (text, text) -> (Result_3);
383
388
  startFileUpload: (PublishingId, Text, nat, blob) -> (Result_2);
384
389
  startPublish: (PackageConfigV3_Publishing) -> (Result_1);
385
390
  transformRequest: (HttpTransformArg) -> (HttpResponse) query;
386
391
  uploadBenchmarks: (PublishingId, Benchmarks) -> (Result);
392
+ uploadDocsCoverage: (PublishingId, float64) -> (Result);
387
393
  uploadFileChunk: (PublishingId, FileId, nat, blob) -> (Result);
388
394
  uploadNotes: (PublishingId, text) -> (Result);
389
395
  uploadTestStats: (PublishingId, TestStats) -> (Result);
@@ -124,6 +124,7 @@ export interface Main {
124
124
  [Text, [] | [bigint], [] | [bigint]],
125
125
  [Array<PackageSummary>, PageCount]
126
126
  >,
127
+ 'setStorageControllers' : ActorMethod<[], undefined>,
127
128
  'setUserProp' : ActorMethod<[string, string], Result_3>,
128
129
  'startFileUpload' : ActorMethod<
129
130
  [PublishingId, Text, bigint, Uint8Array | number[]],
@@ -132,6 +133,7 @@ export interface Main {
132
133
  'startPublish' : ActorMethod<[PackageConfigV3_Publishing], Result_1>,
133
134
  'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>,
134
135
  'uploadBenchmarks' : ActorMethod<[PublishingId, Benchmarks], Result>,
136
+ 'uploadDocsCoverage' : ActorMethod<[PublishingId, number], Result>,
135
137
  'uploadFileChunk' : ActorMethod<
136
138
  [PublishingId, FileId, bigint, Uint8Array | number[]],
137
139
  Result
@@ -143,8 +145,10 @@ export interface PackageChanges {
143
145
  'tests' : TestsChanges,
144
146
  'deps' : Array<DepChange>,
145
147
  'curBenchmarks' : Benchmarks__1,
148
+ 'prevDocsCoverage' : number,
146
149
  'prevBenchmarks' : Benchmarks__1,
147
150
  'notes' : string,
151
+ 'curDocsCoverage' : number,
148
152
  'devDeps' : Array<DepChange>,
149
153
  }
150
154
  export interface PackageConfigV3 {
@@ -196,6 +200,7 @@ export interface PackageDetails {
196
200
  'quality' : PackageQuality,
197
201
  'publisher' : User,
198
202
  'testStats' : TestStats__1,
203
+ 'docsCoverage' : number,
199
204
  'highestVersion' : PackageVersion,
200
205
  'downloadsTotal' : bigint,
201
206
  'downloadsInLast30Days' : bigint,
@@ -223,6 +228,7 @@ export interface PackagePublication {
223
228
  }
224
229
  export interface PackageQuality {
225
230
  'depsStatus' : DepsStatus,
231
+ 'docsCoverage' : number,
226
232
  'hasDescription' : boolean,
227
233
  'hasKeywords' : boolean,
228
234
  'hasLicense' : boolean,
@@ -48,6 +48,7 @@ export const idlFactory = ({ IDL }) => {
48
48
  });
49
49
  const PackageQuality = IDL.Record({
50
50
  'depsStatus' : DepsStatus,
51
+ 'docsCoverage' : IDL.Float64,
51
52
  'hasDescription' : IDL.Bool,
52
53
  'hasKeywords' : IDL.Bool,
53
54
  'hasLicense' : IDL.Bool,
@@ -161,8 +162,10 @@ export const idlFactory = ({ IDL }) => {
161
162
  'tests' : TestsChanges,
162
163
  'deps' : IDL.Vec(DepChange),
163
164
  'curBenchmarks' : Benchmarks__1,
165
+ 'prevDocsCoverage' : IDL.Float64,
164
166
  'prevBenchmarks' : Benchmarks__1,
165
167
  'notes' : IDL.Text,
168
+ 'curDocsCoverage' : IDL.Float64,
166
169
  'devDeps' : IDL.Vec(DepChange),
167
170
  });
168
171
  const PackageSummaryWithChanges__1 = IDL.Record({
@@ -192,6 +195,7 @@ export const idlFactory = ({ IDL }) => {
192
195
  'quality' : PackageQuality,
193
196
  'publisher' : User,
194
197
  'testStats' : TestStats__1,
198
+ 'docsCoverage' : IDL.Float64,
195
199
  'highestVersion' : PackageVersion,
196
200
  'downloadsTotal' : IDL.Nat,
197
201
  'downloadsInLast30Days' : IDL.Nat,
@@ -428,6 +432,7 @@ export const idlFactory = ({ IDL }) => {
428
432
  [IDL.Vec(PackageSummary), PageCount],
429
433
  ['query'],
430
434
  ),
435
+ 'setStorageControllers' : IDL.Func([], [], []),
431
436
  'setUserProp' : IDL.Func([IDL.Text, IDL.Text], [Result_3], []),
432
437
  'startFileUpload' : IDL.Func(
433
438
  [PublishingId, Text, IDL.Nat, IDL.Vec(IDL.Nat8)],
@@ -441,6 +446,7 @@ export const idlFactory = ({ IDL }) => {
441
446
  ['query'],
442
447
  ),
443
448
  'uploadBenchmarks' : IDL.Func([PublishingId, Benchmarks], [Result], []),
449
+ 'uploadDocsCoverage' : IDL.Func([PublishingId, IDL.Float64], [Result], []),
444
450
  'uploadFileChunk' : IDL.Func(
445
451
  [PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)],
446
452
  [Result],
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "bin/mops.js",
@@ -28,13 +28,13 @@
28
28
  "node": ">=18.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@dfinity/agent": "2.3.0",
32
- "@dfinity/candid": "2.3.0",
33
- "@dfinity/identity": "2.3.0",
34
- "@dfinity/identity-secp256k1": "2.3.0",
35
- "@dfinity/principal": "2.3.0",
31
+ "@dfinity/agent": "2.4.1",
32
+ "@dfinity/candid": "2.4.1",
33
+ "@dfinity/identity": "2.4.1",
34
+ "@dfinity/identity-secp256k1": "2.4.1",
35
+ "@dfinity/principal": "2.4.1",
36
36
  "@iarna/toml": "2.2.5",
37
- "@noble/hashes": "1.7.1",
37
+ "@noble/hashes": "1.8.0",
38
38
  "as-table": "1.0.55",
39
39
  "buffer": "6.0.3",
40
40
  "cacheable-request": "12.0.1",
@@ -42,10 +42,10 @@
42
42
  "change-case": "5.4.4",
43
43
  "chokidar": "3.6.0",
44
44
  "commander": "13.1.0",
45
- "debounce": "2.1.1",
45
+ "debounce": "2.2.0",
46
46
  "decomp-tarxz": "0.1.1",
47
47
  "decompress": "4.2.1",
48
- "del": "7.1.0",
48
+ "del": "8.0.0",
49
49
  "dhall-to-json-cli": "1.7.6",
50
50
  "execa": "9.3.1",
51
51
  "filesize": "10.1.6",
@@ -54,6 +54,7 @@
54
54
  "glob": "11.0.1",
55
55
  "globby": "14.0.2",
56
56
  "got": "14.4.6",
57
+ "jsdom": "26.1.0",
57
58
  "log-update": "6.1.0",
58
59
  "markdown-table": "3.0.4",
59
60
  "mdast-util-from-markdown": "2.0.2",
@@ -80,15 +81,16 @@
80
81
  "@types/decompress": "4.2.7",
81
82
  "@types/fs-extra": "11.0.4",
82
83
  "@types/glob": "8.1.0",
84
+ "@types/jsdom": "21.1.7",
83
85
  "@types/ncp": "2.0.8",
84
- "@types/node": "22.13.4",
86
+ "@types/node": "24.0.3",
85
87
  "@types/prompts": "2.4.9",
86
88
  "@types/semver": "7.5.8",
87
89
  "@types/stream-to-promise": "2.2.4",
88
90
  "@types/tar": "6.1.13",
89
- "bun": "1.2.10",
90
91
  "esbuild": "0.23.1",
91
92
  "eslint": "8.57.0",
93
+ "rexreplace": "7.1.13",
92
94
  "tsx": "4.19.2",
93
95
  "typescript": "5.7.3"
94
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "dist/bin/mops.js",
@@ -31,8 +31,8 @@
31
31
  "build": "npm run prepare && npm run bundle",
32
32
  "dist": "tsc",
33
33
  "bundle": "rm -rf ./bundle && bun build ./cli.ts --outdir ./bundle --target node --minify --external @napi-rs/lzma --external fsevents --format esm --define '__dirname=import.meta.dirname' && npm run bundle:fix && npm run bundle:copy && npm run bundle:package-json && npm run bundle:tar",
34
- "bundle:fix": "npx -y rexreplace 'new URL\\(\"\\.\\./templates' 'new URL(\"./templates' bundle/cli.js && npx -y rexreplace '\"import.meta.dirname\",\"wasm_bg.wasm\"' 'import.meta.dirname || new URL(\".\", import.meta.url).pathname,\"wasm_bg.wasm\"' bundle/cli.js",
35
- "bundle:copy": "cp -r commands/bench bundle && cp -r bin declarations templates package.json bundle && cp -r node_modules/prettier-plugin-motoko/wasm/pkg/nodejs/wasm_bg.wasm bundle",
34
+ "bundle:fix": "rexreplace 'new URL\\(\"\\.\\./templates' 'new URL(\"./templates' bundle/cli.js && rexreplace 'resolve\\(\".*?/xhr-sync-worker\\.js\"\\)' 'resolve(\"./xhr-sync-worker.js\")' bundle/cli.js && rexreplace '\"import.meta.dirname\",\"wasm_bg.wasm\"' 'import.meta.dirname || new URL(\".\", import.meta.url).pathname,\"wasm_bg.wasm\"' bundle/cli.js",
35
+ "bundle:copy": "cp -r commands/bench bundle && cp -r bin declarations templates package.json bundle && cp -r node_modules/prettier-plugin-motoko/wasm/pkg/nodejs/wasm_bg.wasm node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js bundle",
36
36
  "bundle:package-json": "tsx bundle-package-json.ts",
37
37
  "bundle:tar": "rm -f bundle/cli.tgz && touch -t 200101010101 bundle/cli.tgz && find bundle -exec touch -d '1970-01-01 00:00:00' {} + && tar --sort name --exclude bundle/cli.tgz -cvf - bundle | gzip -n > bundle/cli.tgz",
38
38
  "copy": "cp -r commands/bench dist/commands && cp -r declarations templates package.json bin dist | true",
@@ -44,13 +44,13 @@
44
44
  "esbuild": "esbuild"
45
45
  },
46
46
  "dependencies": {
47
- "@dfinity/agent": "2.3.0",
48
- "@dfinity/candid": "2.3.0",
49
- "@dfinity/identity": "2.3.0",
50
- "@dfinity/identity-secp256k1": "2.3.0",
51
- "@dfinity/principal": "2.3.0",
47
+ "@dfinity/agent": "2.4.1",
48
+ "@dfinity/candid": "2.4.1",
49
+ "@dfinity/identity": "2.4.1",
50
+ "@dfinity/identity-secp256k1": "2.4.1",
51
+ "@dfinity/principal": "2.4.1",
52
52
  "@iarna/toml": "2.2.5",
53
- "@noble/hashes": "1.7.1",
53
+ "@noble/hashes": "1.8.0",
54
54
  "as-table": "1.0.55",
55
55
  "buffer": "6.0.3",
56
56
  "cacheable-request": "12.0.1",
@@ -58,10 +58,10 @@
58
58
  "change-case": "5.4.4",
59
59
  "chokidar": "3.6.0",
60
60
  "commander": "13.1.0",
61
- "debounce": "2.1.1",
61
+ "debounce": "2.2.0",
62
62
  "decomp-tarxz": "0.1.1",
63
63
  "decompress": "4.2.1",
64
- "del": "7.1.0",
64
+ "del": "8.0.0",
65
65
  "dhall-to-json-cli": "1.7.6",
66
66
  "execa": "9.3.1",
67
67
  "filesize": "10.1.6",
@@ -70,6 +70,7 @@
70
70
  "glob": "11.0.1",
71
71
  "globby": "14.0.2",
72
72
  "got": "14.4.6",
73
+ "jsdom": "26.1.0",
73
74
  "log-update": "6.1.0",
74
75
  "markdown-table": "3.0.4",
75
76
  "mdast-util-from-markdown": "2.0.2",
@@ -96,15 +97,16 @@
96
97
  "@types/decompress": "4.2.7",
97
98
  "@types/fs-extra": "11.0.4",
98
99
  "@types/glob": "8.1.0",
100
+ "@types/jsdom": "21.1.7",
99
101
  "@types/ncp": "2.0.8",
100
- "@types/node": "22.13.4",
102
+ "@types/node": "24.0.3",
101
103
  "@types/prompts": "2.4.9",
102
104
  "@types/semver": "7.5.8",
103
105
  "@types/stream-to-promise": "2.2.4",
104
106
  "@types/tar": "6.1.13",
105
- "bun": "1.2.10",
106
107
  "esbuild": "0.23.1",
107
108
  "eslint": "8.57.0",
109
+ "rexreplace": "7.1.13",
108
110
  "tsx": "4.19.2",
109
111
  "typescript": "5.7.3"
110
112
  }
package/tsconfig.json CHANGED
@@ -3,8 +3,9 @@
3
3
  "include": ["**/*.ts", "**/*.js"],
4
4
  "exclude": ["node_modules", "dist", "bundle", "dist.js", "declarations/**/*.js"],
5
5
  "compilerOptions": {
6
+ "target": "ES2022",
7
+ "lib": ["ES2022"],
6
8
  "types": ["node"],
7
- "target": "ES2021",
8
9
  "outDir": "./dist",
9
10
  "allowJs": true,
10
11
  "module": "nodenext",