wasp/waspc/packages/ts-inspect
2024-06-25 17:48:21 +02:00
..
src [waspls] cleanup extimport code (#1292) 2023-07-07 08:21:33 -04:00
test [waspls] cleanup extimport code (#1292) 2023-07-07 08:21:33 -04:00
.gitignore [waspls] diagnostics for external imports and goto definition (#1268) 2023-06-22 15:37:07 -04:00
eslintrc.cjs [waspls] diagnostics for external imports and goto definition (#1268) 2023-06-22 15:37:07 -04:00
jest.config.js [waspls] diagnostics for external imports and goto definition (#1268) 2023-06-22 15:37:07 -04:00
package-lock.json Bump braces from 3.0.2 to 3.0.3 in /waspc/packages/ts-inspect (#2123) 2024-06-25 17:48:21 +02:00
package.json [waspls] cleanup extimport code (#1292) 2023-07-07 08:21:33 -04:00
README.md [waspls] cleanup extimport code (#1292) 2023-07-07 08:21:33 -04:00
tsconfig.json [waspls] diagnostics for external imports and goto definition (#1268) 2023-06-22 15:37:07 -04:00

This package provides a command-line interface for getting information about exported symbols from JS/TS files. As input you give it a list of exports requests, each containing a list of filepaths and, optionally, a path to a tsconfig file.

[
  { "filenames": ["./src/exports.ts"] },
  {
    "tsconfig": "~/dev/wasp-todoapp/src/client/tsconfig.json",
    "filenames": ["~/dev/wasp-todoapp/src/client/MainPage.tsx"]
  }
]

Note that an instance of the TypeScript compiler is created for each exports request, so grouping all files with the same tsconfig into one request confers some performance benefit.

The program responds with a list of exports for each file. The filepaths in the result will always exactly match the filepaths in the input:

{
  "./src/exports.ts": [
    { "type": "named", "name": "getExportsOfFiles" },
    { "type": "default" }
  ]
}