npm-pkgbuild 11.7.16 → 11.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "11.7.16",
3
+ "version": "11.8.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -64,7 +64,7 @@
64
64
  "tar-stream": "^3.0.0"
65
65
  },
66
66
  "devDependencies": {
67
- "@types/node": "^18.15.13",
67
+ "@types/node": "^18.16.1",
68
68
  "ava": "^5.2.0",
69
69
  "c8": "^7.13.0",
70
70
  "documentation": "^14.0.1",
@@ -52,6 +52,7 @@ export class DOCKER extends Packager {
52
52
  const { properties, staging } = await this.prepareExecute(options);
53
53
 
54
54
  async function* headLines() {
55
+ let scratch = true;
55
56
  for (const [k, v] of Object.entries({
56
57
  ...properties.from,
57
58
  ...Object.fromEntries(
@@ -60,12 +61,17 @@ export class DOCKER extends Packager {
60
61
  .map(([k, v]) => [dependenciesToFrom[k], v.replace(/[>=]*/, "")])
61
62
  )
62
63
  })) {
64
+ scratch = false;
63
65
  yield `FROM ${k}:${v}\n`;
64
66
  }
67
+
68
+ if(scratch) {
69
+ yield "FROM scratch\n";
70
+ }
65
71
  }
66
72
 
67
73
  async function* trailingLines() {
68
- yield "WORKDIR /app\n";
74
+ yield `WORKDIR ${properties.workdir}\n`;
69
75
  yield "COPY . .\n";
70
76
  if (properties.entrypoints) {
71
77
  yield `ENTRYPOINT ["node", "${Object.values(properties.entrypoints)[0]}"]\n`;
@@ -137,5 +143,6 @@ export class DOCKER extends Packager {
137
143
  const fields = {
138
144
  version: { type: "string", mandatory: true },
139
145
  description: { type: "string" },
140
- author: { alias: "maintainer", type: "string" }
146
+ author: { alias: "maintainer", type: "string" },
147
+ workdir: { type: "string", default: "/", mandatory: true }
141
148
  };