npm-pkgbuild 7.24.0 → 7.24.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": "7.24.0",
3
+ "version": "7.24.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,7 +30,7 @@ export class FileContentProvider extends ContentProvider {
30
30
  } else {
31
31
  this.definitions = { pattern: ["**/*"], ...definitions };
32
32
  this.definitions.pattern = asArray(this.definitions.pattern);
33
- /*
33
+ /*
34
34
  if(entryProperties && entryProperties.destination && !entryProperties.destination.endsWith('/')) {
35
35
  entryProperties.destination += '/';
36
36
  }
@@ -41,13 +41,14 @@ export class FileContentProvider extends ContentProvider {
41
41
  }
42
42
 
43
43
  toString() {
44
- return `${this.constructor.name}: ${this.definitions.base}, ${this.definitions.pattern}`;
44
+ return `${this.constructor.name}: ${this.definitions.base}, ${this.definitions.pattern} -> ${this.entryProperties.destination}`;
45
45
  }
46
46
 
47
47
  async *[Symbol.asyncIterator]() {
48
48
  const definitions = this.definitions;
49
49
  const base = definitions.base;
50
50
 
51
+ console.log("XXX", base, definitions.pattern);
51
52
  for (const name of await globby(definitions.pattern, {
52
53
  cwd: base
53
54
  })) {
@@ -30,7 +30,7 @@ export class NodeModulesContentProvider extends ContentProvider {
30
30
  }
31
31
 
32
32
  toString() {
33
- return `${this.constructor.name}: ${this.dir}`;
33
+ return `${this.constructor.name}: ${this.dir} -> ${this.entryProperties.destination}`;
34
34
  }
35
35
 
36
36
  async *[Symbol.asyncIterator]() {
@@ -28,7 +28,7 @@ export class NPMPackContentProvider extends ContentProvider {
28
28
 
29
29
  toString()
30
30
  {
31
- return `${this.constructor.name}: ${this.dir}`;
31
+ return `${this.constructor.name}: ${this.dir} -> ${this.entryProperties.destination}`;
32
32
  }
33
33
 
34
34
  async *[Symbol.asyncIterator]() {
@@ -1,5 +1,6 @@
1
1
  import { arch as hostArch } from "process";
2
2
  import { packageWalker } from "npm-package-walker";
3
+ import { createContext } from "expression-expander";
3
4
  import { asArray } from "./util.mjs";
4
5
  import { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
5
6
  import { NodeModulesContentProvider } from "./content/node-modules-content-provider.mjs";
@@ -67,6 +68,8 @@ export async function extractFromPackage(pkg, dir) {
67
68
  }
68
69
  }
69
70
 
71
+ const context = createContext({ properties });
72
+
70
73
  let dependencies = { ...pkg.engines };
71
74
  let sources = [];
72
75
  let output = {};
@@ -98,6 +101,8 @@ export async function extractFromPackage(pkg, dir) {
98
101
  if (pkgbuild.content && !modulePath) {
99
102
  Object.entries(pkgbuild.content).forEach(
100
103
  ([destination, definitions]) => {
104
+ destination = context.expand(destination);
105
+ definitions = context.expand(definitions);
101
106
  for (const definition of asArray(definitions)) {
102
107
  const entryProperties = { destination };
103
108