ic-mops 0.41.0 → 0.42.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/CHANGELOG.md +12 -0
- package/api/actors.ts +2 -3
- package/bundle/bin/mops.js +0 -0
- package/bundle/cli.js +29 -29
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/bench/bench.did.d.ts +1 -1
- package/bundle/declarations/bench/index.js +0 -9
- package/bundle/declarations/main/index.js +1 -2
- package/bundle/declarations/main/main.did +15 -8
- package/bundle/declarations/main/main.did.d.ts +12 -9
- package/bundle/declarations/main/main.did.js +11 -8
- package/bundle/declarations/storage/storage.did.d.ts +3 -0
- package/bundle/package.json +2 -2
- package/bundle-package-json.ts +3 -0
- package/cache.ts +25 -7
- package/check-requirements.ts +50 -0
- package/cli.ts +3 -2
- package/commands/add.ts +13 -7
- package/commands/available-updates.ts +1 -0
- package/commands/bench-replica.ts +1 -0
- package/commands/bench.ts +1 -0
- package/commands/bump.ts +1 -0
- package/commands/docs.ts +1 -0
- package/commands/import-identity.ts +1 -0
- package/commands/init.ts +2 -1
- package/commands/install/install-all.ts +51 -0
- package/commands/install/install-dep.ts +34 -0
- package/commands/install/install-deps.ts +31 -0
- package/commands/install/install-local-dep.ts +31 -0
- package/commands/{install.ts → install/install-mops-dep.ts} +43 -43
- package/commands/install/sync-local-cache.ts +34 -0
- package/commands/publish.ts +18 -3
- package/commands/remove.ts +15 -18
- package/commands/search.ts +1 -0
- package/commands/self.ts +1 -0
- package/commands/sources.ts +1 -0
- package/commands/sync.ts +1 -0
- package/commands/test/test.ts +1 -0
- package/commands/toolchain/index.ts +8 -0
- package/commands/toolchain/moc.ts +1 -0
- package/commands/toolchain/pocket-ic.ts +1 -0
- package/commands/toolchain/toolchain-utils.ts +2 -0
- package/commands/toolchain/wasmtime.ts +1 -0
- package/commands/transfer-ownership.ts +1 -0
- package/commands/user.ts +1 -0
- package/declarations/bench/bench.did.d.ts +1 -1
- package/declarations/bench/index.js +0 -9
- package/declarations/main/index.js +1 -2
- package/declarations/main/main.did +15 -8
- package/declarations/main/main.did.d.ts +12 -9
- package/declarations/main/main.did.js +11 -8
- package/declarations/storage/storage.did.d.ts +3 -0
- package/dist/api/actors.js +2 -2
- package/dist/bin/mops.js +0 -0
- package/dist/bundle-package-json.js +2 -0
- package/dist/cache.d.ts +7 -3
- package/dist/cache.js +21 -7
- package/dist/check-requirements.js +9 -4
- package/dist/cli.js +3 -2
- package/dist/commands/add.js +9 -6
- package/dist/commands/available-updates.js +1 -0
- package/dist/commands/bench-replica.js +1 -0
- package/dist/commands/bench.js +1 -0
- package/dist/commands/bump.js +1 -0
- package/dist/commands/docs.js +1 -0
- package/dist/commands/import-identity.js +1 -0
- package/dist/commands/init.js +2 -1
- package/dist/commands/install/install-all.d.ts +8 -0
- package/dist/commands/install/install-all.js +36 -0
- package/dist/commands/install/install-dep.d.ts +8 -0
- package/dist/commands/install/install-dep.js +25 -0
- package/dist/commands/install/install-deps.d.ts +8 -0
- package/dist/commands/install/install-deps.js +21 -0
- package/dist/commands/install/install-local-dep.d.ts +6 -0
- package/dist/commands/install/install-local-dep.js +23 -0
- package/dist/commands/install/install-mops-dep.d.ts +8 -0
- package/dist/commands/install/install-mops-dep.js +103 -0
- package/dist/commands/install/sync-local-cache.d.ts +3 -0
- package/dist/commands/install/sync-local-cache.js +26 -0
- package/dist/commands/install-all.js +2 -0
- package/dist/commands/publish.js +14 -1
- package/dist/commands/remove.js +15 -18
- package/dist/commands/search.js +1 -0
- package/dist/commands/self.js +1 -0
- package/dist/commands/sources.js +1 -0
- package/dist/commands/sync.js +1 -0
- package/dist/commands/test/test.js +1 -0
- package/dist/commands/toolchain/index.js +6 -0
- package/dist/commands/toolchain/moc.js +1 -0
- package/dist/commands/toolchain/pocket-ic.js +1 -0
- package/dist/commands/toolchain/toolchain-utils.js +2 -0
- package/dist/commands/toolchain/wasmtime.js +1 -0
- package/dist/commands/transfer-ownership.js +1 -0
- package/dist/commands/user.js +1 -0
- package/dist/declarations/bench/bench.did.d.ts +1 -1
- package/dist/declarations/bench/index.js +0 -9
- package/dist/declarations/main/index.js +1 -2
- package/dist/declarations/main/main.did +15 -8
- package/dist/declarations/main/main.did.d.ts +12 -9
- package/dist/declarations/main/main.did.js +11 -8
- package/dist/declarations/storage/storage.did.d.ts +3 -0
- package/dist/fix-dist.d.ts +1 -0
- package/dist/fix-dist.js +9 -0
- package/dist/helpers/get-moc-path.js +1 -0
- package/dist/integrity.js +1 -0
- package/dist/mops.js +11 -3
- package/dist/notify-installs.d.ts +1 -1
- package/dist/notify-installs.js +8 -5
- package/dist/package.json +3 -3
- package/dist/pem.d.ts +1 -0
- package/dist/pem.js +2 -1
- package/dist/resolve-packages.js +11 -9
- package/dist/types.d.ts +4 -0
- package/dist/vessel.js +10 -12
- package/{remove-scripts.ts → fix-dist.ts} +6 -0
- package/helpers/get-moc-path.ts +1 -0
- package/integrity.ts +1 -0
- package/mops.ts +13 -3
- package/notify-installs.ts +9 -5
- package/package.json +7 -7
- package/pem.ts +2 -1
- package/resolve-packages.ts +11 -9
- package/tsconfig.json +1 -0
- package/types.ts +7 -2
- package/vessel.ts +11 -13
- package/commands/install-all.ts +0 -56
- package/commands/install-local.ts +0 -52
package/commands/install-all.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
-
import {createLogUpdate} from 'log-update';
|
|
4
|
-
import {checkConfigFile, readConfig} from '../mops.js';
|
|
5
|
-
import {install} from './install.js';
|
|
6
|
-
import {installFromGithub} from '../vessel.js';
|
|
7
|
-
import {notifyInstalls} from '../notify-installs.js';
|
|
8
|
-
import {checkIntegrity} from '../integrity.js';
|
|
9
|
-
import {installLocal} from './install-local.js';
|
|
10
|
-
|
|
11
|
-
type InstallAllOptions = {
|
|
12
|
-
verbose ?: boolean;
|
|
13
|
-
silent ?: boolean;
|
|
14
|
-
lock ?: 'check' | 'update' | 'ignore';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function installAll({verbose = false, silent = false, lock} : InstallAllOptions = {}) {
|
|
18
|
-
if (!checkConfigFile()) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let config = readConfig();
|
|
23
|
-
let deps = Object.values(config.dependencies || {});
|
|
24
|
-
let devDeps = Object.values(config['dev-dependencies'] || {});
|
|
25
|
-
let allDeps = [...deps, ...devDeps];
|
|
26
|
-
let installedPackages = {};
|
|
27
|
-
|
|
28
|
-
for (let {name, repo, path, version} of allDeps) {
|
|
29
|
-
if (repo) {
|
|
30
|
-
await installFromGithub(name, repo, {verbose, silent});
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
let res = await (path ? installLocal(name, path, {silent, verbose}) : install(name, version, {silent, verbose}));
|
|
34
|
-
if (res === false) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
installedPackages = {...installedPackages, ...res};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
let logUpdate = createLogUpdate(process.stdout, {showCursor: true});
|
|
42
|
-
|
|
43
|
-
if (!silent && lock !== 'ignore') {
|
|
44
|
-
logUpdate('Checking integrity...');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
await Promise.all([
|
|
48
|
-
notifyInstalls(Object.keys(installedPackages)),
|
|
49
|
-
checkIntegrity(lock),
|
|
50
|
-
]);
|
|
51
|
-
|
|
52
|
-
if (!silent) {
|
|
53
|
-
logUpdate.clear();
|
|
54
|
-
console.log(chalk.green('Packages installed'));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import {createLogUpdate} from 'log-update';
|
|
3
|
-
import {checkConfigFile, getRootDir, readConfig} from '../mops.js';
|
|
4
|
-
import {installFromGithub} from '../vessel.js';
|
|
5
|
-
import {install} from './install.js';
|
|
6
|
-
|
|
7
|
-
// skip install and just find non-local dependencies to install
|
|
8
|
-
// pkgPath should be relative to the current root dir or absolute
|
|
9
|
-
export async function installLocal(pkg : string, pkgPath = '', {verbose = false, silent = false} = {}) : Promise<Record<string, string> | false> {
|
|
10
|
-
if (!checkConfigFile()) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (!silent) {
|
|
15
|
-
let logUpdate = createLogUpdate(process.stdout, {showCursor: true});
|
|
16
|
-
logUpdate(`Local dependency ${pkg} = "${pkgPath}"`);
|
|
17
|
-
|
|
18
|
-
if (verbose) {
|
|
19
|
-
silent || logUpdate.done();
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
logUpdate.clear();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// install dependencies
|
|
27
|
-
let ok = true;
|
|
28
|
-
let rootDir = getRootDir();
|
|
29
|
-
let dir = path.resolve(rootDir, pkgPath);
|
|
30
|
-
let config = readConfig(path.join(dir, 'mops.toml'));
|
|
31
|
-
let deps = Object.values(config.dependencies || {});
|
|
32
|
-
let installedDeps = {};
|
|
33
|
-
for (const {name, repo, version, path: depPath} of deps) {
|
|
34
|
-
if (repo) {
|
|
35
|
-
await installFromGithub(name, repo, {silent, verbose});
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
let res = await (depPath ? installLocal(name, path.resolve(pkgPath, depPath), {silent, verbose}) : install(name, version, {silent, verbose}));
|
|
39
|
-
if (res) {
|
|
40
|
-
installedDeps = {...installedDeps, ...res};
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
ok = false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (!ok) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
return installedDeps;
|
|
52
|
-
}
|