npm-pkgbuild 18.2.2 → 18.2.3

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": "18.2.2",
3
+ "version": "18.2.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -1,4 +1,4 @@
1
- import { ContentEntry } from "content-entry";
1
+ import { ContentEntry, CollectionEntry } from "content-entry";
2
2
 
3
3
  /**
4
4
  * Source of package content.
@@ -24,7 +24,7 @@ export class ContentProvider {
24
24
 
25
25
  /**
26
26
  * List all entries.
27
- * @return {AsyncIterable<ContentEntry>} all entries
27
+ * @return {AsyncIterable<ContentEntry|CollectionEntry>} all entries
28
28
  */
29
29
  async *[Symbol.asyncIterator]() {}
30
30
  }
@@ -59,7 +59,7 @@ export class FileContentProvider extends ContentProvider {
59
59
  }
60
60
 
61
61
  /**
62
- * @return {AsyncIterable<ContentEntry>} all entries
62
+ * @return {AsyncIterable<ContentEntry|CollectionEntry>} all entries
63
63
  */
64
64
  async *[Symbol.asyncIterator]() {
65
65
  const definitions = this.definitions;
@@ -4,7 +4,11 @@ import { mkdtemp, readFile, writeFile } from "node:fs/promises";
4
4
  import { glob } from "node:fs/promises";
5
5
  import Arborist from "@npmcli/arborist";
6
6
  import { parse } from "ini";
7
- import { StringContentEntry, CollectionEntry } from "content-entry";
7
+ import {
8
+ ContentEntry,
9
+ StringContentEntry,
10
+ CollectionEntry
11
+ } from "content-entry";
8
12
  import { FileSystemEntry } from "content-entry-filesystem";
9
13
  import { ContentProvider } from "./content-provider.mjs";
10
14
  import { utf8StreamOptions } from "../util.mjs";
@@ -44,6 +48,10 @@ export class NodeModulesContentProvider extends ContentProvider {
44
48
  return `${this.constructor.name}: ${this.dir} -> ${this.entryProperties.destination}`;
45
49
  }
46
50
 
51
+ /**
52
+ * List all entries.
53
+ * @return {AsyncIterable<ContentEntry|CollectionEntry>} all entries
54
+ */
47
55
  async *[Symbol.asyncIterator]() {
48
56
  try {
49
57
  let pkgSourceDir = this.dir;
@@ -57,18 +57,14 @@ export class NPMPackContentProvider extends ContentProvider {
57
57
  }
58
58
 
59
59
  entries.push(
60
- Object.assign(
61
- Object.create(
62
- new BufferContentEntry(
63
- header.name.substring(8),
64
- Buffer.concat(chunks)
65
- ),
66
- {
67
- mtime: { value: header.mtime },
68
- mode: { value: header.mode }
69
- }
70
- ),
71
- this.entryProperties
60
+ new BufferContentEntry(
61
+ header.name.substring(8),
62
+ {
63
+ ...this.entryProperties,
64
+ mtime: header.mtime,
65
+ mode: header.mode
66
+ },
67
+ Buffer.concat(chunks)
72
68
  )
73
69
  );
74
70
 
@@ -11,8 +11,9 @@ export class ContentProvider {
11
11
  dir: any;
12
12
  /**
13
13
  * List all entries.
14
- * @return {AsyncIterable<ContentEntry>} all entries
14
+ * @return {AsyncIterable<ContentEntry|CollectionEntry>} all entries
15
15
  */
16
- [Symbol.asyncIterator](): AsyncIterable<ContentEntry>;
16
+ [Symbol.asyncIterator](): AsyncIterable<ContentEntry | CollectionEntry>;
17
17
  }
18
18
  import { ContentEntry } from "content-entry";
19
+ import { CollectionEntry } from "content-entry";
@@ -7,5 +7,10 @@
7
7
  export class NFTContentProvider extends ContentProvider {
8
8
  static get description(): string;
9
9
  definitions: any;
10
+ /**
11
+ * @return {AsyncIterable<ContentEntry>} all entries
12
+ */
13
+ [Symbol.asyncIterator](): AsyncIterable<ContentEntry>;
10
14
  }
11
15
  import { ContentProvider } from "./content-provider.mjs";
16
+ import { ContentEntry } from "content-entry";
@@ -6,9 +6,5 @@
6
6
  export class NodeModulesContentProvider extends ContentProvider {
7
7
  static get description(): string;
8
8
  withoutDevelpmentDependencies: boolean;
9
- [Symbol.asyncIterator](): AsyncGenerator<CollectionEntry | StringContentEntry | FileSystemEntry, void, unknown>;
10
9
  }
11
10
  import { ContentProvider } from "./content-provider.mjs";
12
- import { CollectionEntry } from "content-entry";
13
- import { StringContentEntry } from "content-entry";
14
- import { FileSystemEntry } from "content-entry-filesystem";
@@ -27,7 +27,7 @@ export function extractFromPackage(options?: {
27
27
  /**
28
28
  * All content providers (input)
29
29
  */
30
- export const allInputs: (typeof NPMPackContentProvider | typeof NFTContentProvider)[];
30
+ export const allInputs: (typeof NPMPackContentProvider | typeof NodeModulesContentProvider | typeof FileContentProvider | typeof NFTContentProvider)[];
31
31
  /**
32
32
  * All output formats
33
33
  */
@@ -68,6 +68,8 @@ export type PackageDefinition = {
68
68
  };
69
69
  };
70
70
  import { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
71
+ import { NodeModulesContentProvider } from "./content/node-modules-content-provider.mjs";
72
+ import { FileContentProvider } from "./content/file-content-provider.mjs";
71
73
  import { NFTContentProvider } from "./content/nft-content-provider.mjs";
72
74
  import { ARCH } from "./output/arch.mjs";
73
75
  import { DOCKER } from "./output/docker.mjs";