ic-mops 0.40.0 → 0.41.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.
Files changed (186) hide show
  1. package/.DS_Store +0 -0
  2. package/.npmrc +2 -1
  3. package/CHANGELOG.md +8 -0
  4. package/DEVELOPMENT.md +25 -0
  5. package/bundle/bench/bench-canister.mo +87 -0
  6. package/bundle/bench/user-bench.mo +14 -0
  7. package/bundle/bin/moc-wrapper.sh +3 -0
  8. package/bundle/bin/mops.js +3 -0
  9. package/bundle/cli.js +88 -0
  10. package/bundle/cli.tgz +0 -0
  11. package/bundle/declarations/bench/bench.did +26 -0
  12. package/bundle/declarations/bench/bench.did.d.ts +29 -0
  13. package/bundle/declarations/bench/bench.did.js +26 -0
  14. package/bundle/declarations/bench/index.d.ts +50 -0
  15. package/bundle/declarations/bench/index.js +41 -0
  16. package/bundle/declarations/main/index.d.ts +50 -0
  17. package/bundle/declarations/main/index.js +41 -0
  18. package/bundle/declarations/main/main.did +426 -0
  19. package/bundle/declarations/main/main.did.d.ts +352 -0
  20. package/bundle/declarations/main/main.did.js +404 -0
  21. package/bundle/declarations/storage/index.d.ts +50 -0
  22. package/bundle/declarations/storage/index.js +30 -0
  23. package/bundle/declarations/storage/storage.did +46 -0
  24. package/bundle/declarations/storage/storage.did.d.ts +37 -0
  25. package/bundle/declarations/storage/storage.did.js +38 -0
  26. package/bundle/package.json +31 -0
  27. package/bundle/templates/README.md +13 -0
  28. package/bundle/templates/licenses/Apache-2.0 +202 -0
  29. package/bundle/templates/licenses/Apache-2.0-NOTICE +13 -0
  30. package/bundle/templates/licenses/MIT +21 -0
  31. package/bundle/templates/mops-publish.yml +17 -0
  32. package/bundle/templates/mops-test.yml +22 -0
  33. package/bundle/templates/src/lib.mo +15 -0
  34. package/bundle/templates/test/lib.test.mo +4 -0
  35. package/bundle-package-json.ts +14 -0
  36. package/cli.ts +22 -19
  37. package/commands/add.ts +0 -0
  38. package/commands/install-all.ts +0 -0
  39. package/commands/publish.ts +1 -27
  40. package/commands/self.ts +75 -0
  41. package/commands/template.ts +9 -10
  42. package/commands/toolchain/index.ts +0 -0
  43. package/dist/api/actors.d.ts +0 -0
  44. package/dist/api/actors.js +0 -0
  45. package/dist/api/downloadPackageFiles.d.ts +0 -0
  46. package/dist/api/downloadPackageFiles.js +0 -0
  47. package/dist/api/getHighestVersion.d.ts +0 -0
  48. package/dist/api/getHighestVersion.js +0 -0
  49. package/dist/api/index.d.ts +0 -0
  50. package/dist/api/index.js +0 -0
  51. package/dist/api/network.d.ts +0 -0
  52. package/dist/api/network.js +0 -0
  53. package/dist/api/resolveVersion.d.ts +0 -0
  54. package/dist/api/resolveVersion.js +0 -0
  55. package/dist/bin/mops.d.ts +1 -1
  56. package/dist/bin/mops.js +2 -1
  57. package/dist/bundle-package-json.d.ts +0 -0
  58. package/dist/bundle-package-json.js +0 -0
  59. package/dist/cache.d.ts +0 -0
  60. package/dist/cache.js +0 -0
  61. package/dist/check-requirements.d.ts +3 -0
  62. package/dist/check-requirements.js +39 -0
  63. package/dist/cli.d.ts +0 -0
  64. package/dist/cli.js +18 -18
  65. package/dist/commands/add.d.ts +0 -0
  66. package/dist/commands/add.js +0 -0
  67. package/dist/commands/available-updates.d.ts +0 -0
  68. package/dist/commands/available-updates.js +0 -0
  69. package/dist/commands/bench-replica.d.ts +0 -0
  70. package/dist/commands/bench-replica.js +0 -0
  71. package/dist/commands/bench.d.ts +0 -0
  72. package/dist/commands/bench.js +0 -0
  73. package/dist/commands/bump.d.ts +0 -0
  74. package/dist/commands/bump.js +0 -0
  75. package/dist/commands/docs.d.ts +0 -0
  76. package/dist/commands/docs.js +0 -0
  77. package/dist/commands/import-identity.d.ts +0 -0
  78. package/dist/commands/import-identity.js +0 -0
  79. package/dist/commands/init.d.ts +0 -0
  80. package/dist/commands/init.js +0 -0
  81. package/dist/commands/install-all.d.ts +0 -0
  82. package/dist/commands/install-all.js +0 -0
  83. package/dist/commands/install-local.d.ts +0 -0
  84. package/dist/commands/install-local.js +0 -0
  85. package/dist/commands/install.d.ts +0 -0
  86. package/dist/commands/install.js +0 -0
  87. package/dist/commands/outdated.d.ts +0 -0
  88. package/dist/commands/outdated.js +0 -0
  89. package/dist/commands/publish.d.ts +0 -0
  90. package/dist/commands/publish.js +1 -24
  91. package/dist/commands/remove.d.ts +0 -0
  92. package/dist/commands/remove.js +0 -0
  93. package/dist/commands/search.d.ts +0 -0
  94. package/dist/commands/search.js +0 -0
  95. package/dist/commands/self.js +1 -1
  96. package/dist/commands/sources.d.ts +0 -0
  97. package/dist/commands/sources.js +0 -0
  98. package/dist/commands/sync.d.ts +0 -0
  99. package/dist/commands/sync.js +0 -0
  100. package/dist/commands/template.d.ts +0 -0
  101. package/dist/commands/template.js +9 -10
  102. package/dist/commands/test/mmf1.d.ts +0 -0
  103. package/dist/commands/test/mmf1.js +0 -0
  104. package/dist/commands/test/reporters/compact-reporter.d.ts +0 -0
  105. package/dist/commands/test/reporters/compact-reporter.js +0 -0
  106. package/dist/commands/test/reporters/files-reporter.d.ts +0 -0
  107. package/dist/commands/test/reporters/files-reporter.js +0 -0
  108. package/dist/commands/test/reporters/reporter.d.ts +0 -0
  109. package/dist/commands/test/reporters/reporter.js +0 -0
  110. package/dist/commands/test/reporters/silent-reporter.d.ts +0 -0
  111. package/dist/commands/test/reporters/silent-reporter.js +0 -0
  112. package/dist/commands/test/reporters/verbose-reporter.d.ts +0 -0
  113. package/dist/commands/test/reporters/verbose-reporter.js +0 -0
  114. package/dist/commands/test/test.d.ts +0 -0
  115. package/dist/commands/test/test.js +0 -0
  116. package/dist/commands/test/utils.d.ts +0 -0
  117. package/dist/commands/test/utils.js +0 -0
  118. package/dist/commands/toolchain/index.d.ts +0 -0
  119. package/dist/commands/toolchain/index.js +0 -0
  120. package/dist/commands/toolchain/moc.d.ts +0 -0
  121. package/dist/commands/toolchain/moc.js +0 -0
  122. package/dist/commands/toolchain/pocket-ic.d.ts +0 -0
  123. package/dist/commands/toolchain/pocket-ic.js +0 -0
  124. package/dist/commands/toolchain/toolchain-utils.d.ts +0 -0
  125. package/dist/commands/toolchain/toolchain-utils.js +0 -0
  126. package/dist/commands/toolchain/wasmtime.d.ts +0 -0
  127. package/dist/commands/toolchain/wasmtime.js +0 -0
  128. package/dist/commands/transfer-ownership.d.ts +0 -0
  129. package/dist/commands/transfer-ownership.js +0 -0
  130. package/dist/commands/update.d.ts +0 -0
  131. package/dist/commands/update.js +0 -0
  132. package/dist/commands/user.d.ts +0 -0
  133. package/dist/commands/user.js +0 -0
  134. package/dist/commands/whoami.d.ts +0 -0
  135. package/dist/commands/whoami.js +0 -0
  136. package/dist/declarations/bench/bench.did +0 -0
  137. package/dist/declarations/bench/bench.did.d.ts +0 -0
  138. package/dist/declarations/bench/bench.did.js +0 -0
  139. package/dist/declarations/bench/index.d.ts +0 -0
  140. package/dist/declarations/bench/index.js +0 -0
  141. package/dist/declarations/main/index.d.ts +0 -0
  142. package/dist/declarations/main/index.js +0 -0
  143. package/dist/declarations/main/main.did +0 -0
  144. package/dist/declarations/main/main.did.d.ts +0 -0
  145. package/dist/declarations/main/main.did.js +0 -0
  146. package/dist/helpers/find-changelog-entry.d.ts +0 -0
  147. package/dist/helpers/find-changelog-entry.js +0 -0
  148. package/dist/helpers/get-dfx-version.d.ts +0 -0
  149. package/dist/helpers/get-dfx-version.js +0 -0
  150. package/dist/helpers/get-moc-path.d.ts +0 -0
  151. package/dist/helpers/get-moc-path.js +0 -0
  152. package/dist/helpers/get-moc-version.d.ts +0 -0
  153. package/dist/helpers/get-moc-version.js +0 -0
  154. package/dist/integrity.d.ts +0 -0
  155. package/dist/integrity.js +0 -0
  156. package/dist/mops.d.ts +1 -0
  157. package/dist/mops.js +4 -0
  158. package/dist/notify-installs.d.ts +0 -0
  159. package/dist/notify-installs.js +0 -0
  160. package/dist/package.json +20 -26
  161. package/dist/parallel.d.ts +0 -0
  162. package/dist/parallel.js +0 -0
  163. package/dist/pem.d.ts +0 -0
  164. package/dist/pem.js +0 -0
  165. package/dist/release-cli.d.ts +0 -0
  166. package/dist/release-cli.js +9 -7
  167. package/dist/resolve-packages.d.ts +0 -0
  168. package/dist/resolve-packages.js +0 -0
  169. package/dist/templates.d.ts +1 -0
  170. package/dist/templates.js +4 -0
  171. package/dist/types.d.ts +0 -0
  172. package/dist/types.js +0 -0
  173. package/dist/vessel.d.ts +0 -0
  174. package/dist/vessel.js +0 -0
  175. package/helpers/find-changelog-entry.ts +27 -0
  176. package/mops.ts +5 -0
  177. package/package.json +28 -19
  178. package/release-cli.ts +62 -0
  179. package/remove-scripts.ts +6 -0
  180. package/templates.ts +5 -0
  181. package/tsconfig.json +1 -1
  182. package/types.ts +0 -0
  183. package/commands/self-update.ts +0 -6
  184. package/dist/commands/self-update.d.ts +0 -3
  185. package/dist/commands/self-update.js +0 -5
  186. /package/bin/{mops.ts → mops.js} +0 -0
