npm-pkgbuild 22.1.11 → 22.1.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "22.1.11",
3
+ "version": "22.1.13",
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.10.2",
64
+ "pacc": "^11.11.0",
65
65
  "package-directory": "^8.2.0",
66
66
  "pacote": "^22.0.0",
67
67
  "picomatch": "^4.0.7",
@@ -5,7 +5,8 @@ import {
5
5
  integer_attribute_writable,
6
6
  yesno_attribute_writable,
7
7
  string_attribute_writable,
8
- string_collection_attribute_writable
8
+ string_collection_attribute_writable,
9
+ toExternal
9
10
  } from "pacc";
10
11
  import { ContentEntry, IteratorContentEntry } from "content-entry";
11
12
  import {
@@ -18,7 +19,8 @@ import {
18
19
  pkgbuild_version_attribute,
19
20
  pkgbuild_description_attribute,
20
21
  pkgbuild_name_attribute,
21
- dependency_attribute_collection_writable
22
+ dependency_attribute_collection_writable,
23
+ architectureType
22
24
  } from "./packager.mjs";
23
25
  import { copyEntries, fieldProvider, aggregate } from "../util.mjs";
24
26
 
@@ -73,6 +75,7 @@ export class DEBIAN extends Packager {
73
75
  alias: "arch",
74
76
  default: "all",
75
77
  mandatory: true,
78
+ type: architectureType,
76
79
  mapping: { aarch64: "arm64" }
77
80
  },
78
81
  Homepage: {
@@ -153,7 +156,7 @@ export class DEBIAN extends Packager {
153
156
  const p = this.properties;
154
157
 
155
158
  // TODO utility to provide final values
156
- const arch = this.attributes.Architecture.mapping[p.arch] || p.arch;
159
+ const arch = toExternal(p.arch, this.attributes.Architecture);
157
160
 
158
161
  // @ts-ignore
159
162
  return `${p.name}_${p.version}_${arch}${this.constructor.fileNameExtension}`;
@@ -301,6 +301,21 @@ export const dependency_type = {
301
301
  }
302
302
  };
303
303
 
304
+ export const architectureType = {
305
+ name: "dependency",
306
+ primitive: true,
307
+
308
+ toInternal: (value, attribute) => {
309
+ // console.log("architectureType toInternal", value);
310
+ return value;
311
+ },
312
+
313
+ toExternal: (value, attribute) => {
314
+ // console.log("architectureType toExternal", value);
315
+ return attribute.mapping[value] ?? value;
316
+ }
317
+ };
318
+
304
319
  export const dependency_attribute_collection_writable = {
305
320
  ...string_collection_attribute_writable,
306
321
  type: dependency_type,
package/src/util.mjs CHANGED
@@ -182,7 +182,7 @@ export function fieldProvider(properties, attributes) {
182
182
  }
183
183
  } else {
184
184
  const attribute = attributes[k];
185
- yield [k, av(attribute, toExternal(properties[k] || v, attribute))];
185
+ yield [k, av(attribute, toExternal(properties[k] ?? v, attribute))];
186
186
  }
187
187
  };
188
188
  }