ic-mops 1.9.0 → 1.11.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.
- package/CHANGELOG.md +14 -0
- package/api/actors.ts +1 -0
- package/bun.lock +32 -59
- package/bundle/cli.tgz +0 -0
- package/cli.ts +0 -6
- package/commands/bench/bench-canister.mo +2 -2
- package/commands/bench/user-bench.mo +0 -4
- package/commands/bench-replica.ts +1 -0
- package/commands/bench.ts +4 -0
- package/commands/publish.ts +14 -1
- package/commands/test/test.ts +3 -2
- package/commands/toolchain/moc.ts +10 -4
- package/commands/watch/error-checker.ts +14 -8
- package/commands/watch/globMoFiles.ts +3 -2
- package/commands/watch/warning-checker.ts +14 -9
- package/declarations/bench/bench.did +3 -3
- package/declarations/main/main.did +78 -121
- package/declarations/main/main.did.d.ts +45 -95
- package/declarations/main/main.did.js +53 -107
- package/dist/api/actors.js +1 -0
- package/dist/cli.js +0 -5
- package/dist/commands/bench/bench-canister.mo +2 -2
- package/dist/commands/bench/user-bench.mo +0 -4
- package/dist/commands/bench-replica.js +1 -0
- package/dist/commands/bench.js +3 -0
- package/dist/commands/publish.js +13 -1
- package/dist/commands/test/test.js +2 -1
- package/dist/commands/toolchain/moc.js +10 -4
- package/dist/commands/watch/error-checker.d.ts +2 -0
- package/dist/commands/watch/error-checker.js +13 -8
- package/dist/commands/watch/globMoFiles.js +3 -2
- package/dist/commands/watch/warning-checker.d.ts +2 -0
- package/dist/commands/watch/warning-checker.js +14 -9
- package/dist/declarations/bench/bench.did +3 -3
- package/dist/declarations/main/main.did +78 -121
- package/dist/declarations/main/main.did.d.ts +45 -95
- package/dist/declarations/main/main.did.js +53 -107
- package/dist/mops.js +7 -1
- package/dist/package.json +13 -6
- package/mops.ts +7 -1
- package/package.json +13 -6
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const idlFactory = ({ IDL }) => {
|
|
2
|
-
const
|
|
2
|
+
const PackageName = IDL.Text;
|
|
3
3
|
const Result_3 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
|
|
4
4
|
const PublishingId = IDL.Text;
|
|
5
5
|
const Err = IDL.Text;
|
|
6
6
|
const Result = IDL.Variant({ 'ok' : IDL.Null, 'err' : Err });
|
|
7
7
|
const Text = IDL.Text;
|
|
8
|
-
const
|
|
8
|
+
const PackageVersion = IDL.Text;
|
|
9
9
|
const PackageId = IDL.Text;
|
|
10
10
|
const Time = IDL.Int;
|
|
11
|
-
const
|
|
11
|
+
const DownloadsSnapshot = IDL.Record({
|
|
12
12
|
'startTime' : Time,
|
|
13
13
|
'endTime' : Time,
|
|
14
14
|
'downloads' : IDL.Nat,
|
|
@@ -25,10 +25,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
25
25
|
'patch' : IDL.Null,
|
|
26
26
|
});
|
|
27
27
|
const Result_6 = IDL.Variant({
|
|
28
|
-
'ok' : IDL.Vec(IDL.Tuple(
|
|
28
|
+
'ok' : IDL.Vec(IDL.Tuple(PackageName, PackageVersion)),
|
|
29
29
|
'err' : Err,
|
|
30
30
|
});
|
|
31
|
-
const Result_5 = IDL.Variant({ 'ok' :
|
|
31
|
+
const Result_5 = IDL.Variant({ 'ok' : PackageVersion, 'err' : Err });
|
|
32
32
|
const User = IDL.Record({
|
|
33
33
|
'id' : IDL.Principal,
|
|
34
34
|
'emailVerified' : IDL.Bool,
|
|
@@ -57,9 +57,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
57
57
|
'hasRepository' : IDL.Bool,
|
|
58
58
|
'hasReleaseNotes' : IDL.Bool,
|
|
59
59
|
});
|
|
60
|
-
const PackageVersion = IDL.Text;
|
|
61
60
|
const Script = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
62
|
-
const PackageName = IDL.Text;
|
|
63
61
|
const DependencyV2 = IDL.Record({
|
|
64
62
|
'name' : PackageName,
|
|
65
63
|
'repo' : IDL.Text,
|
|
@@ -120,31 +118,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
120
118
|
'replicaVersion' : IDL.Text,
|
|
121
119
|
'forceGC' : IDL.Bool,
|
|
122
120
|
});
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
'ownerInfo' : User,
|
|
126
|
-
'owners' : IDL.Vec(User),
|
|
127
|
-
'maintainers' : IDL.Vec(User),
|
|
128
|
-
'owner' : IDL.Principal,
|
|
129
|
-
'depAlias' : IDL.Text,
|
|
130
|
-
'quality' : PackageQuality,
|
|
131
|
-
'publisher' : User,
|
|
132
|
-
'highestVersion' : PackageVersion,
|
|
133
|
-
'downloadsTotal' : IDL.Nat,
|
|
134
|
-
'downloadsInLast30Days' : IDL.Nat,
|
|
135
|
-
'downloadsInLast7Days' : IDL.Nat,
|
|
136
|
-
'config' : PackageConfigV3,
|
|
137
|
-
'publication' : PackagePublication,
|
|
138
|
-
});
|
|
139
|
-
const TestStats__1 = IDL.Record({
|
|
121
|
+
const Benchmarks = IDL.Vec(Benchmark);
|
|
122
|
+
const TestStats = IDL.Record({
|
|
140
123
|
'passedNames' : IDL.Vec(IDL.Text),
|
|
141
124
|
'passed' : IDL.Nat,
|
|
142
125
|
});
|
|
143
|
-
const DownloadsSnapshot = IDL.Record({
|
|
144
|
-
'startTime' : Time,
|
|
145
|
-
'endTime' : Time,
|
|
146
|
-
'downloads' : IDL.Nat,
|
|
147
|
-
});
|
|
148
126
|
const PackageFileStatsPublic = IDL.Record({
|
|
149
127
|
'sourceFiles' : IDL.Nat,
|
|
150
128
|
'sourceSize' : IDL.Nat,
|
|
@@ -161,14 +139,14 @@ export const idlFactory = ({ IDL }) => {
|
|
|
161
139
|
const PackageChanges = IDL.Record({
|
|
162
140
|
'tests' : TestsChanges,
|
|
163
141
|
'deps' : IDL.Vec(DepChange),
|
|
164
|
-
'curBenchmarks' :
|
|
142
|
+
'curBenchmarks' : Benchmarks,
|
|
165
143
|
'prevDocsCoverage' : IDL.Float64,
|
|
166
|
-
'prevBenchmarks' :
|
|
144
|
+
'prevBenchmarks' : Benchmarks,
|
|
167
145
|
'notes' : IDL.Text,
|
|
168
146
|
'curDocsCoverage' : IDL.Float64,
|
|
169
147
|
'devDeps' : IDL.Vec(DepChange),
|
|
170
148
|
});
|
|
171
|
-
const
|
|
149
|
+
const PackageSummaryWithChanges = IDL.Record({
|
|
172
150
|
'ownerInfo' : User,
|
|
173
151
|
'owners' : IDL.Vec(User),
|
|
174
152
|
'maintainers' : IDL.Vec(User),
|
|
@@ -185,65 +163,39 @@ export const idlFactory = ({ IDL }) => {
|
|
|
185
163
|
'publication' : PackagePublication,
|
|
186
164
|
});
|
|
187
165
|
const PackageDetails = IDL.Record({
|
|
188
|
-
'benchmarks' :
|
|
166
|
+
'benchmarks' : Benchmarks,
|
|
189
167
|
'ownerInfo' : User,
|
|
190
168
|
'owners' : IDL.Vec(User),
|
|
191
169
|
'maintainers' : IDL.Vec(User),
|
|
192
170
|
'owner' : IDL.Principal,
|
|
193
171
|
'depAlias' : IDL.Text,
|
|
194
|
-
'deps' : IDL.Vec(
|
|
172
|
+
'deps' : IDL.Vec(PackageSummary),
|
|
195
173
|
'quality' : PackageQuality,
|
|
196
174
|
'publisher' : User,
|
|
197
|
-
'testStats' :
|
|
175
|
+
'testStats' : TestStats,
|
|
198
176
|
'docsCoverage' : IDL.Float64,
|
|
199
177
|
'highestVersion' : PackageVersion,
|
|
200
178
|
'downloadsTotal' : IDL.Nat,
|
|
201
179
|
'downloadsInLast30Days' : IDL.Nat,
|
|
180
|
+
'dependentsCount' : IDL.Nat,
|
|
202
181
|
'downloadTrend' : IDL.Vec(DownloadsSnapshot),
|
|
203
182
|
'fileStats' : PackageFileStatsPublic,
|
|
204
|
-
'versionHistory' : IDL.Vec(
|
|
205
|
-
'dependents' : IDL.Vec(
|
|
206
|
-
'devDeps' : IDL.Vec(
|
|
183
|
+
'versionHistory' : IDL.Vec(PackageSummaryWithChanges),
|
|
184
|
+
'dependents' : IDL.Vec(PackageSummary),
|
|
185
|
+
'devDeps' : IDL.Vec(PackageSummary),
|
|
207
186
|
'downloadsInLast7Days' : IDL.Nat,
|
|
208
187
|
'config' : PackageConfigV3,
|
|
209
188
|
'changes' : PackageChanges,
|
|
189
|
+
'versions' : IDL.Vec(PackageVersion),
|
|
210
190
|
'publication' : PackagePublication,
|
|
211
191
|
});
|
|
212
192
|
const Result_4 = IDL.Variant({ 'ok' : PackageDetails, 'err' : Err });
|
|
213
|
-
const PackageSummaryWithChanges = IDL.Record({
|
|
214
|
-
'ownerInfo' : User,
|
|
215
|
-
'owners' : IDL.Vec(User),
|
|
216
|
-
'maintainers' : IDL.Vec(User),
|
|
217
|
-
'owner' : IDL.Principal,
|
|
218
|
-
'depAlias' : IDL.Text,
|
|
219
|
-
'quality' : PackageQuality,
|
|
220
|
-
'publisher' : User,
|
|
221
|
-
'highestVersion' : PackageVersion,
|
|
222
|
-
'downloadsTotal' : IDL.Nat,
|
|
223
|
-
'downloadsInLast30Days' : IDL.Nat,
|
|
224
|
-
'downloadsInLast7Days' : IDL.Nat,
|
|
225
|
-
'config' : PackageConfigV3,
|
|
226
|
-
'changes' : PackageChanges,
|
|
227
|
-
'publication' : PackagePublication,
|
|
228
|
-
});
|
|
229
193
|
const StorageId = IDL.Principal;
|
|
230
194
|
const StorageStats = IDL.Record({
|
|
231
195
|
'fileCount' : IDL.Nat,
|
|
232
196
|
'cyclesBalance' : IDL.Nat,
|
|
233
197
|
'memorySize' : IDL.Nat,
|
|
234
198
|
});
|
|
235
|
-
const User__1 = IDL.Record({
|
|
236
|
-
'id' : IDL.Principal,
|
|
237
|
-
'emailVerified' : IDL.Bool,
|
|
238
|
-
'twitter' : IDL.Text,
|
|
239
|
-
'displayName' : IDL.Text,
|
|
240
|
-
'name' : IDL.Text,
|
|
241
|
-
'site' : IDL.Text,
|
|
242
|
-
'email' : IDL.Text,
|
|
243
|
-
'twitterVerified' : IDL.Bool,
|
|
244
|
-
'githubVerified' : IDL.Bool,
|
|
245
|
-
'github' : IDL.Text,
|
|
246
|
-
});
|
|
247
199
|
const Header = IDL.Tuple(IDL.Text, IDL.Text);
|
|
248
200
|
const Request = IDL.Record({
|
|
249
201
|
'url' : IDL.Text,
|
|
@@ -298,23 +250,18 @@ export const idlFactory = ({ IDL }) => {
|
|
|
298
250
|
});
|
|
299
251
|
const Result_1 = IDL.Variant({ 'ok' : PublishingId, 'err' : Err });
|
|
300
252
|
const HttpHeader = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
301
|
-
const
|
|
253
|
+
const HttpRequestResult = IDL.Record({
|
|
302
254
|
'status' : IDL.Nat,
|
|
303
255
|
'body' : IDL.Vec(IDL.Nat8),
|
|
304
256
|
'headers' : IDL.Vec(HttpHeader),
|
|
305
257
|
});
|
|
306
|
-
const
|
|
258
|
+
const TransformArg = IDL.Record({
|
|
307
259
|
'context' : IDL.Vec(IDL.Nat8),
|
|
308
|
-
'response' :
|
|
309
|
-
});
|
|
310
|
-
const Benchmarks = IDL.Vec(Benchmark);
|
|
311
|
-
const TestStats = IDL.Record({
|
|
312
|
-
'passedNames' : IDL.Vec(IDL.Text),
|
|
313
|
-
'passed' : IDL.Nat,
|
|
260
|
+
'response' : HttpRequestResult,
|
|
314
261
|
});
|
|
315
262
|
const Main = IDL.Service({
|
|
316
|
-
'addMaintainer' : IDL.Func([
|
|
317
|
-
'addOwner' : IDL.Func([
|
|
263
|
+
'addMaintainer' : IDL.Func([PackageName, IDL.Principal], [Result_3], []),
|
|
264
|
+
'addOwner' : IDL.Func([PackageName, IDL.Principal], [Result_3], []),
|
|
318
265
|
'backup' : IDL.Func([], [], []),
|
|
319
266
|
'computeHashesForExistingFiles' : IDL.Func([], [], []),
|
|
320
267
|
'finishPublish' : IDL.Func([PublishingId], [Result], []),
|
|
@@ -322,24 +269,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
322
269
|
'getBackupCanisterId' : IDL.Func([], [IDL.Principal], ['query']),
|
|
323
270
|
'getDefaultPackages' : IDL.Func(
|
|
324
271
|
[IDL.Text],
|
|
325
|
-
[IDL.Vec(IDL.Tuple(
|
|
272
|
+
[IDL.Vec(IDL.Tuple(PackageName, PackageVersion))],
|
|
326
273
|
['query'],
|
|
327
274
|
),
|
|
328
275
|
'getDownloadTrendByPackageId' : IDL.Func(
|
|
329
276
|
[PackageId],
|
|
330
|
-
[IDL.Vec(
|
|
277
|
+
[IDL.Vec(DownloadsSnapshot)],
|
|
331
278
|
['query'],
|
|
332
279
|
),
|
|
333
280
|
'getDownloadTrendByPackageName' : IDL.Func(
|
|
334
|
-
[
|
|
335
|
-
[IDL.Vec(
|
|
281
|
+
[PackageName],
|
|
282
|
+
[IDL.Vec(DownloadsSnapshot)],
|
|
336
283
|
['query'],
|
|
337
284
|
),
|
|
338
|
-
'getFileHashes' : IDL.Func(
|
|
339
|
-
[PackageName__1, PackageVersion__1],
|
|
340
|
-
[Result_8],
|
|
341
|
-
[],
|
|
342
|
-
),
|
|
285
|
+
'getFileHashes' : IDL.Func([PackageName, PackageVersion], [Result_8], []),
|
|
343
286
|
'getFileHashesByPackageIds' : IDL.Func(
|
|
344
287
|
[IDL.Vec(PackageId)],
|
|
345
288
|
[
|
|
@@ -350,21 +293,21 @@ export const idlFactory = ({ IDL }) => {
|
|
|
350
293
|
[],
|
|
351
294
|
),
|
|
352
295
|
'getFileHashesQuery' : IDL.Func(
|
|
353
|
-
[
|
|
296
|
+
[PackageName, PackageVersion],
|
|
354
297
|
[Result_8],
|
|
355
298
|
['query'],
|
|
356
299
|
),
|
|
357
300
|
'getFileIds' : IDL.Func(
|
|
358
|
-
[
|
|
301
|
+
[PackageName, PackageVersion],
|
|
359
302
|
[Result_7],
|
|
360
303
|
['query'],
|
|
361
304
|
),
|
|
362
305
|
'getHighestSemverBatch' : IDL.Func(
|
|
363
|
-
[IDL.Vec(IDL.Tuple(
|
|
306
|
+
[IDL.Vec(IDL.Tuple(PackageName, PackageVersion, SemverPart))],
|
|
364
307
|
[Result_6],
|
|
365
308
|
['query'],
|
|
366
309
|
),
|
|
367
|
-
'getHighestVersion' : IDL.Func([
|
|
310
|
+
'getHighestVersion' : IDL.Func([PackageName], [Result_5], ['query']),
|
|
368
311
|
'getMostDownloadedPackages' : IDL.Func(
|
|
369
312
|
[],
|
|
370
313
|
[IDL.Vec(PackageSummary)],
|
|
@@ -376,21 +319,31 @@ export const idlFactory = ({ IDL }) => {
|
|
|
376
319
|
['query'],
|
|
377
320
|
),
|
|
378
321
|
'getNewPackages' : IDL.Func([], [IDL.Vec(PackageSummary)], ['query']),
|
|
322
|
+
'getPackageDependents' : IDL.Func(
|
|
323
|
+
[PackageName, IDL.Nat, IDL.Nat],
|
|
324
|
+
[IDL.Vec(PackageSummary), IDL.Nat],
|
|
325
|
+
['query'],
|
|
326
|
+
),
|
|
379
327
|
'getPackageDetails' : IDL.Func(
|
|
380
|
-
[
|
|
328
|
+
[PackageName, PackageVersion],
|
|
381
329
|
[Result_4],
|
|
382
330
|
['query'],
|
|
383
331
|
),
|
|
384
332
|
'getPackageMaintainers' : IDL.Func(
|
|
385
|
-
[
|
|
333
|
+
[PackageName],
|
|
386
334
|
[IDL.Vec(IDL.Principal)],
|
|
387
335
|
['query'],
|
|
388
336
|
),
|
|
389
337
|
'getPackageOwners' : IDL.Func(
|
|
390
|
-
[
|
|
338
|
+
[PackageName],
|
|
391
339
|
[IDL.Vec(IDL.Principal)],
|
|
392
340
|
['query'],
|
|
393
341
|
),
|
|
342
|
+
'getPackageVersionHistory' : IDL.Func(
|
|
343
|
+
[PackageName],
|
|
344
|
+
[IDL.Vec(PackageSummaryWithChanges)],
|
|
345
|
+
['query'],
|
|
346
|
+
),
|
|
394
347
|
'getPackagesByCategory' : IDL.Func(
|
|
395
348
|
[],
|
|
396
349
|
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(PackageSummary)))],
|
|
@@ -408,24 +361,16 @@ export const idlFactory = ({ IDL }) => {
|
|
|
408
361
|
),
|
|
409
362
|
'getTotalDownloads' : IDL.Func([], [IDL.Nat], ['query']),
|
|
410
363
|
'getTotalPackages' : IDL.Func([], [IDL.Nat], ['query']),
|
|
411
|
-
'getUser' : IDL.Func([IDL.Principal], [IDL.Opt(
|
|
364
|
+
'getUser' : IDL.Func([IDL.Principal], [IDL.Opt(User)], ['query']),
|
|
412
365
|
'http_request' : IDL.Func([Request], [Response], ['query']),
|
|
413
|
-
'notifyInstall' : IDL.Func(
|
|
414
|
-
[PackageName__1, PackageVersion__1],
|
|
415
|
-
[],
|
|
416
|
-
['oneway'],
|
|
417
|
-
),
|
|
366
|
+
'notifyInstall' : IDL.Func([PackageName, PackageVersion], [], ['oneway']),
|
|
418
367
|
'notifyInstalls' : IDL.Func(
|
|
419
|
-
[IDL.Vec(IDL.Tuple(
|
|
368
|
+
[IDL.Vec(IDL.Tuple(PackageName, PackageVersion))],
|
|
420
369
|
[],
|
|
421
370
|
['oneway'],
|
|
422
371
|
),
|
|
423
|
-
'removeMaintainer' : IDL.Func(
|
|
424
|
-
|
|
425
|
-
[Result_3],
|
|
426
|
-
[],
|
|
427
|
-
),
|
|
428
|
-
'removeOwner' : IDL.Func([PackageName__1, IDL.Principal], [Result_3], []),
|
|
372
|
+
'removeMaintainer' : IDL.Func([PackageName, IDL.Principal], [Result_3], []),
|
|
373
|
+
'removeOwner' : IDL.Func([PackageName, IDL.Principal], [Result_3], []),
|
|
429
374
|
'restore' : IDL.Func([IDL.Nat], [], []),
|
|
430
375
|
'search' : IDL.Func(
|
|
431
376
|
[Text, IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)],
|
|
@@ -440,9 +385,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
440
385
|
[],
|
|
441
386
|
),
|
|
442
387
|
'startPublish' : IDL.Func([PackageConfigV3_Publishing], [Result_1], []),
|
|
388
|
+
'takeSnapshotsIfNeeded' : IDL.Func([], [], []),
|
|
443
389
|
'transformRequest' : IDL.Func(
|
|
444
|
-
[
|
|
445
|
-
[
|
|
390
|
+
[TransformArg],
|
|
391
|
+
[HttpRequestResult],
|
|
446
392
|
['query'],
|
|
447
393
|
),
|
|
448
394
|
'uploadBenchmarks' : IDL.Func([PublishingId, Benchmarks], [Result], []),
|
package/dist/api/actors.js
CHANGED
|
@@ -15,6 +15,7 @@ let getAgent = async (identity) => {
|
|
|
15
15
|
identity,
|
|
16
16
|
shouldFetchRootKey: network === 'local',
|
|
17
17
|
verifyQuerySignatures: process.env.MOPS_VERIFY_QUERY_SIGNATURES !== 'false',
|
|
18
|
+
shouldSyncTime: true,
|
|
18
19
|
});
|
|
19
20
|
agentPromiseByPrincipal.set(principal, agentPromise);
|
|
20
21
|
}
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,6 @@ import process from 'node:process';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import events from 'node:events';
|
|
4
4
|
import { Command, Argument, Option } from 'commander';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
5
|
import { init } from './commands/init.js';
|
|
7
6
|
import { publish } from './commands/publish.js';
|
|
8
7
|
import { sources } from './commands/sources.js';
|
|
@@ -84,10 +83,6 @@ program
|
|
|
84
83
|
.option('--verbose')
|
|
85
84
|
.addOption(new Option('--lock <action>', 'Lockfile action').choices(['check', 'update', 'ignore']))
|
|
86
85
|
.action(async (options) => {
|
|
87
|
-
if (process.argv.at(-1) !== 'install' && process.argv.at(-1) !== 'i') {
|
|
88
|
-
console.log(`${chalk.red('Error:')} ${chalk.yellow('mops install')} command installs all dependencies.\nUse ${chalk.green(`mops add ${process.argv.at(-1)}`)} instead.`);
|
|
89
|
-
process.exit(1);
|
|
90
|
-
}
|
|
91
86
|
if (!checkConfigFile()) {
|
|
92
87
|
process.exit(1);
|
|
93
88
|
}
|
|
@@ -10,7 +10,7 @@ import Bench "mo:bench";
|
|
|
10
10
|
|
|
11
11
|
import UserBench "./user-bench"; // file path will be replaced with the *.bench.mo file path
|
|
12
12
|
|
|
13
|
-
actor class() {
|
|
13
|
+
persistent actor class() {
|
|
14
14
|
type BenchResult = {
|
|
15
15
|
instructions : Int;
|
|
16
16
|
rts_mutator_instructions : Int;
|
|
@@ -24,7 +24,7 @@ actor class() {
|
|
|
24
24
|
rts_reclaimed : Int;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
var benchOpt : ?Bench.Bench = null;
|
|
27
|
+
transient var benchOpt : ?Bench.Bench = null;
|
|
28
28
|
|
|
29
29
|
public func init() : async Bench.BenchSchema {
|
|
30
30
|
let bench = UserBench.init();
|
package/dist/commands/bench.js
CHANGED
|
@@ -175,6 +175,9 @@ function computeDiffAll(currentResults, prevResults, rows, cols) {
|
|
|
175
175
|
}
|
|
176
176
|
function getMocArgs(options) {
|
|
177
177
|
let args = '';
|
|
178
|
+
if (options.compilerVersion && new SemVer(options.compilerVersion).compare('0.15.0') >= 0) {
|
|
179
|
+
args += ' --legacy-persistence';
|
|
180
|
+
}
|
|
178
181
|
if (options.forceGc) {
|
|
179
182
|
args += ' --force-gc';
|
|
180
183
|
}
|
package/dist/commands/publish.js
CHANGED
|
@@ -44,7 +44,7 @@ export async function publish(options = {}) {
|
|
|
44
44
|
// desired fields
|
|
45
45
|
for (let key of ['description', 'repository']) {
|
|
46
46
|
// @ts-ignore
|
|
47
|
-
if (!config.package[key]) {
|
|
47
|
+
if (!config.package[key] && !process.env.CI) {
|
|
48
48
|
let res = await prompts({
|
|
49
49
|
type: 'confirm',
|
|
50
50
|
name: 'ok',
|
|
@@ -113,6 +113,18 @@ export async function publish(options = {}) {
|
|
|
113
113
|
}
|
|
114
114
|
delete dep.path;
|
|
115
115
|
}
|
|
116
|
+
for (let dep of Object.values(config.dependencies)) {
|
|
117
|
+
if (dep.repo && !process.env.CI) {
|
|
118
|
+
let res = await prompts({
|
|
119
|
+
type: 'confirm',
|
|
120
|
+
name: 'ok',
|
|
121
|
+
message: chalk.yellow('GitHub dependencies make the registry less reliable and limit its capabilities.\nIf you are the owner of the dependency, please consider publishing it to the Mops registry.') + '\n\nPublish anyway?',
|
|
122
|
+
});
|
|
123
|
+
if (!res.ok) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
116
128
|
}
|
|
117
129
|
if (config['dev-dependencies']) {
|
|
118
130
|
if (Object.keys(config['dev-dependencies']).length > 100) {
|
|
@@ -182,7 +182,7 @@ export async function testWithReporter(reporterName, filter = '', defaultMode =
|
|
|
182
182
|
if (lines.includes('// @testmode wasi')) {
|
|
183
183
|
mode = 'wasi';
|
|
184
184
|
}
|
|
185
|
-
else if (lines.includes('
|
|
185
|
+
else if (lines.includes('// @testmode replica') || lines.find(line => line.match(/^(persistent )?actor( class)?/))) {
|
|
186
186
|
mode = 'replica';
|
|
187
187
|
}
|
|
188
188
|
if (mode === 'wasi' && !wasmtimePath) {
|
|
@@ -233,6 +233,7 @@ export async function testWithReporter(reporterName, filter = '', defaultMode =
|
|
|
233
233
|
'-C', 'cache=n',
|
|
234
234
|
'-W', 'bulk-memory',
|
|
235
235
|
'-W', 'multi-memory',
|
|
236
|
+
'-W', 'memory64',
|
|
236
237
|
'-W', 'max-wasm-stack=4000000',
|
|
237
238
|
'-W', 'nan-canonicalization=y',
|
|
238
239
|
wasmFile,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
|
+
import { SemVer } from 'semver';
|
|
4
5
|
import { globalCacheDir } from '../../mops.js';
|
|
5
6
|
import * as toolchainUtils from './toolchain-utils.js';
|
|
6
7
|
let cacheDir = path.join(globalCacheDir, 'moc');
|
|
@@ -31,11 +32,16 @@ export let download = async (version, { silent = false, verbose = false } = {})
|
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
let url;
|
|
34
|
-
if (
|
|
35
|
+
if (new SemVer(version).compare(new SemVer('0.14.6')) >= 0) {
|
|
35
36
|
let platfrom = process.platform == 'darwin' ? 'Darwin' : 'Linux';
|
|
36
|
-
let arch = process.arch.startsWith('arm')
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
let arch = process.arch.startsWith('arm')
|
|
38
|
+
? (process.platform == 'darwin' ? 'arm64' : 'aarch64')
|
|
39
|
+
: 'x86_64';
|
|
40
|
+
url = `https://github.com/dfinity/motoko/releases/download/${version}/motoko-${platfrom}-${arch}-${version}.tar.gz`;
|
|
41
|
+
}
|
|
42
|
+
else if (new SemVer(version).compare(new SemVer('0.9.5')) >= 0) {
|
|
43
|
+
let platfrom = process.platform == 'darwin' ? 'Darwin' : 'Linux';
|
|
44
|
+
let arch = 'x86_64';
|
|
39
45
|
url = `https://github.com/dfinity/motoko/releases/download/${version}/motoko-${platfrom}-${arch}-${version}.tar.gz`;
|
|
40
46
|
}
|
|
41
47
|
else {
|
|
@@ -3,6 +3,8 @@ export declare class ErrorChecker {
|
|
|
3
3
|
canisters: Record<string, string>;
|
|
4
4
|
status: 'pending' | 'running' | 'error' | 'success';
|
|
5
5
|
errors: string[];
|
|
6
|
+
totalFiles: number;
|
|
7
|
+
processedFiles: number;
|
|
6
8
|
constructor({ verbose, canisters }: {
|
|
7
9
|
verbose: boolean;
|
|
8
10
|
canisters: Record<string, string>;
|
|
@@ -12,6 +12,8 @@ export class ErrorChecker {
|
|
|
12
12
|
canisters = {};
|
|
13
13
|
status = 'pending';
|
|
14
14
|
errors = [];
|
|
15
|
+
totalFiles = 0;
|
|
16
|
+
processedFiles = 0;
|
|
15
17
|
constructor({ verbose, canisters }) {
|
|
16
18
|
this.verbose = verbose;
|
|
17
19
|
this.canisters = canisters;
|
|
@@ -19,6 +21,8 @@ export class ErrorChecker {
|
|
|
19
21
|
reset() {
|
|
20
22
|
this.status = 'pending';
|
|
21
23
|
this.errors = [];
|
|
24
|
+
this.totalFiles = 0;
|
|
25
|
+
this.processedFiles = 0;
|
|
22
26
|
}
|
|
23
27
|
async run(onProgress) {
|
|
24
28
|
this.reset();
|
|
@@ -27,10 +31,9 @@ export class ErrorChecker {
|
|
|
27
31
|
let rootDir = getRootDir();
|
|
28
32
|
let mocPath = getMocPath();
|
|
29
33
|
let deps = await sources({ cwd: rootDir });
|
|
30
|
-
let paths =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
+
let paths = globMoFiles(rootDir);
|
|
35
|
+
this.totalFiles = paths.length;
|
|
36
|
+
this.processedFiles = 0;
|
|
34
37
|
await parallel(os.cpus().length, paths, async (file) => {
|
|
35
38
|
try {
|
|
36
39
|
await promisify(execFile)(mocPath, ['--check', ...deps.flatMap(x => x.split(' ')), file], { cwd: rootDir });
|
|
@@ -53,8 +56,9 @@ export class ErrorChecker {
|
|
|
53
56
|
// console.log('UNKNOWN ERROR', line);
|
|
54
57
|
}
|
|
55
58
|
});
|
|
56
|
-
onProgress();
|
|
57
59
|
}
|
|
60
|
+
this.processedFiles++;
|
|
61
|
+
onProgress();
|
|
58
62
|
});
|
|
59
63
|
this.status = this.errors.length ? 'error' : 'success';
|
|
60
64
|
onProgress();
|
|
@@ -64,12 +68,13 @@ export class ErrorChecker {
|
|
|
64
68
|
return `Errors: ${chalk.gray('(pending)')}`;
|
|
65
69
|
}
|
|
66
70
|
if (this.status === 'running') {
|
|
67
|
-
return `Errors: ${chalk.gray('(running)')}`;
|
|
71
|
+
return `Errors: ${this.processedFiles}/${this.totalFiles} ${chalk.gray('(running)')}`;
|
|
68
72
|
}
|
|
69
73
|
let output = '';
|
|
70
|
-
|
|
74
|
+
let uniqueErrors = [...new Set(this.errors)];
|
|
75
|
+
output += `Errors: ${chalk.bold[uniqueErrors.length ? 'redBright' : 'green'](uniqueErrors.length)}`;
|
|
71
76
|
if (this.verbose && this.errors.length) {
|
|
72
|
-
output += `\n ${
|
|
77
|
+
output += `\n ${uniqueErrors.join('\n ')}`;
|
|
73
78
|
}
|
|
74
79
|
return output;
|
|
75
80
|
}
|
|
@@ -6,9 +6,10 @@ let globConfig = {
|
|
|
6
6
|
'**/.mops/**',
|
|
7
7
|
'**/.vessel/**',
|
|
8
8
|
'**/.git/**',
|
|
9
|
+
'**/.dfx/**',
|
|
10
|
+
'**/{build,bundle,dist}/**',
|
|
9
11
|
],
|
|
10
12
|
};
|
|
11
13
|
export function globMoFiles(rootDir) {
|
|
12
|
-
|
|
13
|
-
return globSync('src/**/*.mo', { cwd: rootDir, ...globConfig });
|
|
14
|
+
return globSync('**/*.mo', { cwd: rootDir, ...globConfig });
|
|
14
15
|
}
|
|
@@ -8,6 +8,8 @@ export declare class WarningChecker {
|
|
|
8
8
|
aborted: boolean;
|
|
9
9
|
controllers: Map<string, AbortController>;
|
|
10
10
|
currentRun: Promise<any> | undefined;
|
|
11
|
+
totalFiles: number;
|
|
12
|
+
processedFiles: number;
|
|
11
13
|
constructor({ verbose, canisters, errorChecker }: {
|
|
12
14
|
verbose: boolean;
|
|
13
15
|
canisters: Record<string, string>;
|
|
@@ -16,6 +16,8 @@ export class WarningChecker {
|
|
|
16
16
|
aborted = false;
|
|
17
17
|
controllers = new Map();
|
|
18
18
|
currentRun;
|
|
19
|
+
totalFiles = 0;
|
|
20
|
+
processedFiles = 0;
|
|
19
21
|
constructor({ verbose, canisters, errorChecker }) {
|
|
20
22
|
this.verbose = verbose;
|
|
21
23
|
this.canisters = canisters;
|
|
@@ -24,6 +26,8 @@ export class WarningChecker {
|
|
|
24
26
|
reset() {
|
|
25
27
|
this.status = 'pending';
|
|
26
28
|
this.warnings = [];
|
|
29
|
+
this.totalFiles = 0;
|
|
30
|
+
this.processedFiles = 0;
|
|
27
31
|
}
|
|
28
32
|
async abortCurrent() {
|
|
29
33
|
this.aborted = true;
|
|
@@ -47,10 +51,9 @@ export class WarningChecker {
|
|
|
47
51
|
let rootDir = getRootDir();
|
|
48
52
|
let mocPath = getMocPath();
|
|
49
53
|
let deps = await sources({ cwd: rootDir });
|
|
50
|
-
let paths =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
+
let paths = globMoFiles(rootDir);
|
|
55
|
+
this.totalFiles = paths.length;
|
|
56
|
+
this.processedFiles = 0;
|
|
54
57
|
this.currentRun = parallel(os.cpus().length, paths, async (file) => {
|
|
55
58
|
let controller = new AbortController();
|
|
56
59
|
let { signal } = controller;
|
|
@@ -83,9 +86,10 @@ export class WarningChecker {
|
|
|
83
86
|
// console.log('UNKNOWN WARNING', line);
|
|
84
87
|
}
|
|
85
88
|
});
|
|
86
|
-
onProgress();
|
|
87
89
|
}
|
|
88
90
|
this.controllers.delete(file);
|
|
91
|
+
this.processedFiles++;
|
|
92
|
+
onProgress();
|
|
89
93
|
});
|
|
90
94
|
await this.currentRun;
|
|
91
95
|
if (!this.aborted) {
|
|
@@ -98,15 +102,16 @@ export class WarningChecker {
|
|
|
98
102
|
return `Warnings: ${chalk.gray('(pending)')}`;
|
|
99
103
|
}
|
|
100
104
|
if (this.status === 'running') {
|
|
101
|
-
return `Warnings: ${chalk.gray('(running)')}`;
|
|
105
|
+
return `Warnings: ${this.processedFiles}/${this.totalFiles} ${chalk.gray('(running)')}`;
|
|
102
106
|
}
|
|
103
107
|
if (this.status === 'syntax-error') {
|
|
104
108
|
return `Warnings: ${chalk.gray('(errors)')}`;
|
|
105
109
|
}
|
|
106
110
|
let output = '';
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
let uniqueWarnings = [...new Set(this.warnings)];
|
|
112
|
+
output += `Warnings: ${chalk.bold[uniqueWarnings.length ? 'yellowBright' : 'green'](uniqueWarnings.length)}`;
|
|
113
|
+
if (this.verbose && uniqueWarnings.length) {
|
|
114
|
+
output += `\n ${uniqueWarnings.join('\n ')}`;
|
|
110
115
|
}
|
|
111
116
|
return output;
|
|
112
117
|
}
|
|
@@ -3,9 +3,9 @@ type _anon_class_13_1 =
|
|
|
3
3
|
getSchema: () -> (BenchSchema) query;
|
|
4
4
|
getStats: () -> (BenchResult) query;
|
|
5
5
|
init: () -> (BenchSchema);
|
|
6
|
-
runCellQuery: (nat, nat) -> (BenchResult) query;
|
|
7
|
-
runCellUpdate: (nat, nat) -> (BenchResult);
|
|
8
|
-
runCellUpdateAwait: (nat, nat) -> (BenchResult);
|
|
6
|
+
runCellQuery: (rowIndex: nat, colIndex: nat) -> (BenchResult) query;
|
|
7
|
+
runCellUpdate: (rowIndex: nat, colIndex: nat) -> (BenchResult);
|
|
8
|
+
runCellUpdateAwait: (rowIndex: nat, colIndex: nat) -> (BenchResult);
|
|
9
9
|
};
|
|
10
10
|
type BenchSchema =
|
|
11
11
|
record {
|