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.
- package/.DS_Store +0 -0
- package/.npmrc +2 -1
- package/CHANGELOG.md +8 -0
- package/DEVELOPMENT.md +25 -0
- package/bundle/bench/bench-canister.mo +87 -0
- package/bundle/bench/user-bench.mo +14 -0
- package/bundle/bin/moc-wrapper.sh +3 -0
- package/bundle/bin/mops.js +3 -0
- package/bundle/cli.js +88 -0
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/bench/bench.did +26 -0
- package/bundle/declarations/bench/bench.did.d.ts +29 -0
- package/bundle/declarations/bench/bench.did.js +26 -0
- package/bundle/declarations/bench/index.d.ts +50 -0
- package/bundle/declarations/bench/index.js +41 -0
- package/bundle/declarations/main/index.d.ts +50 -0
- package/bundle/declarations/main/index.js +41 -0
- package/bundle/declarations/main/main.did +426 -0
- package/bundle/declarations/main/main.did.d.ts +352 -0
- package/bundle/declarations/main/main.did.js +404 -0
- package/bundle/declarations/storage/index.d.ts +50 -0
- package/bundle/declarations/storage/index.js +30 -0
- package/bundle/declarations/storage/storage.did +46 -0
- package/bundle/declarations/storage/storage.did.d.ts +37 -0
- package/bundle/declarations/storage/storage.did.js +38 -0
- package/bundle/package.json +31 -0
- package/bundle/templates/README.md +13 -0
- package/bundle/templates/licenses/Apache-2.0 +202 -0
- package/bundle/templates/licenses/Apache-2.0-NOTICE +13 -0
- package/bundle/templates/licenses/MIT +21 -0
- package/bundle/templates/mops-publish.yml +17 -0
- package/bundle/templates/mops-test.yml +22 -0
- package/bundle/templates/src/lib.mo +15 -0
- package/bundle/templates/test/lib.test.mo +4 -0
- package/bundle-package-json.ts +14 -0
- package/cli.ts +22 -19
- package/commands/add.ts +0 -0
- package/commands/install-all.ts +0 -0
- package/commands/publish.ts +1 -27
- package/commands/self.ts +75 -0
- package/commands/template.ts +9 -10
- package/commands/toolchain/index.ts +0 -0
- package/dist/api/actors.d.ts +0 -0
- package/dist/api/actors.js +0 -0
- package/dist/api/downloadPackageFiles.d.ts +0 -0
- package/dist/api/downloadPackageFiles.js +0 -0
- package/dist/api/getHighestVersion.d.ts +0 -0
- package/dist/api/getHighestVersion.js +0 -0
- package/dist/api/index.d.ts +0 -0
- package/dist/api/index.js +0 -0
- package/dist/api/network.d.ts +0 -0
- package/dist/api/network.js +0 -0
- package/dist/api/resolveVersion.d.ts +0 -0
- package/dist/api/resolveVersion.js +0 -0
- package/dist/bin/mops.d.ts +1 -1
- package/dist/bin/mops.js +2 -1
- package/dist/bundle-package-json.d.ts +0 -0
- package/dist/bundle-package-json.js +0 -0
- package/dist/cache.d.ts +0 -0
- package/dist/cache.js +0 -0
- package/dist/check-requirements.d.ts +3 -0
- package/dist/check-requirements.js +39 -0
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +18 -18
- package/dist/commands/add.d.ts +0 -0
- package/dist/commands/add.js +0 -0
- package/dist/commands/available-updates.d.ts +0 -0
- package/dist/commands/available-updates.js +0 -0
- package/dist/commands/bench-replica.d.ts +0 -0
- package/dist/commands/bench-replica.js +0 -0
- package/dist/commands/bench.d.ts +0 -0
- package/dist/commands/bench.js +0 -0
- package/dist/commands/bump.d.ts +0 -0
- package/dist/commands/bump.js +0 -0
- package/dist/commands/docs.d.ts +0 -0
- package/dist/commands/docs.js +0 -0
- package/dist/commands/import-identity.d.ts +0 -0
- package/dist/commands/import-identity.js +0 -0
- package/dist/commands/init.d.ts +0 -0
- package/dist/commands/init.js +0 -0
- package/dist/commands/install-all.d.ts +0 -0
- package/dist/commands/install-all.js +0 -0
- package/dist/commands/install-local.d.ts +0 -0
- package/dist/commands/install-local.js +0 -0
- package/dist/commands/install.d.ts +0 -0
- package/dist/commands/install.js +0 -0
- package/dist/commands/outdated.d.ts +0 -0
- package/dist/commands/outdated.js +0 -0
- package/dist/commands/publish.d.ts +0 -0
- package/dist/commands/publish.js +1 -24
- package/dist/commands/remove.d.ts +0 -0
- package/dist/commands/remove.js +0 -0
- package/dist/commands/search.d.ts +0 -0
- package/dist/commands/search.js +0 -0
- package/dist/commands/self.js +1 -1
- package/dist/commands/sources.d.ts +0 -0
- package/dist/commands/sources.js +0 -0
- package/dist/commands/sync.d.ts +0 -0
- package/dist/commands/sync.js +0 -0
- package/dist/commands/template.d.ts +0 -0
- package/dist/commands/template.js +9 -10
- package/dist/commands/test/mmf1.d.ts +0 -0
- package/dist/commands/test/mmf1.js +0 -0
- package/dist/commands/test/reporters/compact-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/compact-reporter.js +0 -0
- package/dist/commands/test/reporters/files-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/files-reporter.js +0 -0
- package/dist/commands/test/reporters/reporter.d.ts +0 -0
- package/dist/commands/test/reporters/reporter.js +0 -0
- package/dist/commands/test/reporters/silent-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/silent-reporter.js +0 -0
- package/dist/commands/test/reporters/verbose-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/verbose-reporter.js +0 -0
- package/dist/commands/test/test.d.ts +0 -0
- package/dist/commands/test/test.js +0 -0
- package/dist/commands/test/utils.d.ts +0 -0
- package/dist/commands/test/utils.js +0 -0
- package/dist/commands/toolchain/index.d.ts +0 -0
- package/dist/commands/toolchain/index.js +0 -0
- package/dist/commands/toolchain/moc.d.ts +0 -0
- package/dist/commands/toolchain/moc.js +0 -0
- package/dist/commands/toolchain/pocket-ic.d.ts +0 -0
- package/dist/commands/toolchain/pocket-ic.js +0 -0
- package/dist/commands/toolchain/toolchain-utils.d.ts +0 -0
- package/dist/commands/toolchain/toolchain-utils.js +0 -0
- package/dist/commands/toolchain/wasmtime.d.ts +0 -0
- package/dist/commands/toolchain/wasmtime.js +0 -0
- package/dist/commands/transfer-ownership.d.ts +0 -0
- package/dist/commands/transfer-ownership.js +0 -0
- package/dist/commands/update.d.ts +0 -0
- package/dist/commands/update.js +0 -0
- package/dist/commands/user.d.ts +0 -0
- package/dist/commands/user.js +0 -0
- package/dist/commands/whoami.d.ts +0 -0
- package/dist/commands/whoami.js +0 -0
- package/dist/declarations/bench/bench.did +0 -0
- package/dist/declarations/bench/bench.did.d.ts +0 -0
- package/dist/declarations/bench/bench.did.js +0 -0
- package/dist/declarations/bench/index.d.ts +0 -0
- package/dist/declarations/bench/index.js +0 -0
- package/dist/declarations/main/index.d.ts +0 -0
- package/dist/declarations/main/index.js +0 -0
- package/dist/declarations/main/main.did +0 -0
- package/dist/declarations/main/main.did.d.ts +0 -0
- package/dist/declarations/main/main.did.js +0 -0
- package/dist/helpers/find-changelog-entry.d.ts +0 -0
- package/dist/helpers/find-changelog-entry.js +0 -0
- package/dist/helpers/get-dfx-version.d.ts +0 -0
- package/dist/helpers/get-dfx-version.js +0 -0
- package/dist/helpers/get-moc-path.d.ts +0 -0
- package/dist/helpers/get-moc-path.js +0 -0
- package/dist/helpers/get-moc-version.d.ts +0 -0
- package/dist/helpers/get-moc-version.js +0 -0
- package/dist/integrity.d.ts +0 -0
- package/dist/integrity.js +0 -0
- package/dist/mops.d.ts +1 -0
- package/dist/mops.js +4 -0
- package/dist/notify-installs.d.ts +0 -0
- package/dist/notify-installs.js +0 -0
- package/dist/package.json +20 -26
- package/dist/parallel.d.ts +0 -0
- package/dist/parallel.js +0 -0
- package/dist/pem.d.ts +0 -0
- package/dist/pem.js +0 -0
- package/dist/release-cli.d.ts +0 -0
- package/dist/release-cli.js +9 -7
- package/dist/resolve-packages.d.ts +0 -0
- package/dist/resolve-packages.js +0 -0
- package/dist/templates.d.ts +1 -0
- package/dist/templates.js +4 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.js +0 -0
- package/dist/vessel.d.ts +0 -0
- package/dist/vessel.js +0 -0
- package/helpers/find-changelog-entry.ts +27 -0
- package/mops.ts +5 -0
- package/package.json +28 -19
- package/release-cli.ts +62 -0
- package/remove-scripts.ts +6 -0
- package/templates.ts +5 -0
- package/tsconfig.json +1 -1
- package/types.ts +0 -0
- package/commands/self-update.ts +0 -6
- package/dist/commands/self-update.d.ts +0 -3
- package/dist/commands/self-update.js +0 -5
- /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
|
-
|
|
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();
|
package/dist/commands/add.d.ts
CHANGED
|
File without changes
|
package/dist/commands/add.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/commands/bench.d.ts
CHANGED
|
File without changes
|
package/dist/commands/bench.js
CHANGED
|
File without changes
|
package/dist/commands/bump.d.ts
CHANGED
|
File without changes
|
package/dist/commands/bump.js
CHANGED
|
File without changes
|
package/dist/commands/docs.d.ts
CHANGED
|
File without changes
|
package/dist/commands/docs.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/commands/init.d.ts
CHANGED
|
File without changes
|
package/dist/commands/init.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/commands/install.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/commands/publish.js
CHANGED
|
@@ -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
|
package/dist/commands/remove.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/commands/search.js
CHANGED
|
File without changes
|
package/dist/commands/self.js
CHANGED
|
@@ -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}
|
|
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
|
package/dist/commands/sources.js
CHANGED
|
File without changes
|
package/dist/commands/sync.d.ts
CHANGED
|
File without changes
|
package/dist/commands/sync.js
CHANGED
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/dist/commands/update.js
CHANGED
|
File without changes
|
package/dist/commands/user.d.ts
CHANGED
|
File without changes
|
package/dist/commands/user.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/commands/whoami.js
CHANGED
|
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.d.ts
CHANGED
|
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
|
package/dist/notify-installs.js
CHANGED
|
File without changes
|
package/dist/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ic-mops",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
|
-
"mops": "
|
|
7
|
-
"ic-mops": "
|
|
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": "
|
|
49
|
-
"commander": "
|
|
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": "
|
|
44
|
+
"del": "7.1.0",
|
|
54
45
|
"dhall-to-json-cli": "^1.7.6",
|
|
55
|
-
"eslint": "
|
|
56
|
-
"execa": "
|
|
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.
|
|
75
|
-
"tar": "
|
|
66
|
+
"string-width": "7.1.0",
|
|
67
|
+
"tar": "6.2.0"
|
|
76
68
|
},
|
|
77
69
|
"devDependencies": {
|
|
78
|
-
"@tsconfig/strictest": "
|
|
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": "
|
|
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
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
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
|
+
}
|
package/dist/parallel.d.ts
CHANGED
|
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
|
package/dist/release-cli.d.ts
CHANGED
|
File without changes
|