@@ -0,0 +1,39 @@
1
+ import path from 'node:path';
2
+ import { getDependencyType, readConfig } from './mops.js';
3
+ import { resolvePackages } from './resolve-packages.js';
4
+ import { SemVer } from 'semver';
5
+ import chalk from 'chalk';
6
+ export async function checkRequirements({ verbose = false } = {}) {
7
+ let config = readConfig();
8
+ if (!config.toolchain?.moc) {
9
+ return;
10
+ }
11
+ let installedMoc = new SemVer(config.toolchain.moc);
12
+ let highestRequiredMoc = new SemVer('0.0.0');
13
+ let highestRequiredMocPkgId = '';
14
+ let resolvedPackages = await resolvePackages();
15
+ for (let [name, version] of Object.entries(resolvedPackages)) {
16
+ if (getDependencyType(version) === 'mops') {
17
+ let pkgId = `${name}@${version}`;
18
+ let depConfig = readConfig(path.join('.mops', pkgId, 'mops.toml'));
19
+ let moc = depConfig.requirements?.moc;
20
+ if (moc) {
21
+ let requiredMoc = new SemVer(moc);
22
+ if (highestRequiredMoc.compare(requiredMoc) < 0) {
23
+ highestRequiredMoc = requiredMoc;
24
+ highestRequiredMocPkgId = pkgId;
25
+ }
26
+ verbose && _check(pkgId, installedMoc, requiredMoc);
27
+ }
28
+ }
29
+ }
30
+ verbose || _check(highestRequiredMocPkgId, installedMoc, highestRequiredMoc);
31
+ }
32
+ function _check(pkgId, installedMoc, requiredMoc) {
33
+ let comp = installedMoc.compare(requiredMoc);
34
+ if (comp < 0) {
35
+ console.log(chalk.yellow(`moc version does not meet the requirements of ${pkgId}`));
36
+ console.log(chalk.yellow(` Required: >= ${requiredMoc.format()}`));
37
+ console.log(chalk.yellow(` Installed: ${installedMoc.format()}`));
38
+ }
39
+ }
package/dist/cli.d.ts CHANGED
File without changes
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import { init } from './commands/init.js';
5
5
  import { publish } from './commands/publish.js';
