ic-mops 0.42.1 → 0.44.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 +9 -0
- package/bin/moc-wrapper.sh +39 -2
- package/bundle/cli.js +31 -31
- package/bundle/cli.tgz +0 -0
- package/bundle/package.json +1 -1
- package/cache.ts +4 -0
- package/cli.ts +5 -2
- package/commands/install/install-all.ts +1 -1
- package/commands/install/sync-local-cache.ts +3 -1
- package/dist/bin/moc-wrapper.sh +39 -2
- package/dist/cache.d.ts +1 -0
- package/dist/cache.js +3 -0
- package/dist/cli.js +5 -2
- package/dist/commands/install/install-all.js +1 -1
- package/dist/commands/install/sync-local-cache.js +3 -1
- package/dist/package.json +1 -1
- package/dist/vessel.js +2 -3
- package/package.json +1 -1
- package/vessel.ts +2 -3
package/bundle/cli.tgz
CHANGED
|
Binary file
|
package/bundle/package.json
CHANGED
package/cache.ts
CHANGED
|
@@ -5,6 +5,10 @@ import getFolderSize from 'get-folder-size';
|
|
|
5
5
|
|
|
6
6
|
import {getDependencyType, globalCacheDir, parseGithubURL} from './mops.js';
|
|
7
7
|
|
|
8
|
+
export let show = () => {
|
|
9
|
+
return globalCacheDir;
|
|
10
|
+
};
|
|
11
|
+
|
|
8
12
|
export let getDepCacheDir = (cacheName : string) => {
|
|
9
13
|
return path.join(globalCacheDir, 'packages', cacheName);
|
|
10
14
|
};
|
package/cli.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {whoami} from './commands/whoami.js';
|
|
|
13
13
|
import {installAll} from './commands/install/install-all.js';
|
|
14
14
|
import {search} from './commands/search.js';
|
|
15
15
|
import {add} from './commands/add.js';
|
|
16
|
-
import {cacheSize, cleanCache} from './cache.js';
|
|
16
|
+
import {cacheSize, cleanCache, show} from './cache.js';
|
|
17
17
|
import {test} from './commands/test/test.js';
|
|
18
18
|
import {template} from './commands/template.js';
|
|
19
19
|
import {remove} from './commands/remove.js';
|
|
@@ -199,7 +199,7 @@ program
|
|
|
199
199
|
program
|
|
200
200
|
.command('cache')
|
|
201
201
|
.description('Manage cache')
|
|
202
|
-
.addArgument(new Argument('<sub>').choices(['size', 'clean']))
|
|
202
|
+
.addArgument(new Argument('<sub>').choices(['size', 'clean', 'show']))
|
|
203
203
|
.action(async (sub) => {
|
|
204
204
|
if (sub == 'clean') {
|
|
205
205
|
await cleanCache();
|
|
@@ -209,6 +209,9 @@ program
|
|
|
209
209
|
let size = await cacheSize();
|
|
210
210
|
console.log('Cache size is ' + size);
|
|
211
211
|
}
|
|
212
|
+
else if (sub == 'show') {
|
|
213
|
+
console.log(show());
|
|
214
|
+
}
|
|
212
215
|
});
|
|
213
216
|
|
|
214
217
|
// test
|
|
@@ -36,7 +36,7 @@ export async function installAll({verbose = false, silent = false, threads, lock
|
|
|
36
36
|
logUpdate('Checking integrity...');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
let installedPackages = await syncLocalCache();
|
|
39
|
+
let installedPackages = await syncLocalCache({verbose});
|
|
40
40
|
|
|
41
41
|
await Promise.all([
|
|
42
42
|
notifyInstalls(installedPackages),
|
package/dist/bin/moc-wrapper.sh
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
# set -e
|
|
4
|
+
|
|
5
|
+
findRootDir() {
|
|
6
|
+
dir="$(pwd)"
|
|
7
|
+
while [[ "$dir" != "" && ! -e "$dir/mops.toml" ]]; do
|
|
8
|
+
dir=${dir%/*}
|
|
9
|
+
done
|
|
10
|
+
echo "$dir"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
rootDir=$(findRootDir)
|
|
14
|
+
mopsToml="$rootDir/mops.toml"
|
|
15
|
+
|
|
16
|
+
if [[ $rootDir == "" ]] || [[ ! -f $mopsToml ]]; then
|
|
17
|
+
echo "mops.toml not found in $rootDir or its parent directories"
|
|
18
|
+
exit 1;
|
|
19
|
+
fi;
|
|
20
|
+
|
|
21
|
+
if command -v openssl &> /dev/null; then
|
|
22
|
+
mopsTomlHash=$(openssl sha256 $mopsToml | awk -F'= ' '{print $2}')
|
|
23
|
+
else
|
|
24
|
+
mopsTomlHash=$(shasum $mopsToml -a 256 | awk -F' ' '{print $1}')
|
|
25
|
+
fi;
|
|
26
|
+
|
|
27
|
+
cached="$rootDir/.mops/moc-$mopsTomlHash"
|
|
28
|
+
|
|
29
|
+
if [ -f $cached ]; then
|
|
30
|
+
mocPath=$(cat $cached)
|
|
31
|
+
if [[ "$mocPath" != *"/moc" ]] ; then
|
|
32
|
+
mocPath="$(mops toolchain bin moc --fallback)"
|
|
33
|
+
echo -n $mocPath > "$cached"
|
|
34
|
+
fi;
|
|
35
|
+
else
|
|
36
|
+
mocPath="$(mops toolchain bin moc --fallback)"
|
|
37
|
+
echo -n $mocPath > "$cached"
|
|
38
|
+
fi;
|
|
39
|
+
|
|
40
|
+
$mocPath "$@"
|
package/dist/cache.d.ts
CHANGED
package/dist/cache.js
CHANGED
|
@@ -3,6 +3,9 @@ import path from 'node:path';
|
|
|
3
3
|
import ncp from 'ncp';
|
|
4
4
|
import getFolderSize from 'get-folder-size';
|
|
5
5
|
import { getDependencyType, globalCacheDir, parseGithubURL } from './mops.js';
|
|
6
|
+
export let show = () => {
|
|
7
|
+
return globalCacheDir;
|
|
8
|
+
};
|
|
6
9
|
export let getDepCacheDir = (cacheName) => {
|
|
7
10
|
return path.join(globalCacheDir, 'packages', cacheName);
|
|
8
11
|
};
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import { whoami } from './commands/whoami.js';
|
|
|
12
12
|
import { installAll } from './commands/install/install-all.js';
|
|
13
13
|
import { search } from './commands/search.js';
|
|
14
14
|
import { add } from './commands/add.js';
|
|
15
|
-
import { cacheSize, cleanCache } from './cache.js';
|
|
15
|
+
import { cacheSize, cleanCache, show } from './cache.js';
|
|
16
16
|
import { test } from './commands/test/test.js';
|
|
17
17
|
import { template } from './commands/template.js';
|
|
18
18
|
import { remove } from './commands/remove.js';
|
|
@@ -172,7 +172,7 @@ program
|
|
|
172
172
|
program
|
|
173
173
|
.command('cache')
|
|
174
174
|
.description('Manage cache')
|
|
175
|
-
.addArgument(new Argument('<sub>').choices(['size', 'clean']))
|
|
175
|
+
.addArgument(new Argument('<sub>').choices(['size', 'clean', 'show']))
|
|
176
176
|
.action(async (sub) => {
|
|
177
177
|
if (sub == 'clean') {
|
|
178
178
|
await cleanCache();
|
|
@@ -182,6 +182,9 @@ program
|
|
|
182
182
|
let size = await cacheSize();
|
|
183
183
|
console.log('Cache size is ' + size);
|
|
184
184
|
}
|
|
185
|
+
else if (sub == 'show') {
|
|
186
|
+
console.log(show());
|
|
187
|
+
}
|
|
185
188
|
});
|
|
186
189
|
// test
|
|
187
190
|
program
|
|
@@ -23,7 +23,7 @@ export async function installAll({ verbose = false, silent = false, threads, loc
|
|
|
23
23
|
if (!silent && lock !== 'ignore') {
|
|
24
24
|
logUpdate('Checking integrity...');
|
|
25
25
|
}
|
|
26
|
-
let installedPackages = await syncLocalCache();
|
|
26
|
+
let installedPackages = await syncLocalCache({ verbose });
|
|
27
27
|
await Promise.all([
|
|
28
28
|
notifyInstalls(installedPackages),
|
|
29
29
|
checkIntegrity(lock),
|
package/dist/package.json
CHANGED
package/dist/vessel.js
CHANGED
|
@@ -8,7 +8,7 @@ import chalk from 'chalk';
|
|
|
8
8
|
import { createLogUpdate } from 'log-update';
|
|
9
9
|
import got from 'got';
|
|
10
10
|
import decompress from 'decompress';
|
|
11
|
-
import {
|
|
11
|
+
import { parseGithubURL, progressBar } from './mops.js';
|
|
12
12
|
import { getDepCacheDir, getGithubDepCacheName, isDepCached } from './cache.js';
|
|
13
13
|
const dhallFileToJson = async (filePath, silent) => {
|
|
14
14
|
if (existsSync(filePath)) {
|
|
@@ -117,7 +117,6 @@ export const downloadFromGithub = async (repo, dest, onProgress) => {
|
|
|
117
117
|
return promise;
|
|
118
118
|
};
|
|
119
119
|
export const installFromGithub = async (name, repo, { verbose = false, dep = false, silent = false } = {}) => {
|
|
120
|
-
let dir = formatGithubDir(name, repo);
|
|
121
120
|
let cacheName = getGithubDepCacheName(name, repo);
|
|
122
121
|
let cacheDir = getDepCacheDir(cacheName);
|
|
123
122
|
let logUpdate = createLogUpdate(process.stdout, { showCursor: true });
|
|
@@ -144,7 +143,7 @@ export const installFromGithub = async (name, repo, { verbose = false, dep = fal
|
|
|
144
143
|
else {
|
|
145
144
|
logUpdate.clear();
|
|
146
145
|
}
|
|
147
|
-
const config = await readVesselConfig(
|
|
146
|
+
const config = await readVesselConfig(cacheDir, { silent });
|
|
148
147
|
if (config) {
|
|
149
148
|
for (const { name, repo } of config.dependencies) {
|
|
150
149
|
if (repo) {
|
package/package.json
CHANGED
package/vessel.ts
CHANGED
|
@@ -8,7 +8,7 @@ import chalk from 'chalk';
|
|
|
8
8
|
import {createLogUpdate} from 'log-update';
|
|
9
9
|
import got from 'got';
|
|
10
10
|
import decompress from 'decompress';
|
|
11
|
-
import {
|
|
11
|
+
import {parseGithubURL, progressBar} from './mops.js';
|
|
12
12
|
import {getDepCacheDir, getGithubDepCacheName, isDepCached} from './cache.js';
|
|
13
13
|
|
|
14
14
|
const dhallFileToJson = async (filePath : string, silent : boolean) => {
|
|
@@ -150,7 +150,6 @@ export const downloadFromGithub = async (repo : string, dest : string, onProgres
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
export const installFromGithub = async (name : string, repo : string, {verbose = false, dep = false, silent = false} = {}) => {
|
|
153
|
-
let dir = formatGithubDir(name, repo);
|
|
154
153
|
let cacheName = getGithubDepCacheName(name, repo);
|
|
155
154
|
let cacheDir = getDepCacheDir(cacheName);
|
|
156
155
|
|
|
@@ -184,7 +183,7 @@ export const installFromGithub = async (name : string, repo : string, {verbose =
|
|
|
184
183
|
logUpdate.clear();
|
|
185
184
|
}
|
|
186
185
|
|
|
187
|
-
const config = await readVesselConfig(
|
|
186
|
+
const config = await readVesselConfig(cacheDir, {silent});
|
|
188
187
|
|
|
189
188
|
if (config) {
|
|
190
189
|
for (const {name, repo} of config.dependencies) {
|