ic-mops 0.30.0 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/commands/add.ts +12 -3
  2. package/commands/install.ts +2 -2
  3. package/commands/update.ts +30 -2
  4. package/dist/commands/add.js +11 -3
  5. package/dist/commands/install.js +2 -2
  6. package/dist/commands/update.js +27 -2
  7. package/dist/mops.d.ts +4 -2
  8. package/dist/mops.js +18 -4
  9. package/dist/package.json +1 -1
  10. package/dist/vessel.js +10 -10
  11. package/mops.ts +19 -5
  12. package/package.json +1 -1
  13. package/vessel.ts +10 -10
  14. package/dist/bench/$USER_BENCH_FILE.mo +0 -45
  15. package/dist/bench/bench-canister.mo +0 -57
  16. package/dist/commands/bench/$USER_BENCH_FILE.mo +0 -45
  17. package/dist/commands/bench/bench/$USER_BENCH_FILE.mo +0 -45
  18. package/dist/commands/bench/bench/bench-canister.mo +0 -57
  19. package/dist/commands/bench/bench-canister.mo +0 -85
  20. package/dist/commands/bench/declarations/bench/bench.did.d.ts +0 -6
  21. package/dist/commands/bench/declarations/bench/bench.did.js +0 -22
  22. package/dist/commands/bench/declarations/bench/index.d.ts +0 -2
  23. package/dist/commands/bench/declarations/bench/index.js +0 -30
  24. package/dist/commands/bench/declarations/main/index.d.ts +0 -2
  25. package/dist/commands/bench/declarations/main/index.js +0 -30
  26. package/dist/commands/bench/declarations/main/main.did.d.ts +0 -6
  27. package/dist/commands/bench/declarations/main/main.did.js +0 -242
  28. package/dist/commands/bench/declarations/storage/index.d.ts +0 -4
  29. package/dist/commands/bench/declarations/storage/index.js +0 -26
  30. package/dist/commands/bench/declarations/storage/storage.did.d.ts +0 -6
  31. package/dist/commands/bench/declarations/storage/storage.did.js +0 -34
  32. package/dist/commands/bench/user-bench.mo +0 -14
  33. package/dist/commands/bench.d.ts +0 -10
  34. package/dist/commands/bench.js +0 -214
  35. package/dist/commands/mmf1.d.ts +0 -21
  36. package/dist/commands/mmf1.js +0 -93
  37. package/dist/commands/test/reporter-files.d.ts +0 -10
  38. package/dist/commands/test/reporter-files.js +0 -48
  39. package/dist/commands/test/reporter-verbose.d.ts +0 -10
  40. package/dist/commands/test/reporter-verbose.js +0 -56
  41. package/dist/commands/test.d.ts +0 -4
  42. package/dist/commands/test.js +0 -186
  43. package/dist/declarations/bench/bench.did +0 -24
  44. package/dist/declarations/bench/bench.did.d.ts +0 -24
  45. package/dist/declarations/bench/bench.did.js +0 -24
  46. package/dist/declarations/bench/index.d.ts +0 -50
  47. package/dist/declarations/bench/index.js +0 -41
  48. package/dist/helpers/get-dfx-version.d.ts +0 -1
  49. package/dist/helpers/get-dfx-version.js +0 -9
  50. package/dist/helpers/get-moc-path.d.ts +0 -1
  51. package/dist/helpers/get-moc-path.js +0 -11
  52. package/dist/helpers/get-moc-version.d.ts +0 -1
  53. package/dist/helpers/get-moc-version.js +0 -7
  54. package/dist/out/cli.d.ts +0 -2
  55. package/dist/out/cli.js +0 -114581
  56. package/dist/parse-changelog.d.ts +0 -1
  57. package/dist/parse-changelog.js +0 -1435
  58. package/dist/test.d.ts +0 -1
  59. package/dist/test.js +0 -1411
