qarpeo 0.4.6 → 0.4.8
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/chunks/manifest.get.mjs +8 -165
- package/dist/cli/index.mjs +173 -8
- package/dist/module.d.ts +1 -1
- package/dist/module.mjs +118 -64
- package/dist/runtime/server/db/cms-schema.d.ts +1 -4
- package/dist/runtime/server/db/cms-schema.mjs +1 -21
- package/dist/utils/cms-table-names.d.ts +4 -0
- package/dist/utils/features.d.ts +74 -0
- package/dist/utils/local-db.d.ts +1 -1
- package/package.json +26 -6
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import { existsSync, statSync, readdirSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
-
import { drizzle } from 'drizzle-orm/node-sqlite';
|
|
5
4
|
import { resolve, dirname, join, extname, basename, relative } from 'pathe';
|
|
6
5
|
import { stdin, stdout } from 'node:process';
|
|
7
6
|
import readline from 'node:readline/promises';
|
|
8
7
|
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import { snakeCase, integer, text, index, uniqueIndex } from 'drizzle-orm/sqlite-core';
|
|
10
8
|
import { useRuntimeConfig, defineEventHandler } from 'nuxt/server';
|
|
11
9
|
import { mkdir, writeFile, readFile } from 'node:fs/promises';
|
|
12
10
|
import { defu } from 'defu';
|
|
13
11
|
|
|
14
|
-
const version = "0.4.
|
|
12
|
+
const version = "0.4.7";
|
|
15
13
|
|
|
16
14
|
function resolveBindingName(service, override, defaultName) {
|
|
17
15
|
if (override && typeof override === "string") {
|
|
@@ -114,9 +112,8 @@ function checkDrizzleVersion(rootDir) {
|
|
|
114
112
|
version,
|
|
115
113
|
isRC: false,
|
|
116
114
|
error: `[qarpeo] Outdated "drizzle-orm" detected in your project (v${version}).
|
|
117
|
-
qarpeo requires Drizzle ORM v1.0.0 RC
|
|
118
|
-
|
|
119
|
-
vp add drizzle-orm@rc`
|
|
115
|
+
qarpeo requires Drizzle ORM v1.0.0 RC or newer.
|
|
116
|
+
Run: qp add drizzle`
|
|
120
117
|
};
|
|
121
118
|
}
|
|
122
119
|
return {
|
|
@@ -128,8 +125,8 @@ Please remove or upgrade your project's drizzle-orm dependency:
|
|
|
128
125
|
return {
|
|
129
126
|
installed: false,
|
|
130
127
|
isRC: false,
|
|
131
|
-
error: `[qarpeo] Drizzle ORM is enabled
|
|
132
|
-
|
|
128
|
+
error: `[qarpeo] Drizzle ORM is enabled, but "drizzle-orm" is not installed.
|
|
129
|
+
Run: qp add drizzle`
|
|
133
130
|
};
|
|
134
131
|
}
|
|
135
132
|
}
|
|
@@ -787,7 +784,8 @@ Please apply migrations first: qp db:migrate`
|
|
|
787
784
|
console.warn(`[qarpeo] Warning: Failed to import schema file ${file}: ${err?.message || err}`);
|
|
788
785
|
}
|
|
789
786
|
}
|
|
790
|
-
const
|
|
787
|
+
const { drizzle: initDrizzle } = await import('drizzle-orm/node-sqlite');
|
|
788
|
+
const db = initDrizzle(sqlitePath);
|
|
791
789
|
let customSeedPath = null;
|
|
792
790
|
const seedCandidates = target.isPrimary ? [
|
|
793
791
|
resolve(target.dir, "seed.ts"),
|
|
@@ -1260,161 +1258,6 @@ function getActiveCmsTableNames(cms, prefixOrOptions) {
|
|
|
1260
1258
|
resolveTableName("cms_subscriber", prefixOrOptions)
|
|
1261
1259
|
];
|
|
1262
1260
|
}
|
|
1263
|
-
const collectionTbl = resolveTableName("cms_collection");
|
|
1264
|
-
const entryTbl = resolveTableName("cms_entry");
|
|
1265
|
-
const revisionTbl = resolveTableName("cms_revision");
|
|
1266
|
-
const categoryTbl = resolveTableName("cms_category");
|
|
1267
|
-
const tagTbl = resolveTableName("cms_tag");
|
|
1268
|
-
const bookmarkTbl = resolveTableName("cms_bookmark");
|
|
1269
|
-
const subscriberTbl = resolveTableName("cms_subscriber");
|
|
1270
|
-
const cmsCollection = snakeCase.table(collectionTbl, {
|
|
1271
|
-
id: text().primaryKey(),
|
|
1272
|
-
tenantId: text(),
|
|
1273
|
-
name: text().notNull(),
|
|
1274
|
-
description: text(),
|
|
1275
|
-
schemaJson: text().notNull().default("{}"),
|
|
1276
|
-
source: text().notNull().default("db"),
|
|
1277
|
-
order: integer().notNull().default(0),
|
|
1278
|
-
createdAt: integer().notNull(),
|
|
1279
|
-
updatedAt: integer().notNull()
|
|
1280
|
-
});
|
|
1281
|
-
const cmsCollections = cmsCollection;
|
|
1282
|
-
const cmsEntry = snakeCase.table(
|
|
1283
|
-
entryTbl,
|
|
1284
|
-
{
|
|
1285
|
-
id: text().primaryKey(),
|
|
1286
|
-
tenantId: text(),
|
|
1287
|
-
collectionId: text().notNull(),
|
|
1288
|
-
slug: text().notNull(),
|
|
1289
|
-
title: text().notNull(),
|
|
1290
|
-
description: text(),
|
|
1291
|
-
coverImage: text(),
|
|
1292
|
-
tags: text(),
|
|
1293
|
-
order: integer().notNull().default(0),
|
|
1294
|
-
contentMd: text().notNull().default(""),
|
|
1295
|
-
contentHtml: text().notNull().default(""),
|
|
1296
|
-
metadataJson: text().default("{}"),
|
|
1297
|
-
status: text().notNull().default("draft"),
|
|
1298
|
-
source: text().notNull().default("db"),
|
|
1299
|
-
path: text(),
|
|
1300
|
-
filePath: text(),
|
|
1301
|
-
contentHash: text(),
|
|
1302
|
-
authorId: text(),
|
|
1303
|
-
categoryId: text(),
|
|
1304
|
-
subCategoryId: text(),
|
|
1305
|
-
featured: integer({ mode: "boolean" }).notNull().default(false),
|
|
1306
|
-
viewCount: integer().notNull().default(0),
|
|
1307
|
-
readingTime: integer(),
|
|
1308
|
-
locale: text().notNull().default("en"),
|
|
1309
|
-
version: text().notNull().default("latest"),
|
|
1310
|
-
publishedAt: integer(),
|
|
1311
|
-
createdAt: integer().notNull(),
|
|
1312
|
-
updatedAt: integer().notNull()
|
|
1313
|
-
},
|
|
1314
|
-
(t) => [
|
|
1315
|
-
index(resolveIndexName(entryTbl, "collection")).on(t.collectionId),
|
|
1316
|
-
index(resolveIndexName(entryTbl, "tenant")).on(t.tenantId, t.collectionId),
|
|
1317
|
-
uniqueIndex(resolveIndexName(entryTbl, "slug")).on(t.collectionId, t.slug),
|
|
1318
|
-
index(resolveIndexName(entryTbl, "status")).on(t.status),
|
|
1319
|
-
index(resolveIndexName(entryTbl, "order")).on(t.collectionId, t.order),
|
|
1320
|
-
index(resolveIndexName(entryTbl, "path")).on(t.collectionId, t.path),
|
|
1321
|
-
index(resolveIndexName(entryTbl, "locale")).on(t.collectionId, t.locale),
|
|
1322
|
-
index(resolveIndexName(entryTbl, "path_locale")).on(t.path, t.locale),
|
|
1323
|
-
index(resolveIndexName(entryTbl, "category")).on(t.collectionId, t.categoryId),
|
|
1324
|
-
index(resolveIndexName(entryTbl, "featured")).on(t.collectionId, t.featured),
|
|
1325
|
-
index(resolveIndexName(entryTbl, "published_at")).on(t.publishedAt),
|
|
1326
|
-
index(resolveIndexName(entryTbl, "list")).on(t.collectionId, t.status, t.publishedAt)
|
|
1327
|
-
]
|
|
1328
|
-
);
|
|
1329
|
-
const cmsEntries = cmsEntry;
|
|
1330
|
-
const cmsRevision = snakeCase.table(
|
|
1331
|
-
revisionTbl,
|
|
1332
|
-
{
|
|
1333
|
-
id: text().primaryKey(),
|
|
1334
|
-
entryId: text().notNull(),
|
|
1335
|
-
title: text().notNull(),
|
|
1336
|
-
contentMd: text().notNull(),
|
|
1337
|
-
metadataJson: text().default("{}"),
|
|
1338
|
-
authorId: text(),
|
|
1339
|
-
createdAt: integer().notNull()
|
|
1340
|
-
},
|
|
1341
|
-
(t) => [index(resolveIndexName(revisionTbl, "entry")).on(t.entryId, t.createdAt)]
|
|
1342
|
-
);
|
|
1343
|
-
const cmsRevisions = cmsRevision;
|
|
1344
|
-
const cmsCategory = snakeCase.table(
|
|
1345
|
-
categoryTbl,
|
|
1346
|
-
{
|
|
1347
|
-
id: text().primaryKey(),
|
|
1348
|
-
tenantId: text(),
|
|
1349
|
-
name: text().notNull(),
|
|
1350
|
-
slug: text().notNull(),
|
|
1351
|
-
description: text(),
|
|
1352
|
-
icon: text(),
|
|
1353
|
-
parentId: text(),
|
|
1354
|
-
order: integer().notNull().default(0),
|
|
1355
|
-
metadataJson: text().default("{}"),
|
|
1356
|
-
createdAt: integer().notNull(),
|
|
1357
|
-
updatedAt: integer().notNull()
|
|
1358
|
-
},
|
|
1359
|
-
(t) => [
|
|
1360
|
-
uniqueIndex(resolveIndexName(categoryTbl, "slug")).on(t.tenantId, t.slug),
|
|
1361
|
-
index(resolveIndexName(categoryTbl, "parent")).on(t.parentId),
|
|
1362
|
-
index(resolveIndexName(categoryTbl, "tenant")).on(t.tenantId)
|
|
1363
|
-
]
|
|
1364
|
-
);
|
|
1365
|
-
const cmsCategories = cmsCategory;
|
|
1366
|
-
const cmsTag = snakeCase.table(
|
|
1367
|
-
tagTbl,
|
|
1368
|
-
{
|
|
1369
|
-
id: text().primaryKey(),
|
|
1370
|
-
tenantId: text(),
|
|
1371
|
-
name: text().notNull(),
|
|
1372
|
-
slug: text().notNull(),
|
|
1373
|
-
description: text(),
|
|
1374
|
-
count: integer().notNull().default(0),
|
|
1375
|
-
metadataJson: text().default("{}"),
|
|
1376
|
-
createdAt: integer().notNull(),
|
|
1377
|
-
updatedAt: integer().notNull()
|
|
1378
|
-
},
|
|
1379
|
-
(t) => [
|
|
1380
|
-
uniqueIndex(resolveIndexName(tagTbl, "slug")).on(t.tenantId, t.slug),
|
|
1381
|
-
index(resolveIndexName(tagTbl, "tenant")).on(t.tenantId)
|
|
1382
|
-
]
|
|
1383
|
-
);
|
|
1384
|
-
const cmsTags = cmsTag;
|
|
1385
|
-
const cmsBookmark = snakeCase.table(
|
|
1386
|
-
bookmarkTbl,
|
|
1387
|
-
{
|
|
1388
|
-
id: text().primaryKey(),
|
|
1389
|
-
tenantId: text(),
|
|
1390
|
-
userId: text().notNull(),
|
|
1391
|
-
entryId: text().notNull(),
|
|
1392
|
-
createdAt: integer().notNull()
|
|
1393
|
-
},
|
|
1394
|
-
(t) => [
|
|
1395
|
-
index(resolveIndexName(bookmarkTbl, "user")).on(t.userId),
|
|
1396
|
-
index(resolveIndexName(bookmarkTbl, "entry")).on(t.entryId),
|
|
1397
|
-
uniqueIndex(resolveIndexName(bookmarkTbl, "unique")).on(t.tenantId, t.userId, t.entryId)
|
|
1398
|
-
]
|
|
1399
|
-
);
|
|
1400
|
-
const cmsBookmarks = cmsBookmark;
|
|
1401
|
-
const cmsSubscriber = snakeCase.table(
|
|
1402
|
-
subscriberTbl,
|
|
1403
|
-
{
|
|
1404
|
-
id: text().primaryKey(),
|
|
1405
|
-
tenantId: text(),
|
|
1406
|
-
email: text().notNull(),
|
|
1407
|
-
status: text().notNull().default("active"),
|
|
1408
|
-
source: text().default("website"),
|
|
1409
|
-
createdAt: integer().notNull()
|
|
1410
|
-
},
|
|
1411
|
-
(t) => [
|
|
1412
|
-
uniqueIndex(resolveIndexName(subscriberTbl, "unique_email")).on(t.tenantId, t.email),
|
|
1413
|
-
index(resolveIndexName(subscriberTbl, "status")).on(t.status),
|
|
1414
|
-
index(resolveIndexName(subscriberTbl, "tenant")).on(t.tenantId)
|
|
1415
|
-
]
|
|
1416
|
-
);
|
|
1417
|
-
const cmsSubscribers = cmsSubscriber;
|
|
1418
1261
|
|
|
1419
1262
|
const ALL_STORE_TABLE_NAMES = [
|
|
1420
1263
|
"store_product",
|
|
@@ -2886,4 +2729,4 @@ defineEventHandler((event) => {
|
|
|
2886
2729
|
);
|
|
2887
2730
|
});
|
|
2888
2731
|
|
|
2889
|
-
export { ALL_CMS_TABLE_NAMES as A, buildDevWranglerConfig as B, generateAuthSchema as C, generateCommentsSchema as D, generateStoreSchema as E, findScheduledTasks as F, formatDlxCommand as G, resolveBindingName as H, createWranglerConfig as I, generateDevWranglerConfig as J, applyD1Migrations as K, findQueueFiles as L, findDurableObjectFiles as M,
|
|
2732
|
+
export { ALL_CMS_TABLE_NAMES as A, buildDevWranglerConfig as B, generateAuthSchema as C, generateCommentsSchema as D, generateStoreSchema as E, findScheduledTasks as F, formatDlxCommand as G, resolveBindingName as H, createWranglerConfig as I, generateDevWranglerConfig as J, applyD1Migrations as K, findQueueFiles as L, findDurableObjectFiles as M, isPackageInstalled as N, getActiveCmsTableNames as O, getActiveCommentsTableNames as P, getActiveStoreTableNames as Q, hasDatabaseSchema as R, localDb as S, authSchema as T, wrangler as U, resolveBinaryPath as a, getActiveAuthTableNames as b, ALL_STORE_TABLE_NAMES as c, ALL_COMMENTS_TABLE_NAMES as d, ensurePackage as e, discoverDatabases as f, getLocalDatabaseContext as g, findLocalD1Database as h, spawnBinSync as i, getJiti as j, resolveProjectName as k, checkDrizzleVersion as l, findSchemaFiles as m, findAgentFiles as n, findToolFiles as o, findBotFiles as p, findMcpFiles as q, resolveDatabaseTarget as r, scanSchemaExports as s, findJobFiles as t, findWorkflowFiles as u, findEmailHandlerFiles as v, buildQarpeoManifest as w, version as x, resolveTableName as y, resolveIndexName as z };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,23 +1,185 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineCommand, runMain } from 'citty';
|
|
3
3
|
import { r as resolveDatabaseTarget, a as resolveBinaryPath, e as ensurePackage, g as getLocalDatabaseContext, b as getActiveAuthTableNames, A as ALL_CMS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, s as scanSchemaExports, f as discoverDatabases, h as findLocalD1Database, i as spawnBinSync, j as getJiti, k as resolveProjectName, l as checkDrizzleVersion, m as findSchemaFiles, n as findAgentFiles, o as findToolFiles, p as findBotFiles, q as findMcpFiles, t as findJobFiles, u as findWorkflowFiles, v as findEmailHandlerFiles, w as buildQarpeoManifest, x as version } from '../chunks/manifest.get.mjs';
|
|
4
|
+
import { resolve, join, dirname, relative, basename, extname } from 'pathe';
|
|
4
5
|
import { spawnSync, spawn } from 'node:child_process';
|
|
5
6
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, rmSync, readdirSync, statSync } from 'node:fs';
|
|
6
7
|
import { loadNuxtConfig } from '@nuxt/kit';
|
|
7
|
-
import { resolve, join, dirname, relative, basename, extname } from 'pathe';
|
|
8
|
-
import { reset, seed } from 'drizzle-seed';
|
|
9
8
|
import { stdin, stdout } from 'node:process';
|
|
10
9
|
import readline from 'node:readline/promises';
|
|
11
10
|
import { hostname, homedir } from 'node:os';
|
|
12
11
|
import { randomBytes } from 'node:crypto';
|
|
13
12
|
import 'node:module';
|
|
14
|
-
import 'drizzle-orm/node-sqlite';
|
|
15
13
|
import 'node:url';
|
|
16
|
-
import 'drizzle-orm/sqlite-core';
|
|
17
14
|
import 'nuxt/server';
|
|
18
15
|
import 'node:fs/promises';
|
|
19
16
|
import 'defu';
|
|
20
17
|
|
|
18
|
+
const FEATURE_DEPS = {
|
|
19
|
+
cms: {
|
|
20
|
+
description: "Edge CMS markdown/syntax highlighting (@comark/vue, comark, shiki)",
|
|
21
|
+
dependencies: {
|
|
22
|
+
"@comark/vue": "0.9.1",
|
|
23
|
+
comark: "0.9.1",
|
|
24
|
+
shiki: "4.6.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
drizzle: {
|
|
28
|
+
description: "Drizzle ORM, Drizzle Kit, and Drizzle Seed",
|
|
29
|
+
dependencies: {
|
|
30
|
+
"drizzle-orm": "1.0.0-rc.5"
|
|
31
|
+
},
|
|
32
|
+
devDependencies: {
|
|
33
|
+
"drizzle-kit": "1.0.0-rc.5",
|
|
34
|
+
"drizzle-seed": "1.0.0-rc.5"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
auth: {
|
|
38
|
+
description: "Better Auth + Drizzle adapter",
|
|
39
|
+
dependencies: {
|
|
40
|
+
"better-auth": "1.7.20",
|
|
41
|
+
"@better-auth/drizzle-adapter": "1.7.20"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
webauthn: {
|
|
45
|
+
description: "Passkey / WebAuthn server support",
|
|
46
|
+
dependencies: {
|
|
47
|
+
"@simplewebauthn/server": "14.0.3"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
browser: {
|
|
51
|
+
description: "Cloudflare Browser Rendering (@cloudflare/puppeteer)",
|
|
52
|
+
dependencies: {
|
|
53
|
+
"@cloudflare/puppeteer": "1.4.0"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
fate: {
|
|
57
|
+
description: "Normalized data-fetching client (@nkzw/fate, vue-fate)",
|
|
58
|
+
dependencies: {
|
|
59
|
+
"@nkzw/fate": "1.0.0",
|
|
60
|
+
"vue-fate": "1.0.0"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
postgres: {
|
|
64
|
+
description: "PostgreSQL / Hyperdrive driver",
|
|
65
|
+
dependencies: {
|
|
66
|
+
postgres: "4.1.1"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function getFeatureNames() {
|
|
71
|
+
return Object.keys(FEATURE_DEPS);
|
|
72
|
+
}
|
|
73
|
+
function toVersionedSpecs(pkgMap) {
|
|
74
|
+
if (!pkgMap) return [];
|
|
75
|
+
return Object.entries(pkgMap).map(([name, version]) => `${name}@${version}`);
|
|
76
|
+
}
|
|
77
|
+
function resolveFeatureInstall(target) {
|
|
78
|
+
const key = target.trim().toLowerCase();
|
|
79
|
+
if (key in FEATURE_DEPS) {
|
|
80
|
+
const def = FEATURE_DEPS[key];
|
|
81
|
+
return {
|
|
82
|
+
label: key,
|
|
83
|
+
dependencies: toVersionedSpecs(def.dependencies),
|
|
84
|
+
devDependencies: toVersionedSpecs(def.devDependencies)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
for (const def of Object.values(FEATURE_DEPS)) {
|
|
88
|
+
if (key in def.dependencies) {
|
|
89
|
+
return {
|
|
90
|
+
label: target,
|
|
91
|
+
dependencies: [`${key}@${def.dependencies[key]}`],
|
|
92
|
+
devDependencies: []
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (def.devDependencies && key in def.devDependencies) {
|
|
96
|
+
return {
|
|
97
|
+
label: target,
|
|
98
|
+
dependencies: [],
|
|
99
|
+
devDependencies: [`${key}@${def.devDependencies[key]}`]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function printAvailableFeatures() {
|
|
107
|
+
console.log("\n\u{1F4E6} Available qarpeo features:\n");
|
|
108
|
+
for (const name of getFeatureNames()) {
|
|
109
|
+
const def = FEATURE_DEPS[name];
|
|
110
|
+
const pkgs = [
|
|
111
|
+
...Object.entries(def.dependencies),
|
|
112
|
+
...Object.entries("devDependencies" in def ? def.devDependencies : {})
|
|
113
|
+
].map(([pkg, ver]) => `${pkg}@${ver}`).join(", ");
|
|
114
|
+
console.log(` ${name.padEnd(10)} ${def.description}`);
|
|
115
|
+
console.log(` ${"".padEnd(10)} (${pkgs})
|
|
116
|
+
`);
|
|
117
|
+
}
|
|
118
|
+
console.log("Usage: qp add <feature> [feature...]\n");
|
|
119
|
+
}
|
|
120
|
+
const addCommand = defineCommand({
|
|
121
|
+
meta: {
|
|
122
|
+
name: "add",
|
|
123
|
+
description: "Install pinned dependencies for a qarpeo feature (e.g. cms, drizzle, auth)"
|
|
124
|
+
},
|
|
125
|
+
args: {
|
|
126
|
+
feature: {
|
|
127
|
+
type: "positional",
|
|
128
|
+
description: "Feature or package name to install (omit or pass --list to see all)",
|
|
129
|
+
required: false
|
|
130
|
+
},
|
|
131
|
+
list: {
|
|
132
|
+
type: "boolean",
|
|
133
|
+
alias: "l",
|
|
134
|
+
description: "List available features and their pinned versions",
|
|
135
|
+
default: false
|
|
136
|
+
},
|
|
137
|
+
cwd: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "Working directory",
|
|
140
|
+
default: "."
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
async run({ args }) {
|
|
144
|
+
if (args.list || !args.feature) {
|
|
145
|
+
printAvailableFeatures();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const targets = args._.length > 0 ? args._ : [args.feature];
|
|
149
|
+
const deps = [];
|
|
150
|
+
const devDeps = [];
|
|
151
|
+
const unknown = [];
|
|
152
|
+
for (const target of targets) {
|
|
153
|
+
const resolved = resolveFeatureInstall(target);
|
|
154
|
+
if (!resolved) {
|
|
155
|
+
unknown.push(target);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
deps.push(...resolved.dependencies);
|
|
159
|
+
devDeps.push(...resolved.devDependencies);
|
|
160
|
+
}
|
|
161
|
+
if (unknown.length > 0) {
|
|
162
|
+
console.error(`
|
|
163
|
+
\u274C [qarpeo] Unknown feature(s): ${unknown.join(", ")}`);
|
|
164
|
+
printAvailableFeatures();
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
const cwd = resolve(process.cwd(), args.cwd);
|
|
168
|
+
const { addDependency } = await import('nypm');
|
|
169
|
+
if (deps.length > 0) {
|
|
170
|
+
console.log(`
|
|
171
|
+
\u{1F4E6} [qarpeo] Installing dependencies: ${deps.join(" ")}`);
|
|
172
|
+
await addDependency(deps, { cwd, dev: false, silent: false });
|
|
173
|
+
}
|
|
174
|
+
if (devDeps.length > 0) {
|
|
175
|
+
console.log(`
|
|
176
|
+
\u{1F4E6} [qarpeo] Installing devDependencies: ${devDeps.join(" ")}`);
|
|
177
|
+
await addDependency(devDeps, { cwd, dev: true, silent: false });
|
|
178
|
+
}
|
|
179
|
+
console.log("\n\u2705 [qarpeo] Done! Pinned versions added to package.json.\n");
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
21
183
|
const generate = defineCommand({
|
|
22
184
|
meta: {
|
|
23
185
|
name: "generate",
|
|
@@ -185,6 +347,7 @@ const cleanCommand = defineCommand({
|
|
|
185
347
|
}
|
|
186
348
|
const { db, schema, sqlitePath } = ctx;
|
|
187
349
|
try {
|
|
350
|
+
const { reset } = await import('drizzle-seed');
|
|
188
351
|
console.log("\u23F3 [qarpeo] Resetting tables with drizzle-seed...");
|
|
189
352
|
await reset(db, schema);
|
|
190
353
|
console.log(
|
|
@@ -1325,7 +1488,7 @@ const migrate = defineCommand({
|
|
|
1325
1488
|
} else if (existsSync(resolve(cwd, ".nuxt/wrangler.json"))) {
|
|
1326
1489
|
wranglerConfigPath = resolve(cwd, ".nuxt/wrangler.json");
|
|
1327
1490
|
} else {
|
|
1328
|
-
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.
|
|
1491
|
+
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.U; });
|
|
1329
1492
|
const buildDir = resolve(cwd, ".nuxt");
|
|
1330
1493
|
wranglerConfigPath = await generateDevWranglerConfig(
|
|
1331
1494
|
{
|
|
@@ -1597,8 +1760,8 @@ const migrate = defineCommand({
|
|
|
1597
1760
|
if (args.prune && targets.some((t) => t.isPrimary)) {
|
|
1598
1761
|
const primaryTarget = targets.find((t) => t.isPrimary);
|
|
1599
1762
|
const primaryBinding = primaryTarget.binding;
|
|
1600
|
-
const { getActiveAuthTableNames, ALL_AUTH_TABLE_NAMES } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.
|
|
1601
|
-
const { findLocalD1Database } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.
|
|
1763
|
+
const { getActiveAuthTableNames, ALL_AUTH_TABLE_NAMES } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.T; });
|
|
1764
|
+
const { findLocalD1Database } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.S; });
|
|
1602
1765
|
const authConfig = nuxtConfig.qarpeo?.auth || nuxtConfig.auth;
|
|
1603
1766
|
const activeTables = getActiveAuthTableNames(authConfig);
|
|
1604
1767
|
const unusedTables = ALL_AUTH_TABLE_NAMES.filter(
|
|
@@ -1910,6 +2073,7 @@ const seedCommand = defineCommand({
|
|
|
1910
2073
|
process.exit(1);
|
|
1911
2074
|
}
|
|
1912
2075
|
const { db, schema, customSeedPath, sqlitePath } = ctx;
|
|
2076
|
+
const { reset, seed } = await import('drizzle-seed');
|
|
1913
2077
|
const shouldClean = Boolean(args.clean || args.reset);
|
|
1914
2078
|
if (shouldClean) {
|
|
1915
2079
|
console.log("\u23F3 [qarpeo] Resetting existing records...");
|
|
@@ -2469,7 +2633,7 @@ const deploy = defineCommand({
|
|
|
2469
2633
|
if (!wranglerConfigPath) {
|
|
2470
2634
|
try {
|
|
2471
2635
|
const { loadNuxtConfig } = await import('@nuxt/kit');
|
|
2472
|
-
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.
|
|
2636
|
+
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.U; });
|
|
2473
2637
|
const nuxtConfig = await loadNuxtConfig({ cwd });
|
|
2474
2638
|
const qarpeoOpts = nuxtConfig.qarpeo || {};
|
|
2475
2639
|
const buildDir = resolve(cwd, ".nuxt");
|
|
@@ -5357,6 +5521,7 @@ const main = defineCommand({
|
|
|
5357
5521
|
description: "Cloudflare-native powerhouse module for Nuxt"
|
|
5358
5522
|
},
|
|
5359
5523
|
subCommands: {
|
|
5524
|
+
add: addCommand,
|
|
5360
5525
|
cloud,
|
|
5361
5526
|
db,
|
|
5362
5527
|
kv,
|
package/dist/module.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { findMcpFiles } from "./utils/mcp";
|
|
|
14
14
|
export { findWorkflowFiles } from "./utils/workflows";
|
|
15
15
|
export { findDurableObjectFiles } from "./utils/durable-objects";
|
|
16
16
|
export { generateAuthSchema, getActiveAuthTableNames } from "./utils/auth-schema";
|
|
17
|
-
export {
|
|
17
|
+
export { ALL_CMS_TABLE_NAMES, getActiveCmsTableNames, } from "./utils/cms-table-names";
|
|
18
18
|
export { generatePaymentsSchema, getActivePaymentsTableNames } from "./utils/payments-schema";
|
|
19
19
|
export { generateNotificationsSchema, getActiveNotificationsTableNames, } from "./utils/notifications-schema";
|
|
20
20
|
export { generateCommentsSchema, getActiveCommentsTableNames, ALL_COMMENTS_TABLE_NAMES, } from "./utils/comments-schema";
|
package/dist/module.mjs
CHANGED
|
@@ -2,18 +2,16 @@ import { existsSync, rmSync, readdirSync, readFileSync, appendFileSync } from 'n
|
|
|
2
2
|
import { dirname, resolve, normalize, relative, join } from 'pathe';
|
|
3
3
|
import { addTemplate, hasNuxtModule, addNitroPlugin, addServerImports, addImports, addTypeTemplate, updateTemplates, addServerImportsDir, addServerHandler, extendPages, addPlugin, addComponent, addImportsDir, addRouteMiddleware, installModule, defineNuxtModule, useLogger, createResolver } from '@nuxt/kit';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
|
-
import { y as resolveTableName, z as resolveIndexName, B as buildDevWranglerConfig, l as checkDrizzleVersion, C as generateAuthSchema, D as generateCommentsSchema, E as generateStoreSchema, s as scanSchemaExports, f as discoverDatabases, F as findScheduledTasks, G as formatDlxCommand, H as resolveBindingName, I as createWranglerConfig, J as generateDevWranglerConfig, K as applyD1Migrations, x as version, L as findQueueFiles, t as findJobFiles, v as findEmailHandlerFiles, M as findDurableObjectFiles, u as findWorkflowFiles, e as ensurePackage, n as findAgentFiles, o as findToolFiles, p as findBotFiles, q as findMcpFiles, m as findSchemaFiles, w as buildQarpeoManifest } from './chunks/manifest.get.mjs';
|
|
6
|
-
export { A as ALL_CMS_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES,
|
|
5
|
+
import { y as resolveTableName, z as resolveIndexName, B as buildDevWranglerConfig, l as checkDrizzleVersion, C as generateAuthSchema, D as generateCommentsSchema, E as generateStoreSchema, s as scanSchemaExports, f as discoverDatabases, F as findScheduledTasks, G as formatDlxCommand, H as resolveBindingName, I as createWranglerConfig, J as generateDevWranglerConfig, K as applyD1Migrations, x as version, L as findQueueFiles, t as findJobFiles, v as findEmailHandlerFiles, M as findDurableObjectFiles, u as findWorkflowFiles, e as ensurePackage, N as isPackageInstalled, n as findAgentFiles, o as findToolFiles, p as findBotFiles, q as findMcpFiles, m as findSchemaFiles, w as buildQarpeoManifest } from './chunks/manifest.get.mjs';
|
|
6
|
+
export { A as ALL_CMS_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES, b as getActiveAuthTableNames, O as getActiveCmsTableNames, P as getActiveCommentsTableNames, Q as getActiveStoreTableNames, R as hasDatabaseSchema, r as resolveDatabaseTarget, k as resolveProjectName } from './chunks/manifest.get.mjs';
|
|
7
7
|
import { createHash } from 'node:crypto';
|
|
8
8
|
import { readdir, readFile } from 'node:fs/promises';
|
|
9
9
|
import { createRequire } from 'node:module';
|
|
10
10
|
import { downloadTemplate } from 'giget';
|
|
11
11
|
import { fileURLToPath } from 'node:url';
|
|
12
12
|
import 'node:child_process';
|
|
13
|
-
import 'drizzle-orm/node-sqlite';
|
|
14
13
|
import 'node:process';
|
|
15
14
|
import 'node:readline/promises';
|
|
16
|
-
import 'drizzle-orm/sqlite-core';
|
|
17
15
|
import 'nuxt/server';
|
|
18
16
|
|
|
19
17
|
function getActivePaymentsTableNames(payments, prefixOrOptions) {
|
|
@@ -1016,50 +1014,57 @@ async function setupAliases(options, nuxt, resolver) {
|
|
|
1016
1014
|
});
|
|
1017
1015
|
nuxt.options.alias["#qarpeo/tools-registry"] = emptyToolsTemplate.dst;
|
|
1018
1016
|
try {
|
|
1019
|
-
let resolveShikiDep = function(name) {
|
|
1020
|
-
try {
|
|
1021
|
-
const req = createRequire(resolve(shikiDir, "package.json"));
|
|
1022
|
-
const entry = req.resolve(name);
|
|
1023
|
-
let cur = dirname(entry);
|
|
1024
|
-
while (cur && cur !== dirname(cur)) {
|
|
1025
|
-
if (existsSync(resolve(cur, "package.json"))) return cur;
|
|
1026
|
-
cur = dirname(cur);
|
|
1027
|
-
}
|
|
1028
|
-
return "";
|
|
1029
|
-
} catch {
|
|
1030
|
-
return "";
|
|
1031
|
-
}
|
|
1032
|
-
};
|
|
1033
1017
|
const drizzleDir = resolvePkgDir("drizzle-orm");
|
|
1034
1018
|
nuxt.options.alias["drizzle-orm"] = drizzleDir;
|
|
1035
1019
|
nuxt.options.alias["drizzle-orm/"] = `${drizzleDir}/`;
|
|
1020
|
+
} catch {
|
|
1021
|
+
}
|
|
1022
|
+
try {
|
|
1036
1023
|
const drizzleKitDir = resolvePkgDir("drizzle-kit");
|
|
1037
1024
|
nuxt.options.alias["drizzle-kit"] = drizzleKitDir;
|
|
1038
1025
|
nuxt.options.alias["drizzle-kit/"] = `${drizzleKitDir}/`;
|
|
1026
|
+
} catch {
|
|
1027
|
+
}
|
|
1028
|
+
try {
|
|
1039
1029
|
const drizzleSeedDir = resolvePkgDir("drizzle-seed");
|
|
1040
1030
|
nuxt.options.alias["drizzle-seed"] = drizzleSeedDir;
|
|
1041
1031
|
nuxt.options.alias["drizzle-seed/"] = `${drizzleSeedDir}/`;
|
|
1032
|
+
} catch {
|
|
1033
|
+
}
|
|
1034
|
+
try {
|
|
1042
1035
|
const betterAuthDir = resolvePkgDir("better-auth");
|
|
1043
1036
|
nuxt.options.alias["better-auth/vue"] = resolve(betterAuthDir, "dist/client/vue/index.mjs");
|
|
1044
1037
|
nuxt.options.alias["better-auth/client"] = resolve(betterAuthDir, "dist/client/index.mjs");
|
|
1045
1038
|
nuxt.options.alias["better-auth/crypto"] = resolve(betterAuthDir, "dist/crypto/index.mjs");
|
|
1046
1039
|
nuxt.options.alias["better-auth"] = resolve(betterAuthDir, "dist/index.mjs");
|
|
1040
|
+
} catch {
|
|
1041
|
+
}
|
|
1042
|
+
try {
|
|
1047
1043
|
const betterAuthAdapterDir = resolvePkgDir("@better-auth/drizzle-adapter");
|
|
1048
1044
|
nuxt.options.alias["@better-auth/drizzle-adapter"] = resolve(
|
|
1049
1045
|
betterAuthAdapterDir,
|
|
1050
1046
|
"dist/index.mjs"
|
|
1051
1047
|
);
|
|
1048
|
+
} catch {
|
|
1049
|
+
}
|
|
1050
|
+
try {
|
|
1052
1051
|
const comarkNuxtDir = resolvePkgDir("@comark/nuxt");
|
|
1053
1052
|
nuxt.options.alias["@comark/nuxt/utils"] = resolve(comarkNuxtDir, "dist/utils/index.js");
|
|
1054
1053
|
nuxt.options.alias["@comark/nuxt/render"] = resolve(comarkNuxtDir, "dist/render.js");
|
|
1055
1054
|
nuxt.options.alias["@comark/nuxt/parse"] = resolve(comarkNuxtDir, "dist/parse.js");
|
|
1056
1055
|
nuxt.options.alias["@comark/nuxt"] = resolve(comarkNuxtDir, "dist/module.js");
|
|
1056
|
+
} catch {
|
|
1057
|
+
}
|
|
1058
|
+
try {
|
|
1057
1059
|
const comarkVueDir = resolvePkgDir("@comark/vue");
|
|
1058
1060
|
nuxt.options.alias["@comark/vue/vite"] = resolve(comarkVueDir, "dist/vite.js");
|
|
1059
1061
|
nuxt.options.alias["@comark/vue/utils"] = resolve(comarkVueDir, "dist/utils/index.js");
|
|
1060
1062
|
nuxt.options.alias["@comark/vue/render"] = resolve(comarkVueDir, "dist/render.js");
|
|
1061
1063
|
nuxt.options.alias["@comark/vue/parse"] = resolve(comarkVueDir, "dist/parse.js");
|
|
1062
1064
|
nuxt.options.alias["@comark/vue"] = resolve(comarkVueDir, "dist/index.js");
|
|
1065
|
+
} catch {
|
|
1066
|
+
}
|
|
1067
|
+
try {
|
|
1063
1068
|
const comarkDir = resolvePkgDir("comark");
|
|
1064
1069
|
nuxt.options.alias["comark/utils"] = resolve(comarkDir, "dist/utils/index.js");
|
|
1065
1070
|
nuxt.options.alias["comark/render/html"] = resolve(comarkDir, "dist/render/html.js");
|
|
@@ -1070,6 +1075,23 @@ async function setupAliases(options, nuxt, resolver) {
|
|
|
1070
1075
|
nuxt.options.alias["comark/internal"] = resolve(comarkDir, "dist/internal");
|
|
1071
1076
|
nuxt.options.alias["comark/internal/"] = `${resolve(comarkDir, "dist/internal")}/`;
|
|
1072
1077
|
nuxt.options.alias["comark"] = resolve(comarkDir, "dist/index.js");
|
|
1078
|
+
} catch {
|
|
1079
|
+
}
|
|
1080
|
+
try {
|
|
1081
|
+
let resolveShikiDep = function(name) {
|
|
1082
|
+
try {
|
|
1083
|
+
const req = createRequire(resolve(shikiDir, "package.json"));
|
|
1084
|
+
const entry = req.resolve(name);
|
|
1085
|
+
let cur = dirname(entry);
|
|
1086
|
+
while (cur && cur !== dirname(cur)) {
|
|
1087
|
+
if (existsSync(resolve(cur, "package.json"))) return cur;
|
|
1088
|
+
cur = dirname(cur);
|
|
1089
|
+
}
|
|
1090
|
+
return "";
|
|
1091
|
+
} catch {
|
|
1092
|
+
return "";
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1073
1095
|
const shikiDir = resolvePkgDir("shiki");
|
|
1074
1096
|
nuxt.options.alias["shiki/engine/javascript"] = resolve(
|
|
1075
1097
|
shikiDir,
|
|
@@ -1134,6 +1156,9 @@ async function setupAliases(options, nuxt, resolver) {
|
|
|
1134
1156
|
} catch {
|
|
1135
1157
|
}
|
|
1136
1158
|
}
|
|
1159
|
+
} catch {
|
|
1160
|
+
}
|
|
1161
|
+
if (options.cms) {
|
|
1137
1162
|
nuxt.options.build.transpile.push(
|
|
1138
1163
|
"shiki",
|
|
1139
1164
|
"comark",
|
|
@@ -1143,9 +1168,7 @@ async function setupAliases(options, nuxt, resolver) {
|
|
|
1143
1168
|
"@shikijs/engine-javascript",
|
|
1144
1169
|
"@shikijs/langs",
|
|
1145
1170
|
"@shikijs/themes",
|
|
1146
|
-
"@shikijs/vscode-textmate"
|
|
1147
|
-
"better-auth",
|
|
1148
|
-
"@better-auth/drizzle-adapter"
|
|
1171
|
+
"@shikijs/vscode-textmate"
|
|
1149
1172
|
);
|
|
1150
1173
|
nuxt.options.vite = nuxt.options.vite || {};
|
|
1151
1174
|
nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {};
|
|
@@ -1164,7 +1187,9 @@ async function setupAliases(options, nuxt, resolver) {
|
|
|
1164
1187
|
nuxt.options.vite.optimizeDeps.include.push(dep);
|
|
1165
1188
|
}
|
|
1166
1189
|
}
|
|
1167
|
-
}
|
|
1190
|
+
}
|
|
1191
|
+
if (options.auth) {
|
|
1192
|
+
nuxt.options.build.transpile.push("better-auth", "@better-auth/drizzle-adapter");
|
|
1168
1193
|
}
|
|
1169
1194
|
addTemplate({
|
|
1170
1195
|
filename: "qarpeo-shiki.css",
|
|
@@ -1799,28 +1824,46 @@ async function setupNitro(options, nuxt, resolver, logger) {
|
|
|
1799
1824
|
nuxt.hook("nitro:config", async (nitroConfig) => {
|
|
1800
1825
|
try {
|
|
1801
1826
|
nitroConfig.alias = nitroConfig.alias || {};
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1827
|
+
try {
|
|
1828
|
+
const drizzleDir = resolvePkgDir("drizzle-orm");
|
|
1829
|
+
nitroConfig.alias["drizzle-orm"] = drizzleDir;
|
|
1830
|
+
nitroConfig.alias["drizzle-orm/"] = `${drizzleDir}/`;
|
|
1831
|
+
} catch {
|
|
1832
|
+
}
|
|
1833
|
+
try {
|
|
1834
|
+
const drizzleKitDir = resolvePkgDir("drizzle-kit");
|
|
1835
|
+
nitroConfig.alias["drizzle-kit"] = drizzleKitDir;
|
|
1836
|
+
nitroConfig.alias["drizzle-kit/"] = `${drizzleKitDir}/`;
|
|
1837
|
+
} catch {
|
|
1838
|
+
}
|
|
1839
|
+
try {
|
|
1840
|
+
const drizzleSeedDir = resolvePkgDir("drizzle-seed");
|
|
1841
|
+
nitroConfig.alias["drizzle-seed"] = drizzleSeedDir;
|
|
1842
|
+
nitroConfig.alias["drizzle-seed/"] = `${drizzleSeedDir}/`;
|
|
1843
|
+
} catch {
|
|
1844
|
+
}
|
|
1845
|
+
try {
|
|
1846
|
+
const wranglerDir = resolvePkgDir("wrangler");
|
|
1847
|
+
nitroConfig.alias["wrangler"] = wranglerDir;
|
|
1848
|
+
nitroConfig.alias["wrangler/"] = `${wranglerDir}/`;
|
|
1849
|
+
} catch {
|
|
1850
|
+
}
|
|
1851
|
+
try {
|
|
1852
|
+
const betterAuthDir = resolvePkgDir("better-auth");
|
|
1853
|
+
nitroConfig.alias["better-auth/vue"] = resolve(betterAuthDir, "dist/client/vue/index.mjs");
|
|
1854
|
+
nitroConfig.alias["better-auth/client"] = resolve(betterAuthDir, "dist/client/index.mjs");
|
|
1855
|
+
nitroConfig.alias["better-auth/crypto"] = resolve(betterAuthDir, "dist/crypto/index.mjs");
|
|
1856
|
+
nitroConfig.alias["better-auth"] = resolve(betterAuthDir, "dist/index.mjs");
|
|
1857
|
+
} catch {
|
|
1858
|
+
}
|
|
1859
|
+
try {
|
|
1860
|
+
const betterAuthAdapterDir = resolvePkgDir("@better-auth/drizzle-adapter");
|
|
1861
|
+
nitroConfig.alias["@better-auth/drizzle-adapter"] = resolve(
|
|
1862
|
+
betterAuthAdapterDir,
|
|
1863
|
+
"dist/index.mjs"
|
|
1864
|
+
);
|
|
1865
|
+
} catch {
|
|
1866
|
+
}
|
|
1824
1867
|
if (options.cms) {
|
|
1825
1868
|
try {
|
|
1826
1869
|
const comarkNuxtDir = resolvePkgDir("@comark/nuxt");
|
|
@@ -3920,6 +3963,23 @@ async function setupFate(options, nuxt, resolver, logger) {
|
|
|
3920
3963
|
|
|
3921
3964
|
async function setupAuth(options, nuxt, resolver, logger) {
|
|
3922
3965
|
if (options.auth) {
|
|
3966
|
+
const missingAuth = [];
|
|
3967
|
+
if (!isPackageInstalled("better-auth", nuxt.options.rootDir)) {
|
|
3968
|
+
missingAuth.push("better-auth");
|
|
3969
|
+
}
|
|
3970
|
+
if (!isPackageInstalled("@better-auth/drizzle-adapter", nuxt.options.rootDir)) {
|
|
3971
|
+
missingAuth.push("@better-auth/drizzle-adapter");
|
|
3972
|
+
}
|
|
3973
|
+
if (missingAuth.length > 0) {
|
|
3974
|
+
logger.error(
|
|
3975
|
+
`[qarpeo] Auth is enabled but the following required packages are not installed:
|
|
3976
|
+
${missingAuth.map((p) => `"${p}"`).join(", ")}
|
|
3977
|
+
|
|
3978
|
+
Run: qp add auth
|
|
3979
|
+
`
|
|
3980
|
+
);
|
|
3981
|
+
return;
|
|
3982
|
+
}
|
|
3923
3983
|
const authSecret = process.env.NUXT_APP_SECRET || nuxt.options.runtimeConfig?.appSecret || (typeof options.auth === "object" ? options.auth?.appSecret || options.auth?.session?.secret : void 0);
|
|
3924
3984
|
if (!authSecret || authSecret.length < 32) {
|
|
3925
3985
|
if (!nuxt.options.dev) {
|
|
@@ -5356,25 +5416,19 @@ async function setupCMS(options, nuxt, resolver, logger) {
|
|
|
5356
5416
|
const pluginConfig = cmsOptions.plugins || {};
|
|
5357
5417
|
const shikiOption = cmsOptions.shiki !== void 0 ? cmsOptions.shiki : pluginConfig.shiki;
|
|
5358
5418
|
const shikiEnabled = shikiOption !== false;
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
await ensurePackage("shiki", {
|
|
5373
|
-
cwd: nuxt.options.rootDir,
|
|
5374
|
-
dev: false,
|
|
5375
|
-
purpose: "CMS code syntax highlighting",
|
|
5376
|
-
autoInstall: true
|
|
5377
|
-
});
|
|
5419
|
+
const missing = [];
|
|
5420
|
+
if (!isPackageInstalled("@comark/vue", nuxt.options.rootDir)) missing.push("@comark/vue");
|
|
5421
|
+
if (!isPackageInstalled("comark", nuxt.options.rootDir)) missing.push("comark");
|
|
5422
|
+
if (shikiEnabled && !isPackageInstalled("shiki", nuxt.options.rootDir)) missing.push("shiki");
|
|
5423
|
+
if (missing.length > 0) {
|
|
5424
|
+
logger.error(
|
|
5425
|
+
`[qarpeo] CMS is enabled but the following required packages are not installed:
|
|
5426
|
+
${missing.map((p) => `"${p}"`).join(", ")}
|
|
5427
|
+
|
|
5428
|
+
Run: qp add cms
|
|
5429
|
+
`
|
|
5430
|
+
);
|
|
5431
|
+
return;
|
|
5378
5432
|
}
|
|
5379
5433
|
}
|
|
5380
5434
|
if (options.cms && !hasNuxtModule("@comark/vue/nuxt") && !hasNuxtModule("@comark/vue") && !hasNuxtModule("@comark/nuxt")) {
|
|
@@ -6850,7 +6904,7 @@ ${extraSources}
|
|
|
6850
6904
|
await setupMultitenant(options, nuxt, resolver);
|
|
6851
6905
|
await setupNotifications(options, nuxt, resolver);
|
|
6852
6906
|
await setupConsole(options, nuxt, resolver, logger);
|
|
6853
|
-
await setupCMS(options, nuxt, resolver);
|
|
6907
|
+
await setupCMS(options, nuxt, resolver, logger);
|
|
6854
6908
|
await setupPayments(options, nuxt, resolver);
|
|
6855
6909
|
await setupComments(options, nuxt, resolver);
|
|
6856
6910
|
await setupStore(options, nuxt, resolver);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { type TableResolveOptions } from "../utils/table-names";
|
|
3
|
-
export declare const ALL_CMS_TABLE_NAMES: readonly ["cms_collection", "cms_entry", "cms_revision", "cms_category", "cms_tag", "cms_bookmark", "cms_subscriber"];
|
|
4
|
-
export declare function getActiveCmsTableNames(cms?: boolean | CMSOptions, prefixOrOptions?: boolean | string | TableResolveOptions): string[];
|
|
1
|
+
export { ALL_CMS_TABLE_NAMES, getActiveCmsTableNames } from "../../../utils/cms-table-names";
|
|
5
2
|
export declare const cmsCollection: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
6
3
|
name: string;
|
|
7
4
|
schema: undefined;
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import { integer, text, index, uniqueIndex, snakeCase } from "drizzle-orm/sqlite-core";
|
|
2
2
|
import { resolveTableName, resolveIndexName } from "../utils/table-names.mjs";
|
|
3
|
-
export
|
|
4
|
-
"cms_collection",
|
|
5
|
-
"cms_entry",
|
|
6
|
-
"cms_revision",
|
|
7
|
-
"cms_category",
|
|
8
|
-
"cms_tag",
|
|
9
|
-
"cms_bookmark",
|
|
10
|
-
"cms_subscriber"
|
|
11
|
-
];
|
|
12
|
-
export function getActiveCmsTableNames(cms, prefixOrOptions) {
|
|
13
|
-
if (!cms) return [];
|
|
14
|
-
return [
|
|
15
|
-
resolveTableName("cms_collection", prefixOrOptions),
|
|
16
|
-
resolveTableName("cms_entry", prefixOrOptions),
|
|
17
|
-
resolveTableName("cms_revision", prefixOrOptions),
|
|
18
|
-
resolveTableName("cms_category", prefixOrOptions),
|
|
19
|
-
resolveTableName("cms_tag", prefixOrOptions),
|
|
20
|
-
resolveTableName("cms_bookmark", prefixOrOptions),
|
|
21
|
-
resolveTableName("cms_subscriber", prefixOrOptions)
|
|
22
|
-
];
|
|
23
|
-
}
|
|
3
|
+
export { ALL_CMS_TABLE_NAMES, getActiveCmsTableNames } from "../../../utils/cms-table-names";
|
|
24
4
|
const collectionTbl = resolveTableName("cms_collection");
|
|
25
5
|
const entryTbl = resolveTableName("cms_entry");
|
|
26
6
|
const revisionTbl = resolveTableName("cms_revision");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CMSOptions } from "../types";
|
|
2
|
+
import { type TableResolveOptions } from "../runtime/server/utils/table-names";
|
|
3
|
+
export declare const ALL_CMS_TABLE_NAMES: readonly ["cms_collection", "cms_entry", "cms_revision", "cms_category", "cms_tag", "cms_bookmark", "cms_subscriber"];
|
|
4
|
+
export declare function getActiveCmsTableNames(cms?: boolean | CMSOptions, prefixOrOptions?: boolean | string | TableResolveOptions): string[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface FeatureDefinition {
|
|
2
|
+
description: string;
|
|
3
|
+
dependencies: Record<string, string>;
|
|
4
|
+
devDependencies?: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Pinned package versions tested and supported by this release of qarpeo.
|
|
8
|
+
* Used by `qp add <feature>` so users get exact compatible versions in their package.json.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FEATURE_DEPS: {
|
|
11
|
+
readonly cms: {
|
|
12
|
+
readonly description: "Edge CMS markdown/syntax highlighting (@comark/vue, comark, shiki)";
|
|
13
|
+
readonly dependencies: {
|
|
14
|
+
readonly "@comark/vue": "0.9.1";
|
|
15
|
+
readonly comark: "0.9.1";
|
|
16
|
+
readonly shiki: "4.6.0";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly drizzle: {
|
|
20
|
+
readonly description: "Drizzle ORM, Drizzle Kit, and Drizzle Seed";
|
|
21
|
+
readonly dependencies: {
|
|
22
|
+
readonly "drizzle-orm": "1.0.0-rc.5";
|
|
23
|
+
};
|
|
24
|
+
readonly devDependencies: {
|
|
25
|
+
readonly "drizzle-kit": "1.0.0-rc.5";
|
|
26
|
+
readonly "drizzle-seed": "1.0.0-rc.5";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly auth: {
|
|
30
|
+
readonly description: "Better Auth + Drizzle adapter";
|
|
31
|
+
readonly dependencies: {
|
|
32
|
+
readonly "better-auth": "1.7.20";
|
|
33
|
+
readonly "@better-auth/drizzle-adapter": "1.7.20";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly webauthn: {
|
|
37
|
+
readonly description: "Passkey / WebAuthn server support";
|
|
38
|
+
readonly dependencies: {
|
|
39
|
+
readonly "@simplewebauthn/server": "14.0.3";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly browser: {
|
|
43
|
+
readonly description: "Cloudflare Browser Rendering (@cloudflare/puppeteer)";
|
|
44
|
+
readonly dependencies: {
|
|
45
|
+
readonly "@cloudflare/puppeteer": "1.4.0";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly fate: {
|
|
49
|
+
readonly description: "Normalized data-fetching client (@nkzw/fate, vue-fate)";
|
|
50
|
+
readonly dependencies: {
|
|
51
|
+
readonly "@nkzw/fate": "1.0.0";
|
|
52
|
+
readonly "vue-fate": "1.0.0";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
readonly postgres: {
|
|
56
|
+
readonly description: "PostgreSQL / Hyperdrive driver";
|
|
57
|
+
readonly dependencies: {
|
|
58
|
+
readonly postgres: "4.1.1";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type FeatureName = keyof typeof FEATURE_DEPS;
|
|
63
|
+
export interface ResolvedInstallSpecs {
|
|
64
|
+
label: string;
|
|
65
|
+
dependencies: string[];
|
|
66
|
+
devDependencies: string[];
|
|
67
|
+
}
|
|
68
|
+
/** Returns all supported feature names for `qp add`. */
|
|
69
|
+
export declare function getFeatureNames(): FeatureName[];
|
|
70
|
+
/**
|
|
71
|
+
* Resolves a feature name (e.g. `cms`) or a known pinned package name (e.g. `drizzle-orm`)
|
|
72
|
+
* into exact `pkg@version` install specs. Returns `null` if unknown.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveFeatureInstall(target: string): ResolvedInstallSpecs | null;
|
package/dist/utils/local-db.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qarpeo",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Zero-config Cloudflare Edge Platform for Nuxt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics-engine",
|
|
@@ -140,15 +140,10 @@
|
|
|
140
140
|
"access": "public"
|
|
141
141
|
},
|
|
142
142
|
"dependencies": {
|
|
143
|
-
"@better-auth/drizzle-adapter": "1.7.20",
|
|
144
143
|
"@nuxt/devtools-kit": "^4.2.0",
|
|
145
144
|
"@nuxt/kit": "npm:@nuxt/kit-nightly@^5.0.0-2611231610-fa01a6d",
|
|
146
|
-
"better-auth": "1.7.20",
|
|
147
145
|
"citty": "^0.2.2",
|
|
148
146
|
"defu": "^6.1.7",
|
|
149
|
-
"drizzle-kit": "1.0.0-rc.5",
|
|
150
|
-
"drizzle-orm": "1.0.0-rc.5",
|
|
151
|
-
"drizzle-seed": "1.0.0-rc.5",
|
|
152
147
|
"giget": "^3.3.1",
|
|
153
148
|
"nypm": "^0.6.12",
|
|
154
149
|
"pathe": "^2.0.3",
|
|
@@ -156,13 +151,18 @@
|
|
|
156
151
|
"zod": "^4.6.7"
|
|
157
152
|
},
|
|
158
153
|
"devDependencies": {
|
|
154
|
+
"@better-auth/drizzle-adapter": "1.7.20",
|
|
159
155
|
"@cloudflare/puppeteer": "1.4.0",
|
|
160
156
|
"@comark/vue": "0.9.1",
|
|
161
157
|
"@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-2611041456-7ae6258",
|
|
162
158
|
"@simplewebauthn/server": "14.0.3",
|
|
163
159
|
"@types/node": "^26.6.6",
|
|
164
160
|
"@typescript/typescript6": "^6.0.2",
|
|
161
|
+
"better-auth": "1.7.20",
|
|
165
162
|
"comark": "0.9.1",
|
|
163
|
+
"drizzle-kit": "1.0.0-rc.5",
|
|
164
|
+
"drizzle-orm": "1.0.0-rc.5",
|
|
165
|
+
"drizzle-seed": "1.0.0-rc.5",
|
|
166
166
|
"h3": "^2.0.8",
|
|
167
167
|
"nitro": "3.0.261103-rc",
|
|
168
168
|
"nuxt": "npm:nuxt-nightly@^5.0.0-2611231610-fa01a6d",
|
|
@@ -177,11 +177,16 @@
|
|
|
177
177
|
"yaml": "^2.9.1"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
|
+
"@better-auth/drizzle-adapter": ">=1.7.0",
|
|
180
181
|
"@cloudflare/puppeteer": ">=1.0.0",
|
|
181
182
|
"@comark/vue": ">=0.9.0",
|
|
182
183
|
"@nkzw/fate": ">=1.0.0",
|
|
183
184
|
"@simplewebauthn/server": ">=14.0.0",
|
|
185
|
+
"better-auth": ">=1.7.0",
|
|
184
186
|
"comark": ">=0.9.0",
|
|
187
|
+
"drizzle-kit": ">=1.0.0-rc.1",
|
|
188
|
+
"drizzle-orm": ">=1.0.0-rc.1",
|
|
189
|
+
"drizzle-seed": ">=1.0.0-rc.1",
|
|
185
190
|
"mysql2": ">=3.0.0",
|
|
186
191
|
"postgres": ">=3.0.0",
|
|
187
192
|
"shiki": ">=4.0.0",
|
|
@@ -189,6 +194,9 @@
|
|
|
189
194
|
"yaml": ">=2.0.0"
|
|
190
195
|
},
|
|
191
196
|
"peerDependenciesMeta": {
|
|
197
|
+
"@better-auth/drizzle-adapter": {
|
|
198
|
+
"optional": true
|
|
199
|
+
},
|
|
192
200
|
"@cloudflare/puppeteer": {
|
|
193
201
|
"optional": true
|
|
194
202
|
},
|
|
@@ -201,9 +209,21 @@
|
|
|
201
209
|
"@simplewebauthn/server": {
|
|
202
210
|
"optional": true
|
|
203
211
|
},
|
|
212
|
+
"better-auth": {
|
|
213
|
+
"optional": true
|
|
214
|
+
},
|
|
204
215
|
"comark": {
|
|
205
216
|
"optional": true
|
|
206
217
|
},
|
|
218
|
+
"drizzle-kit": {
|
|
219
|
+
"optional": true
|
|
220
|
+
},
|
|
221
|
+
"drizzle-orm": {
|
|
222
|
+
"optional": true
|
|
223
|
+
},
|
|
224
|
+
"drizzle-seed": {
|
|
225
|
+
"optional": true
|
|
226
|
+
},
|
|
207
227
|
"mysql2": {
|
|
208
228
|
"optional": true
|
|
209
229
|
},
|