npm-pkgbuild 15.3.19 → 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,28 +97,28 @@ 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
- * [NodeModulesContentProvider](#nodemodulescontentprovider)
104
- * [Parameters](#parameters-3)
105
- * [Properties](#properties-1)
106
- * [name](#name-2)
107
100
  * [utf8StreamOptions](#utf8streamoptions)
108
- * [Properties](#properties-2)
101
+ * [Properties](#properties-1)
109
102
  * [packageNameMapping](#packagenamemapping)
110
103
  * [decodePassword](#decodepassword)
111
- * [Parameters](#parameters-4)
104
+ * [Parameters](#parameters-2)
112
105
  * [FunctionDecl](#functiondecl)
113
- * [Properties](#properties-3)
106
+ * [Properties](#properties-2)
114
107
  * [extractFunctions](#extractfunctions)
115
- * [Parameters](#parameters-5)
108
+ * [Parameters](#parameters-3)
116
109
  * [fieldProvider](#fieldprovider)
117
- * [Parameters](#parameters-6)
110
+ * [Parameters](#parameters-4)
118
111
  * [Expander](#expander)
119
- * [Parameters](#parameters-7)
112
+ * [Parameters](#parameters-5)
120
113
  * [copyEntries](#copyentries)
114
+ * [Parameters](#parameters-6)
115
+ * [NFTContentProvider](#nftcontentprovider)
116
+ * [Parameters](#parameters-7)
117
+ * [name](#name-1)
118
+ * [NodeModulesContentProvider](#nodemodulescontentprovider)
121
119
  * [Parameters](#parameters-8)
120
+ * [Properties](#properties-3)
121
+ * [name](#name-2)
122
122
  * [NPMPackContentProvider](#npmpackcontentprovider)
123
123
  * [Parameters](#parameters-9)
124
124
  * [Properties](#properties-4)
@@ -210,44 +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)>)**&#x20;
224
- * `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
225
- * `entryProperties` &#x20;
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
- ## NodeModulesContentProvider
232
-
233
- **Extends ContentProvider**
234
-
235
- Content from node\_modules.
236
- Requires .npmrc or NPM\_TOKEN environment
237
-
238
- ### Parameters
239
-
240
- * `definitions` &#x20;
241
- * `entryProperties` &#x20;
242
-
243
- ### Properties
244
-
245
- * `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
246
-
247
- ### name
248
-
249
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
250
-
251
213
  ## utf8StreamOptions
252
214
 
253
215
  Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
@@ -319,6 +281,44 @@ Destination paths a generated without leading '/' (as for entry names too).
319
281
  * `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
320
282
  * `expander` **[Expander](#expander)** (optional, default `v=>v`)
321
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))**&#x20;
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)>)**&#x20;
295
+ * `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
296
+ * `entryProperties` &#x20;
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
+ ## NodeModulesContentProvider
303
+
304
+ **Extends ContentProvider**
305
+
306
+ Content from node\_modules.
307
+ Requires .npmrc or NPM\_TOKEN environment
308
+
309
+ ### Parameters
310
+
311
+ * `definitions` &#x20;
312
+ * `entryProperties` &#x20;
313
+
314
+ ### Properties
315
+
316
+ * `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
317
+
318
+ ### name
319
+
320
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
321
+
322
322
  ## NPMPackContentProvider
323
323
 
324
324
  **Extends ContentProvider**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "15.3.19",
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.12.2",
86
- "bun": ">=1.0"
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
@@ -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