Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update front dependencies #171

Merged
merged 7 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,050 changes: 1,240 additions & 810 deletions apps/front/package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions apps/front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@cher-ami/css-flat": "^1.0.1",
"@cher-ami/debug": "^1.2.0",
"@cher-ami/router": "^3.4.0",
"@cher-ami/router": "^3.5.0",
"@cher-ami/utils": "^1.4.1",
"cross-fetch": "^4.0.0",
"history": "^5.3.0",
Expand All @@ -27,26 +27,26 @@
},
"devDependencies": {
"@cher-ami/mfs": "^0.2.0",
"@types/events": "^3.0.2",
"@types/node": "^20.8.10",
"@types/react": "^18.2.34",
"@types/react-dom": "^18.2.14",
"@vitejs/plugin-legacy": "^4.1.1",
"@vitejs/plugin-react-swc": "^3.4.1",
"autoprefixer": "^10.4.16",
"@types/events": "^3.0.3",
"@types/node": "^20.11.16",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-legacy": "^5.3.0",
"@vitejs/plugin-react-swc": "^3.6.0",
"autoprefixer": "^10.4.17",
"chalk": "^5.3.0",
"compression": "^1.7.4",
"express": "^4.18.2",
"husky": "^8.0.3",
"husky": "^9.0.10",
"ip": "^1.1.8",
"less": "^4.2.0",
"portfinder-sync": "^0.0.2",
"rollup-plugin-visualizer": "^5.9.2",
"terser": "^5.24.0",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vite-plugin-checker": "^0.6.2",
"vitest": "^0.34.6"
"rollup-plugin-visualizer": "^5.12.0",
"terser": "^5.27.0",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vite-plugin-checker": "^0.6.4",
"vitest": "^1.2.2"
},
"optionalDependencies": {
"esbuild-android-arm64": "^0.15.18",
Expand Down
12 changes: 8 additions & 4 deletions apps/front/prerender/__tests__/ManifestParser.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { expect, it } from "vitest"
import { ManifestParser } from "../helpers/ManifestParser"
import * as mfs from "@cher-ami/mfs"
import config from "../../config/config.js"
import path from "path"
import { fileURLToPath } from "url"
import * as fs from "fs"
const url = import.meta.url

// @ts-ignore
const manifestRaw = await mfs.readFile(`${config.outDirStatic}/manifest.json`)
const manifestRaw = fs.readFileSync(
path.join(path.dirname(fileURLToPath(url)), `fixtures/manifest.json`),
{ encoding: "utf8" },
)

it("should return assets list", () => {
const assets = ManifestParser.getAssets(manifestRaw)
Expand Down
2 changes: 1 addition & 1 deletion apps/front/prerender/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const prerender = async (urls: string[], outDirStatic = config.outDirStat

// get script tags to inject in render
const base = process.env.VITE_APP_BASE || loadEnv("", process.cwd(), "").VITE_APP_BASE
const manifest = (await mfs.readFile(`${outDirStatic}/manifest.json`)) as string
const manifest = (await mfs.readFile(`${outDirStatic}/.vite/manifest.json`)) as string
const scriptTags = ManifestParser.getScriptTagFromManifest(manifest, base)

// pre-render each route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function CookiesBanner(props: IProps) {
// targets script DOM by ids
const $gTagManagerScript = document.getElementById("__gaTagManagerScript")
const $gTagManagerDataLayerScript = document.getElementById(
"__gTagManagerDataLayerScript"
"__gTagManagerDataLayerScript",
)
const $gTagManagerNoScript = document.getElementById("__gaTagManagerNoScript")

Expand Down
21 changes: 14 additions & 7 deletions apps/front/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"allowJs": true,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,

/* Linting */
"strict": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": false,

"composite": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "Node",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
Expand All @@ -22,5 +29,5 @@
"~/*": ["./*"]
}
},
"include": ["./src", "./prerender", "./config"]
"include": ["src", "prerender", "config"]
}
1 change: 1 addition & 0 deletions apps/front/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
cors: true,
host: true,
port: process.env.PORT as any,
// @ts-ignore
https: protocol === "https",
origin: `${protocol}://${process.env.HOST}:${process.env.PORT}`,
watch: {
Expand Down
Loading
Loading