pmcf 1.65.2 → 1.65.3

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": "pmcf",
3
- "version": "1.65.2",
3
+ "version": "1.65.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/dns.mjs CHANGED
@@ -175,7 +175,7 @@ async function generateNamedDefs(dns, targetDir) {
175
175
  const zone = {
176
176
  id: domain,
177
177
  type: "plain",
178
- file: `${domain}.zone`,
178
+ file: `${dns.owner.name}/${domain}.zone`,
179
179
  records: new Set([SOARecord, NSRecord, ...records])
180
180
  };
181
181
  zones.push(zone);
@@ -183,7 +183,7 @@ async function generateNamedDefs(dns, targetDir) {
183
183
  const catalogZone = {
184
184
  id: `catalog.${domain}`,
185
185
  type: "catalog",
186
- file: `catalog.${domain}.zone`,
186
+ file: `${dns.owner.name}/catalog.${domain}.zone`,
187
187
  records: new Set([
188
188
  SOARecord,
189
189
  NSRecord,
@@ -229,7 +229,7 @@ async function generateNamedDefs(dns, targetDir) {
229
229
  reverseZone = {
230
230
  id: reverseArpa,
231
231
  type: "plain",
232
- file: `${reverseArpa}.zone`,
232
+ file: `${dns.owner.name}/${reverseArpa}.zone`,
233
233
  records: new Set([SOARecord, NSRecord])
234
234
  };
235
235
  zones.push(reverseZone);
package/src/utils.mjs CHANGED
@@ -1,7 +1,11 @@
1
1
  import { writeFile, mkdir } from "node:fs/promises";
2
- import { join } from "node:path";
2
+ import { join, dirname, basename } from "node:path";
3
3
 
4
4
  export async function writeLines(dir, name, lines) {
5
+ const full = join(dir, name);
6
+ dir = dirname(full);
7
+ name = basename(full);
8
+
5
9
  await mkdir(dir, { recursive: true });
6
10
  if (typeof lines === "string") lines = [lines];
7
11
  return writeFile(
@@ -33,11 +37,12 @@ export function asArray(value) {
33
37
  return Array.isArray(value) ? value : value === undefined ? [] : [value];
34
38
  }
35
39
 
36
- export function asIterator(value)
37
- {
38
- if(value === undefined) { return []; }
40
+ export function asIterator(value) {
41
+ if (value === undefined) {
42
+ return [];
43
+ }
39
44
 
40
- if(typeof value[Symbol.iterator] === 'function') {
45
+ if (typeof value[Symbol.iterator] === "function") {
41
46
  return value;
42
47
  }
43
48
 
@@ -182,5 +187,5 @@ export function hasWellKnownSubnet(address) {
182
187
 
183
188
  export const IPV4_LOCALHOST = _encode(ipv4, "127.0.0.1");
184
189
  export const IPV6_LOCALHOST = _encode(ipv6, "::1");
185
- export const IPV6_LINK_LOCAL_BROADCAST = _encode(ipv6,"ff02::1");
186
- export const IPV6_ROUTER_BROADCAST = _encode(ipv6,"ff02::2");
190
+ export const IPV6_LINK_LOCAL_BROADCAST = _encode(ipv6, "ff02::1");
191
+ export const IPV6_ROUTER_BROADCAST = _encode(ipv6, "ff02::2");