fix: bun monorepo complex deps

This commit is contained in:
eric
2026-03-08 03:29:54 +01:00
parent 81e9b93914
commit d7a6d6b0ba
24 changed files with 804 additions and 10 deletions

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Paraglide monorepo app A</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,9 @@
import * as messages from "@workspace/i18n/messages";
import { setLocale } from "@workspace/i18n/runtime";
setLocale("sv");
const app = document.querySelector("#app");
if (app) {
app.textContent = `${messages.hero()} :: ${messages.hello()}`;
}

View File

@@ -0,0 +1,14 @@
{
"name": "paraglide-monorepo-app-a",
"private": true,
"type": "module",
"scripts": {
"build": "vite build"
},
"dependencies": {
"@workspace/i18n": "workspace:*"
},
"devDependencies": {
"vite": "catalog:"
}
}

View File

@@ -0,0 +1,10 @@
export default {
resolve: {
preserveSymlinks: true,
},
optimizeDeps: {
esbuildOptions: {
preserveSymlinks: true,
},
},
};

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Paraglide monorepo app B</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,6 @@
import * as messages from "@workspace/i18n/messages";
const app = document.querySelector("#app");
if (app) {
app.textContent = `${messages.hero({ locale: "en" })} :: ${messages.hello({ locale: "en" })}`;
}

View File

@@ -0,0 +1,14 @@
{
"name": "paraglide-monorepo-app-b",
"private": true,
"type": "module",
"scripts": {
"build": "vite build"
},
"dependencies": {
"@workspace/i18n": "workspace:*"
},
"devDependencies": {
"vite": "catalog:"
}
}

View File

@@ -0,0 +1,10 @@
export default {
resolve: {
preserveSymlinks: true,
},
optimizeDeps: {
esbuildOptions: {
preserveSymlinks: true,
},
},
};

View File

@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"hello": "Hello from the shared translations",
"hero": "One shared translation source"
}

View File

@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"hello": "Hej fran de delade oversattningarna",
"hero": "En gemensam oversattningskalla"
}

View File

@@ -0,0 +1,15 @@
{
"name": "@workspace/i18n",
"private": true,
"type": "module",
"exports": {
"./messages": "./src/paraglide/messages.js",
"./runtime": "./src/paraglide/runtime.js"
},
"scripts": {
"build": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide"
},
"devDependencies": {
"@inlang/paraglide-js": "catalog:"
}
}

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://inlang.com/schema/project-settings",
"baseLocale": "en",
"locales": [
"en",
"sv"
],
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@4/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@2/dist/index.js"
],
"plugin.inlang.messageFormat": {
"pathPattern": "./messages/{locale}.json"
}
}