@@ -1,24 +0,0 @@
1
- import type { Principal } from '@dfinity/principal';
2
- import type { ActorMethod } from '@dfinity/agent';
3
-
4
- export interface BenchResult {
5
- 'instructions' : bigint,
6
- 'rts_memory_size' : bigint,
7
- 'rts_total_allocation' : bigint,
8
- 'rts_collector_instructions' : bigint,
9
- 'rts_mutator_instructions' : bigint,
10
- 'rts_heap_size' : bigint,
11
- }
12
- export interface BenchSchema {
13
- 'cols' : Array<string>,
14
- 'name' : string,
15
- 'rows' : Array<string>,
16
- 'description' : string,
17
- }
18
- export interface anon_class_10_1 {
19
- 'getStats' : ActorMethod<[], BenchResult>,
20
- 'init' : ActorMethod<[], BenchSchema>,
21
- 'runCellQuery' : ActorMethod<[bigint, bigint], BenchResult>,
22
- 'runCellUpdate' : ActorMethod<[bigint, bigint], BenchResult>,
23
- }
24
- export interface _SERVICE extends anon_class_10_1 {}
@@ -1,24 +0,0 @@
1
- export const idlFactory = ({ IDL }) => {
2
- const BenchResult = IDL.Record({
3
- 'instructions' : IDL.Int,
4
- 'rts_memory_size' : IDL.Int,
5
- 'rts_total_allocation' : IDL.Int,
6
- 'rts_collector_instructions' : IDL.Int,
7
- 'rts_mutator_instructions' : IDL.Int,
8
- 'rts_heap_size' : IDL.Int,
9
- });
10
- const BenchSchema = IDL.Record({
11
- 'cols' : IDL.Vec(IDL.Text),
12
- 'name' : IDL.Text,
13
- 'rows' : IDL.Vec(IDL.Text),
14
- 'description' : IDL.Text,
15
- });
16
- const anon_class_10_1 = IDL.Service({
17
- 'getStats' : IDL.Func([], [BenchResult], ['query']),
18
- 'init' : IDL.Func([], [BenchSchema], []),
19
- 'runCellQuery' : IDL.Func([IDL.Nat, IDL.Nat], [BenchResult], ['query']),
20
- 'runCellUpdate' : IDL.Func([IDL.Nat, IDL.Nat], [BenchResult], []),
21
- });
22
- return anon_class_10_1;
23
- };
24
- export const init = ({ IDL }) => { return []; };
@@ -1,50 +0,0 @@
1
- import type {
2
- ActorSubclass,
3
- HttpAgentOptions,
4
- ActorConfig,
5
- Agent,
6
- } from "@dfinity/agent";
7
- import type { Principal } from "@dfinity/principal";
8
- import type { IDL } from "@dfinity/candid";
9
-
10
- import { _SERVICE } from './bench.did';
11
-
12
- export declare const idlFactory: IDL.InterfaceFactory;
13
- export declare const canisterId: string;
14
-
15
- export declare interface CreateActorOptions {
16
- /**
17
- * @see {@link Agent}
18
- */
19
- agent?: Agent;
20
- /**
21
- * @see {@link HttpAgentOptions}
22
- */
23
- agentOptions?: HttpAgentOptions;
24
- /**
25
- * @see {@link ActorConfig}
26
- */
27
- actorOptions?: ActorConfig;
28
- }
29
-
30
- /**
31
- * Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister.
32
- * @constructs {@link ActorSubClass}
33
- * @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to
34
- * @param {CreateActorOptions} options - see {@link CreateActorOptions}
35
- * @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions
36
- * @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent
37
- * @see {@link HttpAgentOptions}
38
- * @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor
39
- * @see {@link ActorConfig}
40
- */
41
- export declare const createActor: (
42
- canisterId: string | Principal,
43
- options?: CreateActorOptions
44
- ) => ActorSubclass<_SERVICE>;
45
-
46
- /**
47
- * Intialized Actor using default settings, ready to talk to a canister using its candid interface
48
- * @constructs {@link ActorSubClass}
49
- */
50
- export declare const bench: ActorSubclass<_SERVICE>;
@@ -1,41 +0,0 @@
1
- import { Actor, HttpAgent } from "@dfinity/agent";
2
-
3
- // Imports and re-exports candid interface
4
- import { idlFactory } from "./bench.did.js";
5
- export { idlFactory } from "./bench.did.js";
6
-
7
- /* CANISTER_ID is replaced by webpack based on node environment
8
- * Note: canister environment variable will be standardized as
9
- * process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
10
- * beginning in dfx 0.15.0
11
- */
12
- export const canisterId =
13
- process.env.CANISTER_ID_BENCH ||
14
- process.env.BENCH_CANISTER_ID;
15
-
16
- export const createActor = (canisterId, options = {}) => {
17
- const agent = options.agent || new HttpAgent({ ...options.agentOptions });
18
-
19
- if (options.agent && options.agentOptions) {
20
- console.warn(
21
- "Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent."
22
- );
23
- }
24
-
25
- // Fetch root key for certificate validation during development
26
- if (process.env.DFX_NETWORK !== "ic") {
27
- agent.fetchRootKey().catch((err) => {
28
- console.warn(
29
- "Unable to fetch root key. Check to ensure that your local replica is running"
30
- );
31
- console.error(err);
32
- });
33
- }
34
-
35
- // Creates an actor with using the candid interface and the HttpAgent
36
- return Actor.createActor(idlFactory, {
37
- agent,
38
- canisterId,
39
- ...options.actorOptions,
40
- });
41
- };
@@ -1 +0,0 @@
1
- export declare function getDfxVersion(): string;
@@ -1,9 +0,0 @@
1
- import { execSync } from 'node:child_process';
2
- export function getDfxVersion() {
3
- try {
4
- let res = execSync('dfx --version').toString();
5
- return res.trim().split('dfx ')[1] || '';
6
- }
7
- catch { }
8
- return '';
9
- }
@@ -1 +0,0 @@
1
- export declare function getMocPath(): string;
@@ -1,11 +0,0 @@
1
- import { execSync } from 'node:child_process';
2
- export function getMocPath() {
3
- let mocPath = process.env.DFX_MOC_PATH;
4
- if (!mocPath) {
5
- mocPath = execSync('dfx cache show').toString().trim() + '/moc';
6
- }
7
- if (!mocPath) {
8
- mocPath = 'moc';
9
- }
10
- return mocPath;
11
- }
@@ -1 +0,0 @@
1
- export declare function getMocVersion(): string;
@@ -1,7 +0,0 @@
1
- import { execSync } from 'node:child_process';
2
- import { getMocPath } from './get-moc-path.js';
3
- export function getMocVersion() {
4
- let mocPath = getMocPath();
5
- let match = execSync(mocPath).toString().trim().match(/Motoko compiler ([^\s]+) .*/);
6
- return match?.[1] || '';
7
- }
package/dist/out/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};