ic-mops 0.34.1-0 → 0.34.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.
package/cli.ts CHANGED
@@ -212,6 +212,7 @@ program
212
212
  .addOption(new Option('--mode <mode>', 'Test mode').choices(['interpreter', 'wasi']).default('interpreter'))
213
213
  .option('-w, --watch', 'Enable watch mode')
214
214
  .action(async (filter, options) => {
215
+ await installAll({silent: true, lockfile: 'ignore'});
215
216
  await test(filter, options);
216
217
  });
217
218
 
@@ -225,6 +226,7 @@ program
225
226
  // .addOption(new Option('--force-gc', 'Force GC'))
226
227
  .addOption(new Option('--verbose', 'Show more information'))
227
228
  .action(async (filter, options) => {
229
+ await installAll({silent: true, lockfile: 'ignore'});
228
230
  await bench(filter, options);
229
231
  });
230
232
 
@@ -285,7 +287,7 @@ program
285
287
  }
286
288
  });
287
289
 
288
- // airdrop
290
+ // temp: airdrop
289
291
  program
290
292
  .command('airdrop <check|claim> [canister]')
291
293
  .action(async (sub, canister) => {
package/commands/add.ts CHANGED
@@ -15,7 +15,7 @@ type AddOptions = {
15
15
  };
16
16
 
17
17
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18
- export async function add(name: string, {verbose = false, dev = false, lockfile}: AddOptions = {}) {
18
+ export async function add(name: string, {verbose = false, dev = false, lockfile}: AddOptions = {}, asName?: string) {
19
19
  if (!checkConfigFile()) {
20
20
  return;
21
21
  }
@@ -57,7 +57,7 @@ export async function add(name: string, {verbose = false, dev = false, lockfile}
57
57
  }
58
58
 
59
59
  pkgDetails = {
60
- name: parseGithubURL(name).gitName,
60
+ name: asName || parseGithubURL(name).gitName,
61
61
  repo: `https://github.com/${org}/${gitName}#${branch}@${commitHash}`,
62
62
  version: '',
63
63
  };
@@ -34,7 +34,7 @@ export async function update(pkg?: string, {lockfile}: UpdateOptions = {}) {
34
34
  let dev = !!config['dev-dependencies']?.[dep.name];
35
35
  let commit = await getGithubCommit(`${org}/${gitName}`, branch);
36
36
  if (commit.sha !== commitHash) {
37
- await add(`https://github.com/${org}/${gitName}#${branch}@${commit.sha}`, {dev});
37
+ await add(`https://github.com/${org}/${gitName}#${branch}@${commit.sha}`, {dev}, dep.name);
38
38
  }
39
39
  }
40
40
 
package/dist/cli.js CHANGED
@@ -185,6 +185,7 @@ program
185
185
  .addOption(new Option('--mode <mode>', 'Test mode').choices(['interpreter', 'wasi']).default('interpreter'))
186
186
  .option('-w, --watch', 'Enable watch mode')
187
187
  .action(async (filter, options) => {
188
+ await installAll({ silent: true, lockfile: 'ignore' });
188
189
  await test(filter, options);
189
190
  });
190
191
  // bench
@@ -197,6 +198,7 @@ program
197
198
  // .addOption(new Option('--force-gc', 'Force GC'))
198
199
  .addOption(new Option('--verbose', 'Show more information'))
199
200
  .action(async (filter, options) => {
201
+ await installAll({ silent: true, lockfile: 'ignore' });
200
202
  await bench(filter, options);
201
203
  });
202
204
  // template
@@ -252,7 +254,7 @@ program
252
254
  await setUserProp(prop, value);
253
255
  }
254
256
  });
255
- // airdrop
257
+ // temp: airdrop
256
258
  program
257
259
  .command('airdrop <check|claim> [canister]')
258
260
  .action(async (sub, canister) => {
@@ -3,5 +3,5 @@ type AddOptions = {
3
3
  dev?: boolean;
4
4
  lockfile?: 'save' | 'ignore';
5
5
  };
6
- export declare function add(name: string, { verbose, dev, lockfile }?: AddOptions): Promise<void>;
6
+ export declare function add(name: string, { verbose, dev, lockfile }?: AddOptions, asName?: string): Promise<void>;
7
7
  export {};
@@ -7,7 +7,7 @@ import { installFromGithub } from '../vessel.js';
7
7
  import { install } from './install.js';
8
8
  import { notifyInstalls } from '../notify-installs.js';
9
9
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
- export async function add(name, { verbose = false, dev = false, lockfile } = {}) {
10
+ export async function add(name, { verbose = false, dev = false, lockfile } = {}, asName) {
11
11
  if (!checkConfigFile()) {
12
12
  return;
13
13
  }
@@ -44,7 +44,7 @@ export async function add(name, { verbose = false, dev = false, lockfile } = {})
44
44
  commitHash = commit.sha;
45
45
  }
46
46
  pkgDetails = {
47
- name: parseGithubURL(name).gitName,
47
+ name: asName || parseGithubURL(name).gitName,
48
48
  repo: `https://github.com/${org}/${gitName}#${branch}@${commitHash}`,
49
49
  version: '',
50
50
  };
@@ -24,7 +24,7 @@ export async function update(pkg, { lockfile } = {}) {
24
24
  let dev = !!config['dev-dependencies']?.[dep.name];
25
25
  let commit = await getGithubCommit(`${org}/${gitName}`, branch);
26
26
  if (commit.sha !== commitHash) {
27
- await add(`https://github.com/${org}/${gitName}#${branch}@${commit.sha}`, { dev });
27
+ await add(`https://github.com/${org}/${gitName}#${branch}@${commit.sha}`, { dev }, dep.name);
28
28
  }
29
29
  }
30
30
  // update mops packages
package/dist/mops.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { Identity } from '@dfinity/agent';
2
2
  import { Config } from './types.js';
3
+ import { mainActor, storageActor } from './api/actors.js';
4
+ import { getNetwork } from './api/network.js';
5
+ import { getHighestVersion } from './api/getHighestVersion.js';
3
6
  export declare let apiVersion: string;
4
7
  export declare let globalConfigDir: string;
5
8
  export declare let globalCacheDir: string;
@@ -24,3 +27,4 @@ export declare function formatDir(name: string, version: string): string;
24
27
  export declare function formatGithubDir(name: string, repo: string): string;
25
28
  export declare function readDfxJson(): any;
26
29
  export declare function checkApiCompatibility(): Promise<boolean>;
30
+ export { getNetwork, mainActor, storageActor, getHighestVersion, };
package/dist/mops.js CHANGED
@@ -6,7 +6,9 @@ import prompts from 'prompts';
6
6
  import ncp from 'ncp';
7
7
  import fetch from 'node-fetch';
8
8
  import { decodeFile } from './pem.js';
9
- import { mainActor } from './api/actors.js';
9
+ import { mainActor, storageActor } from './api/actors.js';
10
+ import { getNetwork } from './api/network.js';
11
+ import { getHighestVersion } from './api/getHighestVersion.js';
10
12
  if (!global.fetch) {
11
13
  global.fetch = fetch;
12
14
  }
@@ -233,3 +235,5 @@ export async function checkApiCompatibility() {
233
235
  }
234
236
  return true;
235
237
  }
238
+ // compatibility with older versions
239
+ export { getNetwork, mainActor, storageActor, getHighestVersion, };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.34.1-0",
3
+ "version": "0.34.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "dist/cli.js"
package/mops.ts CHANGED
@@ -9,7 +9,9 @@ import fetch from 'node-fetch';
9
9
 
10
10
  import {decodeFile} from './pem.js';
11
11
  import {Config} from './types.js';
12
- import {mainActor} from './api/actors.js';
12
+ import {mainActor, storageActor} from './api/actors.js';
13
+ import {getNetwork} from './api/network.js';
14
+ import {getHighestVersion} from './api/getHighestVersion.js';
13
15
 
14
16
 
15
17
  if (!global.fetch) {
@@ -267,4 +269,12 @@ export async function checkApiCompatibility() {
267
269
  console.log('-'.repeat(50));
268
270
  }
269
271
  return true;
270
- }
272
+ }
273
+
274
+ // compatibility with older versions
275
+ export {
276
+ getNetwork,
277
+ mainActor,
278
+ storageActor,
279
+ getHighestVersion,
280
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.34.1-0",
3
+ "version": "0.34.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "dist/cli.js"