@xleddyl/nuxt-cms 0.1.52 → 0.1.53
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.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { introspectionFromSchema, buildSchema } from 'graphql';
|
|
|
10
10
|
import { minifyIntrospection, outputIntrospectionFile } from 'gql.tada/internal';
|
|
11
11
|
import { createJiti } from 'jiti';
|
|
12
12
|
import { typeName, blockTypeName, blocksFieldTypeName, renderGraphqlSdl } from '../dist/runtime/shared/graphql-sdl.js';
|
|
13
|
+
import { migrationsDirFor } from '../dist/runtime/shared/migrations-dir.js';
|
|
13
14
|
import { isTranslatableField, isTranslatableMediaField, isMultiSelect, pageAllFields, PAGE_PATH_FIELD, pageRoutes, fieldConditions, isRequiredField, pageFields, isPrivateField, entryFieldsFor, mediaTypeFilter, DEFAULT_MEDIA_MAX_FILE_SIZE } from '../dist/runtime/shared/index.js';
|
|
14
15
|
import { scanMediaDirectory, readMediaFileMeta } from '../dist/runtime/server/utils/media-sync.js';
|
|
15
16
|
import { createHash } from 'node:crypto';
|
|
@@ -1126,7 +1127,7 @@ const module$1 = defineNuxtModule({
|
|
|
1126
1127
|
}
|
|
1127
1128
|
const dialect = driver === "postgres" ? "postgresql" : driver === "libsql" ? "turso" : "sqlite";
|
|
1128
1129
|
const resolvedDbPath = isAbsolute(dbPath) ? dbPath : resolve(nuxt.options.rootDir, dbPath);
|
|
1129
|
-
const migrationsDir =
|
|
1130
|
+
const migrationsDir = migrationsDirFor(nuxt.options.rootDir, driver);
|
|
1130
1131
|
const relativeSchemaPath = relative(nuxt.options.rootDir, schemaTemplate.dst);
|
|
1131
1132
|
const relativeMigrationsDir = relative(nuxt.options.rootDir, migrationsDir);
|
|
1132
1133
|
const toPosix = (path) => path.replace(/\\/g, "/");
|
package/dist/runtime/seed.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdirSync } from "node:fs";
|
|
2
2
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
3
|
+
import { migrationsDirFor } from "./shared/migrations-dir.js";
|
|
3
4
|
import { resolvePageRoutes, routePathsFromDir } from "./shared/page-routes.js";
|
|
4
5
|
import { customId, ID_LENGTH } from "./server/utils/custom-id.js";
|
|
5
6
|
export { customId, ID_LENGTH };
|
|
@@ -24,7 +25,7 @@ export async function createCmsSeeder(opts = {}) {
|
|
|
24
25
|
const driver = opts.driver ?? process.env.NUXT_CMS_DATABASE_DRIVER ?? inferDriver(url);
|
|
25
26
|
const dbPath = opts.dbPath ?? process.env.NUXT_CMS_DATABASE_PATH ?? "data/cms.db";
|
|
26
27
|
const resolvedDbPath = isAbsolute(dbPath) ? dbPath : resolve(root, dbPath);
|
|
27
|
-
const migrationsFolder = opts.migrationsDir ??
|
|
28
|
+
const migrationsFolder = opts.migrationsDir ?? migrationsDirFor(root, driver);
|
|
28
29
|
if (driver === "libsql") {
|
|
29
30
|
const { migrate: migrate2 } = await import("drizzle-orm/libsql/migrator");
|
|
30
31
|
const dbUrl = url || `file:${resolvedDbPath}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function migrationsDirFor(root: string, driver: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
const MIGRATIONS_ROOT = "server/db/migrations";
|
|
4
|
+
export function migrationsDirFor(root, driver) {
|
|
5
|
+
if (driver === "postgres") return resolve(root, `${MIGRATIONS_ROOT}/postgres`);
|
|
6
|
+
const perDriver = resolve(root, `${MIGRATIONS_ROOT}/${driver}`);
|
|
7
|
+
if (driver !== "sqlite" && existsSync(perDriver)) return perDriver;
|
|
8
|
+
return resolve(root, `${MIGRATIONS_ROOT}/sqlite`);
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xleddyl/nuxt-cms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"description": "Lightweight CMS that ships with your Nuxt app: runs on the Nitro server, content types defined in code, /cms admin panel, GraphQL API, SQLite or Postgres. No external CMS needed!",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Edoardo Alberti (https://github.com/xleddyl)",
|