diff options
Diffstat (limited to 'subprojects/frontend/build.gradle')
-rw-r--r-- | subprojects/frontend/build.gradle | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/subprojects/frontend/build.gradle b/subprojects/frontend/build.gradle index dd50860c..e57b2c4b 100644 --- a/subprojects/frontend/build.gradle +++ b/subprojects/frontend/build.gradle | |||
@@ -21,10 +21,15 @@ configurations { | |||
21 | 21 | ||
22 | def installFrontend = tasks.named('installFrontend') | 22 | def installFrontend = tasks.named('installFrontend') |
23 | 23 | ||
24 | def sourcesWithoutTypegen = fileTree('src') { | ||
25 | exclude '**/*.typegen.ts' | ||
26 | } | ||
27 | |||
24 | def assembleFrontend = tasks.named('assembleFrontend') | 28 | def assembleFrontend = tasks.named('assembleFrontend') |
25 | assembleFrontend.configure { | 29 | assembleFrontend.configure { |
30 | dependsOn generateXStateTypes | ||
26 | inputs.dir 'public' | 31 | inputs.dir 'public' |
27 | inputs.dir 'src' | 32 | inputs.files sourcesWithoutTypegen |
28 | inputs.file 'index.html' | 33 | inputs.file 'index.html' |
29 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'vite.config.ts') | 34 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'vite.config.ts') |
30 | inputs.file rootProject.file('yarn.lock') | 35 | inputs.file rootProject.file('yarn.lock') |
@@ -37,9 +42,21 @@ artifacts { | |||
37 | } | 42 | } |
38 | } | 43 | } |
39 | 44 | ||
45 | def generateXStateTypes = tasks.register('generateXStateTypes', RunYarn) { | ||
46 | dependsOn installFrontend | ||
47 | inputs.files sourcesWithoutTypegen | ||
48 | inputs.file 'package.json' | ||
49 | inputs.file rootProject.file('yarn.lock') | ||
50 | outputs.dir 'src' | ||
51 | script = 'run typegen' | ||
52 | description = 'Generate TypeScript typings for XState state machines.' | ||
53 | } | ||
54 | |||
40 | def typecheckFrontend = tasks.register('typecheckFrontend', RunYarn) { | 55 | def typecheckFrontend = tasks.register('typecheckFrontend', RunYarn) { |
41 | dependsOn installFrontend | 56 | dependsOn installFrontend |
57 | dependsOn generateXStateTypes | ||
42 | inputs.dir 'src' | 58 | inputs.dir 'src' |
59 | inputs.dir 'types' | ||
43 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.node.json') | 60 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.node.json') |
44 | inputs.file rootProject.file('yarn.lock') | 61 | inputs.file rootProject.file('yarn.lock') |
45 | outputs.dir "${buildDir}/typescript" | 62 | outputs.dir "${buildDir}/typescript" |
@@ -50,7 +67,9 @@ def typecheckFrontend = tasks.register('typecheckFrontend', RunYarn) { | |||
50 | 67 | ||
51 | def lintFrontend = tasks.register('lintFrontend', RunYarn) { | 68 | def lintFrontend = tasks.register('lintFrontend', RunYarn) { |
52 | dependsOn installFrontend | 69 | dependsOn installFrontend |
70 | dependsOn generateXStateTypes | ||
53 | inputs.dir 'src' | 71 | inputs.dir 'src' |
72 | inputs.dir 'types' | ||
54 | inputs.files('.eslintrc.cjs', 'prettier.config.cjs') | 73 | inputs.files('.eslintrc.cjs', 'prettier.config.cjs') |
55 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.node.json') | 74 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.node.json') |
56 | inputs.file rootProject.file('yarn.lock') | 75 | inputs.file rootProject.file('yarn.lock') |
@@ -66,7 +85,9 @@ def lintFrontend = tasks.register('lintFrontend', RunYarn) { | |||
66 | 85 | ||
67 | def prettier = tasks.register('fixFrontend', RunYarn) { | 86 | def prettier = tasks.register('fixFrontend', RunYarn) { |
68 | dependsOn installFrontend | 87 | dependsOn installFrontend |
88 | dependsOn generateXStateTypes | ||
69 | inputs.dir 'src' | 89 | inputs.dir 'src' |
90 | inputs.dir 'types' | ||
70 | inputs.files('.eslintrc.cjs', 'prettier.config.cjs') | 91 | inputs.files('.eslintrc.cjs', 'prettier.config.cjs') |
71 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.node.json') | 92 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'tsconfig.node.json') |
72 | inputs.file rootProject.file('yarn.lock') | 93 | inputs.file rootProject.file('yarn.lock') |
@@ -82,8 +103,9 @@ tasks.named('check') { | |||
82 | 103 | ||
83 | tasks.register('serveFrontend', RunYarn) { | 104 | tasks.register('serveFrontend', RunYarn) { |
84 | dependsOn installFrontend | 105 | dependsOn installFrontend |
106 | dependsOn generateXStateTypes | ||
85 | inputs.dir 'public' | 107 | inputs.dir 'public' |
86 | inputs.dir 'src' | 108 | inputs.files sourcesWithoutTypegen |
87 | inputs.file 'index.html' | 109 | inputs.file 'index.html' |
88 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'vite.config.ts') | 110 | inputs.files('package.json', 'tsconfig.json', 'tsconfig.base.json', 'vite.config.ts') |
89 | inputs.file rootProject.file('yarn.lock') | 111 | inputs.file rootProject.file('yarn.lock') |
@@ -95,6 +117,9 @@ tasks.register('serveFrontend', RunYarn) { | |||
95 | 117 | ||
96 | tasks.named('clean') { | 118 | tasks.named('clean') { |
97 | delete 'dev-dist' | 119 | delete 'dev-dist' |
120 | delete fileTree('src') { | ||
121 | include '**/*.typegen.ts' | ||
122 | } | ||
98 | } | 123 | } |
99 | 124 | ||
100 | sonarqube.properties { | 125 | sonarqube.properties { |