Skip to content

Commit d36a4d7

Browse files
authored
fix(website): fixed build and deployment for website and docs (#2172)
1 parent 2c253fa commit d36a4d7

File tree

11 files changed

+75
-139
lines changed

11 files changed

+75
-139
lines changed

apps/docs-ui/src/app/js/vendor/highlight.bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function () {
22
'use strict';
33

4-
const hljs = require('highlight.js/lib/highlight');
4+
const hljs = require('highlight.js/lib');
55
hljs.registerLanguage(
66
'asciidoc',
77
require('highlight.js/lib/languages/asciidoc'),

apps/website/adapters/netlify-edge/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { netlifyEdgeAdapter } from '@builder.io/qwik-city/adapters/netlify-edge/vite';
22
import { extendConfig } from '@builder.io/qwik-city/vite';
33
import { qwikVite } from '@builder.io/qwik/optimizer';
4-
import { UserConfig, Plugin } from 'vite';
4+
import { UserConfig, Plugin, UserConfigExport } from 'vite';
55
import { join } from 'path';
66
import baseConfig from '../../vite.config';
77

@@ -12,7 +12,7 @@ const modified: UserConfig = {
1212
(p) => (p as Plugin)?.name !== 'vite-plugin-qwik',
1313
),
1414
};
15-
export default extendConfig(modified, () => {
15+
export default extendConfig(modified as UserConfigExport, () => {
1616
const outDir = 'dist/apps/website/.netlify/edge-functions/entry.netlify-edge';
1717
return {
1818
build: {

apps/website/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"executor": "qwik-nx:build",
1010
"options": {
1111
"runSequence": ["website:build.client", "website:build.ssr"],
12-
"outputPath": "apps/website/dist",
12+
"outputPath": "dist/apps/website",
1313
"skipTypeCheck": false
1414
},
1515
"configurations": {
@@ -20,15 +20,15 @@
2020
"build.client": {
2121
"executor": "@nrwl/vite:build",
2222
"options": {
23-
"outputPath": "apps/website/dist",
23+
"outputPath": "dist/apps/website",
2424
"configFile": "apps/website/vite.config.ts"
2525
}
2626
},
2727
"build.ssr": {
2828
"executor": "@nrwl/vite:build",
2929
"defaultConfiguration": "preview",
3030
"options": {
31-
"outputPath": "apps/website/dist"
31+
"outputPath": "dist/apps/website"
3232
},
3333
"configurations": {
3434
"preview": {

apps/website/src/components/navbar/navbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ export default component$((props: NavbarProps) => {
290290
class="border-blue-gray-900 w-1/2 px-4 py-1.5 pr-8 bg-mf-gray hover:bg-white focus:bg-mf-gray text-lg focus:border-ui-blue"
291291
name="language"
292292
id="language"
293-
onChange$={async (event, el) => {
294-
await changeLocale$(event.target.value as any);
293+
onChange$={async (event: any, el) => {
294+
await changeLocale$(event.target?.value as any);
295295
}}
296296
>
297297
{locales.map((locale) => {

apps/website/src/root.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { QwikSpeakProvider } from 'qwik-speak';
99
import { RouterHead } from './components/router-head/router-head';
1010

1111
import globalStyles from './global.css?inline';
12-
import { config, translationFn } from './speak-config';
12+
import { config } from './speak-config';
13+
import { translationFn } from './speak-functions';
1314

1415
export default component$(() => {
1516
/**

apps/website/src/speak-config.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
import { server$ } from '@builder.io/qwik-city';
2-
import {
3-
LoadTranslationFn,
4-
SpeakConfig,
5-
TranslationFn,
6-
SpeakLocale,
7-
SpeakState,
8-
} from 'qwik-speak';
9-
1+
import { SpeakConfig, SpeakLocale, SpeakState } from 'qwik-speak';
102
export const LOCALES: Record<string, SpeakLocale> = {
113
'en-US': { lang: 'en-US', currency: 'USD', timeZone: 'America/Los_Angeles' },
124
'pt-BR': { lang: 'pt-BR', currency: 'BRL', timeZone: 'America/Sao_Paulo' },
@@ -35,20 +27,6 @@ export const config: SpeakConfig = {
3527
],
3628
};
3729

38-
const translationData = import.meta.glob('/src/i18n/**/*.json', {
39-
as: 'raw',
40-
eager: true,
41-
});
42-
43-
const loadTranslation$: LoadTranslationFn = server$(
44-
(lang: string, asset: string) =>
45-
JSON.parse(translationData[`/src/i18n/${lang}/${asset}.json`]),
46-
);
47-
48-
export const translationFn: TranslationFn = {
49-
loadTranslation$: loadTranslation$,
50-
};
51-
5230
export const localizedUrl = (url: string, speakState: SpeakState) => {
5331
const starturl = url.startsWith('/') ? url : `/${url}`;
5432
const endurl = starturl.endsWith('/') ? starturl : `${starturl}/`;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { LoadTranslationFn, TranslationFn } from 'qwik-speak';
2+
import { server$ } from '@builder.io/qwik-city';
3+
4+
const translationData = import.meta.glob('/src/i18n/**/*.json', {
5+
as: 'raw',
6+
eager: true,
7+
});
8+
9+
const loadTranslation$: LoadTranslationFn = server$(
10+
(lang: string, asset: string) =>
11+
JSON.parse(translationData[`/src/i18n/${lang}/${asset}.json`]),
12+
) as LoadTranslationFn;
13+
14+
export const translationFn: TranslationFn = {
15+
loadTranslation$: loadTranslation$,
16+
};

apps/website/vite.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export default defineConfig({
4444
'Cache-Control': 'public, max-age=600',
4545
},
4646
},
47-
test: {
48-
globals: true,
49-
cache: {
50-
dir: '../../node_modules/.vitest',
51-
},
52-
environment: 'node',
53-
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
54-
},
47+
// test: {
48+
// globals: true,
49+
// cache: {
50+
// dir: '../../node_modules/.vitest',
51+
// },
52+
// environment: 'node',
53+
// include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
54+
// },
5555
});

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
publish = "apps/website/client/dist"
2+
publish = "dist/apps/website/client"

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"react-dom": "18.2.0",
5858
"react-router-dom": "6.22.0",
5959
"regenerator-runtime": "0.14.1",
60+
"sharp": "^0.33.2",
6061
"tapable": "2.2.1",
6162
"tsup": "7.2.0",
6263
"typedoc": "0.25.8",
@@ -199,7 +200,7 @@
199200
"prettier": "3.0.3",
200201
"prettier-eslint": "16.2.0",
201202
"qwik-nx": "1.1.1",
202-
"qwik-speak": "0.19.0",
203+
"qwik-speak": "0.12.2",
203204
"react-refresh": "0.14.0",
204205
"rimraf": "^3.0.2",
205206
"rollup-plugin-copy": "3.5.0",
@@ -215,7 +216,7 @@
215216
"url-loader": "4.1.1",
216217
"verdaccio": "5.29.0",
217218
"vinyl-fs": "4.0.0",
218-
"vite": "4.4.11",
219+
"vite": "5.0.10",
219220
"vite-tsconfig-paths": "4.2.3",
220221
"vitest": "1.2.2",
221222
"vitest-fetch-mock": "^0.2.2",

0 commit comments

Comments
 (0)