ic-mops 1.9.0 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Mops CLI Changelog
2
2
 
3
+ ## 1.10.0
4
+ - Enable `memory64` for `wasi` testing (by @ggreif)
5
+ - Add support for arm64 `moc` binaries (for `moc` >= 0.14.6)
6
+ - Deploy benchmarks with `optimize: "cycles"` dfx setting
7
+ - Show warning when publishing packages with GitHub dependencies
8
+
3
9
  ## 1.9.0
4
10
  - Add `mops docs generate` command for generating package documentation ([docs](https://docs.mops.one/cli/mops-docs-generate))
5
11
  - Add `mops docs coverage` command for analyzing documentation coverage ([docs](https://docs.mops.one/cli/mops-docs-coverage))
package/bundle/cli.tgz CHANGED
Binary file
@@ -93,6 +93,7 @@ export class BenchReplica {
93
93
  type: 'custom',
94
94
  wasm: 'canister.wasm',
95
95
  candid: 'canister.did',
96
+ optimize: 'cycles',
96
97
  };
97
98
  }
98
99
 
@@ -53,7 +53,7 @@ export async function publish(options : {docs ?: boolean, test ?: boolean, bench
53
53
  // desired fields
54
54
  for (let key of ['description', 'repository']) {
55
55
  // @ts-ignore
56
- if (!config.package[key]) {
56
+ if (!config.package[key] && !process.env.CI) {
57
57
  let res = await prompts({
58
58
  type: 'confirm',
59
59
  name: 'ok',
@@ -127,6 +127,19 @@ export async function publish(options : {docs ?: boolean, test ?: boolean, bench
127
127
  }
128
128
  delete dep.path;
129
129
  }
130
+
131
+ for (let dep of Object.values(config.dependencies)) {
132
+ if (dep.repo && !process.env.CI) {
133
+ let res = await prompts({
134
+ type: 'confirm',
135
+ name: 'ok',
136
+ message: chalk.yellow('GitHub dependencies make the registry less reliable and limit its capabilities.\nIf you are the owner of the dependency, please consider publishing it to the Mops registry.') + '\n\nPublish anyway?',
137
+ });
138
+ if (!res.ok) {
139
+ return;
140
+ }
141
+ }
142
+ }
130
143
  }
131
144
 
132
145
  if (config['dev-dependencies']) {
@@ -289,6 +289,7 @@ export async function testWithReporter(reporterName : ReporterName | Reporter |
289
289
  '-C', 'cache=n',
290
290
  '-W', 'bulk-memory',
291
291
  '-W', 'multi-memory',
292
+ '-W', 'memory64',
292
293
  '-W', 'max-wasm-stack=4000000',
293
294
  '-W', 'nan-canonicalization=y',
294
295
  wasmFile,
@@ -475,4 +476,4 @@ function pipeMMF(proc : ChildProcessWithoutNullStreams, mmf : MMF1) {
475
476
  resolve();
476
477
  });
477
478
  });
478
- }
479
+ }
@@ -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
 
5
6
  import {globalCacheDir} from '../../mops.js';
6
7
  import * as toolchainUtils from './toolchain-utils.js';
@@ -39,11 +40,16 @@ export let download = async (version : string, {silent = false, verbose = false}
39
40
  }
40
41
 
41
42
  let url;
42
- if (parseInt(version.replaceAll('.', '')) >= parseInt('0.9.5'.replaceAll('.', ''))) {
43
+ if (new SemVer(version).compare(new SemVer('0.14.6')) >= 0) {
43
44
  let platfrom = process.platform == 'darwin' ? 'Darwin' : 'Linux';
44
- let arch = process.arch.startsWith('arm') ? 'arm64' : 'x86_64';
45
- // currently only x64 binaries are available
46
- arch = 'x86_64';
45
+ let arch = process.arch.startsWith('arm')
46
+ ? (process.platform == 'darwin' ? 'arm64' : 'aarch64')
47
+ : 'x86_64';
48
+ url = `https://github.com/dfinity/motoko/releases/download/${version}/motoko-${platfrom}-${arch}-${version}.tar.gz`;
49
+ }
50
+ else if (new SemVer(version).compare(new SemVer('0.9.5')) >= 0) {
51
+ let platfrom = process.platform == 'darwin' ? 'Darwin' : 'Linux';
52
+ let arch = 'x86_64';
47
53
  url = `https://github.com/dfinity/motoko/releases/download/${version}/motoko-${platfrom}-${arch}-${version}.tar.gz`;
48
54
  }
49
55
  else {
@@ -84,6 +84,7 @@ export class BenchReplica {
84
84
  type: 'custom',
85
85
  wasm: 'canister.wasm',
86
86
  candid: 'canister.did',
87
+ optimize: 'cycles',
87
88
  };
88
89
  }
89
90
  return {
@@ -44,7 +44,7 @@ export async function publish(options = {}) {
44
44
  // desired fields
45
45
  for (let key of ['description', 'repository']) {
46
46
  // @ts-ignore
47
- if (!config.package[key]) {
47
+ if (!config.package[key] && !process.env.CI) {
48
48
  let res = await prompts({
49
49
  type: 'confirm',
50
50
  name: 'ok',
@@ -113,6 +113,18 @@ export async function publish(options = {}) {
113
113
  }
114
114
  delete dep.path;
115
115
  }
116
+ for (let dep of Object.values(config.dependencies)) {
117
+ if (dep.repo && !process.env.CI) {
118
+ let res = await prompts({
119
+ type: 'confirm',
120
+ name: 'ok',
121
+ message: chalk.yellow('GitHub dependencies make the registry less reliable and limit its capabilities.\nIf you are the owner of the dependency, please consider publishing it to the Mops registry.') + '\n\nPublish anyway?',
122
+ });
123
+ if (!res.ok) {
124
+ return;
125
+ }
126
+ }
127
+ }
116
128
  }
117
129
  if (config['dev-dependencies']) {
118
130
  if (Object.keys(config['dev-dependencies']).length > 100) {
@@ -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 (parseInt(version.replaceAll('.', '')) >= parseInt('0.9.5'.replaceAll('.', ''))) {
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') ? 'arm64' : 'x86_64';
37
- // currently only x64 binaries are available
38
- arch = 'x86_64';
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 {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "bin/mops.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "dist/bin/mops.js",