pmcf 6.39.7 → 6.39.8

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
@@ -72,6 +72,7 @@ generates config packages for:
72
72
  * [Parameters](#parameters-11)
73
73
  * [expression](#expression)
74
74
  * [Parameters](#parameters-12)
75
+ * [isTemplate](#istemplate-1)
75
76
  * [PortEndpoint](#portendpoint)
76
77
  * [Parameters](#parameters-13)
77
78
  * [port](#port)
@@ -263,6 +264,10 @@ Returns **any** 
263
264
 
264
265
  Returns **any** 
265
266
 
267
+ ## isTemplate
268
+
269
+ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
270
+
266
271
  ## PortEndpoint
267
272
 
268
273
  **Extends BaseEndpoint**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.39.7",
3
+ "version": "6.39.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -248,22 +248,16 @@ export class base extends core {
248
248
 
249
249
  /**
250
250
  *
251
- * @param {*} entryProperties
252
- * @param {*} directoryProperties
253
251
  * @returns {AsyncIterable<ContentProvider>}
254
252
  */
255
- async *templateContent(entryProperties, directoryProperties) {
253
+ async *templateContent() {
256
254
  for (const node of this.walkDirections(["this", "extends"])) {
257
255
  const dir = join(node.directory, "content");
258
256
 
259
257
  try {
260
258
  if ((await stat(dir)).isDirectory) {
261
259
  yield transform(
262
- new FileContentProvider(
263
- this.templateContentAttributes(dir),
264
- entryProperties,
265
- directoryProperties
266
- ),
260
+ new FileContentProvider(this.templateContentAttributes(dir)),
267
261
  this.templateTransformers
268
262
  );
269
263
  }
@@ -279,10 +273,7 @@ export class base extends core {
279
273
  * @return {boolean}
280
274
  */
281
275
  get isTemplate() {
282
- return (
283
- this.template ??
284
- (this.name?.indexOf("*") >= 0 || this.owner?.isTemplate || false)
285
- );
276
+ return this.template ?? (super.isTemplate || this.name?.indexOf("*") >= 0);
286
277
  }
287
278
 
288
279
  error(...args) {
@@ -274,7 +274,7 @@ export class CoreService extends base {
274
274
  const pd = await this.packageData;
275
275
 
276
276
  pd.sources = await Array.fromAsync(
277
- this.templateContent(this.content.permissions)
277
+ this.templateContent()
278
278
  );
279
279
 
280
280
  if (pd.sources.length) {
@@ -281,7 +281,6 @@ class bind_object extends base {
281
281
  }
282
282
 
283
283
  export class bind_acl extends bind_object {
284
-
285
284
  static {
286
285
  addType(this);
287
286
  }
@@ -630,9 +629,7 @@ class bind_view extends bind_object {
630
629
 
631
630
  async packageContent(outputControl) {
632
631
  outputControl.packageData.sources.push(
633
- ...(await Array.fromAsync(
634
- this.templateContent(...outputControl.permissions)
635
- ))
632
+ ...(await Array.fromAsync(this.templateContent()))
636
633
  );
637
634
 
638
635
  for (const config of this.zoneConfigs.values()) {
@@ -803,36 +800,14 @@ export class bind extends CoreService {
803
800
  return false;
804
801
  }
805
802
 
806
- templateContentAttributes(dir) {
807
- const attr = super.templateContentAttributes(dir);
808
-
809
- // attr.properties = this.packageContentProperties;
810
-
811
- attr.properties = {
812
- "usr/share/libalpm/scripts/*": { mode: 0o777 },
813
- "etc/named/**/*": { user: "named", group: "named" },
814
- "var/lib/named/**/*": { user: "named", group: "named" }
815
- };
816
-
817
- console.log("templateContentAttributes", this.fullName, attr);
818
-
819
- return attr;
820
- }
821
-
822
803
  async *preparePackages(dir) {
823
804
  const packageData = await this.packageData;
824
805
 
825
- const permissions = this.content.permissions;
826
-
827
- packageData.sources = await Array.fromAsync(
828
- this.templateContent(permissions)
829
- );
806
+ packageData.sources = await Array.fromAsync(this.templateContent());
830
807
 
831
808
  let hasContent = packageData.sources.length > 0;
832
809
 
833
- packageData.sources.push(
834
- new FileContentProvider(dir + "/", permissions)
835
- );
810
+ packageData.sources.push(new FileContentProvider({ dir: dir + "/" }));
836
811
 
837
812
  const outputControl = { packageData, dir, permissions };
838
813
 
@@ -59,15 +59,10 @@ export class mosquitto extends CoreService {
59
59
  );*/
60
60
 
61
61
  const packageData = await this.packageData;
62
- const permissions = this.content.permissions;
63
62
 
64
- packageData.sources = await Array.fromAsync(
65
- this.templateContent(...permissions)
66
- );
63
+ packageData.sources = await Array.fromAsync(this.templateContent());
67
64
 
68
- packageData.sources.push(
69
- new FileContentProvider(dir + "/", permissions)
70
- );
65
+ packageData.sources.push(new FileContentProvider({ dir: dir + "/" }));
71
66
 
72
67
  await writeLines(
73
68
  join(dir, "etc", "mosquitto"),