@vitnode/core 2.0.0-canary.1 → 2.0.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/scripts.js +50 -46
- package/dist/src/config.js +1 -1
- package/dist/src/framework/vite/index.d.ts +2 -0
- package/dist/src/framework/vite/index.d.ts.map +1 -1
- package/dist/src/framework/vite/index.js +1 -1
- package/dist/src/framework/vite/optimize-deps.d.ts +1 -1
- package/dist/src/framework/vite/optimize-deps.d.ts.map +1 -1
- package/dist/src/framework/vite/optimize-deps.js +1 -1
- package/dist/src/framework/vite/vitnode.d.ts +7 -0
- package/dist/src/framework/vite/vitnode.d.ts.map +1 -0
- package/dist/src/framework/vite/vitnode.js +1 -0
- package/dist/src/tanstack/i18n/messages.d.ts +3 -1
- package/dist/src/tanstack/i18n/messages.d.ts.map +1 -1
- package/dist/src/tanstack/i18n/messages.js +1 -1
- package/dist/src/tanstack/i18n/server.d.ts +1 -1
- package/dist/src/tanstack/i18n/server.d.ts.map +1 -1
- package/dist/src/tanstack/start/create-start.d.ts +9 -0
- package/dist/src/tanstack/start/create-start.d.ts.map +1 -0
- package/dist/src/tanstack/start/create-start.js +1 -0
- package/dist/src/tanstack/start/document-headers.d.ts +4 -0
- package/dist/src/tanstack/start/document-headers.d.ts.map +1 -0
- package/dist/src/tanstack/start/document-headers.js +1 -0
- package/dist/src/tanstack/start/index.d.ts +4 -0
- package/dist/src/tanstack/start/index.d.ts.map +1 -0
- package/dist/src/tanstack/start/index.js +1 -0
- package/dist/src/tanstack/start/locale-middleware.d.ts +7 -0
- package/dist/src/tanstack/start/locale-middleware.d.ts.map +1 -0
- package/dist/src/tanstack/start/locale-middleware.js +1 -0
- package/dist/src/vitnode.config.d.ts +8 -2
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/src/vitnode.config.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/test-fixtures/config-split/vitnode.config.ts +23 -0
- package/test-fixtures/config-split/vitnode.server.config.ts +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitnode/core",
|
|
3
|
-
"version": "2.0.0-canary.
|
|
3
|
+
"version": "2.0.0-canary.2",
|
|
4
4
|
"description": "Core package for VitNode, providing essential functionalities and configurations.",
|
|
5
5
|
"author": "VitNode Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"vite": "^8.1.5",
|
|
86
86
|
"vitest": "^4.1.10",
|
|
87
87
|
"zod": "^4.4.3",
|
|
88
|
-
"@vitnode/config": "2.0.0-canary.
|
|
88
|
+
"@vitnode/config": "2.0.0-canary.2"
|
|
89
89
|
},
|
|
90
90
|
"bin": {
|
|
91
91
|
"vitnode": "./cli.mjs"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { buildConfig } from "../../src/vitnode.config";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A shared config exactly as an app writes one - the browser-safe half.
|
|
5
|
+
*
|
|
6
|
+
* Imports nothing but `buildConfig`, which is the whole claim under test: Vite
|
|
7
|
+
* loads this file with `jiti` to discover the configured plugins, and the
|
|
8
|
+
* document shell holds it in the browser bundle. `vitnode.server.config.ts`
|
|
9
|
+
* beside it throws on import, so a discovery pass that reached the server half
|
|
10
|
+
* would fail loudly instead of merely being slower than it should be.
|
|
11
|
+
*/
|
|
12
|
+
export const vitNodeConfig = buildConfig({
|
|
13
|
+
i18n: {
|
|
14
|
+
defaultLocale: "en",
|
|
15
|
+
locales: [
|
|
16
|
+
{ code: "en", name: "English" },
|
|
17
|
+
{ code: "pl", name: "Polski" },
|
|
18
|
+
],
|
|
19
|
+
timeZone: "UTC",
|
|
20
|
+
},
|
|
21
|
+
metadata: { shortTitle: "Fixture", title: "Fixture" },
|
|
22
|
+
plugins: [{ pluginId: "@acme/blog" }, { pluginId: "@acme/docs" }],
|
|
23
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server-only half, rigged to fail if anything build-time reaches it.
|
|
3
|
+
*
|
|
4
|
+
* A real one carries `() => import("./locales/...")` loaders that read a
|
|
5
|
+
* package's build output, plus the `server-only` marker. This throws at module
|
|
6
|
+
* scope instead, which is how `shared-config-discovery.test.ts` proves the
|
|
7
|
+
* plugin generator never loads it: an assertion about a call count nobody owns
|
|
8
|
+
* would pass the day the generator started importing this file and stopped
|
|
9
|
+
* calling anything on it.
|
|
10
|
+
*/
|
|
11
|
+
throw new Error(
|
|
12
|
+
"the server-only config was loaded by something that should only read the shared one",
|
|
13
|
+
);
|