Skip to content

Commit

Permalink
Build UI faster locally
Browse files Browse the repository at this point in the history
By not dropping node_modules on every build
  • Loading branch information
wendigo committed Sep 11, 2024
1 parent edd504d commit 72aab64
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
28 changes: 24 additions & 4 deletions core/trino-web-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<artifactId>trino-web-ui</artifactId>
<description>Trino - Web UI</description>

<properties>
<frontend.package.goal>package</frontend.package.goal>
<frontend.check.goal>check</frontend.check.goal>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -94,7 +99,7 @@
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run package</arguments>
<arguments>run ${frontend.package.goal}</arguments>
<workingDirectory>src/main/resources/webapp/src</workingDirectory>
</configuration>
</execution>
Expand All @@ -105,7 +110,7 @@
</goals>
<phase>verify</phase>
<configuration>
<arguments>run check</arguments>
<arguments>run ${frontend.check.goal}</arguments>
<workingDirectory>src/main/resources/webapp/src</workingDirectory>
</configuration>
</execution>
Expand All @@ -116,7 +121,7 @@
</goals>
<phase>verify</phase>
<configuration>
<arguments>run check</arguments>
<arguments>run ${frontend.check.goal}</arguments>
<workingDirectory>src/main/resources/webapp-preview</workingDirectory>
</configuration>
</execution>
Expand All @@ -127,12 +132,27 @@
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run package</arguments>
<arguments>run ${frontend.package.goal}</arguments>
<workingDirectory>src/main/resources/webapp-preview</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ci</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env.CI</name>
</property>
</activation>
<properties>
<frontend.package.goal>package:clean</frontend.package.goal>
<frontend.check.goal>check:clean</frontend.check.goal>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"package": "npm clean-install && npm run build",
"package": "npm install && npm run build",
"package:clean": "npm clean-install && npm run build",
"preview": "vite preview",
"prettier:format": "prettier --write \"./src/*.{ts,tsx}\"",
"prettier:check": "prettier --check \"./src/*.{ts,tsx}\"",
"check": "npm clean-install && npm run lint && npm run prettier:check"
"check": "npm install && npm run lint && npm run prettier:check",
"check:clean": "npm clean-install && npm run lint && npm run prettier:check"
},
"dependencies": {
"@emotion/react": "^11.13.0",
Expand Down
6 changes: 4 additions & 2 deletions core/trino-web-ui/src/main/resources/webapp/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
]
},
"scripts": {
"package": "npm clean-install && webpack --config webpack.config.js",
"package": "npm install && webpack --config webpack.config.js",
"package:clean": "npm clean-install && webpack --config webpack.config.js",
"watch": "npm clean-install && webpack --config webpack.config.js --watch",
"flow": "flow",
"check": "flow && prettier --check **/*.js **/*.jsx *.js *.jsx",
"check": "npm install && flow && prettier --check **/*.js **/*.jsx *.js *.jsx",
"check:clean": "npm clean-install && flow && prettier --check **/*.js **/*.jsx *.js *.jsx",
"format": "prettier --write **/*.js **/*.jsx *.js *.jsx",
"lint": "prettier --check **/*.js **/*.jsx"
}
Expand Down

0 comments on commit 72aab64

Please sign in to comment.