Skip to content

Commit

Permalink
docs(compartment-mapper): Workspace language-for-extension options
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Nov 9, 2024
1 parent 141c689 commit 5b764d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/compartment-mapper/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ User-visible changes to `@endo/compartment-mapper`:
package’s `type` in the way we already vary `js` between `cjs` and `mjs`.
These options enter through the high level functions including `makeArchive`
and `importLocation`.
- The new options `workspaceLanguageForExtension`,
`workspaceModuleLanguageForExtension`, and
`workspaceCommonjsLanguageForExtension` apply like the above except more
specifically and for packages that are not physically located under a
`node_modules` directory, indicating that JavaScript has not yet been
generated from any non-JavaScript source files.
- Omits unused module descriptors from `compartment-map.json` in archived
applications, potentially reducing file sizes.
- Fixes an issue where errors thrown from exit module hooks (`importHook`) would
Expand Down
7 changes: 7 additions & 0 deletions packages/compartment-mapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@ Packages with `type` set to `"commonjs"` or simply not set,
This provides an hook for mapping TypeScript's `.ts` to either `.cts` or
`.mts`.
The analogous `workspaceLanguageForExtension`,
`workspaceCommonjsLanguageForExtension`, and
`workspaceModuleLanguageForExtension` options apply more specifically for
packages that are not under a `node_modules` directory, indicating that they
are in the set of linked workspaces and have not been built or published to
npm.
In the scope any given package, the `parsers` property in `package.json` may
override the extension-to-language mapping.
Expand Down

0 comments on commit 5b764d5

Please sign in to comment.