Skip to content

Commit

Permalink
Merge pull request #1644 from davidpcaldwell/refine-wf-project-typesc…
Browse files Browse the repository at this point in the history
…ript-versioning-code

Refine code that determines TypeScript version for wf project and doc…
  • Loading branch information
davidpcaldwell authored Sep 2, 2024
2 parents b2ce64a + 9603815 commit 0f43b9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tools/wf/typescript.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ namespace slime.jsh.wf.internal.module {

export namespace project {
export interface Typescript {
/**
* Returns the TypeScript version that should be used when processing this project. Defaults to the project version
* indicated in `tsc.version`, if any; falls back to the default TypeScript version declared by SLIME.
*/
version: (project: slime.jsh.wf.Project) => string

configurationFile: (project: slime.jsh.wf.Project) => slime.$api.fp.Maybe<slime.jrunscript.file.Location>
}
}
Expand Down
6 changes: 4 additions & 2 deletions tools/wf/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@
/** @type { slime.jsh.wf.internal.typescript.Exports["Project"]["version"] } */
var Project_getTypescriptVersion = $api.fp.pipe(
base,
$context.library.file.Location.directory.relativePath("tsc.version"),
$api.fp.world.mapping($context.library.file.world.Location.file.read.string.world()),
$api.fp.pipe(
$context.library.file.Location.directory.relativePath("tsc.version"),
$context.library.file.Location.file.read.string.maybe
),
$api.fp.Maybe.else(version)
);

Expand Down

0 comments on commit 0f43b9e

Please sign in to comment.