npm-pkgbuild 20.7.11 → 20.8.0
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 +5 -5
- package/src/output/arch.mjs +56 -32
- package/src/output/debian.mjs +64 -22
- package/src/output/packager.mjs +12 -8
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.8.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
7
7
|
},
|
|
8
|
-
"packageManager": "npm@11.
|
|
8
|
+
"packageManager": "npm@11.18.0",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"default": "./src/module.mjs"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"lint:docs": "documentation lint ./src**/*.mjs"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@npmcli/arborist": "^
|
|
49
|
+
"@npmcli/arborist": "^10.0.0",
|
|
50
50
|
"@vercel/nft": "^1.10.2",
|
|
51
51
|
"aggregate-async-iterator": "^1.2.5",
|
|
52
52
|
"commander": "^15.0.0",
|
|
@@ -60,14 +60,14 @@
|
|
|
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": "^10.4.
|
|
63
|
+
"pacc": "^10.4.1",
|
|
64
64
|
"package-directory": "^8.2.0",
|
|
65
65
|
"pacote": "^22.0.0",
|
|
66
66
|
"tar-stream": "^3.1.7",
|
|
67
67
|
"uti": "^8.11.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@types/node": "^26.1.
|
|
70
|
+
"@types/node": "^26.1.1",
|
|
71
71
|
"ava": "^8.0.1",
|
|
72
72
|
"c8": "^11.0.0",
|
|
73
73
|
"documentation": "^14.0.3",
|
package/src/output/arch.mjs
CHANGED
|
@@ -90,50 +90,77 @@ export class ARCH extends Packager {
|
|
|
90
90
|
static attributes = {
|
|
91
91
|
Maintainer: {
|
|
92
92
|
...string_collection_attribute_writable,
|
|
93
|
+
name: "Maintainer",
|
|
93
94
|
alias: "maintainer",
|
|
94
95
|
prefix: "# "
|
|
95
96
|
},
|
|
96
|
-
packager: {
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
packager: {
|
|
98
|
+
...string_collection_attribute_writable,
|
|
99
|
+
name: "packager",
|
|
100
|
+
alias: "maintainer"
|
|
101
|
+
},
|
|
102
|
+
pkgname: { ...pkgbuild_name_attribute, name: "pkgname", collection: true },
|
|
103
|
+
pkgver: { ...pkgbuild_version_attribute, name: "pkgver" },
|
|
99
104
|
pkgrel: {
|
|
100
105
|
...integer_attribute,
|
|
106
|
+
name: "pkgrel",
|
|
101
107
|
alias: "release",
|
|
102
108
|
default: 1,
|
|
103
109
|
mandatory: true
|
|
104
110
|
},
|
|
105
|
-
epoch: { ...integer_attribute, default: 0 },
|
|
106
|
-
pkgdesc: pkgbuild_description_attribute,
|
|
107
|
-
url: { ...string_attribute, alias: "homepage" },
|
|
108
|
-
license: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
epoch: { ...integer_attribute, name: "epoch", default: 0 },
|
|
112
|
+
pkgdesc: { ...pkgbuild_description_attribute, name: "pkgdesc" },
|
|
113
|
+
url: { ...string_attribute, name: "url", alias: "homepage" },
|
|
114
|
+
license: {
|
|
115
|
+
...string_collection_attribute_writable,
|
|
116
|
+
name: "license",
|
|
117
|
+
mandatory: true
|
|
118
|
+
},
|
|
119
|
+
install: { ...string_attribute, name: "install" },
|
|
120
|
+
changelog: { ...string_attribute, name: "changelog" },
|
|
121
|
+
source: { ...string_collection_attribute_writable, name: "source" },
|
|
122
|
+
validpgpkeys: {
|
|
123
|
+
...string_collection_attribute_writable,
|
|
124
|
+
name: "validpgpkeys"
|
|
125
|
+
},
|
|
126
|
+
noextract: { ...default_attribute, name: "noextract" },
|
|
127
|
+
cksums: { ...string_collection_attribute_writable, name: "cksums" },
|
|
128
|
+
md5sums: { ...string_collection_attribute_writable, name: "md5sums" },
|
|
129
|
+
sha1sums: { ...string_collection_attribute_writable, name: "sha1sums" },
|
|
130
|
+
sha256sums: { ...string_collection_attribute_writable, name: "sha256sums" },
|
|
131
|
+
sha384sums: { ...string_collection_attribute_writable, name: "sha384sums" },
|
|
132
|
+
sha512sums: { ...string_collection_attribute_writable, name: "sha512sums" },
|
|
133
|
+
groups: { ...string_collection_attribute_writable, name: "groups" },
|
|
121
134
|
arch: {
|
|
122
135
|
...string_collection_attribute_writable,
|
|
136
|
+
name: "arch",
|
|
123
137
|
default: ["any"],
|
|
124
138
|
mandatory: true
|
|
125
139
|
},
|
|
126
|
-
backup: string_collection_attribute_writable,
|
|
140
|
+
backup: { ...string_collection_attribute_writable, name: "backup" },
|
|
127
141
|
depends: {
|
|
128
|
-
...dependency_attribute_collection_writable /*, alias: "dependencies"
|
|
142
|
+
...dependency_attribute_collection_writable /*, alias: "dependencies" */,
|
|
143
|
+
name: "depends"
|
|
144
|
+
},
|
|
145
|
+
makedepends: {
|
|
146
|
+
...dependency_attribute_collection_writable,
|
|
147
|
+
name: "makedepends"
|
|
148
|
+
},
|
|
149
|
+
checkdepends: {
|
|
150
|
+
...dependency_attribute_collection_writable,
|
|
151
|
+
name: "checkdepends"
|
|
152
|
+
},
|
|
153
|
+
optdepends: {
|
|
154
|
+
...dependency_attribute_collection_writable,
|
|
155
|
+
name: "optdepends"
|
|
156
|
+
},
|
|
157
|
+
conflicts: {
|
|
158
|
+
...dependency_attribute_collection_writable,
|
|
159
|
+
name: "conflicts"
|
|
129
160
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
conflicts: dependency_attribute_collection_writable,
|
|
134
|
-
provides: dependency_attribute_collection_writable,
|
|
135
|
-
replaces: dependency_attribute_collection_writable,
|
|
136
|
-
options: default_attribute
|
|
161
|
+
provides: { ...dependency_attribute_collection_writable, name: "provides" },
|
|
162
|
+
replaces: { ...dependency_attribute_collection_writable, name: "replaces" },
|
|
163
|
+
options: { ...default_attribute, name: "options" }
|
|
137
164
|
};
|
|
138
165
|
|
|
139
166
|
static async prepare(options = {}, variant = {}) {
|
|
@@ -246,10 +273,7 @@ package() {
|
|
|
246
273
|
const ownership = [];
|
|
247
274
|
|
|
248
275
|
for await (const file of copyEntries(
|
|
249
|
-
transform(
|
|
250
|
-
aggregate(sources),
|
|
251
|
-
transformer
|
|
252
|
-
),
|
|
276
|
+
transform(aggregate(sources), transformer),
|
|
253
277
|
join(staging, "src"),
|
|
254
278
|
expander
|
|
255
279
|
)) {
|
package/src/output/debian.mjs
CHANGED
|
@@ -4,7 +4,8 @@ import { execa } from "execa";
|
|
|
4
4
|
import {
|
|
5
5
|
integer_attribute_writable,
|
|
6
6
|
yesno_attribute_writable,
|
|
7
|
-
string_attribute_writable
|
|
7
|
+
string_attribute_writable,
|
|
8
|
+
string_collection_attribute_writable
|
|
8
9
|
} from "pacc";
|
|
9
10
|
import { ContentEntry, IteratorContentEntry } from "content-entry";
|
|
10
11
|
import {
|
|
@@ -51,41 +52,82 @@ export class DEBIAN extends Packager {
|
|
|
51
52
|
static attributes = {
|
|
52
53
|
Package: {
|
|
53
54
|
...pkgbuild_name_attribute,
|
|
55
|
+
name: "Package",
|
|
54
56
|
set: v => v.toLowerCase()
|
|
55
57
|
},
|
|
56
|
-
Version: pkgbuild_version_attribute,
|
|
58
|
+
Version: { ...pkgbuild_version_attribute, name: "Version" },
|
|
57
59
|
Maintainer: {
|
|
58
60
|
...string_attribute_writable,
|
|
61
|
+
name: "Maintainer",
|
|
59
62
|
alias: "maintainer",
|
|
60
63
|
mandatory: true
|
|
61
64
|
},
|
|
62
|
-
Description: pkgbuild_description_attribute,
|
|
63
|
-
Section: { ...string_attribute_writable, alias: "groups" },
|
|
64
|
-
Priority: string_attribute_writable,
|
|
65
|
-
Essential: yesno_attribute_writable,
|
|
66
|
-
Origin: string_attribute_writable,
|
|
65
|
+
Description: { ...pkgbuild_description_attribute, name: "Description" },
|
|
66
|
+
Section: { ...string_attribute_writable, name: "Section", alias: "groups" },
|
|
67
|
+
Priority: { ...string_attribute_writable, name: "Priority" },
|
|
68
|
+
Essential: { ...yesno_attribute_writable, name: "Essential" },
|
|
69
|
+
Origin: { ...string_attribute_writable, name: "Origin" },
|
|
67
70
|
Architecture: {
|
|
68
71
|
...string_attribute_writable,
|
|
72
|
+
name: "Architecture",
|
|
69
73
|
alias: "arch",
|
|
70
74
|
default: "all",
|
|
71
75
|
mandatory: true,
|
|
72
76
|
mapping: { aarch64: "arm64" }
|
|
73
77
|
},
|
|
74
|
-
Homepage: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
78
|
+
Homepage: {
|
|
79
|
+
...string_attribute_writable,
|
|
80
|
+
name: "Homepage",
|
|
81
|
+
alias: "homepage"
|
|
82
|
+
},
|
|
83
|
+
Bugs: { ...string_attribute_writable, name: "Bugs", alias: "bugs" },
|
|
84
|
+
Depends: {
|
|
85
|
+
...debian_dependency_attribute_collection_writable,
|
|
86
|
+
name: "Depends"
|
|
87
|
+
},
|
|
88
|
+
"Pre-Depends": {
|
|
89
|
+
...debian_dependency_attribute_collection_writable,
|
|
90
|
+
name: "Pre-Depends"
|
|
91
|
+
},
|
|
92
|
+
"Build-Depends": {
|
|
93
|
+
...debian_dependency_attribute_collection_writable,
|
|
94
|
+
name: "Build-Depends"
|
|
95
|
+
},
|
|
96
|
+
"Build-Depends-Indep": {
|
|
97
|
+
...debian_dependency_attribute_collection_writable,
|
|
98
|
+
name: "Build-Depends-Indep"
|
|
99
|
+
},
|
|
100
|
+
"Build-Depends-Arch": {
|
|
101
|
+
...debian_dependency_attribute_collection_writable,
|
|
102
|
+
name: "Build-Depends-Arch"
|
|
103
|
+
},
|
|
104
|
+
Recommends: {
|
|
105
|
+
...debian_dependency_attribute_collection_writable,
|
|
106
|
+
name: "Recommends"
|
|
107
|
+
},
|
|
108
|
+
Suggests: {
|
|
109
|
+
...debian_dependency_attribute_collection_writable,
|
|
110
|
+
name: "Suggests"
|
|
111
|
+
},
|
|
112
|
+
Provides: {
|
|
113
|
+
...debian_dependency_attribute_collection_writable,
|
|
114
|
+
name: "Provides"
|
|
115
|
+
},
|
|
116
|
+
Breaks: {
|
|
117
|
+
...debian_dependency_attribute_collection_writable,
|
|
118
|
+
name: "Breaks"
|
|
119
|
+
},
|
|
120
|
+
Replaces: {
|
|
121
|
+
...debian_dependency_attribute_collection_writable,
|
|
122
|
+
name: "Replaces"
|
|
123
|
+
},
|
|
124
|
+
Source: { ...string_attribute_writable, name: "Source", alias: "source" },
|
|
125
|
+
Uploaders: {
|
|
126
|
+
...string_collection_attribute_writable,
|
|
127
|
+
name: "Uploaders",
|
|
128
|
+
mandatory: false
|
|
129
|
+
},
|
|
130
|
+
"Installed-Size": { ...integer_attribute_writable, name: "Installed-Size" }
|
|
89
131
|
};
|
|
90
132
|
|
|
91
133
|
/**
|
package/src/output/packager.mjs
CHANGED
|
@@ -5,7 +5,8 @@ import { createReadStream } from "node:fs";
|
|
|
5
5
|
import {
|
|
6
6
|
expand,
|
|
7
7
|
expandContextDoubbleCurly,
|
|
8
|
-
|
|
8
|
+
string_collection_attribute_writable,
|
|
9
|
+
name_attribute,
|
|
9
10
|
description_attribute,
|
|
10
11
|
version_attribute_writable
|
|
11
12
|
} from "pacc";
|
|
@@ -212,12 +213,15 @@ export class Packager {
|
|
|
212
213
|
* @param {Object} options
|
|
213
214
|
* @param {string} [options.staging]
|
|
214
215
|
* @param {string} [options.destination]
|
|
216
|
+
* @param {boolean} [options.noPreserve] do not preserve (tmp) directories
|
|
215
217
|
* @param {Object} [publishingDetail]
|
|
216
218
|
* @returns {Promise<{properties:Object, destination:string, tmpdir:string, staging:string}>}
|
|
217
219
|
*/
|
|
218
220
|
async prepare(options, publishingDetail) {
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
+
if (!options.noPreserve) {
|
|
222
|
+
if (this.#prepared) {
|
|
223
|
+
return this.#prepared;
|
|
224
|
+
}
|
|
221
225
|
}
|
|
222
226
|
|
|
223
227
|
const tmpdir = await this.tmpdir;
|
|
@@ -251,7 +255,9 @@ export class Packager {
|
|
|
251
255
|
await mkdir(out.destination, mdo);
|
|
252
256
|
}
|
|
253
257
|
|
|
254
|
-
|
|
258
|
+
if (!options.noPreserve) {
|
|
259
|
+
this.#prepared = out;
|
|
260
|
+
}
|
|
255
261
|
return out;
|
|
256
262
|
}
|
|
257
263
|
|
|
@@ -274,7 +280,7 @@ export class Packager {
|
|
|
274
280
|
}
|
|
275
281
|
|
|
276
282
|
export const pkgbuild_name_attribute = {
|
|
277
|
-
...
|
|
283
|
+
...name_attribute,
|
|
278
284
|
alias: "name",
|
|
279
285
|
mandatory: true,
|
|
280
286
|
pattern: /^[a-z_][a-z0-9_\-]*$/i
|
|
@@ -302,10 +308,8 @@ export const dependency_type = {
|
|
|
302
308
|
};
|
|
303
309
|
|
|
304
310
|
export const dependency_attribute_collection_writable = {
|
|
305
|
-
...
|
|
311
|
+
...string_collection_attribute_writable,
|
|
306
312
|
type: dependency_type,
|
|
307
|
-
writable: true,
|
|
308
|
-
collection: true,
|
|
309
313
|
separator: " ",
|
|
310
314
|
pattern: /^[a-z_][a-z0-9_\-]*$/i
|
|
311
315
|
};
|