npm-pkgbuild 11.8.15 → 11.9.0
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 +2 -2
- package/src/content/content-provider.mjs +22 -0
- package/src/content/file-content-provider.mjs +1 -15
- package/src/content/nft-content-provider.mjs +1 -15
- package/src/content/node-modules-content-provider.mjs +1 -2
- package/src/content/npm-pack-content-provider.mjs +1 -3
- package/src/extract-from-package.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.9.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@vercel/nft": "^0.22.5",
|
|
47
47
|
"aggregate-async-iterator": "^1.1.16",
|
|
48
48
|
"commander": "^11.0.0",
|
|
49
|
-
"compare-versions": "^6.0.0
|
|
49
|
+
"compare-versions": "^6.0.0",
|
|
50
50
|
"content-entry": "^6.0.0",
|
|
51
51
|
"content-entry-filesystem": "^5.2.13",
|
|
52
52
|
"content-entry-transform": "^1.4.29",
|
|
@@ -3,8 +3,30 @@ import { ContentEntry } from "content-entry";
|
|
|
3
3
|
/**
|
|
4
4
|
* Source of package content.
|
|
5
5
|
* @property {string} dir
|
|
6
|
+
* @property {Transformer[]} transformer
|
|
6
7
|
*/
|
|
7
8
|
export class ContentProvider {
|
|
9
|
+
|
|
10
|
+
transformers = [];
|
|
11
|
+
entryProperties;
|
|
12
|
+
dir;
|
|
13
|
+
|
|
14
|
+
constructor(definitions, entryProperties) {
|
|
15
|
+
if (entryProperties) {
|
|
16
|
+
this.entryProperties = entryProperties;
|
|
17
|
+
|
|
18
|
+
for (const a of ["mode"]) {
|
|
19
|
+
if (this.entryProperties[a] !== undefined) {
|
|
20
|
+
if (!this.baseProperties) {
|
|
21
|
+
this.baseProperties = {};
|
|
22
|
+
}
|
|
23
|
+
this.baseProperties[a] = { value: this.entryProperties[a] };
|
|
24
|
+
delete this.entryProperties[a];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
/**
|
|
9
31
|
* List all entries.
|
|
10
32
|
* @return {AsyncIterator<ContentEntry>} all entries
|
|
@@ -21,7 +21,7 @@ export class FileContentProvider extends ContentProvider {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
constructor(definitions, entryProperties) {
|
|
24
|
-
super();
|
|
24
|
+
super(definitions, entryProperties);
|
|
25
25
|
|
|
26
26
|
if (typeof definitions === "string") {
|
|
27
27
|
if (definitions.endsWith("/")) {
|
|
@@ -40,20 +40,6 @@ export class FileContentProvider extends ContentProvider {
|
|
|
40
40
|
this.definitions = { pattern: DEFAULT_PATTERN, ...definitions };
|
|
41
41
|
this.definitions.pattern = asArray(this.definitions.pattern);
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
this.entryProperties = entryProperties;
|
|
45
|
-
|
|
46
|
-
if (this.entryProperties) {
|
|
47
|
-
for (const a of ["mode"]) {
|
|
48
|
-
if (this.entryProperties[a] !== undefined) {
|
|
49
|
-
if (!this.baseProperties) {
|
|
50
|
-
this.baseProperties = {};
|
|
51
|
-
}
|
|
52
|
-
this.baseProperties[a] = { value: this.entryProperties[a] };
|
|
53
|
-
delete this.entryProperties[a];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
43
|
}
|
|
58
44
|
|
|
59
45
|
toString() {
|
|
@@ -24,7 +24,7 @@ export class NFTContentProvider extends ContentProvider {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
constructor(definitions, entryProperties) {
|
|
27
|
-
super();
|
|
27
|
+
super(definitions, entryProperties);
|
|
28
28
|
|
|
29
29
|
if (typeof definitions === "string") {
|
|
30
30
|
this.definitions = { start: [definitions] };
|
|
@@ -32,20 +32,6 @@ export class NFTContentProvider extends ContentProvider {
|
|
|
32
32
|
this.definitions = definitions;
|
|
33
33
|
this.definitions.start = asArray(this.definitions.start);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
this.entryProperties = entryProperties;
|
|
37
|
-
|
|
38
|
-
if (this.entryProperties) {
|
|
39
|
-
for (const a of ["mode"]) {
|
|
40
|
-
if (this.entryProperties[a] !== undefined) {
|
|
41
|
-
if (!this.baseProperties) {
|
|
42
|
-
this.baseProperties = {};
|
|
43
|
-
}
|
|
44
|
-
this.baseProperties[a] = { value: this.entryProperties[a] };
|
|
45
|
-
delete this.entryProperties[a];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
35
|
}
|
|
50
36
|
|
|
51
37
|
toString() {
|
|
@@ -28,9 +28,8 @@ export class NodeModulesContentProvider extends ContentProvider {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
constructor(definitions, entryProperties) {
|
|
31
|
-
super();
|
|
31
|
+
super(definitions, entryProperties);
|
|
32
32
|
Object.assign(this, { withoutDevelpmentDependencies: true }, definitions);
|
|
33
|
-
this.entryProperties = entryProperties;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
toString() {
|
|
@@ -26,10 +26,8 @@ export class NPMPackContentProvider extends ContentProvider {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
constructor(definitions, entryProperties) {
|
|
29
|
-
super();
|
|
29
|
+
super(definitions, entryProperties);
|
|
30
30
|
Object.assign(this, definitions);
|
|
31
|
-
|
|
32
|
-
this.entryProperties = entryProperties;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
toString() {
|
|
@@ -50,7 +50,7 @@ export const npmArchMapping = {
|
|
|
50
50
|
const entryAttributeNames = ["owner", "group", "mode"];
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Delivers ContentProviders from pkgbuild.content
|
|
53
|
+
* Delivers ContentProviders from pkgbuild.content definition.
|
|
54
54
|
* @param {Object} content from pkgbuild.content
|
|
55
55
|
* @returns {Iterator<ContentProvider>}
|
|
56
56
|
*/
|