npm-pkgbuild 11.1.10 → 11.1.12

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": "11.1.10",
3
+ "version": "11.1.12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -173,7 +173,7 @@ package() {
173
173
 
174
174
  if (options.verbose) {
175
175
  console.log(
176
- await readFile(join(staging, PKGBUILD), { encoding: "utf8" })
176
+ await readFile(join(staging, PKGBUILD), utf8StreamOptions)
177
177
  );
178
178
  }
179
179
 
@@ -3,8 +3,10 @@ import { execa } from "execa";
3
3
  import { EmptyContentEntry, ReadableStreamContentEntry } from "content-entry";
4
4
  import {
5
5
  keyValueTransformer,
6
+ equalSeparatedKeyValuePairOptions
6
7
  } from "key-value-transformer";
7
8
  import { Packager } from "./packager.mjs";
9
+ import { fieldProvider } from "../util.mjs";
8
10
 
9
11
  const DOCKERFILE = "Dockerfile";
10
12
 
@@ -13,9 +15,8 @@ export class DOCKER extends Packager {
13
15
  return "docker";
14
16
  }
15
17
 
16
- static get description()
17
- {
18
- return "generate container image with docker|podman";
18
+ static get description() {
19
+ return "generate container image with docker|podman";
19
20
  }
20
21
 
21
22
  async execute(
@@ -29,6 +30,13 @@ export class DOCKER extends Packager {
29
30
  options
30
31
  );
31
32
 
33
+ async function* trailingLines() {
34
+ yield `
35
+ FROM node-18
36
+ ENTRYPOINT ["node", ""]
37
+ `;
38
+ }
39
+
32
40
  const fp = fieldProvider(properties, fields);
33
41
 
34
42
  transformer.push({
@@ -37,7 +45,10 @@ export class DOCKER extends Packager {
37
45
  transform: async entry =>
38
46
  new ReadableStreamContentEntry(
39
47
  "../" + entry.name,
40
- keyValueTransformer(await entry.readStream, fp)
48
+ keyValueTransformer(await entry.readStream, fp, {
49
+ ...equalSeparatedKeyValuePairOptions,
50
+ trailingLines
51
+ })
41
52
  ),
42
53
  createEntryWhenMissing: () => new EmptyContentEntry(DOCKERFILE)
43
54
  });
@@ -56,5 +67,9 @@ export class DOCKER extends Packager {
56
67
  }
57
68
  }
58
69
 
70
+ /**
71
+ * @see {https://docs.docker.com/engine/reference/builder/}
72
+ */
59
73
  const fields = {
74
+ version: { type: "string", mandatory: true }
60
75
  };