npm-pkgbuild 20.0.0 → 20.1.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/README.md CHANGED
@@ -98,47 +98,47 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
98
98
  * [Properties](#properties)
99
99
  * [extractFromPackage](#extractfrompackage)
100
100
  * [Parameters](#parameters-1)
101
- * [BUILDAH](#buildah)
102
- * [ContentProvider](#contentprovider)
101
+ * [NPMPackContentProvider](#npmpackcontentprovider)
103
102
  * [Parameters](#parameters-2)
104
103
  * [Properties](#properties-1)
105
- * [asyncIterator](#asynciterator)
106
- * [FileContentProvider](#filecontentprovider)
107
- * [Parameters](#parameters-3)
108
- * [asyncIterator](#asynciterator-1)
109
104
  * [name](#name)
110
105
  * [NodeModulesContentProvider](#nodemodulescontentprovider)
111
- * [Parameters](#parameters-4)
106
+ * [Parameters](#parameters-3)
112
107
  * [Properties](#properties-2)
113
- * [asyncIterator](#asynciterator-2)
108
+ * [asyncIterator](#asynciterator)
114
109
  * [name](#name-1)
115
- * [NPMPackContentProvider](#npmpackcontentprovider)
116
- * [Parameters](#parameters-5)
117
- * [Properties](#properties-3)
110
+ * [FileContentProvider](#filecontentprovider)
111
+ * [Parameters](#parameters-4)
112
+ * [asyncIterator](#asynciterator-1)
118
113
  * [name](#name-2)
119
114
  * [NFTContentProvider](#nftcontentprovider)
115
+ * [Parameters](#parameters-5)
116
+ * [asyncIterator](#asynciterator-2)
117
+ * [name](#name-3)
118
+ * [ContentProvider](#contentprovider)
120
119
  * [Parameters](#parameters-6)
120
+ * [Properties](#properties-3)
121
121
  * [asyncIterator](#asynciterator-3)
122
- * [name](#name-3)
123
122
  * [DEBIAN](#debian)
124
123
  * [hookMapping](#hookmapping)
125
124
  * [attributes](#attributes)
126
125
  * [prepare](#prepare)
127
126
  * [Parameters](#parameters-7)
127
+ * [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
128
+ * [attributes](#attributes-1)
128
129
  * [quoteFile](#quotefile)
129
130
  * [Parameters](#parameters-8)
130
131
  * [RPM](#rpm)
131
132
  * [hookMapping](#hookmapping-1)
132
- * [attributes](#attributes-1)
133
+ * [attributes](#attributes-2)
133
134
  * [prepare](#prepare-1)
134
135
  * [Parameters](#parameters-9)
135
- * [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
136
- * [attributes](#attributes-2)
137
136
  * [OCI](#oci)
138
137
  * [DOCKER](#docker)
139
138
  * [attributes](#attributes-3)
140
139
  * [prepare](#prepare-2)
141
140
  * [Parameters](#parameters-10)
141
+ * [BUILDAH](#buildah)
142
142
  * [Packager](#packager)
143
143
  * [Parameters](#parameters-11)
144
144
  * [packageName](#packagename)
@@ -248,51 +248,21 @@ Extract package definition from package.json.
248
248
 
249
249
  Returns **AsyncIterable<[PackageDefinition](#packagedefinition)>**&#x20;
250
250
 
251
- ## BUILDAH
252
-
253
- **Extends DOCKER**
254
-
255
- Use buildah @see <https://buildah.io>
251
+ ## NPMPackContentProvider
256
252
 
257
- ## ContentProvider
253
+ **Extends ContentProvider**
258
254
 
259
- Source of package content.
255
+ Content from npm pack.
260
256
 
261
257
  ### Parameters
262
258
 
263
- * `definitions` &#x20;
264
- * `entryProperties` &#x20;
259
+ * `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
260
+ * `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
265
261
  * `directoryProperties` &#x20;
266
262
 
267
263
  ### Properties
268
264
 
269
265
  * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
270
- * `transformer` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<Transformer>**&#x20;
271
-
272
- ### asyncIterator
273
-
274
- List all entries.
275
-
276
- Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
277
-
278
- ## FileContentProvider
279
-
280
- **Extends ContentProvider**
281
-
282
- Content provided form the file system.
283
-
284
- ### Parameters
285
-
286
- * `definitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**&#x20;
287
-
288
- * `definitions.pattern` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)**&#x20;
289
- * `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
290
- * `entryProperties` &#x20;
291
- * `directoryProperties` &#x20;
292
-
293
- ### asyncIterator
294
-
295
- Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
296
266
 
297
267
  ### name
298
268
 
@@ -325,21 +295,21 @@ Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
325
295
 
326
296
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
327
297
 
328
- ## NPMPackContentProvider
298
+ ## FileContentProvider
329
299
 
330
300
  **Extends ContentProvider**
331
301
 
332
- Content from npm pack.
302
+ Content provided form the file system.
333
303
 
334
304
  ### Parameters
335
305
 
336
- * `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
337
- * `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
306
+ * `definitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**&#x20;
307
+ * `entryProperties` &#x20;
338
308
  * `directoryProperties` &#x20;
339
309
 
340
- ### Properties
310
+ ### asyncIterator
341
311
 
342
- * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
312
+ Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
343
313
 
344
314
  ### name
345
315
 
@@ -354,11 +324,8 @@ Content provided form the file system.
354
324
  ### Parameters
355
325
 
356
326
  * `definitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**&#x20;
357
-
358
- * `definitions.pattern` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)**&#x20;
359
- * `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
360
- * `entryProperties` &#x20;
361
- * `directoryProperties` &#x20;
327
+ * `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**&#x20;
328
+ * `directoryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**&#x20;
362
329
 
363
330
  ### asyncIterator
364
331
 
@@ -368,6 +335,26 @@ Returns **AsyncIterable\<ContentEntry>** all entries
368
335
 
369
336
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
370
337
 
338
+ ## ContentProvider
339
+
340
+ Source of package content.
341
+
342
+ ### Parameters
343
+
344
+ * `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
345
+ * `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**&#x20;
346
+ * `directoryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**&#x20;
347
+
348
+ ### Properties
349
+
350
+ * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
351
+
352
+ ### asyncIterator
353
+
354
+ List all entries.
355
+
356
+ Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
357
+
371
358
  ## DEBIAN
372
359
 
373
360
  **Extends Packager**
@@ -394,6 +381,15 @@ Map install hook named from default (arch) to deb.
394
381
 
395
382
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>**&#x20;
396
383
 
384
+ ## pkgKeyValuePairOptions
385
+
386
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
387
+
388
+ ## attributes
389
+
390
+ well known package properties
391
+ <https://www.archlinux.org/pacman/PKGBUILD.5.html>
392
+
397
393
  ## quoteFile
398
394
 
399
395
  ### Parameters
@@ -427,15 +423,6 @@ Check for rpmbuild presence.
427
423
 
428
424
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>** true when rpmbuild executable is present
429
425
 
430
- ## pkgKeyValuePairOptions
431
-
432
- Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
433
-
434
- ## attributes
435
-
436
- well known package properties
437
- <https://www.archlinux.org/pacman/PKGBUILD.5.html>
438
-
439
426
  ## OCI
440
427
 
441
428
  **Extends Packager**
@@ -465,6 +452,12 @@ Check for docker presence.
465
452
 
466
453
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>** true when docker executable is present
467
454
 
455
+ ## BUILDAH
456
+
457
+ **Extends DOCKER**
458
+
459
+ Use buildah @see <https://buildah.io>
460
+
468
461
  ## Packager
469
462
 
470
463
  ### Parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "20.0.0",
3
+ "version": "20.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -59,7 +59,7 @@
59
59
  "compare-versions": "^6.1.1",
60
60
  "content-entry": "^14.2.7",
61
61
  "content-entry-filesystem": "^9.0.14",
62
- "content-entry-transform": "^1.5.17",
62
+ "content-entry-transform": "^1.6.0",
63
63
  "execa": "^9.6.0",
64
64
  "expression-expander": "^7.2.8",
65
65
  "ini": "^6.0.0",
@@ -67,14 +67,14 @@
67
67
  "key-value-transformer": "^3.3.1",
68
68
  "npm-package-walker": "^8.0.11",
69
69
  "npm-packlist": "^10.0.3",
70
- "pacc": "^8.0.2",
70
+ "pacc": "^8.0.3",
71
71
  "package-directory": "^8.1.0",
72
72
  "pacote": "^21.0.4",
73
73
  "tar-stream": "^3.1.7",
74
74
  "uti": "^8.10.3"
75
75
  },
76
76
  "devDependencies": {
77
- "@types/node": "^25.0.8",
77
+ "@types/node": "^25.0.9",
78
78
  "ava": "^6.4.1",
79
79
  "c8": "^10.1.3",
80
80
  "documentation": "^14.0.3",
@@ -90,9 +90,7 @@ function* content2Sources(content, dir) {
90
90
  } else {
91
91
  switch (typeof definition) {
92
92
  case "object":
93
- definition.dir = definition.dir
94
- ? join(dir, definition.dir)
95
- : dir;
93
+ definition.dir = definition.dir ? join(dir, definition.dir) : dir;
96
94
  break;
97
95
  case "string":
98
96
  definition = join(dir, definition);
@@ -110,6 +108,7 @@ function* content2Sources(content, dir) {
110
108
  * @typedef {Object} PackageDefinition
111
109
  * @property {Object} properties values describing the package attributes
112
110
  * @property {Object} properties.dependencies
111
+ * @property {Object} properties.replaces
113
112
  * @property {ContentProvider[]} sources content providers
114
113
  * @property {Object} output package type
115
114
  * @property {Object} variant identifier of the variant
@@ -136,159 +135,166 @@ export async function* extractFromPackage(options = {}, env = {}) {
136
135
 
137
136
  const packages = new Map();
138
137
 
139
- await packageWalker(async (packageContent, dir, modulePath) => {
140
- let i = 0;
138
+ await packageWalker(
139
+ async (packageContent, dir, modulePath) => {
140
+ let i = 0;
141
141
 
142
- packages.set(packageContent.name, packageContent.version);
142
+ packages.set(packageContent.name, packageContent.version);
143
143
 
144
- for (const pkgbuild of asArray(packageContent.pkgbuild)) {
145
- if (modulePath.length > 0 && !pkgbuild.variant) {
146
- continue;
147
- }
144
+ for (const pkgbuild of asArray(packageContent.pkgbuild)) {
145
+ if (modulePath.length > 0 && !pkgbuild.variant) {
146
+ continue;
147
+ }
148
148
 
149
- let name = `${packageContent.name}[${i++}]`;
149
+ let name = `${packageContent.name}[${i++}]`;
150
150
 
151
- const fragment = {
152
- dir,
153
- name,
154
- priority: 1,
155
- dependencies: packageContent.engines || {},
156
- arch: new Set(),
157
- restrictArch: new Set()
158
- };
151
+ const fragment = {
152
+ dir,
153
+ name,
154
+ priority: 1,
155
+ dependencies: packageContent.engines || {},
156
+ replaces: {},
157
+ arch: new Set(),
158
+ restrictArch: new Set()
159
+ };
159
160
 
160
- const requires = pkgbuild.requires;
161
+ const requires = pkgbuild.requires;
161
162
 
162
- if (requires) {
163
- fragment.requires = requires;
164
- delete pkgbuild.requires;
163
+ if (requires) {
164
+ fragment.requires = requires;
165
+ delete pkgbuild.requires;
165
166
 
166
- let fullfilled = true;
167
+ let fullfilled = true;
167
168
 
168
- if (requires.properties) {
169
- for (const [k, v] of Object.entries(requires.properties)) {
170
- if (root?.properties[k] !== v && options[k] !== v) {
171
- fullfilled = false;
172
- break;
173
- }
169
+ if (requires.properties) {
170
+ for (const [k, v] of Object.entries(requires.properties)) {
171
+ if (root?.properties[k] !== v && options[k] !== v) {
172
+ fullfilled = false;
173
+ break;
174
+ }
174
175
 
175
- fragment.priority += 1;
176
+ fragment.priority += 1;
177
+ }
176
178
  }
177
- }
178
179
 
179
- if (requires.environment) {
180
- if (env[requires.environment.has] === undefined) {
181
- fullfilled = false;
180
+ if (requires.environment) {
181
+ if (env[requires.environment.has] === undefined) {
182
+ fullfilled = false;
183
+ }
184
+ fragment.priority += 10;
182
185
  }
183
- fragment.priority += 10;
184
- }
185
186
 
186
- if (fullfilled) {
187
- if (options.verbose) {
188
- console.log(`${name}: requirement fullfilled`, requires);
187
+ if (fullfilled) {
188
+ if (options.verbose) {
189
+ console.log(`${name}: requirement fullfilled`, requires);
190
+ }
191
+ } else {
192
+ if (options.verbose) {
193
+ console.log(`${name}: requirement not fullfilled`, requires);
194
+ }
195
+ continue;
189
196
  }
190
197
  } else {
191
198
  if (options.verbose) {
192
- console.log(`${name}: requirement not fullfilled`, requires);
199
+ console.log(`${name}: load`);
193
200
  }
194
- continue;
195
- }
196
- } else {
197
- if (options.verbose) {
198
- console.log(`${name}: load`);
199
201
  }
200
- }
201
202
 
202
- if (packageContent.cpu) {
203
- for (const a of asArray(packageContent.cpu)) {
204
- fragment.arch.add(npmArchMapping[a]);
203
+ if (packageContent.cpu) {
204
+ for (const a of asArray(packageContent.cpu)) {
205
+ fragment.arch.add(npmArchMapping[a]);
206
+ }
205
207
  }
206
- }
207
208
 
208
- if (pkgbuild.arch) {
209
- for (const a of asArray(pkgbuild.arch)) {
210
- if (modulePath.length === 0) {
211
- fragment.arch.add(a);
212
- } else {
213
- fragment.restrictArch.add(a);
209
+ if (pkgbuild.arch) {
210
+ for (const a of asArray(pkgbuild.arch)) {
211
+ if (modulePath.length === 0) {
212
+ fragment.arch.add(a);
213
+ } else {
214
+ fragment.restrictArch.add(a);
215
+ }
214
216
  }
217
+ delete pkgbuild.arch;
215
218
  }
216
- delete pkgbuild.arch;
217
- }
218
219
 
219
- for (const k of ["hooks"]) {
220
- if (pkgbuild[k]) {
221
- pkgbuild[k] = resolve(dir, pkgbuild[k]);
220
+ for (const k of ["hooks"]) {
221
+ if (pkgbuild[k]) {
222
+ pkgbuild[k] = resolve(dir, pkgbuild[k]);
223
+ }
222
224
  }
223
- }
224
225
 
225
- for (const k of ["output", "content", "dependencies"]) {
226
- if (pkgbuild[k]) {
227
- fragment[k] = pkgbuild[k];
228
- delete pkgbuild[k];
226
+ for (const k of ["output", "content", "dependencies", "replaces"]) {
227
+ if (pkgbuild[k]) {
228
+ fragment[k] = pkgbuild[k];
229
+ delete pkgbuild[k];
230
+ }
229
231
  }
230
- }
231
232
 
232
- const properties = {};
233
+ const properties = {};
233
234
 
234
- if (modulePath.length >= 1) {
235
- fragment.parent =
236
- modulePath.length === 1 ? parent : modulePath[modulePath.length - 2];
237
- } else {
238
- properties.access = packageContent?.publishConfig?.access || "private";
239
-
240
- Object.assign(
241
- properties,
242
- packageContent.config,
243
- Object.fromEntries(
244
- ["name", "version", "description", "homepage", "license"]
245
- .map(key => [key, packageContent[key]])
246
- .filter(([k, v]) => v !== undefined)
247
- )
248
- );
235
+ if (modulePath.length >= 1) {
236
+ fragment.parent =
237
+ modulePath.length === 1
238
+ ? parent
239
+ : modulePath[modulePath.length - 2];
240
+ } else {
241
+ properties.access =
242
+ packageContent?.publishConfig?.access || "private";
243
+
244
+ Object.assign(
245
+ properties,
246
+ packageContent.config,
247
+ Object.fromEntries(
248
+ ["name", "version", "description", "homepage", "license"]
249
+ .map(key => [key, packageContent[key]])
250
+ .filter(([k, v]) => v !== undefined)
251
+ )
252
+ );
249
253
 
250
- if (properties.name) {
251
- properties.name = properties.name.replace(/^\@[^\/]+\//, "");
252
- }
254
+ if (properties.name) {
255
+ properties.name = properties.name.replace(/^\@[^\/]+\//, "");
256
+ }
253
257
 
254
- if (packageContent.bugs?.url) {
255
- properties.bugs = packageContent.bugs.url;
256
- }
258
+ if (packageContent.bugs?.url) {
259
+ properties.bugs = packageContent.bugs.url;
260
+ }
257
261
 
258
- if (packageContent.bin) {
259
- properties.entrypoints = packageContent.bin;
260
- }
262
+ if (packageContent.bin) {
263
+ properties.entrypoints = packageContent.bin;
264
+ }
261
265
 
262
- if (packageContent.contributors) {
263
- properties.maintainer = packageContent.contributors.map(
264
- c => c.name + (c.email ? ` <${c.email}>` : "")
265
- );
266
- }
266
+ if (packageContent.contributors) {
267
+ properties.maintainer = packageContent.contributors.map(
268
+ c => c.name + (c.email ? ` <${c.email}>` : "")
269
+ );
270
+ }
267
271
 
268
- if (typeof packageContent.repository === "string") {
269
- properties.source = packageContent.repository;
270
- } else {
271
- if (packageContent.repository?.url) {
272
- properties.source = packageContent.repository.url;
272
+ if (typeof packageContent.repository === "string") {
273
+ properties.source = packageContent.repository;
274
+ } else {
275
+ if (packageContent.repository?.url) {
276
+ properties.source = packageContent.repository.url;
277
+ }
273
278
  }
274
279
  }
275
- }
276
280
 
277
- fragment.properties = Object.assign(properties, pkgbuild);
278
- fragments[fragment.name] = fragment;
281
+ fragment.properties = Object.assign(properties, pkgbuild);
282
+ fragments[fragment.name] = fragment;
279
283
 
280
- if (pkgbuild.variant) {
281
- variants[pkgbuild.variant] = fragment;
282
- }
284
+ if (pkgbuild.variant) {
285
+ variants[pkgbuild.variant] = fragment;
286
+ }
283
287
 
284
- if (modulePath.length === 0) {
285
- root = fragment;
288
+ if (modulePath.length === 0) {
289
+ root = fragment;
290
+ }
291
+ parent = fragment.name;
286
292
  }
287
- parent = fragment.name;
288
- }
289
293
 
290
- return true;
291
- }, await packageDirectory({ cwd: options.dir }));
294
+ return true;
295
+ },
296
+ await packageDirectory({ cwd: options.dir })
297
+ );
292
298
 
293
299
  if (root && Object.keys(variants).length === 0) {
294
300
  // @ts-ignore
@@ -301,6 +307,7 @@ export async function* extractFromPackage(options = {}, env = {}) {
301
307
  let arch = variant.arch;
302
308
  let properties = {};
303
309
  let dependencies = {};
310
+ let replaces = {};
304
311
  const output = {};
305
312
  const content = [];
306
313
 
@@ -332,6 +339,7 @@ export async function* extractFromPackage(options = {}, env = {}) {
332
339
  arch = new Set([...arch, ...fragment.arch]);
333
340
  properties = { ...fragment.properties, ...properties };
334
341
  dependencies = mergeDependencies(dependencies, fragment.dependencies);
342
+ replaces = mergeDependencies(replaces, fragment.replaces);
335
343
  Object.assign(output, fragment.output);
336
344
  for (const def of Object.values(output)) {
337
345
  if (def.content && !def.dir) {
@@ -349,6 +357,7 @@ export async function* extractFromPackage(options = {}, env = {}) {
349
357
  // @ts-ignore
350
358
  Object.assign(properties, root.properties);
351
359
  delete properties.dependencies;
360
+ delete properties.replaces;
352
361
 
353
362
  properties.variant = name;
354
363
 
@@ -357,6 +366,7 @@ export async function* extractFromPackage(options = {}, env = {}) {
357
366
  content,
358
367
  output,
359
368
  dependencies,
369
+ replaces,
360
370
  properties
361
371
  };
362
372
 
@@ -388,7 +398,8 @@ export async function* extractFromPackage(options = {}, env = {}) {
388
398
  dependencies: mergeDependencies(
389
399
  result.dependencies,
390
400
  output.dependencies
391
- )
401
+ ),
402
+ replaces: mergeDependencies(result.replaces, output.replaces)
392
403
  };
393
404
 
394
405
  const context = createContext({ properties });
@@ -15,7 +15,8 @@ import {
15
15
  Packager,
16
16
  pkgbuild_version_attribute,
17
17
  pkgbuild_description_attribute,
18
- pkgbuild_name_attribute
18
+ pkgbuild_name_attribute,
19
+ dependency_attribute_collection_writable
19
20
  } from "./packager.mjs";
20
21
  import {
21
22
  copyEntries,
@@ -111,13 +112,13 @@ export class ARCH extends Packager {
111
112
  groups: string_collection_attribute_writable,
112
113
  arch: { ...string_collection_attribute_writable, default: ["any"], mandatory: true },
113
114
  backup: string_collection_attribute_writable,
114
- depends: string_collection_attribute_writable,
115
- makedepends: default_attribute,
116
- checkdepends: default_attribute,
117
- optdepends: default_attribute,
118
- conflicts: default_attribute,
119
- provides: default_attribute,
120
- replaces: default_attribute,
115
+ depends: { ...dependency_attribute_collection_writable /*, alias: "dependencies" */ },
116
+ makedepends: dependency_attribute_collection_writable,
117
+ checkdepends: dependency_attribute_collection_writable,
118
+ optdepends: dependency_attribute_collection_writable,
119
+ conflicts: dependency_attribute_collection_writable,
120
+ provides: dependency_attribute_collection_writable,
121
+ replaces: dependency_attribute_collection_writable,
121
122
  options: default_attribute
122
123
  };
123
124
 
@@ -211,6 +212,7 @@ package() {
211
212
  properties.backup = properties.backup.replace(/\//, "");
212
213
  }
213
214
 
215
+ console.log(properties);
214
216
  const fp = fieldProvider(properties, this.attributes);
215
217
 
216
218
  transformer.push({