@momentumcms/db-drizzle 0.1.10 → 0.3.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/CHANGELOG.md +16 -0
- package/index.cjs +20 -2
- package/index.js +20 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.3.0 (2026-02-20)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- implement Payload-style migration CLI workflow with clone-test-apply safety ([#35](https://github.com/DonaldMurillo/momentum-cms/pull/35))
|
|
6
|
+
- add named tabs support with nested data grouping and UI improvements ([#30](https://github.com/DonaldMurillo/momentum-cms/pull/30))
|
|
7
|
+
|
|
8
|
+
### ❤️ Thank You
|
|
9
|
+
|
|
10
|
+
- Claude Opus 4.6
|
|
11
|
+
- Donald Murillo @DonaldMurillo
|
|
12
|
+
|
|
13
|
+
## 0.2.0 (2026-02-17)
|
|
14
|
+
|
|
15
|
+
This was a version bump only for db-drizzle to align it with other projects, there were no code changes.
|
|
16
|
+
|
|
1
17
|
## 0.1.10 (2026-02-17)
|
|
2
18
|
|
|
3
19
|
### 🩹 Fixes
|
package/index.cjs
CHANGED
|
@@ -79,12 +79,26 @@ var ReferentialIntegrityError = class extends Error {
|
|
|
79
79
|
this.constraint = constraint;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
+
function isNamedTab(tab) {
|
|
83
|
+
return typeof tab.name === "string" && tab.name.length > 0;
|
|
84
|
+
}
|
|
82
85
|
function flattenDataFields(fields) {
|
|
83
86
|
const result = [];
|
|
84
87
|
for (const field of fields) {
|
|
85
88
|
if (field.type === "tabs") {
|
|
86
89
|
for (const tab of field.tabs) {
|
|
87
|
-
|
|
90
|
+
if (isNamedTab(tab)) {
|
|
91
|
+
const syntheticGroup = {
|
|
92
|
+
name: tab.name,
|
|
93
|
+
type: "group",
|
|
94
|
+
label: tab.label,
|
|
95
|
+
description: tab.description,
|
|
96
|
+
fields: tab.fields
|
|
97
|
+
};
|
|
98
|
+
result.push(syntheticGroup);
|
|
99
|
+
} else {
|
|
100
|
+
result.push(...flattenDataFields(tab.fields));
|
|
101
|
+
}
|
|
88
102
|
}
|
|
89
103
|
} else if (field.type === "collapsible" || field.type === "row") {
|
|
90
104
|
result.push(...flattenDataFields(field.fields));
|
|
@@ -125,6 +139,9 @@ var MediaCollection = defineCollection({
|
|
|
125
139
|
singular: "Media",
|
|
126
140
|
plural: "Media"
|
|
127
141
|
},
|
|
142
|
+
upload: {
|
|
143
|
+
mimeTypes: ["image/*", "application/pdf", "video/*", "audio/*"]
|
|
144
|
+
},
|
|
128
145
|
admin: {
|
|
129
146
|
useAsTitle: "filename",
|
|
130
147
|
defaultColumns: ["filename", "mimeType", "filesize", "createdAt"]
|
|
@@ -145,7 +162,6 @@ var MediaCollection = defineCollection({
|
|
|
145
162
|
description: "File size in bytes"
|
|
146
163
|
}),
|
|
147
164
|
text("path", {
|
|
148
|
-
required: true,
|
|
149
165
|
label: "Storage Path",
|
|
150
166
|
description: "Path/key where the file is stored",
|
|
151
167
|
admin: {
|
|
@@ -643,6 +659,7 @@ function sqliteAdapter(options) {
|
|
|
643
659
|
).run(status, now, id);
|
|
644
660
|
}
|
|
645
661
|
return {
|
|
662
|
+
dialect: "sqlite",
|
|
646
663
|
getRawDatabase() {
|
|
647
664
|
return sqlite;
|
|
648
665
|
},
|
|
@@ -1702,6 +1719,7 @@ function postgresAdapter(options) {
|
|
|
1702
1719
|
const helpers = createHelpers(pool);
|
|
1703
1720
|
const methods = buildMethods(helpers);
|
|
1704
1721
|
return {
|
|
1722
|
+
dialect: "postgresql",
|
|
1705
1723
|
/**
|
|
1706
1724
|
* Get the pg Pool instance for Better Auth integration.
|
|
1707
1725
|
*/
|
package/index.js
CHANGED
|
@@ -42,12 +42,26 @@ var ReferentialIntegrityError = class extends Error {
|
|
|
42
42
|
this.constraint = constraint;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
+
function isNamedTab(tab) {
|
|
46
|
+
return typeof tab.name === "string" && tab.name.length > 0;
|
|
47
|
+
}
|
|
45
48
|
function flattenDataFields(fields) {
|
|
46
49
|
const result = [];
|
|
47
50
|
for (const field of fields) {
|
|
48
51
|
if (field.type === "tabs") {
|
|
49
52
|
for (const tab of field.tabs) {
|
|
50
|
-
|
|
53
|
+
if (isNamedTab(tab)) {
|
|
54
|
+
const syntheticGroup = {
|
|
55
|
+
name: tab.name,
|
|
56
|
+
type: "group",
|
|
57
|
+
label: tab.label,
|
|
58
|
+
description: tab.description,
|
|
59
|
+
fields: tab.fields
|
|
60
|
+
};
|
|
61
|
+
result.push(syntheticGroup);
|
|
62
|
+
} else {
|
|
63
|
+
result.push(...flattenDataFields(tab.fields));
|
|
64
|
+
}
|
|
51
65
|
}
|
|
52
66
|
} else if (field.type === "collapsible" || field.type === "row") {
|
|
53
67
|
result.push(...flattenDataFields(field.fields));
|
|
@@ -88,6 +102,9 @@ var MediaCollection = defineCollection({
|
|
|
88
102
|
singular: "Media",
|
|
89
103
|
plural: "Media"
|
|
90
104
|
},
|
|
105
|
+
upload: {
|
|
106
|
+
mimeTypes: ["image/*", "application/pdf", "video/*", "audio/*"]
|
|
107
|
+
},
|
|
91
108
|
admin: {
|
|
92
109
|
useAsTitle: "filename",
|
|
93
110
|
defaultColumns: ["filename", "mimeType", "filesize", "createdAt"]
|
|
@@ -108,7 +125,6 @@ var MediaCollection = defineCollection({
|
|
|
108
125
|
description: "File size in bytes"
|
|
109
126
|
}),
|
|
110
127
|
text("path", {
|
|
111
|
-
required: true,
|
|
112
128
|
label: "Storage Path",
|
|
113
129
|
description: "Path/key where the file is stored",
|
|
114
130
|
admin: {
|
|
@@ -606,6 +622,7 @@ function sqliteAdapter(options) {
|
|
|
606
622
|
).run(status, now, id);
|
|
607
623
|
}
|
|
608
624
|
return {
|
|
625
|
+
dialect: "sqlite",
|
|
609
626
|
getRawDatabase() {
|
|
610
627
|
return sqlite;
|
|
611
628
|
},
|
|
@@ -1665,6 +1682,7 @@ function postgresAdapter(options) {
|
|
|
1665
1682
|
const helpers = createHelpers(pool);
|
|
1666
1683
|
const methods = buildMethods(helpers);
|
|
1667
1684
|
return {
|
|
1685
|
+
dialect: "postgresql",
|
|
1668
1686
|
/**
|
|
1669
1687
|
* Get the pg Pool instance for Better Auth integration.
|
|
1670
1688
|
*/
|