ic-mops 0.2.0 → 0.2.1
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/.eslintrc.json +1 -21
- package/commands/init.js +1 -1
- package/commands/sources.js +7 -5
- package/package.json +1 -1
- package/vessel.js +8 -5
package/.eslintrc.json
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"env": {
|
|
3
|
-
"node": true
|
|
4
|
-
"es2021": true
|
|
3
|
+
"node": true
|
|
5
4
|
},
|
|
6
|
-
"extends": "eslint:recommended",
|
|
7
5
|
"parserOptions": {
|
|
8
6
|
"sourceType": "module"
|
|
9
|
-
},
|
|
10
|
-
"rules": {
|
|
11
|
-
"indent": [
|
|
12
|
-
"error",
|
|
13
|
-
"tab"
|
|
14
|
-
],
|
|
15
|
-
"linebreak-style": [
|
|
16
|
-
"error",
|
|
17
|
-
"unix"
|
|
18
|
-
],
|
|
19
|
-
"quotes": [
|
|
20
|
-
"error",
|
|
21
|
-
"single"
|
|
22
|
-
],
|
|
23
|
-
"semi": [
|
|
24
|
-
"error",
|
|
25
|
-
"always"
|
|
26
|
-
]
|
|
27
7
|
}
|
|
28
8
|
}
|
package/commands/init.js
CHANGED
package/commands/sources.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import {install} from './install.js';
|
|
5
4
|
import {formatDir, formatGithubDir, getHighestVersion, parseGithubURL, readConfig} from '../mops.js';
|
|
6
5
|
import { readVesselConfig } from '../vessel.js';
|
|
7
6
|
|
|
@@ -63,12 +62,15 @@ export async function sources({verbose} = {}) {
|
|
|
63
62
|
|
|
64
63
|
// take root dep version or bigger one
|
|
65
64
|
if (
|
|
66
|
-
isRoot
|
|
67
|
-
!packages[name]
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
isRoot
|
|
66
|
+
|| !packages[name]
|
|
67
|
+
|| !packages[name].isRoot
|
|
68
|
+
&& (
|
|
69
|
+
repo && packages[name].repo && compareGitVersions(packages[name].repo, repo) === -1
|
|
70
|
+
|| compareVersions(packages[name].version, version) === -1)
|
|
70
71
|
) {
|
|
71
72
|
packages[name] = pkgDetails;
|
|
73
|
+
packages[name].isRoot = isRoot;
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
let nestedConfig;
|
package/package.json
CHANGED
package/vessel.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
existsSync, mkdirSync, createWriteStream, readFileSync, writeFileSync
|
|
3
|
-
} from 'fs';
|
|
1
|
+
import {existsSync, mkdirSync, createWriteStream, readFileSync, writeFileSync} from 'fs';
|
|
4
2
|
import del from 'del';
|
|
5
3
|
import { execaCommand} from 'execa';
|
|
6
4
|
import chalk from 'chalk';
|
|
@@ -14,7 +12,13 @@ import {pipeline} from 'stream/promises';
|
|
|
14
12
|
const dhallFileToJson = async (filePath) => {
|
|
15
13
|
if (existsSync(filePath)) {
|
|
16
14
|
let cwd = new URL(path.dirname(import.meta.url)).pathname;
|
|
17
|
-
|
|
15
|
+
let res;
|
|
16
|
+
try {
|
|
17
|
+
res = await execaCommand(`dhall-to-json --file ${filePath}`, {preferLocal:true, cwd});
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
18
22
|
|
|
19
23
|
if (res.exitCode === 0){
|
|
20
24
|
return JSON.parse(res.stdout);
|
|
@@ -125,7 +129,6 @@ export const downloadFromGithub = async (repo, dest, onProgress = null) => {
|
|
|
125
129
|
};
|
|
126
130
|
|
|
127
131
|
export const installFromGithub = async (name, repo, options = {})=>{
|
|
128
|
-
|
|
129
132
|
const {verbose, dep, silent} = options;
|
|
130
133
|
|
|
131
134
|
const {branch} = parseGithubURL(repo);
|