@wervt/nuxt 0.1.0 → 0.2.0
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/module.js +19 -2
- package/package.json +2 -1
package/dist/module.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveAppName, setupDev } from "./dev.js";
|
|
2
|
-
import { addImports, addPlugin, addServerHandler, createResolver, defineNuxtModule, hasNuxtModule } from "nuxt/kit";
|
|
2
|
+
import { addImports, addPlugin, addServerHandler, createResolver, defineNuxtModule, hasNuxtModule, installModule } from "nuxt/kit";
|
|
3
3
|
import { builtinModules } from "node:module";
|
|
4
|
+
import evlog from "evlog/nuxt";
|
|
4
5
|
//#region src/module.ts
|
|
5
6
|
const CONTENT_DATABASE = {
|
|
6
7
|
type: "postgres",
|
|
@@ -15,6 +16,22 @@ var module_default = defineNuxtModule({
|
|
|
15
16
|
const resolver = createResolver(import.meta.url);
|
|
16
17
|
const nitro = nuxt.options.nitro;
|
|
17
18
|
if (!nuxt.options.dev) nitro.preset ||= "deno-server";
|
|
19
|
+
if (!hasNuxtModule("evlog/nuxt", nuxt)) {
|
|
20
|
+
const app = await resolveAppName(nuxt.options.rootDir, options.app);
|
|
21
|
+
const config = nuxt.options;
|
|
22
|
+
config.evlog = {
|
|
23
|
+
env: { service: app },
|
|
24
|
+
redact: true,
|
|
25
|
+
exclude: [
|
|
26
|
+
"/_wervt/**",
|
|
27
|
+
"/_nuxt/**",
|
|
28
|
+
"/__nuxt_error",
|
|
29
|
+
"/_fonts/**"
|
|
30
|
+
],
|
|
31
|
+
...config.evlog
|
|
32
|
+
};
|
|
33
|
+
await installModule(evlog, void 0, nuxt);
|
|
34
|
+
}
|
|
18
35
|
const useContentDatabase = !nuxt.options.dev && hasNuxtModule("@nuxt/content", nuxt);
|
|
19
36
|
if (useContentDatabase) {
|
|
20
37
|
const options = nuxt.options;
|
|
@@ -30,7 +47,7 @@ var module_default = defineNuxtModule({
|
|
|
30
47
|
inline: [
|
|
31
48
|
...options.externals?.inline ?? [],
|
|
32
49
|
resolver.resolve("./runtime"),
|
|
33
|
-
/(^|\/node_modules\/)(drizzle-orm|postgres|valibot|@electric-sql\/client)(\/|$)/
|
|
50
|
+
/(^|\/node_modules\/)(drizzle-orm|postgres|valibot|@electric-sql\/client|evlog)(\/|$)/
|
|
34
51
|
]
|
|
35
52
|
};
|
|
36
53
|
const exclude = options.esbuild?.options?.exclude ?? /node_modules/;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wervt/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Nuxt module for apps hosted on wervt: database, live data and runtime setup.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"drizzle",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@electric-sql/client": "^1.5.28",
|
|
42
|
+
"evlog": "^2.30.0",
|
|
42
43
|
"postgres": "^3.4.9",
|
|
43
44
|
"valibot": "^1.5.0"
|
|
44
45
|
},
|