Skip to content

Commit

Permalink
Added typechecking of typescript files as tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianReeves committed May 30, 2024
1 parent a703d65 commit 1f9db2e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .moon/tasks/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
fileGroups:
sources:
- 'src/**/*'
- 'tsconfig.json'
- 'tsconfig.cjs.json'
- 'types/**/*'
tasks:
type-check-esm:
command: tsc
args:
- '--project'
- 'tsconfig.json'
inputs:
- '@globs(sources)'

type-check-cjs:
command: tsc
args:
- '--project'
- 'tsconfig.cjs.json'
inputs:
- '@globs(sources)'

type-check:
inputs: []
deps:
- target: '~:type-check-esm'
- target: '~:type-check-cjs'
1 change: 0 additions & 1 deletion packages/morphir-elm-compiler/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as Dependencies from "./dependencies";

import { DependencyConfig } from "./dependencies";
import { parseIncludes } from "./compiler/types";
import { z } from "zod";
import CLI from "./elm/Morphir/Elm/CLI.elm";

const fsExists = util.promisify(fs.exists);
Expand Down
11 changes: 10 additions & 1 deletion packages/morphir-elm-compiler/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
VirtualFile,
} from "./compiler/types";
import * as Dependencies from "./dependencies";

import {
type FileChanges,
type FileChange,
Expand All @@ -15,8 +16,16 @@ export function compileVirtualFiles(
projectManifest: MorphirProjectManifest,
options: ElmCompilerOptions
) {
const changes = virtualFilesToFileChanges(...files);
const _changes = virtualFilesToFileChanges(...files);
console.log("changes: ", _changes);
//TODO: Load dependencies and such
const loadOptions = {
...projectManifest,
localDependencies: projectManifest.localDependencies || [],
dependencies: projectManifest.dependencies || [],
includes: options.include || [],
};
Dependencies.loadAllDependencies(loadOptions);
return {};
}

Expand Down
1 change: 0 additions & 1 deletion packages/morphir-elm-compiler/src/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Readable } from "stream";
import { ResultAsync } from "neverthrow";
import { DataUrl, FileUrl } from "./compiler/types";

const parseDataUrl = require("data-urls");
//const fsReadFile = util.promisify(fs.readFile);

const Url = z
Expand Down

0 comments on commit 1f9db2e

Please sign in to comment.