npm-pkgbuild 20.9.0 → 20.9.2
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/README.md +32 -33
- package/package.json +3 -3
- package/src/content/file-content-provider.mjs +1 -1
- package/src/content/nft-content-provider.mjs +1 -1
- package/src/extract-from-package.mjs +2 -2
- package/src/output/arch.mjs +11 -10
- package/src/util.mjs +1 -23
package/README.md
CHANGED
|
@@ -117,77 +117,77 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
117
117
|
* [ContentProvider](#contentprovider)
|
|
118
118
|
* [Parameters](#parameters-6)
|
|
119
119
|
* [Properties](#properties-3)
|
|
120
|
+
* [propertiesFor](#propertiesfor)
|
|
121
|
+
* [Parameters](#parameters-7)
|
|
120
122
|
* [asyncIterator](#asynciterator-3)
|
|
121
123
|
* [DEBIAN](#debian)
|
|
122
124
|
* [hookMapping](#hookmapping)
|
|
123
125
|
* [attributes](#attributes)
|
|
124
126
|
* [prepare](#prepare)
|
|
125
|
-
* [Parameters](#parameters-
|
|
127
|
+
* [Parameters](#parameters-8)
|
|
126
128
|
* [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
|
|
127
129
|
* [attributes](#attributes-1)
|
|
128
130
|
* [quoteFile](#quotefile)
|
|
129
|
-
* [Parameters](#parameters-
|
|
131
|
+
* [Parameters](#parameters-9)
|
|
130
132
|
* [RPM](#rpm)
|
|
131
133
|
* [hookMapping](#hookmapping-1)
|
|
132
134
|
* [attributes](#attributes-2)
|
|
133
135
|
* [prepare](#prepare-1)
|
|
134
|
-
* [Parameters](#parameters-
|
|
136
|
+
* [Parameters](#parameters-10)
|
|
135
137
|
* [OCI](#oci)
|
|
136
138
|
* [DOCKER](#docker)
|
|
137
139
|
* [attributes](#attributes-3)
|
|
138
140
|
* [prepare](#prepare-2)
|
|
139
|
-
* [Parameters](#parameters-
|
|
141
|
+
* [Parameters](#parameters-11)
|
|
140
142
|
* [BUILDAH](#buildah)
|
|
141
143
|
* [Packager](#packager)
|
|
142
|
-
* [Parameters](#parameters-
|
|
144
|
+
* [Parameters](#parameters-12)
|
|
143
145
|
* [packageName](#packagename)
|
|
144
|
-
* [Parameters](#parameters-
|
|
146
|
+
* [Parameters](#parameters-13)
|
|
145
147
|
* [hookContent](#hookcontent)
|
|
146
148
|
* [dependencyExpression](#dependencyexpression)
|
|
147
|
-
* [Parameters](#parameters-
|
|
149
|
+
* [Parameters](#parameters-14)
|
|
148
150
|
* [tmpdir](#tmpdir)
|
|
149
151
|
* [prepare](#prepare-3)
|
|
150
|
-
* [Parameters](#parameters-14)
|
|
151
|
-
* [create](#create)
|
|
152
152
|
* [Parameters](#parameters-15)
|
|
153
|
+
* [create](#create)
|
|
154
|
+
* [Parameters](#parameters-16)
|
|
153
155
|
* [workspaceLayout](#workspacelayout)
|
|
154
156
|
* [prepare](#prepare-4)
|
|
155
|
-
* [Parameters](#parameters-
|
|
157
|
+
* [Parameters](#parameters-17)
|
|
156
158
|
* [Packager](#packager-1)
|
|
157
|
-
* [Parameters](#parameters-
|
|
159
|
+
* [Parameters](#parameters-18)
|
|
158
160
|
* [packageName](#packagename-1)
|
|
159
|
-
* [Parameters](#parameters-
|
|
161
|
+
* [Parameters](#parameters-19)
|
|
160
162
|
* [hookContent](#hookcontent-1)
|
|
161
163
|
* [dependencyExpression](#dependencyexpression-1)
|
|
162
|
-
* [Parameters](#parameters-
|
|
164
|
+
* [Parameters](#parameters-20)
|
|
163
165
|
* [tmpdir](#tmpdir-1)
|
|
164
166
|
* [prepare](#prepare-5)
|
|
165
|
-
* [Parameters](#parameters-20)
|
|
166
|
-
* [create](#create-1)
|
|
167
167
|
* [Parameters](#parameters-21)
|
|
168
|
+
* [create](#create-1)
|
|
169
|
+
* [Parameters](#parameters-22)
|
|
168
170
|
* [workspaceLayout](#workspacelayout-1)
|
|
169
171
|
* [prepare](#prepare-6)
|
|
170
|
-
* [Parameters](#parameters-
|
|
172
|
+
* [Parameters](#parameters-23)
|
|
171
173
|
* [Field](#field)
|
|
172
174
|
* [Properties](#properties-4)
|
|
173
175
|
* [deleteKey](#deletekey)
|
|
174
|
-
* [Parameters](#parameters-23)
|
|
175
|
-
* [copyNodeModules](#copynodemodules)
|
|
176
176
|
* [Parameters](#parameters-24)
|
|
177
|
+
* [copyNodeModules](#copynodemodules)
|
|
178
|
+
* [Parameters](#parameters-25)
|
|
177
179
|
* [PublishingDetail](#publishingdetail)
|
|
178
180
|
* [Properties](#properties-5)
|
|
179
181
|
* [createPublishingDetails](#createpublishingdetails)
|
|
180
|
-
* [Parameters](#parameters-25)
|
|
181
|
-
* [publish](#publish)
|
|
182
182
|
* [Parameters](#parameters-26)
|
|
183
|
+
* [publish](#publish)
|
|
184
|
+
* [Parameters](#parameters-27)
|
|
183
185
|
* [utf8StreamOptions](#utf8streamoptions)
|
|
184
186
|
* [decodePassword](#decodepassword)
|
|
185
|
-
* [Parameters](#parameters-
|
|
187
|
+
* [Parameters](#parameters-28)
|
|
186
188
|
* [FunctionDecl](#functiondecl)
|
|
187
189
|
* [Properties](#properties-6)
|
|
188
190
|
* [extractFunctions](#extractfunctions)
|
|
189
|
-
* [Parameters](#parameters-28)
|
|
190
|
-
* [asArray](#asarray)
|
|
191
191
|
* [Parameters](#parameters-29)
|
|
192
192
|
* [fieldProvider](#fieldprovider)
|
|
193
193
|
* [Parameters](#parameters-30)
|
|
@@ -358,6 +358,15 @@ Source of package content.
|
|
|
358
358
|
|
|
359
359
|
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
360
360
|
|
|
361
|
+
### propertiesFor
|
|
362
|
+
|
|
363
|
+
#### Parameters
|
|
364
|
+
|
|
365
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
366
|
+
* `isCollection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
367
|
+
|
|
368
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
369
|
+
|
|
361
370
|
### asyncIterator
|
|
362
371
|
|
|
363
372
|
List all entries.
|
|
@@ -726,16 +735,6 @@ Extract shell functions from a given text.
|
|
|
726
735
|
|
|
727
736
|
Returns **AsyncIterable<[FunctionDecl](#functiondecl)>** 
|
|
728
737
|
|
|
729
|
-
## asArray
|
|
730
|
-
|
|
731
|
-
Convert scalar or iterable into Array.
|
|
732
|
-
|
|
733
|
-
### Parameters
|
|
734
|
-
|
|
735
|
-
* `value` **any** 
|
|
736
|
-
|
|
737
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>** 
|
|
738
|
-
|
|
739
738
|
## fieldProvider
|
|
740
739
|
|
|
741
740
|
### Parameters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "20.9.
|
|
3
|
+
"version": "20.9.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"key-value-transformer": "^3.3.2",
|
|
61
61
|
"npm-package-walker": "^8.0.11",
|
|
62
62
|
"npm-packlist": "^11.3.0",
|
|
63
|
-
"pacc": "^11.
|
|
63
|
+
"pacc": "^11.5.1",
|
|
64
64
|
"package-directory": "^8.2.0",
|
|
65
65
|
"pacote": "^22.0.0",
|
|
66
66
|
"tar-stream": "^3.1.7",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"stream-buffers": "^3.0.3"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": ">=24.
|
|
78
|
+
"node": ">=24.19.0"
|
|
79
79
|
},
|
|
80
80
|
"repository": {
|
|
81
81
|
"type": "git",
|
|
@@ -3,7 +3,7 @@ import { cwd } from "node:process";
|
|
|
3
3
|
import { glob } from "node:fs/promises";
|
|
4
4
|
import { ContentEntry, CollectionEntry } from "content-entry";
|
|
5
5
|
import { FileSystemEntry } from "content-entry-filesystem";
|
|
6
|
-
import { asArray } from "
|
|
6
|
+
import { asArray } from "pacc";
|
|
7
7
|
import { ContentProvider } from "./content-provider.mjs";
|
|
8
8
|
|
|
9
9
|
const DEFAULT_PATTERN = ["**/*", "!.*"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nodeFileTrace } from "@vercel/nft";
|
|
2
2
|
import { ContentEntry } from "content-entry";
|
|
3
3
|
import { FileSystemEntry } from "content-entry-filesystem";
|
|
4
|
-
import { asArray } from "
|
|
4
|
+
import { asArray } from "pacc";
|
|
5
5
|
import { ContentProvider } from "./content-provider.mjs";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join, resolve } from "node:path";
|
|
2
2
|
import { packageDirectory } from "package-directory";
|
|
3
3
|
import { packageWalker } from "npm-package-walker";
|
|
4
|
-
import { expand } from "pacc";
|
|
4
|
+
import { expand, asArray } from "pacc";
|
|
5
5
|
import { satisfies } from "compare-versions";
|
|
6
|
-
import {
|
|
6
|
+
import { mergeDependencies } from "./util.mjs";
|
|
7
7
|
import { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
|
|
8
8
|
import { NodeModulesContentProvider } from "./content/node-modules-content-provider.mjs";
|
|
9
9
|
import { FileContentProvider } from "./content/file-content-provider.mjs";
|
package/src/output/arch.mjs
CHANGED
|
@@ -230,18 +230,19 @@ export class ARCH extends Packager {
|
|
|
230
230
|
out.end();
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
+
const depends = this.makeDepends(properties.dependencies).join(" ");
|
|
234
|
+
const dependsStatement = depends.length ? `depends=(${depends})`: "";
|
|
233
235
|
const verbose = options.verbose ? 'ls -laR "$pkgdir"' : "";
|
|
234
236
|
|
|
235
|
-
const self = this;
|
|
236
237
|
async function* trailingLines() {
|
|
237
238
|
yield `
|
|
238
239
|
package() {
|
|
239
|
-
|
|
240
|
+
${dependsStatement}
|
|
240
241
|
|
|
241
242
|
if [ "$(ls -A $srcdir)" ]
|
|
242
243
|
then
|
|
243
244
|
cp -rp $srcdir/* "$pkgdir"
|
|
244
|
-
###
|
|
245
|
+
### PERMISSION ###
|
|
245
246
|
|
|
246
247
|
${verbose}
|
|
247
248
|
fi
|
|
@@ -270,15 +271,15 @@ package() {
|
|
|
270
271
|
createEntryWhenMissing: () => new ContentEntry(PKGBUILD)
|
|
271
272
|
});
|
|
272
273
|
|
|
273
|
-
const
|
|
274
|
+
const permissions = [];
|
|
274
275
|
|
|
275
276
|
for await (const file of copyEntries(
|
|
276
277
|
transform(aggregate(sources), transformer),
|
|
277
278
|
join(staging, "src"),
|
|
278
279
|
expander
|
|
279
280
|
)) {
|
|
280
|
-
if (file.owner || file.group) {
|
|
281
|
-
|
|
281
|
+
if (file.owner || file.group || file.mode) {
|
|
282
|
+
permissions.push(file);
|
|
282
283
|
}
|
|
283
284
|
|
|
284
285
|
if (options.verbose) {
|
|
@@ -286,15 +287,15 @@ package() {
|
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
|
|
289
|
-
if (
|
|
290
|
+
if (permissions.length) {
|
|
290
291
|
const pkgbuild = join(staging, PKGBUILD);
|
|
291
292
|
let content = await readFile(pkgbuild, utf8StreamOptions);
|
|
292
|
-
const markerPos = content.indexOf("###
|
|
293
|
+
const markerPos = content.indexOf("### PERMISSION ###");
|
|
293
294
|
|
|
294
295
|
content =
|
|
295
296
|
content.substring(0, markerPos) +
|
|
296
|
-
|
|
297
|
-
.map(
|
|
297
|
+
permissions
|
|
298
|
+
.filter(f=>f.user||f.group).map(
|
|
298
299
|
f =>
|
|
299
300
|
` chown ${[f.owner ?? "", f.group ?? ""].join(
|
|
300
301
|
":"
|
package/src/util.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { mkdir } from "node:fs/promises";
|
|
|
3
3
|
import { pipeline } from "node:stream/promises";
|
|
4
4
|
import { Readable } from "node:stream";
|
|
5
5
|
import { createWriteStream } from "node:fs";
|
|
6
|
-
import { toExternal } from "pacc";
|
|
6
|
+
import { toExternal, asArray } from "pacc";
|
|
7
7
|
import { ContentEntry } from "content-entry";
|
|
8
8
|
import { aggregateFifo } from "aggregate-async-iterator";
|
|
9
9
|
|
|
@@ -138,28 +138,6 @@ export function quote(v, qc = "'") {
|
|
|
138
138
|
return v.match(/^\w+$/) ? v : qc + v + qc;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
/**
|
|
142
|
-
* Convert scalar or iterable into Array.
|
|
143
|
-
* @param {any} value
|
|
144
|
-
* @returns {Array<any>}
|
|
145
|
-
*/
|
|
146
|
-
export function asArray(value) {
|
|
147
|
-
switch (typeof value) {
|
|
148
|
-
case "undefined":
|
|
149
|
-
return [];
|
|
150
|
-
case "object":
|
|
151
|
-
if (Array.isArray(value)) {
|
|
152
|
-
return value;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (value instanceof Iterator || value[Symbol.iterator]) {
|
|
156
|
-
return [...value];
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return [value];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
141
|
/**
|
|
164
142
|
*
|
|
165
143
|
* @param {Object} properties
|