ic-mops 0.39.2 → 0.40.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/.eslintrc.json +0 -0
- package/.gitignore +1 -0
- package/README.md +0 -0
- package/api/actors.ts +2 -2
- package/api/downloadPackageFiles.ts +9 -6
- package/api/getHighestVersion.ts +1 -1
- package/api/index.ts +0 -0
- package/api/network.ts +1 -1
- package/api/resolveVersion.ts +1 -1
- package/cache.ts +3 -3
- package/cli.ts +3 -2
- package/commands/add.ts +6 -6
- package/commands/available-updates.ts +2 -2
- package/commands/bench/bench-canister.mo +0 -0
- package/commands/bench/user-bench.mo +0 -0
- package/commands/bench-replica.ts +10 -10
- package/commands/bench.ts +96 -56
- package/commands/bump.ts +2 -2
- package/commands/docs.ts +1 -1
- package/commands/import-identity.ts +2 -2
- package/commands/init.ts +9 -9
- package/commands/install-all.ts +4 -4
- package/commands/install-local.ts +1 -1
- package/commands/install.ts +2 -2
- package/commands/outdated.ts +0 -0
- package/commands/publish.ts +34 -9
- package/commands/remove.ts +8 -8
- package/commands/search.ts +2 -2
- package/commands/sources.ts +0 -0
- package/commands/sync.ts +8 -8
- package/commands/template.ts +2 -2
- package/commands/test/mmf1.ts +18 -18
- package/commands/test/reporters/compact-reporter.ts +5 -5
- package/commands/test/reporters/files-reporter.ts +3 -3
- package/commands/test/reporters/reporter.ts +3 -3
- package/commands/test/reporters/silent-reporter.ts +4 -4
- package/commands/test/reporters/verbose-reporter.ts +3 -3
- package/commands/test/test.ts +10 -10
- package/commands/test/utils.ts +1 -1
- package/commands/toolchain/index.ts +9 -9
- package/commands/toolchain/moc.ts +2 -2
- package/commands/toolchain/pocket-ic.ts +6 -31
- package/commands/toolchain/toolchain-utils.ts +11 -11
- package/commands/toolchain/wasmtime.ts +2 -2
- package/commands/transfer-ownership.ts +2 -2
- package/commands/update.ts +4 -4
- package/commands/user.ts +2 -2
- package/commands/whoami.ts +0 -0
- package/declarations/bench/bench.did.d.ts +3 -0
- package/declarations/main/main.did +27 -1
- package/declarations/main/main.did.d.ts +26 -1
- package/declarations/main/main.did.js +27 -1
- package/declarations/storage/index.d.ts +0 -0
- package/declarations/storage/index.js +0 -0
- package/declarations/storage/storage.did +0 -0
- package/declarations/storage/storage.did.d.ts +0 -0
- package/declarations/storage/storage.did.js +0 -0
- package/dist/api/actors.d.ts +0 -0
- package/dist/api/actors.js +0 -0
- package/dist/api/downloadPackageFiles.d.ts +1 -1
- package/dist/api/downloadPackageFiles.js +4 -0
- package/dist/api/getHighestVersion.d.ts +0 -0
- package/dist/api/getHighestVersion.js +0 -0
- package/dist/api/index.d.ts +0 -0
- package/dist/api/index.js +0 -0
- package/dist/api/network.d.ts +0 -0
- package/dist/api/network.js +0 -0
- package/dist/api/resolveVersion.d.ts +0 -0
- package/dist/api/resolveVersion.js +0 -0
- package/dist/bin/moc-wrapper.sh +3 -0
- package/dist/bin/mops.d.ts +0 -0
- package/dist/bin/mops.js +0 -0
- package/dist/bundle-package-json.d.ts +1 -0
- package/dist/bundle-package-json.js +11 -0
- package/dist/cache.d.ts +0 -0
- package/dist/cache.js +0 -0
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +1 -0
- package/dist/commands/add.d.ts +0 -0
- package/dist/commands/add.js +0 -0
- package/dist/commands/available-updates.d.ts +0 -0
- package/dist/commands/available-updates.js +0 -0
- package/dist/commands/bench/bench-canister.mo +0 -0
- package/dist/commands/bench/user-bench.mo +0 -0
- package/dist/commands/bench-replica.d.ts +3 -1
- package/dist/commands/bench-replica.js +2 -2
- package/dist/commands/bench.d.ts +5 -2
- package/dist/commands/bench.js +66 -29
- package/dist/commands/bump.d.ts +0 -0
- package/dist/commands/bump.js +0 -0
- package/dist/commands/docs.d.ts +0 -0
- package/dist/commands/docs.js +0 -0
- package/dist/commands/import-identity.d.ts +0 -0
- package/dist/commands/import-identity.js +0 -0
- package/dist/commands/init.d.ts +0 -0
- package/dist/commands/init.js +1 -1
- package/dist/commands/install-all.d.ts +0 -0
- package/dist/commands/install-all.js +0 -0
- package/dist/commands/install-local.d.ts +0 -0
- package/dist/commands/install-local.js +0 -0
- package/dist/commands/install.d.ts +0 -0
- package/dist/commands/install.js +0 -0
- package/dist/commands/outdated.d.ts +0 -0
- package/dist/commands/outdated.js +0 -0
- package/dist/commands/publish.d.ts +1 -0
- package/dist/commands/publish.js +24 -1
- package/dist/commands/remove.d.ts +0 -0
- package/dist/commands/remove.js +0 -0
- package/dist/commands/search.d.ts +0 -0
- package/dist/commands/search.js +0 -0
- package/dist/commands/self-update.d.ts +0 -0
- package/dist/commands/self-update.js +0 -0
- package/dist/commands/self.d.ts +3 -0
- package/dist/commands/self.js +62 -0
- package/dist/commands/sources.d.ts +0 -0
- package/dist/commands/sources.js +0 -0
- package/dist/commands/sync.d.ts +0 -0
- package/dist/commands/sync.js +0 -0
- package/dist/commands/template.d.ts +0 -0
- package/dist/commands/template.js +0 -0
- package/dist/commands/test/mmf1.d.ts +0 -0
- package/dist/commands/test/mmf1.js +1 -1
- package/dist/commands/test/reporters/compact-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/compact-reporter.js +0 -0
- package/dist/commands/test/reporters/files-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/files-reporter.js +0 -0
- package/dist/commands/test/reporters/reporter.d.ts +0 -0
- package/dist/commands/test/reporters/reporter.js +0 -0
- package/dist/commands/test/reporters/silent-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/silent-reporter.js +0 -0
- package/dist/commands/test/reporters/verbose-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/verbose-reporter.js +0 -0
- package/dist/commands/test/test.d.ts +0 -0
- package/dist/commands/test/test.js +2 -2
- package/dist/commands/test/utils.d.ts +0 -0
- package/dist/commands/test/utils.js +0 -0
- package/dist/commands/toolchain/index.d.ts +0 -0
- package/dist/commands/toolchain/index.js +0 -0
- package/dist/commands/toolchain/moc.d.ts +0 -0
- package/dist/commands/toolchain/moc.js +0 -0
- package/dist/commands/toolchain/pocket-ic.d.ts +1 -5
- package/dist/commands/toolchain/pocket-ic.js +4 -27
- package/dist/commands/toolchain/toolchain-utils.d.ts +1 -1
- package/dist/commands/toolchain/toolchain-utils.js +7 -7
- package/dist/commands/toolchain/wasmtime.d.ts +0 -0
- package/dist/commands/toolchain/wasmtime.js +0 -0
- package/dist/commands/transfer-ownership.d.ts +0 -0
- package/dist/commands/transfer-ownership.js +1 -1
- package/dist/commands/update.d.ts +0 -0
- package/dist/commands/update.js +0 -0
- package/dist/commands/user.d.ts +0 -0
- package/dist/commands/user.js +0 -0
- package/dist/commands/whoami.d.ts +0 -0
- package/dist/commands/whoami.js +0 -0
- package/dist/declarations/bench/bench.did +0 -0
- package/dist/declarations/bench/bench.did.d.ts +3 -0
- package/dist/declarations/bench/bench.did.js +0 -0
- package/dist/declarations/bench/index.d.ts +0 -0
- package/dist/declarations/bench/index.js +0 -0
- package/dist/declarations/main/index.d.ts +0 -0
- package/dist/declarations/main/index.js +0 -0
- package/dist/declarations/main/main.did +27 -1
- package/dist/declarations/main/main.did.d.ts +26 -1
- package/dist/declarations/main/main.did.js +27 -1
- package/dist/declarations/storage/index.d.ts +0 -0
- package/dist/declarations/storage/index.js +0 -0
- package/dist/declarations/storage/storage.did +0 -0
- package/dist/declarations/storage/storage.did.d.ts +0 -0
- package/dist/declarations/storage/storage.did.js +0 -0
- package/dist/helpers/find-changelog-entry.d.ts +1 -0
- package/dist/helpers/find-changelog-entry.js +24 -0
- package/dist/helpers/get-dfx-version.d.ts +0 -0
- package/dist/helpers/get-dfx-version.js +0 -0
- package/dist/helpers/get-moc-path.d.ts +0 -0
- package/dist/helpers/get-moc-path.js +0 -0
- package/dist/helpers/get-moc-version.d.ts +0 -0
- package/dist/helpers/get-moc-version.js +0 -0
- package/dist/integrity.d.ts +0 -0
- package/dist/integrity.js +0 -0
- package/dist/mops.d.ts +0 -0
- package/dist/mops.js +1 -1
- package/dist/notify-installs.d.ts +0 -0
- package/dist/notify-installs.js +0 -0
- package/dist/package.json +1 -1
- package/dist/parallel.d.ts +0 -0
- package/dist/parallel.js +0 -0
- package/dist/pem.d.ts +0 -0
- package/dist/pem.js +0 -0
- package/dist/release-cli.d.ts +1 -0
- package/dist/release-cli.js +35 -0
- package/dist/remove-scripts.d.ts +1 -0
- package/dist/remove-scripts.js +5 -0
- package/dist/resolve-packages.d.ts +0 -0
- package/dist/resolve-packages.js +0 -0
- package/dist/templates/README.md +0 -0
- package/dist/templates/licenses/Apache-2.0 +0 -0
- package/dist/templates/licenses/Apache-2.0-NOTICE +0 -0
- package/dist/templates/licenses/MIT +0 -0
- package/dist/templates/mops-publish.yml +0 -0
- package/dist/templates/mops-test.yml +0 -0
- package/dist/templates/src/lib.mo +0 -0
- package/dist/templates/test/lib.test.mo +0 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.js +0 -0
- package/dist/vessel.d.ts +0 -0
- package/dist/vessel.js +1 -1
- package/global.d.ts +0 -0
- package/helpers/get-dfx-version.ts +1 -1
- package/helpers/get-moc-path.ts +1 -1
- package/helpers/get-moc-version.ts +1 -1
- package/integrity.ts +16 -16
- package/mops.ts +17 -17
- package/notify-installs.ts +2 -2
- package/package.json +1 -1
- package/parallel.ts +1 -1
- package/pem.ts +5 -5
- package/resolve-packages.ts +9 -9
- package/templates/README.md +0 -0
- package/templates/licenses/Apache-2.0 +0 -0
- package/templates/licenses/Apache-2.0-NOTICE +0 -0
- package/templates/licenses/MIT +0 -0
- package/templates/mops-publish.yml +0 -0
- package/templates/mops-test.yml +0 -0
- package/templates/src/lib.mo +0 -0
- package/templates/test/lib.test.mo +0 -0
- package/types.ts +25 -25
- package/vessel.ts +16 -16
- package/dist/commands/replica.d.ts +0 -36
- package/dist/commands/replica.js +0 -103
|
File without changes
|
package/dist/commands/whoami.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Principal } from '@dfinity/principal';
|
|
2
2
|
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
import type { IDL } from '@dfinity/candid';
|
|
3
4
|
|
|
4
5
|
export interface BenchResult {
|
|
5
6
|
'instructions' : bigint,
|
|
@@ -24,3 +25,5 @@ export interface anon_class_10_1 {
|
|
|
24
25
|
'runCellUpdateAwait' : ActorMethod<[bigint, bigint], BenchResult>,
|
|
25
26
|
}
|
|
26
27
|
export interface _SERVICE extends anon_class_10_1 {}
|
|
28
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
29
|
+
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -216,6 +216,7 @@ type PackageFileStatsPublic =
|
|
|
216
216
|
};
|
|
217
217
|
type PackageDetails =
|
|
218
218
|
record {
|
|
219
|
+
benchmarks: Benchmarks__1;
|
|
219
220
|
changes: PackageChanges;
|
|
220
221
|
config: PackageConfigV2__1;
|
|
221
222
|
dependents: vec PackageSummary__1;
|
|
@@ -273,9 +274,11 @@ type PackageConfigV2 =
|
|
|
273
274
|
};
|
|
274
275
|
type PackageChanges =
|
|
275
276
|
record {
|
|
277
|
+
curBenchmarks: Benchmarks__1;
|
|
276
278
|
deps: vec DepChange;
|
|
277
279
|
devDeps: vec DepChange;
|
|
278
280
|
notes: text;
|
|
281
|
+
prevBenchmarks: Benchmarks__1;
|
|
279
282
|
tests: TestsChanges;
|
|
280
283
|
};
|
|
281
284
|
type Main =
|
|
@@ -303,6 +306,7 @@ type Main =
|
|
|
303
306
|
blob;
|
|
304
307
|
};
|
|
305
308
|
});
|
|
309
|
+
getFileHashesQuery: (PackageName, PackageVersion) -> (Result_8) query;
|
|
306
310
|
getFileIds: (PackageName, PackageVersion) -> (Result_7) query;
|
|
307
311
|
getHighestSemverBatch:
|
|
308
312
|
(vec record {
|
|
@@ -333,13 +337,14 @@ type Main =
|
|
|
333
337
|
PackageName;
|
|
334
338
|
PackageVersion;
|
|
335
339
|
}) -> () oneway;
|
|
336
|
-
restore: (nat
|
|
340
|
+
restore: (nat) -> ();
|
|
337
341
|
search: (Text, opt nat, opt nat) -> (vec PackageSummary, PageCount) query;
|
|
338
342
|
setUserProp: (text, text) -> (Result_1);
|
|
339
343
|
startFileUpload: (PublishingId, Text, nat, blob) -> (Result_3);
|
|
340
344
|
startPublish: (PackageConfigV2) -> (Result_2);
|
|
341
345
|
transferOwnership: (PackageName, principal) -> (Result_1);
|
|
342
346
|
transformRequest: (HttpTransformArg) -> (HttpResponse) query;
|
|
347
|
+
uploadBenchmarks: (PublishingId, Benchmarks) -> (Result);
|
|
343
348
|
uploadFileChunk: (PublishingId, FileId, nat, blob) -> (Result);
|
|
344
349
|
uploadNotes: (PublishingId, text) -> (Result);
|
|
345
350
|
uploadTestStats: (PublishingId, TestStats) -> (Result);
|
|
@@ -397,4 +402,25 @@ type DepChange =
|
|
|
397
402
|
newVersion: text;
|
|
398
403
|
oldVersion: text;
|
|
399
404
|
};
|
|
405
|
+
type Benchmarks__1 = vec Benchmark;
|
|
406
|
+
type Benchmarks = vec Benchmark;
|
|
407
|
+
type BenchmarkMetric = text;
|
|
408
|
+
type Benchmark =
|
|
409
|
+
record {
|
|
410
|
+
cols: vec text;
|
|
411
|
+
compiler: text;
|
|
412
|
+
compilerVersion: text;
|
|
413
|
+
description: text;
|
|
414
|
+
file: text;
|
|
415
|
+
forceGC: bool;
|
|
416
|
+
gc: text;
|
|
417
|
+
metrics: vec record {
|
|
418
|
+
BenchmarkMetric;
|
|
419
|
+
vec vec int;
|
|
420
|
+
};
|
|
421
|
+
name: text;
|
|
422
|
+
replica: text;
|
|
423
|
+
replicaVersion: text;
|
|
424
|
+
rows: vec text;
|
|
425
|
+
};
|
|
400
426
|
service : () -> Main
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import type { Principal } from '@dfinity/principal';
|
|
2
2
|
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
import type { IDL } from '@dfinity/candid';
|
|
3
4
|
|
|
5
|
+
export interface Benchmark {
|
|
6
|
+
'gc' : string,
|
|
7
|
+
'metrics' : Array<[BenchmarkMetric, Array<Array<bigint>>]>,
|
|
8
|
+
'cols' : Array<string>,
|
|
9
|
+
'file' : string,
|
|
10
|
+
'name' : string,
|
|
11
|
+
'rows' : Array<string>,
|
|
12
|
+
'description' : string,
|
|
13
|
+
'compilerVersion' : string,
|
|
14
|
+
'compiler' : string,
|
|
15
|
+
'replica' : string,
|
|
16
|
+
'replicaVersion' : string,
|
|
17
|
+
'forceGC' : boolean,
|
|
18
|
+
}
|
|
19
|
+
export type BenchmarkMetric = string;
|
|
20
|
+
export type Benchmarks = Array<Benchmark>;
|
|
21
|
+
export type Benchmarks__1 = Array<Benchmark>;
|
|
4
22
|
export interface DepChange {
|
|
5
23
|
'oldVersion' : string,
|
|
6
24
|
'name' : string,
|
|
@@ -60,6 +78,7 @@ export interface Main {
|
|
|
60
78
|
[Array<PackageId>],
|
|
61
79
|
Array<[PackageId, Array<[FileId, Uint8Array | number[]]>]>
|
|
62
80
|
>,
|
|
81
|
+
'getFileHashesQuery' : ActorMethod<[PackageName, PackageVersion], Result_8>,
|
|
63
82
|
'getFileIds' : ActorMethod<[PackageName, PackageVersion], Result_7>,
|
|
64
83
|
'getHighestSemverBatch' : ActorMethod<
|
|
65
84
|
[Array<[PackageName, PackageVersion, SemverPart]>],
|
|
@@ -88,7 +107,7 @@ export interface Main {
|
|
|
88
107
|
[Array<[PackageName, PackageVersion]>],
|
|
89
108
|
undefined
|
|
90
109
|
>,
|
|
91
|
-
'restore' : ActorMethod<[bigint
|
|
110
|
+
'restore' : ActorMethod<[bigint], undefined>,
|
|
92
111
|
'search' : ActorMethod<
|
|
93
112
|
[Text, [] | [bigint], [] | [bigint]],
|
|
94
113
|
[Array<PackageSummary>, PageCount]
|
|
@@ -101,6 +120,7 @@ export interface Main {
|
|
|
101
120
|
'startPublish' : ActorMethod<[PackageConfigV2], Result_2>,
|
|
102
121
|
'transferOwnership' : ActorMethod<[PackageName, Principal], Result_1>,
|
|
103
122
|
'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>,
|
|
123
|
+
'uploadBenchmarks' : ActorMethod<[PublishingId, Benchmarks], Result>,
|
|
104
124
|
'uploadFileChunk' : ActorMethod<
|
|
105
125
|
[PublishingId, FileId, bigint, Uint8Array | number[]],
|
|
106
126
|
Result
|
|
@@ -111,6 +131,8 @@ export interface Main {
|
|
|
111
131
|
export interface PackageChanges {
|
|
112
132
|
'tests' : TestsChanges,
|
|
113
133
|
'deps' : Array<DepChange>,
|
|
134
|
+
'curBenchmarks' : Benchmarks__1,
|
|
135
|
+
'prevBenchmarks' : Benchmarks__1,
|
|
114
136
|
'notes' : string,
|
|
115
137
|
'devDeps' : Array<DepChange>,
|
|
116
138
|
}
|
|
@@ -151,6 +173,7 @@ export interface PackageConfigV2__1 {
|
|
|
151
173
|
'readme' : string,
|
|
152
174
|
}
|
|
153
175
|
export interface PackageDetails {
|
|
176
|
+
'benchmarks' : Benchmarks__1,
|
|
154
177
|
'ownerInfo' : User,
|
|
155
178
|
'owner' : Principal,
|
|
156
179
|
'deps' : Array<PackageSummary__1>,
|
|
@@ -325,3 +348,5 @@ export interface User__1 {
|
|
|
325
348
|
'github' : string,
|
|
326
349
|
}
|
|
327
350
|
export interface _SERVICE extends Main {}
|
|
351
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
352
|
+
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
|
|
@@ -95,6 +95,22 @@ export const idlFactory = ({ IDL }) => {
|
|
|
95
95
|
'config' : PackageConfigV2__1,
|
|
96
96
|
'publication' : PackagePublication,
|
|
97
97
|
});
|
|
98
|
+
const BenchmarkMetric = IDL.Text;
|
|
99
|
+
const Benchmark = IDL.Record({
|
|
100
|
+
'gc' : IDL.Text,
|
|
101
|
+
'metrics' : IDL.Vec(IDL.Tuple(BenchmarkMetric, IDL.Vec(IDL.Vec(IDL.Int)))),
|
|
102
|
+
'cols' : IDL.Vec(IDL.Text),
|
|
103
|
+
'file' : IDL.Text,
|
|
104
|
+
'name' : IDL.Text,
|
|
105
|
+
'rows' : IDL.Vec(IDL.Text),
|
|
106
|
+
'description' : IDL.Text,
|
|
107
|
+
'compilerVersion' : IDL.Text,
|
|
108
|
+
'compiler' : IDL.Text,
|
|
109
|
+
'replica' : IDL.Text,
|
|
110
|
+
'replicaVersion' : IDL.Text,
|
|
111
|
+
'forceGC' : IDL.Bool,
|
|
112
|
+
});
|
|
113
|
+
const Benchmarks__1 = IDL.Vec(Benchmark);
|
|
98
114
|
const PackageSummary__1 = IDL.Record({
|
|
99
115
|
'ownerInfo' : User,
|
|
100
116
|
'owner' : IDL.Principal,
|
|
@@ -130,6 +146,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
130
146
|
const PackageChanges = IDL.Record({
|
|
131
147
|
'tests' : TestsChanges,
|
|
132
148
|
'deps' : IDL.Vec(DepChange),
|
|
149
|
+
'curBenchmarks' : Benchmarks__1,
|
|
150
|
+
'prevBenchmarks' : Benchmarks__1,
|
|
133
151
|
'notes' : IDL.Text,
|
|
134
152
|
'devDeps' : IDL.Vec(DepChange),
|
|
135
153
|
});
|
|
@@ -145,6 +163,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
145
163
|
'publication' : PackagePublication,
|
|
146
164
|
});
|
|
147
165
|
const PackageDetails = IDL.Record({
|
|
166
|
+
'benchmarks' : Benchmarks__1,
|
|
148
167
|
'ownerInfo' : User,
|
|
149
168
|
'owner' : IDL.Principal,
|
|
150
169
|
'deps' : IDL.Vec(PackageSummary__1),
|
|
@@ -255,6 +274,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
255
274
|
'context' : IDL.Vec(IDL.Nat8),
|
|
256
275
|
'response' : HttpResponse,
|
|
257
276
|
});
|
|
277
|
+
const Benchmarks = IDL.Vec(Benchmark);
|
|
258
278
|
const TestStats = IDL.Record({
|
|
259
279
|
'passedNames' : IDL.Vec(IDL.Text),
|
|
260
280
|
'passed' : IDL.Nat,
|
|
@@ -290,6 +310,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
290
310
|
],
|
|
291
311
|
[],
|
|
292
312
|
),
|
|
313
|
+
'getFileHashesQuery' : IDL.Func(
|
|
314
|
+
[PackageName, PackageVersion],
|
|
315
|
+
[Result_8],
|
|
316
|
+
['query'],
|
|
317
|
+
),
|
|
293
318
|
'getFileIds' : IDL.Func(
|
|
294
319
|
[PackageName, PackageVersion],
|
|
295
320
|
[Result_7],
|
|
@@ -342,7 +367,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
342
367
|
[],
|
|
343
368
|
['oneway'],
|
|
344
369
|
),
|
|
345
|
-
'restore' : IDL.Func([IDL.Nat
|
|
370
|
+
'restore' : IDL.Func([IDL.Nat], [], []),
|
|
346
371
|
'search' : IDL.Func(
|
|
347
372
|
[Text, IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)],
|
|
348
373
|
[IDL.Vec(PackageSummary), PageCount],
|
|
@@ -365,6 +390,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
365
390
|
[HttpResponse],
|
|
366
391
|
['query'],
|
|
367
392
|
),
|
|
393
|
+
'uploadBenchmarks' : IDL.Func([PublishingId, Benchmarks], [Result], []),
|
|
368
394
|
'uploadFileChunk' : IDL.Func(
|
|
369
395
|
[PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)],
|
|
370
396
|
[Result],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findChangelogEntry(changelog: string, version: string): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
2
|
+
import { toMarkdown } from 'mdast-util-to-markdown';
|
|
3
|
+
export function findChangelogEntry(changelog, version) {
|
|
4
|
+
let tree = fromMarkdown(changelog);
|
|
5
|
+
let found = false;
|
|
6
|
+
let nodes = [];
|
|
7
|
+
for (let node of tree.children) {
|
|
8
|
+
if (found) {
|
|
9
|
+
if (node.type === 'heading') {
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
nodes.push(node);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else if (node.type === 'heading' && toMarkdown(node).match(new RegExp(`\\b${version}\\b`))) {
|
|
17
|
+
found = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return toMarkdown({
|
|
21
|
+
type: 'root',
|
|
22
|
+
children: nodes,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/integrity.d.ts
CHANGED
|
File without changes
|
package/dist/integrity.js
CHANGED
|
File without changes
|
package/dist/mops.d.ts
CHANGED
|
File without changes
|
package/dist/mops.js
CHANGED
|
File without changes
|
package/dist/notify-installs.js
CHANGED
|
File without changes
|
package/dist/package.json
CHANGED
package/dist/parallel.d.ts
CHANGED
|
File without changes
|
package/dist/parallel.js
CHANGED
|
File without changes
|
package/dist/pem.d.ts
CHANGED
|
File without changes
|
package/dist/pem.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { URL } from 'node:url';
|
|
5
|
+
import { execSync } from 'node:child_process';
|
|
6
|
+
import semver from 'semver';
|
|
7
|
+
import { sha256 } from '@noble/hashes/sha256';
|
|
8
|
+
import { bytesToHex } from '@noble/hashes/utils';
|
|
9
|
+
import { findChangelogEntry } from './helpers/find-changelog-entry.js';
|
|
10
|
+
let __dirname = new URL('.', import.meta.url).pathname;
|
|
11
|
+
execSync('npm run prepare', { stdio: 'inherit', cwd: __dirname });
|
|
12
|
+
execSync('npm run bundle', { stdio: 'inherit', cwd: __dirname });
|
|
13
|
+
let version = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json'), 'utf8')).version;
|
|
14
|
+
let major = semver.parse(version)?.major;
|
|
15
|
+
let tag = semver.parse(version)?.prerelease[0] || 'latest';
|
|
16
|
+
let releaseNotes = findChangelogEntry(fs.readFileSync(path.resolve(__dirname, 'CHANGELOG.md'), 'utf8'), version);
|
|
17
|
+
let hash = bytesToHex(sha256(fs.readFileSync(path.resolve(__dirname, 'bundle/cli.tgz'))));
|
|
18
|
+
fs.cpSync(path.resolve(__dirname, 'bundle/cli.tgz'), path.resolve(__dirname, `../cli-releases/versions/${version}/cli.tgz`), { force: false, errorOnExist: true });
|
|
19
|
+
fs.writeFileSync(path.resolve(__dirname, `../cli-releases/versions/${version}/RELEASE_NOTES.md`), releaseNotes);
|
|
20
|
+
fs.writeFileSync(path.resolve(__dirname, `../cli-releases/versions/${version}/cli.tgz.sha256`), hash);
|
|
21
|
+
fs.cpSync(path.resolve(__dirname, `../cli-releases/versions/${version}`), path.resolve(__dirname, `../cli-releases/versions/${tag}`), { force: true, errorOnExist: false, recursive: true });
|
|
22
|
+
fs.cpSync(path.resolve(__dirname, `../cli-releases/versions/${version}`), path.resolve(__dirname, `../cli-releases/versions/${major}`), { force: true, errorOnExist: false, recursive: true });
|
|
23
|
+
fs.writeFileSync(path.resolve(__dirname, `../cli-releases/tags/${tag}`), version);
|
|
24
|
+
console.log(`Release '${version}' created with tag '${tag}'`);
|
|
25
|
+
if (!fs.existsSync(path.resolve(__dirname, '../cli-releases/releases.json'))) {
|
|
26
|
+
fs.writeFileSync(path.resolve(__dirname, '../cli-releases/releases.json'), JSON.stringify({ tags: {}, versions: {} }, null, 2));
|
|
27
|
+
}
|
|
28
|
+
let releases = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../cli-releases/releases.json'), 'utf8'));
|
|
29
|
+
releases.tags[tag] = version;
|
|
30
|
+
releases.versions[version] = {
|
|
31
|
+
relseaseNotes: releaseNotes,
|
|
32
|
+
hash,
|
|
33
|
+
url: `https://cli.mops.one/versions/${version}/cli.tgz`,
|
|
34
|
+
};
|
|
35
|
+
fs.writeFileSync(path.resolve(__dirname, '../cli-releases/releases.json'), JSON.stringify(releases, null, 2));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
package/dist/resolve-packages.js
CHANGED
|
File without changes
|
package/dist/templates/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
File without changes
|
package/dist/types.js
CHANGED
|
File without changes
|
package/dist/vessel.d.ts
CHANGED
|
File without changes
|
package/dist/vessel.js
CHANGED
|
@@ -37,7 +37,7 @@ export const readVesselConfig = async (dir, { cache = true, silent = false } = {
|
|
|
37
37
|
}
|
|
38
38
|
const [vessel, packageSetArray] = await Promise.all([
|
|
39
39
|
dhallFileToJson((dir || process.cwd()) + '/vessel.dhall', silent),
|
|
40
|
-
dhallFileToJson((dir || process.cwd()) + '/package-set.dhall', silent)
|
|
40
|
+
dhallFileToJson((dir || process.cwd()) + '/package-set.dhall', silent),
|
|
41
41
|
]);
|
|
42
42
|
if (!vessel || !packageSetArray) {
|
|
43
43
|
return null;
|
package/global.d.ts
CHANGED
|
File without changes
|
package/helpers/get-moc-path.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {execSync} from 'node:child_process';
|
|
2
2
|
import {getMocPath} from './get-moc-path.js';
|
|
3
3
|
|
|
4
|
-
export function getMocVersion(): string {
|
|
4
|
+
export function getMocVersion() : string {
|
|
5
5
|
let mocPath = getMocPath();
|
|
6
6
|
let match = execSync(mocPath).toString().trim().match(/Motoko compiler ([^\s]+) .*/);
|
|
7
7
|
return match?.[1] || '';
|
package/integrity.ts
CHANGED
|
@@ -7,24 +7,24 @@ import {mainActor} from './api/actors.js';
|
|
|
7
7
|
import {resolvePackages} from './resolve-packages.js';
|
|
8
8
|
|
|
9
9
|
type LockFileGeneric = {
|
|
10
|
-
version: number;
|
|
10
|
+
version : number;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
type LockFileV1 = {
|
|
14
|
-
version: 1;
|
|
15
|
-
mopsTomlHash: string;
|
|
16
|
-
hashes: Record<string, Record<string, string>>;
|
|
14
|
+
version : 1;
|
|
15
|
+
mopsTomlHash : string;
|
|
16
|
+
hashes : Record<string, Record<string, string>>;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
type LockFileV2 = {
|
|
20
|
-
version: 2;
|
|
21
|
-
mopsTomlDepsHash: string;
|
|
22
|
-
hashes: Record<string, Record<string, string>>;
|
|
20
|
+
version : 2;
|
|
21
|
+
mopsTomlDepsHash : string;
|
|
22
|
+
hashes : Record<string, Record<string, string>>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
type LockFile = LockFileV1 | LockFileV2;
|
|
26
26
|
|
|
27
|
-
export async function checkIntegrity(lock?: 'check' | 'update' | 'ignore') {
|
|
27
|
+
export async function checkIntegrity(lock ?: 'check' | 'update' | 'ignore') {
|
|
28
28
|
let force = !!lock;
|
|
29
29
|
|
|
30
30
|
if (!lock && !process.env['CI'] && fs.existsSync(path.join(getRootDir(), 'mops.lock'))) {
|
|
@@ -44,14 +44,14 @@ export async function checkIntegrity(lock?: 'check' | 'update' | 'ignore') {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
async function getFileHashesFromRegistry(): Promise<[string, [string, Uint8Array | number[]][]][]> {
|
|
47
|
+
async function getFileHashesFromRegistry() : Promise<[string, [string, Uint8Array | number[]][]][]> {
|
|
48
48
|
let packageIds = await getResolvedMopsPackageIds();
|
|
49
49
|
let actor = await mainActor();
|
|
50
50
|
let fileHashesByPackageIds = await actor.getFileHashesByPackageIds(packageIds);
|
|
51
51
|
return fileHashesByPackageIds;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
async function getResolvedMopsPackageIds(): Promise<string[]> {
|
|
54
|
+
async function getResolvedMopsPackageIds() : Promise<string[]> {
|
|
55
55
|
let resolvedPackages = await resolvePackages();
|
|
56
56
|
let packageIds = Object.entries(resolvedPackages)
|
|
57
57
|
.filter(([_, version]) => getDependencyType(version) === 'mops')
|
|
@@ -60,7 +60,7 @@ async function getResolvedMopsPackageIds(): Promise<string[]> {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// get hash of local file from '.mops' dir by fileId
|
|
63
|
-
export function getLocalFileHash(fileId: string): string {
|
|
63
|
+
export function getLocalFileHash(fileId : string) : string {
|
|
64
64
|
let rootDir = getRootDir();
|
|
65
65
|
let file = path.join(rootDir, '.mops', fileId);
|
|
66
66
|
if (!fs.existsSync(file)) {
|
|
@@ -71,11 +71,11 @@ export function getLocalFileHash(fileId: string): string {
|
|
|
71
71
|
return bytesToHex(sha256(fileData));
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function getMopsTomlHash(): string {
|
|
74
|
+
function getMopsTomlHash() : string {
|
|
75
75
|
return bytesToHex(sha256(fs.readFileSync(getRootDir() + '/mops.toml')));
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
function getMopsTomlDepsHash(): string {
|
|
78
|
+
function getMopsTomlDepsHash() : string {
|
|
79
79
|
let config = readConfig();
|
|
80
80
|
let deps = config.dependencies || {};
|
|
81
81
|
let devDeps = config['dev-dependencies'] || {};
|
|
@@ -113,7 +113,7 @@ export async function updateLockFile() {
|
|
|
113
113
|
|
|
114
114
|
// if lock file exists and mops.toml hasn't changed, don't update it
|
|
115
115
|
if (fs.existsSync(lockFile)) {
|
|
116
|
-
let lockFileJson: LockFileV2 = JSON.parse(fs.readFileSync(lockFile).toString());
|
|
116
|
+
let lockFileJson : LockFileV2 = JSON.parse(fs.readFileSync(lockFile).toString());
|
|
117
117
|
let mopsTomlDepsHash = getMopsTomlDepsHash();
|
|
118
118
|
if (mopsTomlDepsHash === lockFileJson.mopsTomlDepsHash) {
|
|
119
119
|
return;
|
|
@@ -122,7 +122,7 @@ export async function updateLockFile() {
|
|
|
122
122
|
|
|
123
123
|
let fileHashes = await getFileHashesFromRegistry();
|
|
124
124
|
|
|
125
|
-
let lockFileJson: LockFileV2 = {
|
|
125
|
+
let lockFileJson : LockFileV2 = {
|
|
126
126
|
version: 2,
|
|
127
127
|
mopsTomlDepsHash: getMopsTomlDepsHash(),
|
|
128
128
|
hashes: fileHashes.reduce((acc, [packageId, fileHashes]) => {
|
|
@@ -151,7 +151,7 @@ export async function checkLockFile(force = false) {
|
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
let lockFileJsonGeneric: LockFileGeneric = JSON.parse(fs.readFileSync(lockFile).toString());
|
|
154
|
+
let lockFileJsonGeneric : LockFileGeneric = JSON.parse(fs.readFileSync(lockFile).toString());
|
|
155
155
|
let packageIds = await getResolvedMopsPackageIds();
|
|
156
156
|
|
|
157
157
|
// check lock file version
|