Skip to content

Commit

Permalink
Migrating to Typescript (#1698)
Browse files Browse the repository at this point in the history
* migrate into typescript

* add ts-standard

* fix type

* remove unnecessary files

* add lint/typecheck for ui into build configuration

* add test configuration

Co-authored-by: seiya <seiyab@users.noreply.github.com>
  • Loading branch information
seiyab and seiyab committed May 1, 2022
1 parent b309aa7 commit 8b21fdc
Show file tree
Hide file tree
Showing 22 changed files with 7,392 additions and 3,864 deletions.
45 changes: 32 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -362,41 +362,60 @@ wrapper {
}

project(':digdag-ui') {
task buildUi {
inputs.files fileTree(dir: ".", include: ["*.js", "*.jsx", "config/*"])
outputs.dir "public"

task dependenciesUi {
doFirst {
exec {
// npm ci requires npm version 5.7 or more.
commandLine System.env.NPM ?: "npm", "ci"
}
}
}

task buildUi {
inputs.files fileTree(dir: ".", include: ["*.js", "*.jsx", "*.ts", "*.tsx", "config/*"])
outputs.dir "public"

doFirst {
exec {
commandLine System.env.NPM ?: "npm", "run", "build"
environment "SHA", "assets"
}
}

dependsOn('dependenciesUi')

// include public/* in the jar file
processResources {
from '.'
include 'public/**/*'
}
processResources.dependsOn('buildUi')
}

task testUi {
doFirst {
exec {
// npm ci requires npm version 5.7 or more.
commandLine System.env.NPM ?: "npm", "ci"
}
exec {
commandLine System.env.NPM ?: "npm", "run", "test"
}
}

dependsOn('dependenciesUi')
}
test.dependsOn('testUi')

// include public/* in the jar file
processResources {
from '.'
include 'public/**/*'
task checkUi {
doFirst {
exec {
commandLine System.env.NPM ?: "npm", "run", "lint"
}
exec {
commandLine System.env.NPM ?: "npm", "run", "type"
}
}

dependsOn('dependenciesUi')
}
processResources.dependsOn('buildUi')
check.dependsOn('checkUi')
}

project(':digdag-cli') {
Expand Down
4 changes: 1 addition & 3 deletions digdag-ui/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-flow"
"@babel/preset-typescript"
],
"env": {
"production": {
Expand All @@ -13,10 +13,8 @@
},
"plugins": [
"@babel/plugin-transform-react-display-name",
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-syntax-flow",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
Expand Down
16 changes: 0 additions & 16 deletions digdag-ui/.flowconfig

This file was deleted.

1 change: 0 additions & 1 deletion digdag-ui/CSSFlowStub.js.flow

This file was deleted.

1 change: 0 additions & 1 deletion digdag-ui/LESSFlowStub.js.flow

This file was deleted.

2 changes: 2 additions & 0 deletions digdag-ui/ace-digdag.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const TD_LOAD_VALUE_TOKEN: string
export const TD_RUN_VALUE_TOKEN: string
2 changes: 1 addition & 1 deletion digdag-ui/config/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var DIGDAG_CONFIG = {
const DIGDAG_CONFIG = {
url: '/api/',
td: {
useTD: false,
Expand Down
158 changes: 0 additions & 158 deletions digdag-ui/console.test.jsx

This file was deleted.

Loading

0 comments on commit 8b21fdc

Please sign in to comment.