bingo-systems 0.4.1 → 0.5.1

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.
@@ -1,6 +1,17 @@
1
1
  import { Octokit } from "octokit";
2
+ /**
3
+ * APIs to send network requests.
4
+ */
2
5
  export interface SystemFetchers {
6
+ /**
7
+ * Standard fetch function to send requests.
8
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API}
9
+ */
3
10
  fetch: typeof fetch;
11
+ /**
12
+ * Octokit.js instance wrapping the same `fetch` function.
13
+ * @see {@link https://octokit.github.io/rest.js}
14
+ */
4
15
  octokit: Octokit;
5
16
  }
6
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fetchers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CACjB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fetchers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;;OAGG;IACH,KAAK,EAAE,OAAO,KAAK,CAAC;IAEpB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;CACjB"}
@@ -1,7 +1,7 @@
1
- import { CreatedFileOptions } from "bingo-fs";
1
+ import { CreatedFileMetadata } from "bingo-fs";
2
2
  export declare function createWritingFileSystem(): {
3
3
  writeDirectory: (directoryPath: string) => Promise<undefined>;
4
- writeFile: (filePath: string, contents: string, options?: CreatedFileOptions) => Promise<void>;
4
+ writeFile: (filePath: string, contents: string, options?: CreatedFileMetadata) => Promise<void>;
5
5
  readDirectory: import("./types.js").ReadDirectory;
6
6
  readFile: import("./types.js").ReadFile;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createWritingFileSystem.d.ts","sourceRoot":"","sources":["../../src/files/createWritingFileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAK9C,wBAAgB,uBAAuB;oCAGC,MAAM;0BAGjC,MAAM,YACN,MAAM,YACN,kBAAkB;;;EAS9B"}
1
+ {"version":3,"file":"createWritingFileSystem.d.ts","sourceRoot":"","sources":["../../src/files/createWritingFileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAK/C,wBAAgB,uBAAuB;oCAGC,MAAM;0BAGjC,MAAM,YACN,MAAM,YACN,mBAAmB;;;EAS/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"createWritingFileSystem.js","sourceRoot":"","sources":["../../src/files/createWritingFileSystem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,UAAU,uBAAuB;IACtC,OAAO;QACN,GAAG,uBAAuB,EAAE;QAC5B,cAAc,EAAE,KAAK,EAAE,aAAqB,EAAE,EAAE,CAC/C,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,SAAS,EAAE,KAAK,EACf,QAAgB,EAChB,QAAgB,EAChB,OAA4B,EAC3B,EAAE;YACH,MAAM,EAAE,CAAC,SAAS,CACjB,QAAQ,EACR,QAAQ,EACR,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CACjD,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"createWritingFileSystem.js","sourceRoot":"","sources":["../../src/files/createWritingFileSystem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,MAAM,UAAU,uBAAuB;IACtC,OAAO;QACN,GAAG,uBAAuB,EAAE;QAC5B,cAAc,EAAE,KAAK,EAAE,aAAqB,EAAE,EAAE,CAC/C,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,SAAS,EAAE,KAAK,EACf,QAAgB,EAChB,QAAgB,EAChB,OAA6B,EAC5B,EAAE;YACH,MAAM,EAAE,CAAC,SAAS,CACjB,QAAQ,EACR,QAAQ,EACR,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CACjD,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -1,20 +1,61 @@
1
- export interface DirectoryChild {
2
- name: string;
3
- type: "directory" | "file";
4
- }
5
- export type ReadDirectory = (filePath: string) => Promise<string[]>;
1
+ /**
2
+ * Reads the names of a directory's children.
3
+ * @param directoryPath Path to the directory on disk.
4
+ * @returns Promise for the names of the directory's children.
5
+ */
6
+ export type ReadDirectory = (directoryPath: string) => Promise<string[]>;
7
+ /**
8
+ * Reads the contents of a file.
9
+ * @param filePath Path to the file on disk.
10
+ * @returns Promise for the text contents of the file.
11
+ */
6
12
  export type ReadFile = (filePath: string) => Promise<string>;
13
+ /**
14
+ * APIs to read from a file system.
15
+ */
7
16
  export interface ReadingFileSystem {
17
+ /**
18
+ * Reads the names of a directory's children.
19
+ */
8
20
  readDirectory: ReadDirectory;
21
+ /**
22
+ * Reads the contents of a file.
23
+ */
9
24
  readFile: ReadFile;
10
25
  }
26
+ /**
27
+ * Creates a directory if it doesn't yet exist.
28
+ * @param directoryPath Path to the directory on disk.
29
+ */
11
30
  export type WriteDirectory = (directoryPath: string) => Promise<void>;
31
+ /**
32
+ * Writes contents to a file, updating it if it already exists.
33
+ * @param filePath Path to the file on disk.
34
+ * @param contents New contents for the file.
35
+ * @param options Extra metadata to attach to the file.
36
+ * @returns Promise for the text contents of the file.
37
+ */
12
38
  export type WriteFile = (filePath: string, contents: string, options?: WriteFileOptions) => Promise<void>;
39
+ /**
40
+ * Extra metadata for writing a file.
41
+ */
13
42
  export interface WriteFileOptions {
43
+ /**
44
+ * Whether the file has an executable bit enabled.
45
+ */
14
46
  executable?: boolean;
15
47
  }
48
+ /**
49
+ * APIs to read from and write to a file system.
50
+ */
16
51
  export interface WritingFileSystem extends ReadingFileSystem {
52
+ /**
53
+ * Creates a directory if it doesn't yet exist.
54
+ */
17
55
  writeDirectory: WriteDirectory;
56
+ /**
57
+ * Writes contents to a file, updating it if it already exists.
58
+ */
18
59
  writeFile: WriteFile;
19
60
  }
20
61
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/files/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAEpE,MAAM,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEtE,MAAM,MAAM,SAAS,GAAG,CACvB,QAAQ,EAAE,MAAM,EAChB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ExecaError, Result } from "execa";
2
+ /**
3
+ * Executes a command in the system shell.
4
+ * @see {@link https://github.com/sindresorhus/execa}
5
+ */
2
6
  export type SystemRunner = (command: string) => Promise<ExecaError | Result>;
3
7
  //# sourceMappingURL=runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC"}
@@ -1,9 +1,21 @@
1
1
  import { SystemFetchers } from "../fetchers/types.js";
2
2
  import { WritingFileSystem } from "../files/types.js";
3
3
  import { SystemRunner } from "../runner/runner.js";
4
+ /**
5
+ * Shared APIs used by Bingo preparers, producers, and runners.
6
+ */
4
7
  export interface BingoSystem {
8
+ /**
9
+ * APIs to send network requests.
10
+ */
5
11
  fetchers: SystemFetchers;
12
+ /**
13
+ * APIs to read from and write to a file system.
14
+ */
6
15
  fs: WritingFileSystem;
16
+ /**
17
+ * Executes a command in the system shell.
18
+ */
7
19
  runner: SystemRunner;
8
20
  }
9
21
  //# sourceMappingURL=system.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/types/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,EAAE,EAAE,iBAAiB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;CACrB"}
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/types/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC;IAEzB;;OAEG;IACH,EAAE,EAAE,iBAAiB,CAAC;IAEtB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingo-systems",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "File, network, and shell wrapper APIs used by Bingo. 🧰",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  "execa": "^9.5.2",
25
25
  "get-github-auth-token": "^0.1.1",
26
26
  "octokit": "^4.1.2",
27
- "bingo-fs": "^0.4.1"
27
+ "bingo-fs": "^0.5.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "22.13.4"