npm-pkgbuild 22.2.2 → 22.2.4
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/alpm.mjs +15 -2
- package/src/output/docker.mjs +4 -4
- package/src/output/packager.mjs +14 -1
- package/src/output/rpm.mjs +15 -6
- package/src/types.mjs +1 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"key-value-transformer": "^3.3.2",
|
|
62
62
|
"npm-package-walker": "^8.0.11",
|
|
63
63
|
"npm-packlist": "^11.3.0",
|
|
64
|
-
"pacc": "^11.13.
|
|
64
|
+
"pacc": "^11.13.2",
|
|
65
65
|
"package-directory": "^8.2.0",
|
|
66
66
|
"pacote": "^22.0.0",
|
|
67
67
|
"picomatch": "^4.0.7",
|
package/src/output/alpm.mjs
CHANGED
|
@@ -134,11 +134,13 @@ export class ALPM extends Packager {
|
|
|
134
134
|
source: {
|
|
135
135
|
...string_collection_attribute_writable,
|
|
136
136
|
name: "source",
|
|
137
|
+
separator: undefined,
|
|
137
138
|
skipEmpty: true
|
|
138
139
|
},
|
|
139
140
|
validpgpkeys: {
|
|
140
141
|
...string_collection_attribute_writable,
|
|
141
142
|
name: "validpgpkeys",
|
|
143
|
+
separator: undefined,
|
|
142
144
|
skipEmpty: true
|
|
143
145
|
},
|
|
144
146
|
noextract: { ...default_attribute, name: "noextract", skipEmpty: true },
|
|
@@ -150,32 +152,37 @@ export class ALPM extends Packager {
|
|
|
150
152
|
md5sums: {
|
|
151
153
|
...string_collection_attribute_writable,
|
|
152
154
|
name: "md5sums",
|
|
155
|
+
separator: undefined,
|
|
153
156
|
default: ["SKIP"]
|
|
154
|
-
// skipEmpty: true
|
|
155
157
|
},
|
|
156
158
|
sha1sums: {
|
|
157
159
|
...string_collection_attribute_writable,
|
|
158
160
|
name: "sha1sums",
|
|
161
|
+
separator: undefined,
|
|
159
162
|
skipEmpty: true
|
|
160
163
|
},
|
|
161
164
|
sha256sums: {
|
|
162
165
|
...string_collection_attribute_writable,
|
|
163
166
|
name: "sha256sums",
|
|
167
|
+
separator: undefined,
|
|
164
168
|
skipEmpty: true
|
|
165
169
|
},
|
|
166
170
|
sha384sums: {
|
|
167
171
|
...string_collection_attribute_writable,
|
|
168
172
|
name: "sha384sums",
|
|
173
|
+
separator: undefined,
|
|
169
174
|
skipEmpty: true
|
|
170
175
|
},
|
|
171
176
|
sha512sums: {
|
|
172
177
|
...string_collection_attribute_writable,
|
|
173
178
|
name: "sha512sums",
|
|
179
|
+
separator: undefined,
|
|
174
180
|
skipEmpty: true
|
|
175
181
|
},
|
|
176
182
|
groups: {
|
|
177
183
|
...string_collection_attribute_writable,
|
|
178
184
|
name: "groups",
|
|
185
|
+
separator: undefined,
|
|
179
186
|
skipEmpty: true
|
|
180
187
|
},
|
|
181
188
|
arch: {
|
|
@@ -185,6 +192,7 @@ export class ALPM extends Packager {
|
|
|
185
192
|
backup: {
|
|
186
193
|
...string_collection_attribute_writable,
|
|
187
194
|
name: "backup",
|
|
195
|
+
separator: undefined,
|
|
188
196
|
skipEmpty: true
|
|
189
197
|
},
|
|
190
198
|
dependencies: {
|
|
@@ -223,7 +231,12 @@ export class ALPM extends Packager {
|
|
|
223
231
|
name: "replaces",
|
|
224
232
|
skipEmpty: true
|
|
225
233
|
},
|
|
226
|
-
options: {
|
|
234
|
+
options: {
|
|
235
|
+
...default_attribute,
|
|
236
|
+
name: "options",
|
|
237
|
+
separator: undefined,
|
|
238
|
+
skipEmpty: true
|
|
239
|
+
}
|
|
227
240
|
};
|
|
228
241
|
|
|
229
242
|
static async prepare(options = {}, variant = {}) {
|
package/src/output/docker.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { execa } from "execa";
|
|
4
|
-
import {
|
|
4
|
+
import { string_attribute_writable, types } from "pacc";
|
|
5
5
|
import { ContentEntry, IteratorContentEntry } from "content-entry";
|
|
6
6
|
import { transform } from "content-entry-transform";
|
|
7
7
|
import { aggregateFifo } from "aggregate-async-iterator";
|
|
@@ -64,12 +64,12 @@ export class DOCKER extends Packager {
|
|
|
64
64
|
static attributes = {
|
|
65
65
|
name: {
|
|
66
66
|
...pkgbuild_name_attribute,
|
|
67
|
-
|
|
67
|
+
type: types["lowercase-string"]
|
|
68
68
|
},
|
|
69
69
|
version: pkgbuild_version_attribute,
|
|
70
70
|
description: pkgbuild_description_attribute,
|
|
71
|
-
|
|
72
|
-
workdir: { ...
|
|
71
|
+
maintainer: { ...string_attribute_writable, name: "maintainer", externalName: "author" },
|
|
72
|
+
workdir: { ...string_attribute_writable, default: "/", mandatory: true }
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
/**
|
package/src/output/packager.mjs
CHANGED
|
@@ -2,7 +2,12 @@ import { join } from "node:path";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { mkdtemp, mkdir } from "node:fs/promises";
|
|
4
4
|
import { createReadStream } from "node:fs";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
expand,
|
|
7
|
+
expandContextDoubbleCurly,
|
|
8
|
+
attributeIterator,
|
|
9
|
+
iterateToExternal
|
|
10
|
+
} from "pacc";
|
|
6
11
|
import { StringContentEntry } from "content-entry";
|
|
7
12
|
import { publish } from "../publish.mjs";
|
|
8
13
|
import {
|
|
@@ -60,6 +65,14 @@ export class Packager {
|
|
|
60
65
|
*/
|
|
61
66
|
constructor(properties) {
|
|
62
67
|
this.properties = { ...properties, type: this.constructor.name };
|
|
68
|
+
|
|
69
|
+
for (const [path, attribute] of attributeIterator(
|
|
70
|
+
this.constructor.attributes,
|
|
71
|
+
attribute => attribute.default !== undefined
|
|
72
|
+
)) {
|
|
73
|
+
const name = path.join(".");
|
|
74
|
+
this.properties[name] ??= attribute.default;
|
|
75
|
+
}
|
|
63
76
|
}
|
|
64
77
|
|
|
65
78
|
get externalProperties() {
|
package/src/output/rpm.mjs
CHANGED
|
@@ -5,8 +5,7 @@ import { execa } from "execa";
|
|
|
5
5
|
import {
|
|
6
6
|
integer_attribute_writable,
|
|
7
7
|
url_attribute_writable,
|
|
8
|
-
string_attribute_writable
|
|
9
|
-
string_collection_attribute_writable
|
|
8
|
+
string_attribute_writable
|
|
10
9
|
} from "pacc";
|
|
11
10
|
import { ContentEntry, IteratorContentEntry } from "content-entry";
|
|
12
11
|
import { transform } from "content-entry-transform";
|
|
@@ -82,7 +81,8 @@ export class RPM extends Packager {
|
|
|
82
81
|
source: {
|
|
83
82
|
...string_attribute_writable,
|
|
84
83
|
externalName: "Source0",
|
|
85
|
-
name: "source"
|
|
84
|
+
name: "source",
|
|
85
|
+
skipEmpty: true
|
|
86
86
|
},
|
|
87
87
|
groups: {
|
|
88
88
|
...string_attribute_writable,
|
|
@@ -115,10 +115,19 @@ export class RPM extends Packager {
|
|
|
115
115
|
},
|
|
116
116
|
dependencies: {
|
|
117
117
|
...dependency_attribute_collection_writable,
|
|
118
|
-
externalName: "Requires"
|
|
118
|
+
externalName: "Requires",
|
|
119
|
+
skipEmpty: true
|
|
120
|
+
},
|
|
121
|
+
Obsoletes: {
|
|
122
|
+
...dependency_attribute_collection_writable,
|
|
123
|
+
name: "Obsoletes",
|
|
124
|
+
skipEmpty: true
|
|
119
125
|
},
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
Conflicts: {
|
|
127
|
+
...dependency_attribute_collection_writable,
|
|
128
|
+
name: "Conflicts",
|
|
129
|
+
skipEmpty: true
|
|
130
|
+
}
|
|
122
131
|
};
|
|
123
132
|
|
|
124
133
|
static get workspaceLayout() {
|
package/src/types.mjs
CHANGED
|
@@ -37,12 +37,10 @@ export const architecture_type = {
|
|
|
37
37
|
name: "architecture",
|
|
38
38
|
|
|
39
39
|
toInternal: (value, attribute) => {
|
|
40
|
-
// console.log("architectureType toInternal", value);
|
|
41
40
|
return value;
|
|
42
41
|
},
|
|
43
42
|
|
|
44
43
|
toExternal: (value, attribute) => {
|
|
45
|
-
// console.log("architectureType toExternal", value);
|
|
46
44
|
return attribute.mapping?.[value] ?? value;
|
|
47
45
|
}
|
|
48
46
|
};
|
|
@@ -64,7 +62,7 @@ export const pkgbuild_name_attribute = {
|
|
|
64
62
|
export const dependency_attribute_collection_writable = {
|
|
65
63
|
...string_collection_attribute_writable,
|
|
66
64
|
type: dependency_type,
|
|
67
|
-
separator:
|
|
65
|
+
separator: undefined,
|
|
68
66
|
pattern: /^[a-z_][a-z0-9_\-]*$/i
|
|
69
67
|
};
|
|
70
68
|
|