npm-pkgbuild 12.0.2 → 12.1.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/package.json +2 -3
- package/src/publish.mjs +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tsc:types": "tsc -d --allowJs --declarationDir dist --emitDeclarationOnly ./src/extract-from-package.mjs"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@npmcli/arborist": "^
|
|
47
|
+
"@npmcli/arborist": "^7.0.0",
|
|
48
48
|
"@vercel/nft": "^0.23.0",
|
|
49
49
|
"aggregate-async-iterator": "^1.1.16",
|
|
50
50
|
"commander": "^11.0.0",
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"ini": "^4.1.0",
|
|
59
59
|
"iterable-string-interceptor": "^2.2.4",
|
|
60
60
|
"key-value-transformer": "^3.1.1",
|
|
61
|
-
"node-fetch": "^3.3.2",
|
|
62
61
|
"npm-package-walker": "^6.2.4",
|
|
63
62
|
"npm-packlist": "^8.0.0",
|
|
64
63
|
"pacote": "^17.0.4",
|
package/src/publish.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
2
|
import { createReadStream } from "node:fs";
|
|
3
3
|
import { mkdir, copyFile } from "node:fs/promises";
|
|
4
|
-
import fetch from "node-fetch";
|
|
5
4
|
import { decodePassword } from "./util.mjs";
|
|
6
5
|
|
|
7
6
|
export function analysePublish(publish, properties) {
|
|
@@ -19,16 +18,15 @@ export function analysePublish(publish, properties) {
|
|
|
19
18
|
return publish;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export async function publish(fileName, destination, properties) {
|
|
21
|
+
export async function publish(fileName, destination, properties, logger=console.log) {
|
|
23
22
|
if (!destination) {
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
const publish = analysePublish(destination, properties);
|
|
28
|
-
|
|
29
27
|
const url = publish.url + "/" + basename(fileName);
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
logger(`Publishing to ${url}`);
|
|
32
30
|
|
|
33
31
|
switch (publish.scheme) {
|
|
34
32
|
case "file:":
|
|
@@ -54,6 +52,7 @@ export async function publish(fileName, destination, properties) {
|
|
|
54
52
|
const response = await fetch(url, {
|
|
55
53
|
method: "PUT",
|
|
56
54
|
headers,
|
|
55
|
+
duplex: 'half',
|
|
57
56
|
body: createReadStream(fileName)
|
|
58
57
|
});
|
|
59
58
|
|