npm-pkgbuild 10.14.5 → 10.14.6
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/output/oci.mjs +14 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "10.14.
|
|
3
|
+
"version": "10.14.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@vercel/nft": "^0.21.0",
|
|
45
45
|
"aggregate-async-iterator": "^1.1.14",
|
|
46
46
|
"commander": "^9.4.0",
|
|
47
|
-
"content-entry": "^5.2.
|
|
47
|
+
"content-entry": "^5.2.1",
|
|
48
48
|
"content-entry-filesystem": "^5.2.2",
|
|
49
49
|
"content-entry-transform": "^1.4.13",
|
|
50
50
|
"execa": "^6.1.0",
|
package/src/output/oci.mjs
CHANGED
|
@@ -64,7 +64,7 @@ export class OCI extends Packager {
|
|
|
64
64
|
return `${p.name}-${p.version}${this.fileNameExtension}`;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
async execute(sources, transformer, dependencies, options, expander) {
|
|
67
|
+
async execute(sources, transformer, dependencies, options, expander = v => v) {
|
|
68
68
|
const { properties, destination } = await this.prepareExecute(options);
|
|
69
69
|
const packageFile = join(destination, this.packageFileName);
|
|
70
70
|
|
|
@@ -77,8 +77,7 @@ export class OCI extends Packager {
|
|
|
77
77
|
digest:
|
|
78
78
|
"sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7"
|
|
79
79
|
},
|
|
80
|
-
layers: [
|
|
81
|
-
],
|
|
80
|
+
layers: [],
|
|
82
81
|
annotations: {
|
|
83
82
|
description: properties.description,
|
|
84
83
|
version: properties.version
|
|
@@ -105,15 +104,20 @@ export class OCI extends Packager {
|
|
|
105
104
|
const buffer = await entry.buffer;
|
|
106
105
|
const size = buffer.length;
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
const destination = entry.destination;
|
|
108
|
+
|
|
109
|
+
const name = expander(
|
|
110
|
+
destination === undefined
|
|
111
|
+
? entry.name
|
|
112
|
+
: destination.endsWith("/")
|
|
113
|
+
? join(destination, entry.name)
|
|
114
|
+
: destination
|
|
115
|
+
).replace(/^\//, "");
|
|
116
|
+
|
|
117
|
+
into(header, 0, 100, name);
|
|
109
118
|
intoOctal(header, 100, 8, entry.mode);
|
|
110
119
|
intoOctal(header, 124, 12, size);
|
|
111
|
-
|
|
112
|
-
const mtime = await entry.mtime;
|
|
113
|
-
if (!mtime) {
|
|
114
|
-
console.warn("no mtime", entry.name);
|
|
115
|
-
}
|
|
116
|
-
intoOctal(header, 136, 12, mtime ? mtime.getTime() / 1000 : 0);
|
|
120
|
+
intoOctal(header, 136, 12, (await entry.mtime).getTime() / 1000);
|
|
117
121
|
intoOctal(header, 148, 8, chksum(header));
|
|
118
122
|
|
|
119
123
|
out.write(header);
|