npm-pkgbuild 7.29.0 → 8.0.1

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
@@ -45,6 +45,8 @@ The resulting pkg will contain the package dist content and all production depen
45
45
  * [fields](#fields)
46
46
  * [fields](#fields-1)
47
47
  * [fields](#fields-2)
48
+ * [hookMapping](#hookmapping)
49
+ * [hookMapping](#hookmapping-1)
48
50
  * [Field](#field)
49
51
  * [Properties](#properties)
50
52
  * [Packager](#packager)
@@ -52,7 +54,6 @@ The resulting pkg will contain the package dist content and all production depen
52
54
  * [tmpdir](#tmpdir)
53
55
  * [execute](#execute)
54
56
  * [Parameters](#parameters-4)
55
- * [hookMapping](#hookmapping)
56
57
  * [decodePassword](#decodepassword)
57
58
  * [Parameters](#parameters-5)
58
59
  * [extractFunctions](#extractfunctions)
@@ -138,6 +139,14 @@ well known package properties
138
139
 
139
140
  * **See**: <https://rpm-packaging-guide.github.io>
140
141
 
142
+ ## hookMapping
143
+
144
+ map install hook named from arch to deb
145
+
146
+ ## hookMapping
147
+
148
+ map install hook named from arch to rpm
149
+
141
150
  ## Field
142
151
 
143
152
  Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
@@ -173,10 +182,6 @@ Execute package generation
173
182
  * `options`
174
183
  * `expander`
175
184
 
176
- ## hookMapping
177
-
178
- map install hook named from arch to rpm
179
-
180
185
  ## decodePassword
181
186
 
182
187
  Decode a password
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "7.29.0",
3
+ "version": "8.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -5,12 +5,12 @@ import { asArray } from "./util.mjs";
5
5
  import { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
6
6
  import { NodeModulesContentProvider } from "./content/node-modules-content-provider.mjs";
7
7
  import { FileContentProvider } from "./content/file-content-provider.mjs";
8
- import { DEB } from "./output/deb.mjs";
8
+ import { DEBIAN } from "./output/debian.mjs";
9
9
  import { ARCH } from "./output/arch.mjs";
10
10
  import { RPM } from "./output/rpm.mjs";
11
11
 
12
12
  export const allInputs = [NPMPackContentProvider, NodeModulesContentProvider];
13
- export const allOutputs = [DEB, ARCH, RPM];
13
+ export const allOutputs = [DEBIAN, ARCH, RPM];
14
14
 
15
15
  export const npmArchMapping = {
16
16
  arm64: "aarch64",
package/src/module.mjs CHANGED
@@ -6,7 +6,7 @@ export * from "./content/content-provider.mjs";
6
6
  export * from "./content/file-content-provider.mjs";
7
7
  export * from "./content/node-modules-content-provider.mjs";
8
8
  export * from "./content/npm-pack-content-provider.mjs";
9
- export * from "./output/deb.mjs";
9
+ export * from "./output/debian.mjs";
10
10
  export * from "./output/rpm.mjs";
11
11
  export * from "./output/arch.mjs";
12
12
  export * from "./output/packager.mjs";
@@ -4,7 +4,6 @@ import { readFileSync } from "fs";
4
4
  import { readFile } from "fs/promises";
5
5
  import { join } from "path";
6
6
  import { program } from "commander";
7
- import { aggregateFifo } from "aggregate-async-iterator";
8
7
  import { createContext } from "expression-expander";
9
8
  import { packageDirectory } from "pkg-dir";
10
9
  import {
@@ -28,9 +28,9 @@ const hookMapping = {
28
28
  post_remove: "DEBIAN/postrm"
29
29
  };
30
30
 
31
- export class DEB extends Packager {
31
+ export class DEBIAN extends Packager {
32
32
  static get name() {
33
- return "deb";
33
+ return "debian";
34
34
  }
35
35
 
36
36
  static get description() {
@@ -92,6 +92,10 @@ export class DEB extends Packager {
92
92
  )
93
93
  );
94
94
 
95
+ properties.Depends = Object.entries(dependencies).map(
96
+ ([n, e]) => `${n} (${e})`
97
+ );
98
+
95
99
  const fp = fieldProvider(properties, fields);
96
100
  const debianControlName = "DEBIAN/control";
97
101
 
@@ -150,13 +154,16 @@ const fields = {
150
154
  },
151
155
  Homepage: { alias: "homepage", type: "string" },
152
156
  Bugs: { alias: "bugs", type: "string" },
153
- Depends: { alias: "depends", type: "packageList" },
154
- Recommends: { type: "packageList" },
155
- Suggests: { type: "packageList" },
156
- Provides: { type: "packageList" },
157
- Breaks: { type: "packageList" },
158
- Replaces: { type: "packageList" },
159
-
157
+ Depends: { type: "string[]" },
158
+ "Pre-Depends": { type: "string[]" },
159
+ "Build-Depends": { type: "string[]" },
160
+ "Build-Depends-Indep": { type: "string[]" },
161
+ "Build-Depends-Arch": { type: "string[]" },
162
+ Recommends: { type: "string[]" },
163
+ Suggests: { type: "string[]" },
164
+ Provides: { type: "string[]" },
165
+ Breaks: { type: "string[]" },
166
+ Replaces: { type: "string[]" },
160
167
  Source: { alias: "source", type: "string" },
161
168
  Uploaders: { mandatory: false },
162
169
  "Installed-Size": {}
package/src/util.mjs CHANGED
@@ -32,7 +32,7 @@ export function decodePassword(password)
32
32
  */
33
33
  export async function* extractFunctions(source) {
34
34
  let name;
35
- let body = [];
35
+ const body = [];
36
36
 
37
37
  for await (const line of asLines(source)) {
38
38
  let m;