piral-cli 0.14.11-beta.3680 → 0.14.11-beta.3683
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/package.json +2 -2
- package/src/common/http.ts +0 -13
- package/src/common/package.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "0.14.11-beta.
|
|
3
|
+
"version": "0.14.11-beta.3683",
|
|
4
4
|
"description": "The standard CLI for creating and building a Piral instance or a Pilet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"typescript": "^4.0.2",
|
|
78
78
|
"yargs": "^15.4.1"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "175022bc5b565d8aa303a412bd72d75302a53223"
|
|
81
81
|
}
|
package/src/common/http.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Stream } from 'stream';
|
|
|
4
4
|
import { platform, tmpdir } from 'os';
|
|
5
5
|
import { createWriteStream } from 'fs';
|
|
6
6
|
import { log } from './log';
|
|
7
|
-
import { computeHash } from './hash';
|
|
8
7
|
import { axios, FormData } from '../external';
|
|
9
8
|
|
|
10
9
|
const os = platform();
|
|
@@ -40,18 +39,6 @@ function streamToFile(source: Stream, target: string) {
|
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
export function getHashFromUrl(target: string): Promise<string> {
|
|
44
|
-
return axios.default
|
|
45
|
-
.get<Buffer>(target, {
|
|
46
|
-
responseType: 'arraybuffer',
|
|
47
|
-
headers: standardHeaders,
|
|
48
|
-
})
|
|
49
|
-
.then((res) => {
|
|
50
|
-
log('generalDebug_0003', `Received the contents from "${target}" (status: ${res.status}).`);
|
|
51
|
-
return computeHash(res.data);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
42
|
export function downloadFile(target: string, ca?: Buffer): Promise<Array<string>> {
|
|
56
43
|
const httpsAgent = ca ? new Agent({ ca }) : undefined;
|
|
57
44
|
return axios.default
|
package/src/common/package.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { getDependencies, getDevDependencies } from './language';
|
|
|
6
6
|
import { SourceLanguage, ForceOverwrite } from './enums';
|
|
7
7
|
import { checkAppShellCompatibility } from './compatibility';
|
|
8
8
|
import { deepMerge } from './merge';
|
|
9
|
-
import {
|
|
9
|
+
import { computeHash } from './hash';
|
|
10
10
|
import { applyTemplate } from './template';
|
|
11
11
|
import { isGitPackage, isLocalPackage, makeGitUrl, makeFilePath, makePiletExternals, makeExternals } from './npm';
|
|
12
12
|
import { filesTar, filesOnceTar, declarationEntryExtensions } from './constants';
|
|
@@ -604,7 +604,7 @@ async function resolveImportmap(dir: string, importmap: Importmap) {
|
|
|
604
604
|
|
|
605
605
|
if (typeof url !== 'string') {
|
|
606
606
|
} else if (/^https?:\/\//.test(url)) {
|
|
607
|
-
const hash =
|
|
607
|
+
const hash = computeHash(url).substring(0, 7);
|
|
608
608
|
|
|
609
609
|
dependencies.push({
|
|
610
610
|
id: `${depName}@${hash}`,
|