@infrascan/fs-connector 0.2.3 → 0.4.0

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/dist/index.d.mts CHANGED
@@ -23,4 +23,4 @@ declare const DEFAULT_CONFIG: Required<FsResolverConfig>;
23
23
  */
24
24
  declare function buildFsConnector(basePath: string, config?: FsResolverConfig): Connector;
25
25
 
26
- export { DEFAULT_CONFIG, FsResolverConfig, buildFsConnector as default };
26
+ export { DEFAULT_CONFIG, type FsResolverConfig, buildFsConnector as default };
package/dist/index.d.ts CHANGED
@@ -23,4 +23,4 @@ declare const DEFAULT_CONFIG: Required<FsResolverConfig>;
23
23
  */
24
24
  declare function buildFsConnector(basePath: string, config?: FsResolverConfig): Connector;
25
25
 
26
- export { DEFAULT_CONFIG, FsResolverConfig, buildFsConnector as default };
26
+ export { DEFAULT_CONFIG, type FsResolverConfig, buildFsConnector as default };
package/dist/index.js CHANGED
@@ -17,13 +17,13 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // index.ts
21
- var fs_connector_exports = {};
22
- __export(fs_connector_exports, {
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  DEFAULT_CONFIG: () => DEFAULT_CONFIG,
24
24
  default: () => buildFsConnector
25
25
  });
26
- module.exports = __toCommonJS(fs_connector_exports);
26
+ module.exports = __toCommonJS(index_exports);
27
27
  var import_fs = require("fs");
28
28
  var import_promises = require("fs/promises");
29
29
  var import_path = require("path");
@@ -55,7 +55,12 @@ async function readStateFromFile(filePath) {
55
55
  if (readError?.code === "ENOENT") {
56
56
  return [];
57
57
  }
58
- throw err;
58
+ if (err instanceof Error) {
59
+ throw err;
60
+ }
61
+ throw new Error(
62
+ `Unexpected error occurred reading state from file: ${String(err)}`
63
+ );
59
64
  }
60
65
  }
61
66
  function serializeState(state, prettyPrint) {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // index.ts
1
+ // src/index.ts
2
2
  import { existsSync } from "fs";
3
3
  import { mkdir, readFile, readdir, writeFile } from "fs/promises";
4
4
  import { join, resolve } from "path";
@@ -30,7 +30,12 @@ async function readStateFromFile(filePath) {
30
30
  if (readError?.code === "ENOENT") {
31
31
  return [];
32
32
  }
33
- throw err;
33
+ if (err instanceof Error) {
34
+ throw err;
35
+ }
36
+ throw new Error(
37
+ `Unexpected error occurred reading state from file: ${String(err)}`
38
+ );
34
39
  }
35
40
  }
36
41
  function serializeState(state, prettyPrint) {
package/package.json CHANGED
@@ -1,39 +1,23 @@
1
1
  {
2
2
  "name": "@infrascan/fs-connector",
3
- "version": "0.2.3",
3
+ "version": "0.4.0",
4
4
  "description": "Connector for the Infrascan SDK to read and write state to the local filesystem",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
+ "source": "src/index.ts",
8
9
  "exports": {
9
10
  ".": {
10
11
  "require": "./dist/index.js",
11
- "import": "./dist/index.mjs",
12
- "types": "./dist/index.d.ts"
12
+ "import": "./dist/index.mjs"
13
13
  }
14
14
  },
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "scripts": {
19
- "build": "rm -rf dist ; tsup",
20
- "prepublish": "rm -rf dist ; tsup",
21
- "lint": "tsc --noEmit ; eslint .",
22
- "clean": "rm -rf dist node_modules"
23
- },
24
- "tsup": {
25
- "clean": true,
26
- "cjsInterop": true,
27
- "splitting": false,
28
- "dts": true,
29
- "entry": [
30
- "index.ts"
31
- ],
32
- "format": [
33
- "esm",
34
- "cjs"
35
- ],
36
- "target": "node18"
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/infrascan/infrascan.git"
37
21
  },
38
22
  "keywords": [
39
23
  "AWS",
@@ -45,12 +29,18 @@
45
29
  "author": "Liam Farrelly <liam@l3f7.dev> (https://whoisli.am/)",
46
30
  "license": "MPL-2.0",
47
31
  "devDependencies": {
48
- "@infrascan/shared-types": "^0.2.2",
49
- "eslint-config-custom": "*",
50
- "tsconfig": "*",
51
- "typescript": "^5.1.6"
32
+ "@infrascan/shared-types": "^0.9.0",
33
+ "eslint-config-custom": "1.0.0",
34
+ "@infrascan/tsconfig": "0.0.0",
35
+ "typescript": "5.8.3",
36
+ "@types/node": "^24"
52
37
  },
53
38
  "dependencies": {
54
39
  "minimatch": "^9.0.3"
40
+ },
41
+ "scripts": {
42
+ "build": "rm -rf dist ; tsup --config internal/tsconfig/tsup.json",
43
+ "lint": "tsc --noEmit ; eslint .",
44
+ "clean": "rm -rf dist node_modules"
55
45
  }
56
- }
46
+ }