6
6
  import { importPem } from './commands/import-identity.js';
7
7
  import { sources } from './commands/sources.js';
8
- import { checkApiCompatibility, setNetwork, apiVersion, checkConfigFile, getNetworkFile } from './mops.js';
8
+ import { checkApiCompatibility, setNetwork, apiVersion, checkConfigFile, getNetworkFile, version } from './mops.js';
9
9
  import { getNetwork } from './api/network.js';
10
10
  import { whoami } from './commands/whoami.js';
11
11
  import { installAll } from './commands/install-all.js';
@@ -14,7 +14,6 @@ import { add } from './commands/add.js';
14
14
  import { cacheSize, cleanCache } from './cache.js';
15
15
  import { test } from './commands/test/test.js';
16
16
  import { template } from './commands/template.js';
17
- import { selfUpdate } from './commands/self-update.js';
18
17
  import { remove } from './commands/remove.js';
19
18
  import { getUserProp, setUserProp } from './commands/user.js';
20
19
  import { bump } from './commands/bump.js';
@@ -24,6 +23,7 @@ import { update } from './commands/update.js';
24
23
  import { bench } from './commands/bench.js';
25
24
  import { transferOwnership } from './commands/transfer-ownership.js';
26
25
  import { toolchain } from './commands/toolchain/index.js';
