npm-pkgbuild 15.3.18 → 15.3.20
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
|
@@ -97,24 +97,24 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
97
97
|
* [FileContentProvider](#filecontentprovider)
|
|
98
98
|
* [Parameters](#parameters-1)
|
|
99
99
|
* [name](#name)
|
|
100
|
-
* [NFTContentProvider](#nftcontentprovider)
|
|
101
|
-
* [Parameters](#parameters-2)
|
|
102
|
-
* [name](#name-1)
|
|
103
100
|
* [utf8StreamOptions](#utf8streamoptions)
|
|
104
101
|
* [Properties](#properties-1)
|
|
105
102
|
* [packageNameMapping](#packagenamemapping)
|
|
106
103
|
* [decodePassword](#decodepassword)
|
|
107
|
-
* [Parameters](#parameters-
|
|
104
|
+
* [Parameters](#parameters-2)
|
|
108
105
|
* [FunctionDecl](#functiondecl)
|
|
109
106
|
* [Properties](#properties-2)
|
|
110
107
|
* [extractFunctions](#extractfunctions)
|
|
111
|
-
* [Parameters](#parameters-
|
|
108
|
+
* [Parameters](#parameters-3)
|
|
112
109
|
* [fieldProvider](#fieldprovider)
|
|
113
|
-
* [Parameters](#parameters-
|
|
110
|
+
* [Parameters](#parameters-4)
|
|
114
111
|
* [Expander](#expander)
|
|
115
|
-
* [Parameters](#parameters-
|
|
112
|
+
* [Parameters](#parameters-5)
|
|
116
113
|
* [copyEntries](#copyentries)
|
|
114
|
+
* [Parameters](#parameters-6)
|
|
115
|
+
* [NFTContentProvider](#nftcontentprovider)
|
|
117
116
|
* [Parameters](#parameters-7)
|
|
117
|
+
* [name](#name-1)
|
|
118
118
|
* [NodeModulesContentProvider](#nodemodulescontentprovider)
|
|
119
119
|
* [Parameters](#parameters-8)
|
|
120
120
|
* [Properties](#properties-3)
|
|
@@ -210,24 +210,6 @@ Content provided form the file system.
|
|
|
210
210
|
|
|
211
211
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
212
212
|
|
|
213
|
-
## NFTContentProvider
|
|
214
|
-
|
|
215
|
-
**Extends ContentProvider**
|
|
216
|
-
|
|
217
|
-
Content provided form the file system.
|
|
218
|
-
|
|
219
|
-
### Parameters
|
|
220
|
-
|
|
221
|
-
* `definitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** 
|
|
222
|
-
|
|
223
|
-
* `definitions.pattern` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)** 
|
|
224
|
-
* `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
|
|
225
|
-
* `entryProperties`  
|
|
226
|
-
|
|
227
|
-
### name
|
|
228
|
-
|
|
229
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
230
|
-
|
|
231
213
|
## utf8StreamOptions
|
|
232
214
|
|
|
233
215
|
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
@@ -299,6 +281,24 @@ Destination paths a generated without leading '/' (as for entry names too).
|
|
|
299
281
|
* `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
300
282
|
* `expander` **[Expander](#expander)** (optional, default `v=>v`)
|
|
301
283
|
|
|
284
|
+
## NFTContentProvider
|
|
285
|
+
|
|
286
|
+
**Extends ContentProvider**
|
|
287
|
+
|
|
288
|
+
Content provided form the file system.
|
|
289
|
+
|
|
290
|
+
### Parameters
|
|
291
|
+
|
|
292
|
+
* `definitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** 
|
|
293
|
+
|
|
294
|
+
* `definitions.pattern` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)** 
|
|
295
|
+
* `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
|
|
296
|
+
* `entryProperties`  
|
|
297
|
+
|
|
298
|
+
### name
|
|
299
|
+
|
|
300
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
301
|
+
|
|
302
302
|
## NodeModulesContentProvider
|
|
303
303
|
|
|
304
304
|
**Extends ContentProvider**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "15.3.
|
|
3
|
+
"version": "15.3.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"typescript": "^5.4.5"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
|
-
"node": ">=20.
|
|
86
|
-
"bun": ">=1.
|
|
85
|
+
"node": ">=20.14.0",
|
|
86
|
+
"bun": ">=1.1"
|
|
87
87
|
},
|
|
88
88
|
"repository": {
|
|
89
89
|
"type": "git",
|
|
@@ -2,7 +2,6 @@ import { tmpdir, homedir } from "node:os";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
4
4
|
import { globby } from "globby";
|
|
5
|
-
import { execa } from "execa";
|
|
6
5
|
import Arborist from "@npmcli/arborist";
|
|
7
6
|
import { parse } from "ini";
|
|
8
7
|
import { StringContentEntry } from "content-entry";
|
|
@@ -116,14 +115,6 @@ export class NodeModulesContentProvider extends ContentProvider {
|
|
|
116
115
|
console.error(e, name);
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
|
-
if (name.endsWith(".node")) {
|
|
120
|
-
const proc = await execa("file", ["-b", name], {
|
|
121
|
-
cwd: pkgSourceDir
|
|
122
|
-
});
|
|
123
|
-
const arch = proc.stdout.split(/\s*,\s*/)[1];
|
|
124
|
-
console.log(name, arch);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
118
|
yield Object.assign(
|
|
128
119
|
new FileSystemEntry(name, pkgSourceDir),
|
|
129
120
|
this.entryProperties
|
|
@@ -85,13 +85,20 @@ function* content2Sources(content, dir) {
|
|
|
85
85
|
delete definition.type;
|
|
86
86
|
yield new type({ ...definition, dir }, entryProperties);
|
|
87
87
|
} else {
|
|
88
|
-
|
|
88
|
+
throw new Error(`Unknown content provider '${type}'`);
|
|
89
89
|
}
|
|
90
90
|
} else {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
switch (typeof definition) {
|
|
92
|
+
case "object":
|
|
93
|
+
definition.base = definition.base
|
|
94
|
+
? join(dir, definition.base)
|
|
95
|
+
: dir;
|
|
96
|
+
break;
|
|
97
|
+
case "string":
|
|
98
|
+
definition = join(dir, definition);
|
|
99
|
+
break;
|
|
100
|
+
default:
|
|
101
|
+
throw new Error(`Unsupported content value '${definition}'`);
|
|
95
102
|
}
|
|
96
103
|
yield new FileContentProvider(definition, entryProperties);
|
|
97
104
|
}
|
|
@@ -253,7 +260,9 @@ export async function* extractFromPackage(options = {}, env = {}) {
|
|
|
253
260
|
}
|
|
254
261
|
|
|
255
262
|
if (packageContent.contributors) {
|
|
256
|
-
properties.maintainer = packageContent.contributors.map(
|
|
263
|
+
properties.maintainer = packageContent.contributors.map(
|
|
264
|
+
c => `${c.name} <${c.email}>`
|
|
265
|
+
);
|
|
257
266
|
}
|
|
258
267
|
|
|
259
268
|
if (typeof packageContent.repository === "string") {
|
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --no-warnings --title npm-pkgbuild
|
|
2
2
|
|
|
3
3
|
import { program, Option } from "commander";
|
|
4
|
+
import { execa } from "execa";
|
|
4
5
|
import { createExpressionTransformer } from "content-entry-transform";
|
|
5
6
|
import { UTIController } from "uti";
|
|
6
7
|
import additionalUTIs from "./utis.mjs";
|
|
@@ -104,6 +105,23 @@ program
|
|
|
104
105
|
|
|
105
106
|
const o = new outputFactory(context.expand(properties));
|
|
106
107
|
const transformer = [
|
|
108
|
+
{
|
|
109
|
+
name: "skip-architecutes",
|
|
110
|
+
match: (entry) => entry.name.endsWith(".node"),
|
|
111
|
+
async transform(entry) {
|
|
112
|
+
const proc = await execa("file", ["-b", entry.name], {
|
|
113
|
+
cwd: options.dir
|
|
114
|
+
});
|
|
115
|
+
const arch = proc.stdout.split(/\s*,\s*/)[1];
|
|
116
|
+
|
|
117
|
+
if(arch === 'ARM aarch64') {
|
|
118
|
+
return entry;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
console.log('skip',entry.name, arch);
|
|
122
|
+
return entry;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
107
125
|
createExpressionTransformer(
|
|
108
126
|
entry => uc.fileNameConformsTo(entry.name, "public.text") && !uc.fileNameConformsTo(entry.name, "com.netscape.javascript-source"),
|
|
109
127
|
properties
|