@bettercms-ai/db 0.1.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.
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Is this collection entry hidden from search? The entry-level twin of `pages.noindex`.
3
+ *
4
+ * An entry keeps its SEO in one `meta_json` blob (EntryMetaJson), so the flag is a blob key
5
+ * rather than a column. Only a literal `true` hides: absent means "never said", and every
6
+ * existing entry is indexable until someone flips the switch (#735).
7
+ *
8
+ * THE one definition. It lives in @bettercms-ai/db, and has no imports, so that every lane that
9
+ * decides whether an entry is exposed can reach it: the app (`@/lib/seo/entry-noindex`
10
+ * re-exports it), the scheduled-publish runner in @bettercms-ai/content, and the bulk rebuilds.
11
+ * The single-entry lanes (indexEntry) and the bulk ones (reconcileProject behind the manual
12
+ * Reindex, the workspace reindex, the delivery self-heal, llms.txt / llms-full.txt) used to be
13
+ * able to disagree: the manual Reindex put hidden entries straight back into site search.
14
+ *
15
+ * The only SQL spelling left is the sitemap reader's `COALESCE((meta_json->>'noindex')::boolean,
16
+ * false)` (migration 0317). The bulk SQL readers deliberately do NOT filter: they return
17
+ * `meta_json` (migration 0323) and this predicate decides.
18
+ */
19
+ declare function isEntryNoindex(metaJson: unknown): boolean;
20
+
21
+ export { isEntryNoindex };
@@ -0,0 +1,8 @@
1
+ // src/lib/entry-noindex.ts
2
+ function isEntryNoindex(metaJson) {
3
+ return !!metaJson && typeof metaJson === "object" && !Array.isArray(metaJson) && metaJson.noindex === true;
4
+ }
5
+ export {
6
+ isEntryNoindex
7
+ };
8
+ //# sourceMappingURL=entry-noindex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/entry-noindex.ts"],"sourcesContent":["/**\n * Is this collection entry hidden from search? The entry-level twin of `pages.noindex`.\n *\n * An entry keeps its SEO in one `meta_json` blob (EntryMetaJson), so the flag is a blob key\n * rather than a column. Only a literal `true` hides: absent means \"never said\", and every\n * existing entry is indexable until someone flips the switch (#735).\n *\n * THE one definition. It lives in @bettercms-ai/db, and has no imports, so that every lane that\n * decides whether an entry is exposed can reach it: the app (`@/lib/seo/entry-noindex`\n * re-exports it), the scheduled-publish runner in @bettercms-ai/content, and the bulk rebuilds.\n * The single-entry lanes (indexEntry) and the bulk ones (reconcileProject behind the manual\n * Reindex, the workspace reindex, the delivery self-heal, llms.txt / llms-full.txt) used to be\n * able to disagree: the manual Reindex put hidden entries straight back into site search.\n *\n * The only SQL spelling left is the sitemap reader's `COALESCE((meta_json->>'noindex')::boolean,\n * false)` (migration 0317). The bulk SQL readers deliberately do NOT filter: they return\n * `meta_json` (migration 0323) and this predicate decides.\n */\nexport function isEntryNoindex(metaJson: unknown): boolean {\n return (\n !!metaJson &&\n typeof metaJson === \"object\" &&\n !Array.isArray(metaJson) &&\n (metaJson as { noindex?: unknown }).noindex === true\n );\n}\n"],"mappings":";AAkBO,SAAS,eAAe,UAA4B;AACzD,SACE,CAAC,CAAC,YACF,OAAO,aAAa,YACpB,CAAC,MAAM,QAAQ,QAAQ,KACtB,SAAmC,YAAY;AAEpD;","names":[]}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@bettercms-ai/db",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./entry-noindex": {
17
+ "types": "./dist/lib/entry-noindex.d.ts",
18
+ "import": "./dist/lib/entry-noindex.js",
19
+ "default": "./dist/lib/entry-noindex.js"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "build": "tsup",
24
+ "typecheck": "tsc --noEmit",
25
+ "db:generate": "drizzle-kit generate",
26
+ "db:push": "drizzle-kit push",
27
+ "db:migrate": "drizzle-kit migrate",
28
+ "db:studio": "drizzle-kit studio",
29
+ "db:setup": "bun scripts/setup-db.ts",
30
+ "db:seed": "bun scripts/seed-plan-limits.ts"
31
+ },
32
+ "dependencies": {
33
+ "drizzle-orm": "^0.45.2",
34
+ "nanoid": "^5.0.0",
35
+ "postgres": "^3.4.9"
36
+ },
37
+ "devDependencies": {
38
+ "drizzle-kit": "^0.30.0",
39
+ "@types/node": "^20",
40
+ "tsup": "^8.0.0"
41
+ },
42
+ "peerDependencies": {
43
+ "drizzle-orm": "^0.45.2",
44
+ "postgres": "^3.4.9"
45
+ },
46
+ "description": "Drizzle schema and workspace-scoped query helpers for BetterCMS",
47
+ "publishConfig": {
48
+ "access": "restricted"
49
+ }
50
+ }