Skip to content

Commit 0003d3c

Browse files
committed
Maintenance: Relocate vite build files and fonts.css for better caching from reverse proxy.
1 parent 7911ca2 commit 0003d3c

File tree

17 files changed

+23
-20
lines changed

17 files changed

+23
-20
lines changed

.cypress/support/component-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7-
<link rel="stylesheet" href="/fonts.css">
7+
<link rel="stylesheet" href="/assets/mobile/fonts.css">
88
<title>Zammad</title>
99
</head>
1010
<body class="bg-black font-sans text-sm text-white antialiased">

.eslintignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ app/frontend/shared/graphql/types.ts
88
public/assets/tests/**/*.js
99
public/assets/form/**/*.js
1010

11-
public/vite/**/*.js
12-
public/vite-dev/**/*.js
11+
public/assets/mobile/vite/**/*.js
12+
public/assets/mobile/vite-dev/**/*.js

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
# logfiles and tempfiles
4848
/log
4949
/public/assets/*.*
50+
/public/assets/mobile/vite
51+
/public/assets/mobile/vite-dev
5052
/public/assets/addons
5153
/public/assets/app
5254
/public/assets/custom
@@ -91,10 +93,6 @@
9193
# Backup files
9294
*~
9395

94-
# Vite Ruby
95-
/public/vite
96-
/public/vite-dev
97-
9896
# Vite PWA
9997
/app/frontend/dev-dist
10098

.gitlab/ci/review-app.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@
115115
"name": "product_name",
116116
"value": "Zammad Review App ${APP_NAME}"
117117
},
118+
{
119+
"name": "http_type",
120+
"value": "http"
121+
},
118122
{
119123
"name": "fqdn",
120124
"value": "${APP_FQDN}"

.gitlab/ci/test/browser_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ browser:build:
99
- public/assets/application-*
1010
- public/assets/knowledge_base*
1111
- public/assets/print-*
12-
- public/vite
12+
- public/assets/mobile/vite
1313
cache: !reference [.cache, read_only_full]
1414
variables:
1515
RAILS_ENV: 'production'

.stylelintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"public/assets/*.css",
4545
"public/assets/chat/chat.css",
4646
"public/assets/doorkeeper/**",
47-
"public/vite-dev/**",
48-
"public/vite/**",
47+
"public/assets/mobile/vite-dev/**",
48+
"public/assets/mobile/vite/**",
4949
"**/reset*.css",
5050
"**/bootstrap*.css",
5151
"**/codemirror.css",

app/controllers/mobile_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def manifest
2727
display: 'standalone',
2828
start_url: '/mobile/',
2929
icons: [
30-
# files a relative to manifest.webmanifest and are stored in public/
31-
{ src: '../app-icon-512.png', sizes: '512x512', type: 'image/png' },
32-
{ src: '../app-icon-192.png', sizes: '192x192', type: 'image/png' },
30+
# files are relative to manifest.webmanifest and are stored in public/assets/mobile
31+
{ src: '../assets/mobile/app-icon-512.png', sizes: '512x512', type: 'image/png' },
32+
{ src: '../assets/mobile/app-icon-192.png', sizes: '192x192', type: 'image/png' },
3333
]
3434
},
3535
content_type: 'application/manifest+json'

app/frontend/shared/sw/register.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const registerSW = (options: RegisterSWOptions) => {
2929
onNeedRefresh?.()
3030
}
3131
// you can disable service worker in development mode by running in console: pwa.enable()
32-
// you can enable service worker, it will point to /public/vite-dev/sw.js
32+
// you can enable service worker, it will point to /public/assets/mobile/vite-dev/sw.js
3333
// don't forget to unregister service worker, when you are done in console: pwa.disable()
3434
if (!sw.isEnabled()) {
3535
return () => {

app/graphql/gql/queries/application_build_checksum.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def resolve(...)
1515
# Use a stable identifier for the development environment, as we use hot reloading there instead.
1616
return 'development-auto-build' if Rails.env.development?
1717

18-
filename = Rails.public_path.join('vite/manifest.json')
18+
filename = Rails.public_path.join('assets/mobile/vite/manifest.json')
1919
Digest::MD5.hexdigest(File.read(filename))
2020
end
2121

app/views/layouts/mobile.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link rel="manifest" href="/mobile/manifest.webmanifest" />
99
<link rel="shortcut icon" href="/favicon.ico">
1010
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
11-
<%= stylesheet_link_tag '/fonts.css', nonce: true %>
11+
<%= stylesheet_link_tag '/assets/mobile/fonts.css', nonce: true %>
1212
<%= csrf_meta_tags %>
1313
<%= csp_meta_tag %>
1414
<%= action_cable_meta_tag %>

0 commit comments

Comments
 (0)