26
+ import * as self from './commands/self.js';
27
27
  let networkFile = getNetworkFile();
28
28
  if (fs.existsSync(networkFile)) {
29
29
  globalThis.MOPS_NETWORK = fs.readFileSync(networkFile).toString() || 'ic';
@@ -31,8 +31,7 @@ if (fs.existsSync(networkFile)) {
31
31
  let program = new Command();
32
32
  program.name('mops');
33
33
  // --version
34
- let packageJson = JSON.parse(fs.readFileSync(new URL('package.json', import.meta.url)).toString());
35
- program.version(`CLI ${packageJson.version}\nAPI ${apiVersion}`, '-v --version');
34
+ program.version(`CLI ${version()}\nAPI ${apiVersion}`, '-v --version');
36
35
  // init
37
36
  program
38
37
  .command('init')
@@ -225,20 +224,6 @@ program
225
224
  // }
226
225
  // await docs();
227
226
  // });
228
- // self update
229
- program
230
- .command('self-update')
231
- .description('Update mops CLI to the latest version')
232
- .option('--detached')
233
- .option('--force')
234
- .action(async (options) => {
235
- if (options.force) {
236
- selfUpdate(options);
237
- }
238
- else {
239
- console.log('Please run \'npm i -g ic-mops\'');
240
- }
241
- });
242
227
  // user
243
228
  program
244
229
  .command('user')
@@ -340,4 +325,19 @@ toolchainCommand
340
325
  console.log(bin);
341
326
  });
342
327
  program.addCommand(toolchainCommand);
328
+ // self
329
+ const selfCommand = new Command('self').description('Mops CLI management');
330
+ selfCommand
331
+ .command('update')
332
+ .description('Update mops CLI to the latest version')
333
+ .action(async () => {
334
+ await self.update();
335
+ });
336
+ selfCommand
337
+ .command('uninstall')
338
+ .description('Uninstall mops CLI')
339
+ .action(async () => {
340
+ await self.uninstall();
341
+ });
342
+ program.addCommand(selfCommand);
343
343
  program.parse();
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,14 +5,13 @@ import logUpdate from 'log-update';
5
5
  import { globbySync } from 'globby';
6
6
  import { minimatch } from 'minimatch';
7
7
  import prompts from 'prompts';
