ic-mops 1.8.1 → 1.10.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/.DS_Store +0 -0
- package/.dockerignore +3 -0
- package/CHANGELOG.md +10 -0
- package/bun.lock +1278 -0
- package/bundle/bench/bench-canister.mo +109 -101
- package/bundle/bench/user-bench.mo +6 -6
- package/bundle/cli.js +1793 -909
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/main/main.did +6 -0
- package/bundle/declarations/main/main.did.d.ts +6 -0
- package/bundle/declarations/main/main.did.js +6 -0
- package/bundle/package.json +1 -1
- package/bundle/templates/src/lib.mo +13 -13
- package/bundle/templates/test/lib.test.mo +2 -2
- package/bundle/xhr-sync-worker.js +59 -0
- package/cli.ts +28 -0
- package/commands/bench-replica.ts +1 -0
- package/commands/docs-coverage.ts +110 -0
- package/commands/docs.ts +47 -20
- package/commands/publish.ts +25 -2
- package/commands/test/test.ts +2 -1
- package/commands/toolchain/moc.ts +10 -4
- package/declarations/main/main.did +6 -0
- package/declarations/main/main.did.d.ts +6 -0
- package/declarations/main/main.did.js +6 -0
- package/dist/cli.js +25 -0
- package/dist/commands/bench-replica.js +6 -2
- package/dist/commands/docs-coverage.d.ts +8 -0
- package/dist/commands/docs-coverage.js +86 -0
- package/dist/commands/docs.d.ts +9 -3
- package/dist/commands/docs.js +34 -17
- package/dist/commands/publish.js +23 -2
- package/dist/commands/replica.js +8 -7
- package/dist/commands/test/mmf1.js +14 -12
- package/dist/commands/test/reporters/compact-reporter.js +50 -63
- package/dist/commands/test/reporters/files-reporter.js +5 -14
- package/dist/commands/test/reporters/silent-reporter.js +10 -10
- package/dist/commands/test/reporters/verbose-reporter.js +7 -23
- package/dist/commands/test/test.js +1 -0
- package/dist/commands/toolchain/moc.js +10 -4
- package/dist/commands/watch/deployer.js +10 -7
- package/dist/commands/watch/error-checker.js +4 -4
- package/dist/commands/watch/formatter.js +7 -4
- package/dist/commands/watch/generator.js +9 -7
- package/dist/commands/watch/tester.js +7 -5
- package/dist/commands/watch/warning-checker.js +8 -6
- package/dist/declarations/main/main.did +6 -0
- package/dist/declarations/main/main.did.d.ts +6 -0
- package/dist/declarations/main/main.did.js +6 -0
- package/dist/package.json +13 -11
- package/package.json +15 -13
- package/tsconfig.json +2 -1
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _VerboseReporter_startTime, _VerboseReporter_curFileIndex;
|
|
13
1
|
import chalk from 'chalk';
|
|
14
2
|
import { absToRel } from '../utils.js';
|
|
15
3
|
export class VerboseReporter {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_VerboseReporter_curFileIndex.set(this, 0);
|
|
22
|
-
}
|
|
4
|
+
passed = 0;
|
|
5
|
+
failed = 0;
|
|
6
|
+
skipped = 0;
|
|
7
|
+
#startTime = Date.now();
|
|
8
|
+
#curFileIndex = 0;
|
|
23
9
|
addFiles(files) {
|
|
24
10
|
console.log('Test files:');
|
|
25
11
|
for (let file of files) {
|
|
@@ -52,16 +38,14 @@ export class VerboseReporter {
|
|
|
52
38
|
else {
|
|
53
39
|
console.log(chalk.greenBright('Tests passed'));
|
|
54
40
|
}
|
|
55
|
-
console.log(`Done in ${chalk.gray(((Date.now() -
|
|
41
|
+
console.log(`Done in ${chalk.gray(((Date.now() - this.#startTime) / 1000).toFixed(2) + 's')}`
|
|
56
42
|
+ `, passed ${chalk.greenBright(this.passed)}`
|
|
57
43
|
+ (this.skipped ? `, skipped ${chalk[this.skipped ? 'yellowBright' : 'gray'](this.skipped)}` : '')
|
|
58
44
|
+ (this.failed ? `, failed ${chalk[this.failed ? 'redBright' : 'gray'](this.failed)}` : ''));
|
|
59
45
|
return this.failed === 0;
|
|
60
46
|
}
|
|
61
47
|
_printStart(file, mode) {
|
|
62
|
-
|
|
63
|
-
(__classPrivateFieldSet(this, _VerboseReporter_curFileIndex, (_b = __classPrivateFieldGet(this, _VerboseReporter_curFileIndex, "f"), _a = _b++, _b), "f"), _a) && console.log('-'.repeat(50));
|
|
48
|
+
this.#curFileIndex++ && console.log('-'.repeat(50));
|
|
64
49
|
console.log(`Running ${chalk.gray(absToRel(file))} ${mode === 'interpreter' ? '' : chalk.gray(`(${mode})`)}`);
|
|
65
50
|
}
|
|
66
51
|
}
|
|
67
|
-
_VerboseReporter_startTime = new WeakMap(), _VerboseReporter_curFileIndex = new WeakMap();
|
|
@@ -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 {
|
|
@@ -5,14 +5,17 @@ import { execFile, execSync } from 'node:child_process';
|
|
|
5
5
|
import { parallel } from '../../parallel.js';
|
|
6
6
|
import { getRootDir } from '../../mops.js';
|
|
7
7
|
export class Deployer {
|
|
8
|
+
verbose = false;
|
|
9
|
+
canisters = {};
|
|
10
|
+
status = 'pending';
|
|
11
|
+
errorChecker;
|
|
12
|
+
generator;
|
|
13
|
+
success = 0;
|
|
14
|
+
errors = [];
|
|
15
|
+
aborted = false;
|
|
16
|
+
controllers = new Map();
|
|
17
|
+
currentRun;
|
|
8
18
|
constructor({ verbose, canisters, errorChecker, generator }) {
|
|
9
|
-
this.verbose = false;
|
|
10
|
-
this.canisters = {};
|
|
11
|
-
this.status = 'pending';
|
|
12
|
-
this.success = 0;
|
|
13
|
-
this.errors = [];
|
|
14
|
-
this.aborted = false;
|
|
15
|
-
this.controllers = new Map();
|
|
16
19
|
this.verbose = verbose;
|
|
17
20
|
this.canisters = canisters;
|
|
18
21
|
this.errorChecker = errorChecker;
|
|
@@ -8,11 +8,11 @@ import { sources } from '../sources.js';
|
|
|
8
8
|
import { parallel } from '../../parallel.js';
|
|
9
9
|
import { globMoFiles } from './globMoFiles.js';
|
|
10
10
|
export class ErrorChecker {
|
|
11
|
+
verbose = false;
|
|
12
|
+
canisters = {};
|
|
13
|
+
status = 'pending';
|
|
14
|
+
errors = [];
|
|
11
15
|
constructor({ verbose, canisters }) {
|
|
12
|
-
this.verbose = false;
|
|
13
|
-
this.canisters = {};
|
|
14
|
-
this.status = 'pending';
|
|
15
|
-
this.errors = [];
|
|
16
16
|
this.verbose = verbose;
|
|
17
17
|
this.canisters = canisters;
|
|
18
18
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { format } from '../format.js';
|
|
3
3
|
export class Formatter {
|
|
4
|
+
verbose = false;
|
|
5
|
+
status = 'pending';
|
|
6
|
+
errorChecker;
|
|
7
|
+
aborted = false;
|
|
8
|
+
controller = new AbortController();
|
|
9
|
+
currentRun;
|
|
10
|
+
result;
|
|
4
11
|
constructor({ verbose, errorChecker }) {
|
|
5
|
-
this.verbose = false;
|
|
6
|
-
this.status = 'pending';
|
|
7
|
-
this.aborted = false;
|
|
8
|
-
this.controller = new AbortController();
|
|
9
12
|
this.verbose = verbose;
|
|
10
13
|
this.errorChecker = errorChecker;
|
|
11
14
|
}
|
|
@@ -5,14 +5,16 @@ import chalk from 'chalk';
|
|
|
5
5
|
import { parallel } from '../../parallel.js';
|
|
6
6
|
import { getRootDir } from '../../mops.js';
|
|
7
7
|
export class Generator {
|
|
8
|
+
verbose = false;
|
|
9
|
+
canisters = {};
|
|
10
|
+
status = 'pending';
|
|
11
|
+
errorChecker;
|
|
12
|
+
success = 0;
|
|
13
|
+
errors = [];
|
|
14
|
+
aborted = false;
|
|
15
|
+
controllers = new Map();
|
|
16
|
+
currentRun;
|
|
8
17
|
constructor({ verbose, canisters, errorChecker }) {
|
|
9
|
-
this.verbose = false;
|
|
10
|
-
this.canisters = {};
|
|
11
|
-
this.status = 'pending';
|
|
12
|
-
this.success = 0;
|
|
13
|
-
this.errors = [];
|
|
14
|
-
this.aborted = false;
|
|
15
|
-
this.controllers = new Map();
|
|
16
18
|
this.verbose = verbose;
|
|
17
19
|
this.canisters = canisters;
|
|
18
20
|
this.errorChecker = errorChecker;
|
|
@@ -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.
|
|
3
|
+
"version": "1.10.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.
|
|
32
|
-
"@dfinity/candid": "2.
|
|
33
|
-
"@dfinity/identity": "2.
|
|
34
|
-
"@dfinity/identity-secp256k1": "2.
|
|
35
|
-
"@dfinity/principal": "2.
|
|
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.
|
|
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.
|
|
45
|
+
"debounce": "2.2.0",
|
|
46
46
|
"decomp-tarxz": "0.1.1",
|
|
47
47
|
"decompress": "4.2.1",
|
|
48
|
-
"del": "
|
|
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": "
|
|
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.
|
|
3
|
+
"version": "1.10.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": "
|
|
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.
|
|
48
|
-
"@dfinity/candid": "2.
|
|
49
|
-
"@dfinity/identity": "2.
|
|
50
|
-
"@dfinity/identity-secp256k1": "2.
|
|
51
|
-
"@dfinity/principal": "2.
|
|
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.
|
|
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.
|
|
61
|
+
"debounce": "2.2.0",
|
|
62
62
|
"decomp-tarxz": "0.1.1",
|
|
63
63
|
"decompress": "4.2.1",
|
|
64
|
-
"del": "
|
|
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": "
|
|
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",
|