npm-pkgbuild 22.1.6 → 22.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"key-value-transformer": "^3.3.2",
|
|
62
62
|
"npm-package-walker": "^8.0.11",
|
|
63
63
|
"npm-packlist": "^11.3.0",
|
|
64
|
-
"pacc": "^11.
|
|
64
|
+
"pacc": "^11.10.0",
|
|
65
65
|
"package-directory": "^8.2.0",
|
|
66
66
|
"pacote": "^22.0.0",
|
|
67
67
|
"picomatch": "^4.0.7",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"uti": "^8.11.3"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@types/node": "^26.5.
|
|
72
|
+
"@types/node": "^26.5.1",
|
|
73
73
|
"ava": "^8.0.1",
|
|
74
74
|
"c8": "^12.0.0",
|
|
75
75
|
"documentation": "^14.0.3",
|
|
@@ -6,7 +6,7 @@ import { ContentEntry, CollectionEntry } from "content-entry";
|
|
|
6
6
|
* @property {string} dir
|
|
7
7
|
* @property {string} destination
|
|
8
8
|
* @property {Object} defaultProperties
|
|
9
|
-
* @property {Map<Object,Object
|
|
9
|
+
* @property {Map<Object,Object>|Object} permissions
|
|
10
10
|
*/
|
|
11
11
|
export class ContentProvider {
|
|
12
12
|
dir;
|
|
@@ -21,17 +21,18 @@ export class ContentProvider {
|
|
|
21
21
|
*/
|
|
22
22
|
constructor(definitions) {
|
|
23
23
|
this.dir = definitions.dir;
|
|
24
|
-
|
|
24
|
+
delete definitions.dir;
|
|
25
25
|
|
|
26
26
|
if (definitions.permissions) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const permissions = definitions.permissions;
|
|
28
|
+
delete definitions.permissions;
|
|
29
|
+
|
|
30
|
+
if (Object.values(permissions).find(v => typeof v !== "object")) {
|
|
31
|
+
Object.assign(definitions, permissions);
|
|
31
32
|
} else {
|
|
32
|
-
const entries =
|
|
33
|
-
?
|
|
34
|
-
: Object.entries(
|
|
33
|
+
const entries = permissions.entries
|
|
34
|
+
? permissions.entries()
|
|
35
|
+
: Object.entries(permissions);
|
|
35
36
|
|
|
36
37
|
this.permissions = new Map(
|
|
37
38
|
entries.map(([pattern, properties]) => [
|
|
@@ -41,6 +42,8 @@ export class ContentProvider {
|
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
|
|
46
|
+
this.defaultProperties = { ...definitions };
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
get destination() {
|
|
@@ -48,7 +51,8 @@ export class ContentProvider {
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
toString() {
|
|
51
|
-
|
|
54
|
+
const str = `${this.constructor.name}: ${this.dir}`;
|
|
55
|
+
return this.destination ? str + " -> " + this.destination : str;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
/**
|
|
@@ -61,12 +65,6 @@ export class ContentProvider {
|
|
|
61
65
|
if (this.permissions) {
|
|
62
66
|
for (const [matcher, properties] of this.permissions) {
|
|
63
67
|
if (matcher(name)) {
|
|
64
|
-
/*console.log("A",name, {
|
|
65
|
-
mode: properties.mode,
|
|
66
|
-
user: properties.user,
|
|
67
|
-
group: properties.group,
|
|
68
|
-
destination: this.destination
|
|
69
|
-
});*/
|
|
70
68
|
return isCollection && properties.collection
|
|
71
69
|
? { ...properties.collection, destination: this.destination }
|
|
72
70
|
: { ...properties, destination: this.destination };
|
|
@@ -61,7 +61,8 @@ export class FileContentProvider extends ContentProvider {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
toString() {
|
|
64
|
-
|
|
64
|
+
const str = `${this.constructor.name}: ${this.dir}, ${this.pattern}`;
|
|
65
|
+
return this.destination ? str + " -> " + this.destination : str;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
/**
|