8
- import { fromMarkdown } from 'mdast-util-from-markdown';
9
- import { toMarkdown } from 'mdast-util-to-markdown';
10
8
  import { checkConfigFile, getIdentity, getRootDir, progressBar, readConfig } from '../mops.js';
11
9
  import { mainActor } from '../api/actors.js';
12
10
  import { parallel } from '../parallel.js';
13
11
  import { docs } from './docs.js';
14
12
  import { testWithReporter } from './test/test.js';
15
13
  import { SilentReporter } from './test/reporters/silent-reporter.js';
14
+ import { findChangelogEntry } from '../helpers/find-changelog-entry.js';
16
15
  import { bench } from './bench.js';
17
16
  export async function publish(options = {}) {
18
17
  if (!checkConfigFile()) {
@@ -355,25 +354,3 @@ async function fetchGitHubReleaseNotes(repo, version) {
355
354
  }
356
355
  return release.body;
357
356
  }
358
- function findChangelogEntry(changelog, version) {
359
- let tree = fromMarkdown(changelog);
360
- let found = false;
361
- let nodes = [];
362
- for (let node of tree.children) {
363
- if (found) {
364
- if (node.type === 'heading') {
365
- break;
366
- }
367
- else {
368
- nodes.push(node);
369
- }
370
- }
371
- else if (node.type === 'heading' && toMarkdown(node).match(new RegExp(`\\b${version}\\b`))) {
372
- found = true;
373
- }
374
- }
375
- return toMarkdown({
376
- type: 'root',
377
- children: nodes,
378
- });
379
- }
File without changes
File without changes
File without changes
File without changes
@@ -39,7 +39,7 @@ export async function update() {
39
39
  console.log('Updating to version: ' + chalk.green(latest));
40
40
  let pm = detectPackageManager();
41
41
  let npmArgs = pm === 'npm' ? ['--no-fund', '--silent'] : [];
42
- let proc = child_process.spawn(pm, ['add', '-g', ...npmArgs, `${url}/versions/${latest}/cli.tgz`], { stdio: 'inherit', detached: false });
42
+ let proc = child_process.spawn(pm, ['add', '-g', ...npmArgs, `${url}/versions/${latest}.tgz`], { stdio: 'inherit', detached: false });
43
43
  proc.on('exit', (res) => {
44
44
  if (res !== 0) {
45
45
  console.log(chalk.red('Failed to update.'));
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,6 +4,7 @@ import chalk from 'chalk';
4
4
  import prompts from 'prompts';
5
5
  import camelCase from 'camelcase';
6
6
  import { getRootDir, readConfig } from '../mops.js';
7
+ import { copyTemplateFileSync } from '../templates.js';
7
8
  export async function template(templateName, options = {}) {
8
9
  if (!templateName) {
9
10
  let res = await prompts({
@@ -30,9 +31,8 @@ export async function template(templateName, options = {}) {
30
31
  console.log(chalk.yellow('Workflow already exists:'), path.relative(getRootDir(), dest));
31
32
  return;
32
33
  }
33
- let mopsTestYml = new URL('../templates/mops-test.yml', import.meta.url);
34
34
  fs.mkdirSync(path.resolve(getRootDir(), '.github/workflows'), { recursive: true });
35
- fs.copyFileSync(mopsTestYml, dest);
35
+ copyTemplateFileSync('mops-test.yml', dest);
36
36
  console.log(chalk.green('Created'), path.relative(getRootDir(), dest));
37
37
  }
38
38
  else if (templateName === 'github-workflow:mops-publish') {
@@ -41,9 +41,8 @@ export async function template(templateName, options = {}) {
41
41
  console.log(chalk.yellow('Workflow already exists:'), path.relative(getRootDir(), dest));
42
42
  return;
43
43
  }
44
- let mopsPublishYml = new URL('../templates/mops-publish.yml', import.meta.url);
45
44
  fs.mkdirSync(path.resolve(getRootDir(), '.github/workflows'), { recursive: true });
46
- fs.copyFileSync(mopsPublishYml, dest);
45
+ copyTemplateFileSync('mops-publish.yml', dest);
47
46
  console.log(chalk.green('Created'), path.relative(getRootDir(), dest));
48
47
  }
49
48
  else if (templateName?.startsWith('license:')) {
@@ -61,13 +60,13 @@ export async function template(templateName, options = {}) {
61
60
  fs.writeFileSync(file, license);
62
61
  };
63
62
  if (templateName === 'license:MIT') {
64
- fs.copyFileSync(new URL('../templates/licenses/MIT', import.meta.url), path.resolve(getRootDir(), 'LICENSE'));
63
+ copyTemplateFileSync('licenses/MIT', path.resolve(getRootDir(), 'LICENSE'));
65
64
  setYearAndOwner(path.resolve(getRootDir(), 'LICENSE'));
66
65
  console.log(chalk.green('Created'), path.relative(getRootDir(), 'LICENSE'));
67
66
  }
68
67
  else if (templateName === 'license:Apache-2.0') {
69
- fs.copyFileSync(new URL('../templates/licenses/Apache-2.0', import.meta.url), path.resolve(getRootDir(), 'LICENSE'));
70
- fs.copyFileSync(new URL('../templates/licenses/Apache-2.0-NOTICE', import.meta.url), path.resolve(getRootDir(), 'NOTICE'));
68
+ copyTemplateFileSync('licenses/Apache-2.0', path.resolve(getRootDir(), 'LICENSE'));
69
+ copyTemplateFileSync('licenses/Apache-2.0-NOTICE', path.resolve(getRootDir(), 'NOTICE'));
71
70
  setYearAndOwner(path.resolve(getRootDir(), 'NOTICE'));
72
71
  console.log(chalk.green('Created'), path.relative(getRootDir(), 'LICENSE'));
73
72
  console.log(chalk.green('Created'), path.relative(getRootDir(), 'NOTICE'));
@@ -75,12 +74,12 @@ export async function template(templateName, options = {}) {
75
74
  }
76
75
  else if (templateName === 'lib.mo') {
77
76
  fs.mkdirSync(path.join(getRootDir(), 'src'), { recursive: true });
78
- fs.copyFileSync(new URL('../templates/src/lib.mo', import.meta.url), path.resolve(getRootDir(), 'src/lib.mo'));
77
+ copyTemplateFileSync('src/lib.mo', path.resolve(getRootDir(), 'src/lib.mo'));
79
78
  console.log(chalk.green('Created'), path.relative(getRootDir(), 'src/lib.mo'));
80
79
  }
81
80
  else if (templateName === 'lib.test.mo') {
82
81
  fs.mkdirSync(path.join(getRootDir(), 'test'), { recursive: true });
83
- fs.copyFileSync(new URL('../templates/test/lib.test.mo', import.meta.url), path.resolve(getRootDir(), 'test/lib.test.mo'));
82
+ copyTemplateFileSync('test/lib.test.mo', path.resolve(getRootDir(), 'test/lib.test.mo'));
84
83
  console.log(chalk.green('Created'), path.relative(getRootDir(), 'test/lib.test.mo'));
85
84
  }
86
85
  else if (templateName === 'readme') {
@@ -89,7 +88,7 @@ export async function template(templateName, options = {}) {
89
88
  console.log(chalk.yellow('README.md already exists'));
90
89
  return;
91
90
  }
92
- fs.copyFileSync(new URL('../templates/README.md', import.meta.url), dest);
91
+ copyTemplateFileSync('README.md', dest);
93
92
  let config = readConfig();
94
93
  let data = fs.readFileSync(dest).toString();
95
94
  data = data.replace(/<year>/g, new Date().getFullYear().toString());
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
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/integrity.js CHANGED
File without changes
package/dist/mops.d.ts CHANGED
@@ -27,4 +27,5 @@ export declare function formatDir(name: string, version: string): string;
27
27
  export declare function formatGithubDir(name: string, repo: string): string;
28
28
  export declare function readDfxJson(): any;
29
29
  export declare function checkApiCompatibility(): Promise<boolean>;
30
+ export declare function version(): any;
30
31
  export { getNetwork, mainActor, storageActor, getHighestVersion, };
package/dist/mops.js CHANGED
@@ -235,5 +235,9 @@ export async function checkApiCompatibility() {
235
235
  }
236
236
  return true;
237
237
  }
238
+ export function version() {
239
+ let packageJson = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url)).toString());
240
+ return packageJson.version;
241
+ }
238
242
  // compatibility with older versions
239
243
  export { getNetwork, mainActor, storageActor, getHighestVersion, };
File without changes
File without changes
package/dist/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "type": "module",
5
5
  "bin": {
6
- "mops": "dist/bin/mops.js",
7
- "ic-mops": "dist/bin/mops.js",
6
+ "mops": "bin/mops.js",
7
+ "ic-mops": "bin/mops.js",
8
8
  "moc-wrapper": "bin/moc-wrapper.sh"
9
9
  },
10
10
  "files": [
@@ -23,16 +23,6 @@
23
23
  "engines": {
24
24
  "node": ">=18.0.0"
25
25
  },
26
- "scripts": {
27
- "build": "tsc",
28
- "bundle": "esbuild --bundle --outfile=cli.js --platform=node --packages=external --target=node16 --format=esm ./dist/cli.js",
29
- "copy": "cp -r commands/bench dist/commands && cp -r declarations templates network.txt package.json dist | true",
30
- "save-network": "cp -r dist/network.txt . | true",
31
- "prepare": "npm run save-network && npm run build && npm run copy",
32
- "check": "tsc --project tsconfig.json --noEmit",
33
- "tsc": "tsc",
34
- "esbuild": "esbuild"
35
- },
36
26
  "dependencies": {
37
27
  "@dfinity/agent": "^0.19.3",
38
28
  "@dfinity/candid": "^0.19.3",
@@ -42,18 +32,19 @@
42
32
  "@iarna/toml": "^2.2.5",
43
33
  "@noble/hashes": "1.3.2",
44
34
  "as-table": "^1.0.55",
35
+ "buffer": "6.0.3",
45
36
  "cacheable-request": "10.2.12",
46
37
  "camelcase": "^7.0.1",
47
38
  "chalk": "^5.3.0",
48
- "chokidar": "^3.5.3",
49
- "commander": "11.1.0",
39
+ "chokidar": "3.6.0",
40
+ "commander": "12.0.0",
50
41
  "debounce": "^1.2.1",
51
42
  "decomp-tarxz": "0.1.1",
52
43
  "decompress": "^4.2.1",
53
- "del": "^7.0.0",
44
+ "del": "7.1.0",
54
45
  "dhall-to-json-cli": "^1.7.6",
55
- "eslint": "^8.45.0",
56
- "execa": "7.1.1",
46
+ "eslint": "8.57.0",
47
+ "execa": "8.0.1",
57
48
  "fs-extra": "11.2.0",
58
49
  "get-folder-size": "^4.0.0",
59
50
  "glob": "^10.3.3",
@@ -70,24 +61,27 @@
70
61
  "pem-file": "^1.0.1",
71
62
  "pic-ic": "0.3.2",
72
63
  "prompts": "^2.4.2",
64
+ "semver": "7.6.0",
73
65
  "stream-to-promise": "^3.0.0",
74
- "string-width": "7.0.0",
75
- "tar": "^6.1.15"
66
+ "string-width": "7.1.0",
67
+ "tar": "6.2.0"
76
68
  },
77
69
  "devDependencies": {
78
- "@tsconfig/strictest": "^2.0.1",
70
+ "@tsconfig/strictest": "2.0.2",
79
71
  "@types/debounce": "^1.2.1",
80
72
  "@types/decompress": "^4.2.4",
81
73
  "@types/fs-extra": "11.0.4",
82
74
  "@types/glob": "^8.1.0",
83
75
  "@types/ncp": "^2.0.5",
84
- "@types/node": "^20.4.4",
76
+ "@types/node": "20.11.24",
85
77
  "@types/prompts": "^2.4.4",
78
+ "@types/semver": "7.5.8",
86
79
  "@types/stream-to-promise": "^2.2.1",
87
80
  "@types/tar": "^6.1.5",
88
- "esbuild": "^0.18.16",
89
- "tsx": "4.6.2",
90
- "typescript": "^5.1.6"
81
+ "bun": "1.0.35",
82
+ "esbuild": "0.20.1",
83
+ "tsx": "4.7.1",
84
+ "typescript": "5.3.2"
91
85
  },
92
86
  "overrides": {
93
87
  "@dfinity/agent": "^0.19.3",
@@ -95,4 +89,4 @@
95
89
  "@dfinity/principal": "^0.19.3",
96
90
  "@dfinity/candid": "^0.19.3"
97
91
  }
98
- }
92
+ }
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
File without changes