-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
40 lines (38 loc) · 1.5 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Plugin, StoreAggregateTrigger, Step } from "@shanzhai/interfaces";
import { typeScriptCompilerOptionsStore } from "@shanzhai/type-script-compiler-options-store";
import { WriteFileStep } from "@shanzhai/write-file-step";
import { StringifyJsonInput } from "@shanzhai/stringify-json-input";
import { BuildTsconfigInput } from "@shanzhai/build-tsconfig-input";
import { ConstantInput } from "@shanzhai/constant-input";
import { UnkeyedStoreGetInput } from "@shanzhai/unkeyed-store-get-input";
const outputTypeScriptCompilerOptionsPlugin: Plugin<{
readonly outputTypeScriptCompilerOptions: StoreAggregateTrigger;
}> = {
triggers: {
outputTypeScriptCompilerOptions: {
type: `storeAggregate`,
stores: [typeScriptCompilerOptionsStore],
invalidated(): Step {
return new WriteFileStep(
`Output TypeScript compiler options`,
[`tsconfig.json`],
new StringifyJsonInput(
new BuildTsconfigInput(
new UnkeyedStoreGetInput(typeScriptCompilerOptionsStore),
new ConstantInput(undefined),
new ConstantInput(undefined),
new ConstantInput(undefined),
new ConstantInput(undefined),
new ConstantInput(undefined),
new ConstantInput(undefined),
new ConstantInput([`src/**/*.ts`]),
new ConstantInput(undefined)
)
)
);
},
writesToStores: [],
},
},
};
export = outputTypeScriptCompilerOptionsPlugin;