@beignet/cli 0.0.7 → 0.0.9
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 +21 -0
- package/README.md +90 -68
- package/dist/create.js +1 -1
- package/dist/create.js.map +1 -1
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +482 -56
- package/dist/inspect.js.map +1 -1
- package/dist/make.d.ts.map +1 -1
- package/dist/make.js +269 -98
- package/dist/make.js.map +1 -1
- package/dist/registry-edits.d.ts +77 -0
- package/dist/registry-edits.d.ts.map +1 -0
- package/dist/registry-edits.js +255 -0
- package/dist/registry-edits.js.map +1 -0
- package/dist/templates/base.js +4 -4
- package/dist/templates/base.js.map +1 -1
- package/dist/templates/db.js +16 -16
- package/dist/templates/server.js +10 -10
- package/dist/templates/server.js.map +1 -1
- package/package.json +2 -2
- package/src/create.ts +1 -1
- package/src/inspect.ts +785 -77
- package/src/make.ts +435 -123
- package/src/registry-edits.ts +352 -0
- package/src/templates/base.ts +4 -4
- package/src/templates/db.ts +16 -16
- package/src/templates/server.ts +10 -10
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared string-edit helpers for registry files.
|
|
3
|
+
*
|
|
4
|
+
* `beignet make` generators and `beignet doctor --fix` both append entries to
|
|
5
|
+
* app-owned registry files such as `server/schedules.ts`, `server/tasks.ts`,
|
|
6
|
+
* and `server/outbox.ts`. Keeping the import insertion, array append, and
|
|
7
|
+
* membership primitives in one module keeps both write paths byte-compatible.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Source slice for an initializer expression, with absolute offsets.
|
|
11
|
+
*/
|
|
12
|
+
export type InitializerInfo = {
|
|
13
|
+
text: string;
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Result of appending an entry to a named registry.
|
|
19
|
+
*
|
|
20
|
+
* `missing` means the registry anchor could not be found or is not an array
|
|
21
|
+
* literal; callers should bail without writing.
|
|
22
|
+
*/
|
|
23
|
+
export type AppendResult = {
|
|
24
|
+
kind: "updated";
|
|
25
|
+
source: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "unchanged";
|
|
28
|
+
} | {
|
|
29
|
+
kind: "missing";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Find the index of the delimiter closing the one at `openIndex`, skipping
|
|
33
|
+
* string literals.
|
|
34
|
+
*/
|
|
35
|
+
export declare function matchingDelimiterIndex(source: string, openIndex: number, open: string, close: string): number;
|
|
36
|
+
/**
|
|
37
|
+
* Insert a line directly after the last top-level import statement.
|
|
38
|
+
*/
|
|
39
|
+
export declare function insertAfterImports(source: string, line: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Collect every identifier referenced inside an array (or object) expression.
|
|
42
|
+
*/
|
|
43
|
+
export declare function identifiersFromArrayExpression(expression: string): Set<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Append entries to an array literal, preserving single-line and multiline
|
|
46
|
+
* formatting plus trailing commas.
|
|
47
|
+
*/
|
|
48
|
+
export declare function appendToArrayExpression(expression: string, names: string[]): string;
|
|
49
|
+
/**
|
|
50
|
+
* Locate the array literal initializing `const <constName> = ...`.
|
|
51
|
+
*
|
|
52
|
+
* Wrapping calls such as `defineTasks([...])` are tolerated because the first
|
|
53
|
+
* `[` after the assignment is used.
|
|
54
|
+
*/
|
|
55
|
+
export declare function arrayInitializerInfo(source: string, constName: string): InitializerInfo | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Append `entry` to the array initializing `const <constName> = [...]` and
|
|
58
|
+
* insert `importLine` after the imports when it is not already present.
|
|
59
|
+
*
|
|
60
|
+
* Generalizes the `server/schedules.ts` and `server/tasks.ts` registry update
|
|
61
|
+
* used by `beignet make`. Returns `missing` without touching the source when
|
|
62
|
+
* the array cannot be found, so callers never partially write.
|
|
63
|
+
*/
|
|
64
|
+
export declare function appendToNamedArray(source: string, constName: string, entry: string, importLine?: string): AppendResult;
|
|
65
|
+
/**
|
|
66
|
+
* Locate the `events` or `jobs` value inside `defineOutboxRegistry({...})`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function outboxRegistryValueInfo(source: string, property: "events" | "jobs"): InitializerInfo | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Append `entry` to the `events` or `jobs` array of
|
|
71
|
+
* `defineOutboxRegistry({...})` and insert `importLine` when needed.
|
|
72
|
+
*
|
|
73
|
+
* Returns `missing` without touching the source when the registry call or
|
|
74
|
+
* property is absent, or when the property value is not an array literal.
|
|
75
|
+
*/
|
|
76
|
+
export declare function appendToOutboxRegistryArray(source: string, property: "events" | "jobs", entry: string, importLine?: string): AppendResult;
|
|
77
|
+
//# sourceMappingURL=registry-edits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-edits.d.ts","sourceRoot":"","sources":["../src/registry-edits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,CAmCR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgBvE;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,GAAG,CAAC,MAAM,CAAC,CASb;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,CA4BR;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,eAAe,GAAG,SAAS,CAe7B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,YAAY,CAOd;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAC1B,eAAe,GAAG,SAAS,CAmB7B;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAC3B,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,YAAY,CAgBd"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared string-edit helpers for registry files.
|
|
3
|
+
*
|
|
4
|
+
* `beignet make` generators and `beignet doctor --fix` both append entries to
|
|
5
|
+
* app-owned registry files such as `server/schedules.ts`, `server/tasks.ts`,
|
|
6
|
+
* and `server/outbox.ts`. Keeping the import insertion, array append, and
|
|
7
|
+
* membership primitives in one module keeps both write paths byte-compatible.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Find the index of the delimiter closing the one at `openIndex`, skipping
|
|
11
|
+
* string literals.
|
|
12
|
+
*/
|
|
13
|
+
export function matchingDelimiterIndex(source, openIndex, open, close) {
|
|
14
|
+
let depth = 0;
|
|
15
|
+
let inString;
|
|
16
|
+
let escaped = false;
|
|
17
|
+
for (let index = openIndex; index < source.length; index++) {
|
|
18
|
+
const char = source[index];
|
|
19
|
+
if (inString) {
|
|
20
|
+
if (escaped) {
|
|
21
|
+
escaped = false;
|
|
22
|
+
}
|
|
23
|
+
else if (char === "\\") {
|
|
24
|
+
escaped = true;
|
|
25
|
+
}
|
|
26
|
+
else if (char === inString) {
|
|
27
|
+
inString = undefined;
|
|
28
|
+
}
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
32
|
+
inString = char;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (char === open) {
|
|
36
|
+
depth++;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (char === close) {
|
|
40
|
+
depth--;
|
|
41
|
+
if (depth === 0)
|
|
42
|
+
return index;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return -1;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Insert a line directly after the last top-level import statement.
|
|
49
|
+
*/
|
|
50
|
+
export function insertAfterImports(source, line) {
|
|
51
|
+
const lines = source.split("\n");
|
|
52
|
+
let lastImportIndex = -1;
|
|
53
|
+
for (let index = 0; index < lines.length; index++) {
|
|
54
|
+
if (lines[index].startsWith("import ")) {
|
|
55
|
+
lastImportIndex = index;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (lastImportIndex === -1) {
|
|
59
|
+
return `${line}\n${source}`;
|
|
60
|
+
}
|
|
61
|
+
lines.splice(lastImportIndex + 1, 0, line);
|
|
62
|
+
return lines.join("\n");
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Collect every identifier referenced inside an array (or object) expression.
|
|
66
|
+
*/
|
|
67
|
+
export function identifiersFromArrayExpression(expression) {
|
|
68
|
+
const withoutBrackets = expression.replace(/^\[/, "").replace(/\]$/, "");
|
|
69
|
+
return new Set(Array.from(withoutBrackets.matchAll(/\b[A-Za-z_$][\w$]*\b/g), ([name]) => name));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Append entries to an array literal, preserving single-line and multiline
|
|
73
|
+
* formatting plus trailing commas.
|
|
74
|
+
*/
|
|
75
|
+
export function appendToArrayExpression(expression, names) {
|
|
76
|
+
const closingBracket = /\]\s*$/.exec(expression);
|
|
77
|
+
if (!closingBracket)
|
|
78
|
+
return expression;
|
|
79
|
+
const beforeClosingBracket = expression.slice(0, closingBracket.index);
|
|
80
|
+
const closingBracketText = expression.slice(closingBracket.index);
|
|
81
|
+
const inner = beforeClosingBracket.replace(/^\[/, "");
|
|
82
|
+
if (!inner.trim())
|
|
83
|
+
return `[${names.join(", ")}]`;
|
|
84
|
+
if (!expression.includes("\n")) {
|
|
85
|
+
const separator = /,\s*$/.test(inner) ? " " : ", ";
|
|
86
|
+
return `${beforeClosingBracket}${separator}${names.join(", ")}${closingBracketText}`;
|
|
87
|
+
}
|
|
88
|
+
const itemIndent = inner
|
|
89
|
+
.split("\n")
|
|
90
|
+
.find((line) => line.trim())
|
|
91
|
+
?.match(/^[\t ]*/)?.[0] ?? "\t";
|
|
92
|
+
const closingIndent = inner.match(/\n([\t ]*)$/)?.[1] ?? "";
|
|
93
|
+
const trimmedBeforeClosingBracket = beforeClosingBracket.replace(/\s*$/, "");
|
|
94
|
+
const appendedNames = names.join(`,\n${itemIndent}`);
|
|
95
|
+
if (/,\s*$/.test(inner)) {
|
|
96
|
+
return `${trimmedBeforeClosingBracket}\n${itemIndent}${appendedNames},\n${closingIndent}${closingBracketText}`;
|
|
97
|
+
}
|
|
98
|
+
return `${trimmedBeforeClosingBracket},\n${itemIndent}${appendedNames}${closingBracketText}`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Locate the array literal initializing `const <constName> = ...`.
|
|
102
|
+
*
|
|
103
|
+
* Wrapping calls such as `defineTasks([...])` are tolerated because the first
|
|
104
|
+
* `[` after the assignment is used.
|
|
105
|
+
*/
|
|
106
|
+
export function arrayInitializerInfo(source, constName) {
|
|
107
|
+
const match = new RegExp(`\\bconst\\s+${constName}\\s*=`).exec(source);
|
|
108
|
+
if (!match)
|
|
109
|
+
return undefined;
|
|
110
|
+
const openBracket = source.indexOf("[", match.index);
|
|
111
|
+
if (openBracket === -1)
|
|
112
|
+
return undefined;
|
|
113
|
+
const closeBracket = matchingDelimiterIndex(source, openBracket, "[", "]");
|
|
114
|
+
if (closeBracket === -1)
|
|
115
|
+
return undefined;
|
|
116
|
+
return {
|
|
117
|
+
text: source.slice(openBracket, closeBracket + 1),
|
|
118
|
+
start: openBracket,
|
|
119
|
+
end: closeBracket + 1,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Append `entry` to the array initializing `const <constName> = [...]` and
|
|
124
|
+
* insert `importLine` after the imports when it is not already present.
|
|
125
|
+
*
|
|
126
|
+
* Generalizes the `server/schedules.ts` and `server/tasks.ts` registry update
|
|
127
|
+
* used by `beignet make`. Returns `missing` without touching the source when
|
|
128
|
+
* the array cannot be found, so callers never partially write.
|
|
129
|
+
*/
|
|
130
|
+
export function appendToNamedArray(source, constName, entry, importLine) {
|
|
131
|
+
const registry = arrayInitializerInfo(source, constName);
|
|
132
|
+
if (!registry)
|
|
133
|
+
return { kind: "missing" };
|
|
134
|
+
return appendEntry(source, registry, entry, importLine, (next) => arrayInitializerInfo(next, constName));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Locate the `events` or `jobs` value inside `defineOutboxRegistry({...})`.
|
|
138
|
+
*/
|
|
139
|
+
export function outboxRegistryValueInfo(source, property) {
|
|
140
|
+
const call = /\bdefineOutboxRegistry\s*(?:<[^>]*>\s*)?\(/.exec(source);
|
|
141
|
+
if (!call)
|
|
142
|
+
return undefined;
|
|
143
|
+
const openBrace = source.indexOf("{", call.index);
|
|
144
|
+
if (openBrace === -1)
|
|
145
|
+
return undefined;
|
|
146
|
+
const closeBrace = matchingDelimiterIndex(source, openBrace, "{", "}");
|
|
147
|
+
if (closeBrace === -1)
|
|
148
|
+
return undefined;
|
|
149
|
+
const objectText = source.slice(openBrace, closeBrace + 1);
|
|
150
|
+
const propertyMatch = new RegExp(`\\b${property}\\s*:`).exec(objectText);
|
|
151
|
+
if (!propertyMatch)
|
|
152
|
+
return undefined;
|
|
153
|
+
const valueStart = openBrace + propertyMatch.index + propertyMatch[0].length;
|
|
154
|
+
const value = topLevelValueSlice(source, valueStart, closeBrace);
|
|
155
|
+
if (!value)
|
|
156
|
+
return undefined;
|
|
157
|
+
return value;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Append `entry` to the `events` or `jobs` array of
|
|
161
|
+
* `defineOutboxRegistry({...})` and insert `importLine` when needed.
|
|
162
|
+
*
|
|
163
|
+
* Returns `missing` without touching the source when the registry call or
|
|
164
|
+
* property is absent, or when the property value is not an array literal.
|
|
165
|
+
*/
|
|
166
|
+
export function appendToOutboxRegistryArray(source, property, entry, importLine) {
|
|
167
|
+
const value = outboxRegistryValueInfo(source, property);
|
|
168
|
+
if (!value)
|
|
169
|
+
return { kind: "missing" };
|
|
170
|
+
const entryName = entryIdentifier(entry);
|
|
171
|
+
if (identifiersFromArrayExpression(value.text).has(entryName)) {
|
|
172
|
+
return appendEntry(source, value, entry, importLine, () => undefined, {
|
|
173
|
+
alreadyListed: true,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (!value.text.startsWith("["))
|
|
177
|
+
return { kind: "missing" };
|
|
178
|
+
return appendEntry(source, value, entry, importLine, (next) => outboxRegistryValueInfo(next, property));
|
|
179
|
+
}
|
|
180
|
+
function entryIdentifier(entry) {
|
|
181
|
+
return entry.replace(/^\.{3}/, "").trim();
|
|
182
|
+
}
|
|
183
|
+
function appendEntry(source, info, entry, importLine, relocate, options = {}) {
|
|
184
|
+
const alreadyListed = options.alreadyListed ??
|
|
185
|
+
identifiersFromArrayExpression(info.text).has(entryIdentifier(entry));
|
|
186
|
+
let next = source;
|
|
187
|
+
if (importLine && !next.includes(importLine)) {
|
|
188
|
+
next = insertAfterImports(next, importLine);
|
|
189
|
+
}
|
|
190
|
+
if (!alreadyListed) {
|
|
191
|
+
const target = next === source ? info : relocate(next);
|
|
192
|
+
if (!target)
|
|
193
|
+
return { kind: "missing" };
|
|
194
|
+
const nextArray = appendToArrayExpression(target.text, [entry]);
|
|
195
|
+
next = `${next.slice(0, target.start)}${nextArray}${next.slice(target.end)}`;
|
|
196
|
+
}
|
|
197
|
+
if (next === source)
|
|
198
|
+
return { kind: "unchanged" };
|
|
199
|
+
return { kind: "updated", source: next };
|
|
200
|
+
}
|
|
201
|
+
function topLevelValueSlice(source, valueStart, hardEnd) {
|
|
202
|
+
let start = valueStart;
|
|
203
|
+
while (start < hardEnd && /\s/.test(source[start]))
|
|
204
|
+
start++;
|
|
205
|
+
if (start >= hardEnd)
|
|
206
|
+
return undefined;
|
|
207
|
+
let depth = 0;
|
|
208
|
+
let inString;
|
|
209
|
+
let escaped = false;
|
|
210
|
+
for (let index = start; index <= hardEnd; index++) {
|
|
211
|
+
const char = source[index];
|
|
212
|
+
if (inString) {
|
|
213
|
+
if (escaped) {
|
|
214
|
+
escaped = false;
|
|
215
|
+
}
|
|
216
|
+
else if (char === "\\") {
|
|
217
|
+
escaped = true;
|
|
218
|
+
}
|
|
219
|
+
else if (char === inString) {
|
|
220
|
+
inString = undefined;
|
|
221
|
+
}
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
225
|
+
inString = char;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
if (char === "[" || char === "(" || char === "{") {
|
|
229
|
+
depth++;
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (char === "]" || char === ")" || char === "}") {
|
|
233
|
+
if (depth === 0) {
|
|
234
|
+
return trimmedInfo(source, start, index);
|
|
235
|
+
}
|
|
236
|
+
depth--;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (char === "," && depth === 0) {
|
|
240
|
+
return trimmedInfo(source, start, index);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
function trimmedInfo(source, start, end) {
|
|
246
|
+
let trimmedEnd = end;
|
|
247
|
+
while (trimmedEnd > start && /\s/.test(source[trimmedEnd - 1]))
|
|
248
|
+
trimmedEnd--;
|
|
249
|
+
return {
|
|
250
|
+
text: source.slice(start, trimmedEnd),
|
|
251
|
+
start,
|
|
252
|
+
end: trimmedEnd,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=registry-edits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-edits.js","sourceRoot":"","sources":["../src/registry-edits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsBH;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAc,EACd,SAAiB,EACjB,IAAY,EACZ,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,QAA4B,CAAC;IACjC,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,IAAI,KAAK,GAAG,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC;iBAAM,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBACzB,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;iBAAM,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,QAAQ,GAAG,SAAS,CAAC;YACvB,CAAC;YACD,SAAS;QACX,CAAC;QAED,IAAI,IAAI,KAAK,GAAG,IAAI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nB,CAAC;AAED,SAAS,WAAW,CAClB,MAAc,EACd,KAAa,EACb,GAAW;IAEX,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,OAAO,UAAU,GAAG,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAAE,UAAU,EAAE,CAAC;IAE7E,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC;QACrC,KAAK;QACL,GAAG,EAAE,UAAU;KAChB,CAAC;AACJ,CAAC"}
|
package/dist/templates/base.js
CHANGED
|
@@ -7,7 +7,7 @@ export function packageJson(ctx) {
|
|
|
7
7
|
"@beignet/devtools": ctx.beignetVersion,
|
|
8
8
|
"@beignet/next": ctx.beignetVersion,
|
|
9
9
|
"@beignet/provider-auth-better-auth": ctx.beignetVersion,
|
|
10
|
-
"@beignet/provider-drizzle
|
|
10
|
+
"@beignet/provider-db-drizzle": ctx.beignetVersion,
|
|
11
11
|
"@beignet/provider-logger-pino": ctx.beignetVersion,
|
|
12
12
|
"@libsql/client": externalVersions.libsqlClient,
|
|
13
13
|
"better-auth": externalVersions.betterAuth,
|
|
@@ -185,7 +185,7 @@ ${cli} doctor
|
|
|
185
185
|
${shellMap}
|
|
186
186
|
## Before deploying
|
|
187
187
|
|
|
188
|
-
-
|
|
188
|
+
- Keep \`SQLITE_DB_URL=file:local.db\` for local libSQL development or point it at a hosted libSQL database such as Turso.
|
|
189
189
|
- Run \`${cli} db generate\` and \`${cli} db migrate\` after changing the Drizzle schema.
|
|
190
190
|
- Run \`${cli} db reset\` to rebuild a local SQLite database from the checked-in migrations.
|
|
191
191
|
- Remove \`DEVTOOLS_ENABLED=true\` in production unless you add authentication and stricter redaction.
|
|
@@ -227,8 +227,8 @@ export function envExample(ctx) {
|
|
|
227
227
|
`LOG_SERVICE=${ctx.name}`,
|
|
228
228
|
"",
|
|
229
229
|
"# Use file:local.db for local libSQL or libsql://... for Turso cloud.",
|
|
230
|
-
"
|
|
231
|
-
"#
|
|
230
|
+
"SQLITE_DB_URL=file:local.db",
|
|
231
|
+
"# SQLITE_DB_AUTH_TOKEN=",
|
|
232
232
|
"",
|
|
233
233
|
"BETTER_AUTH_SECRET=local-dev-better-auth-secret-change-me",
|
|
234
234
|
"BETTER_AUTH_URL=http://localhost:3000",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/templates/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,IAAI,EACJ,aAAa,GAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC9C,MAAM,YAAY,GAA2B;QAC3C,eAAe,EAAE,GAAG,CAAC,cAAc;QACnC,mBAAmB,EAAE,GAAG,CAAC,cAAc;QACvC,eAAe,EAAE,GAAG,CAAC,cAAc;QACnC,oCAAoC,EAAE,GAAG,CAAC,cAAc;QACxD,
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/templates/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,IAAI,EACJ,aAAa,GAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC9C,MAAM,YAAY,GAA2B;QAC3C,eAAe,EAAE,GAAG,CAAC,cAAc;QACnC,mBAAmB,EAAE,GAAG,CAAC,cAAc;QACvC,eAAe,EAAE,GAAG,CA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EAAE,CACH,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE;;;;;;;;CAQZ;IACC,OAAO,EAAE;;;;CAIV;IACC,UAAU,EAAE;;;;CAIb;IACC,QAAQ,EAAE,IAAI,CAAC;QACb,eAAe,EAAE;YACf,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,CAAC;YACtC,OAAO,EAAE,IAAI;YACb,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,QAAQ;YAChB,gBAAgB,EAAE,SAAS;YAC3B,iBAAiB,EAAE,IAAI;YACvB,eAAe,EAAE,IAAI;YACrB,GAAG,EAAE,WAAW;YAChB,WAAW,EAAE,IAAI;YACjB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YAC3B,KAAK,EAAE;gBACL,KAAK,EAAE,CAAC,KAAK,CAAC;aACf;SACF;QACD,OAAO,EAAE;YACP,eAAe;YACf,SAAS;YACT,UAAU;YACV,qBAAqB;YACrB,yBAAyB;SAC1B;QACD,OAAO,EAAE,CAAC,cAAc,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,CAAC"}
|
package/dist/templates/db.js
CHANGED
|
@@ -14,8 +14,8 @@ const files = {
|
|
|
14
14
|
out: "./drizzle",
|
|
15
15
|
dialect: "sqlite",
|
|
16
16
|
dbCredentials: {
|
|
17
|
-
url: process.env.
|
|
18
|
-
authToken: process.env.
|
|
17
|
+
url: process.env.SQLITE_DB_URL ?? "file:local.db",
|
|
18
|
+
authToken: process.env.SQLITE_DB_AUTH_TOKEN,
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
`,
|
|
@@ -122,7 +122,7 @@ export const idempotencyRecords = sqliteTable(
|
|
|
122
122
|
`,
|
|
123
123
|
drizzleTodoRepository: `import type { beignetServerOnly } from "@beignet/core/server-only";
|
|
124
124
|
import { offsetPageResult } from "@beignet/core/pagination";
|
|
125
|
-
import type {
|
|
125
|
+
import type { DrizzleSqliteDatabase } from "@beignet/provider-db-drizzle/sqlite";
|
|
126
126
|
import { count, desc, eq } from "drizzle-orm";
|
|
127
127
|
import type {
|
|
128
128
|
NewTodo,
|
|
@@ -145,7 +145,7 @@ function toTodo(row: TodoRow): Todo {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
export function createDrizzleTodoRepository(
|
|
148
|
-
db:
|
|
148
|
+
db: DrizzleSqliteDatabase<typeof schema>,
|
|
149
149
|
): TodoRepository {
|
|
150
150
|
return {
|
|
151
151
|
async list(userId, page) {
|
|
@@ -207,13 +207,13 @@ export function createDrizzleTodoRepository(
|
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
`,
|
|
210
|
-
dbRepositories: `import type {
|
|
210
|
+
dbRepositories: `import type { DrizzleSqliteDatabase } from "@beignet/provider-db-drizzle/sqlite";
|
|
211
211
|
import { createDrizzleTodoRepository } from "@/infra/todos/drizzle-todo-repository";
|
|
212
212
|
import type { AppTransactionPorts } from "@/ports";
|
|
213
213
|
import * as schema from "./schema";
|
|
214
214
|
|
|
215
215
|
export function createRepositories(
|
|
216
|
-
db:
|
|
216
|
+
db: DrizzleSqliteDatabase<typeof schema>,
|
|
217
217
|
): Omit<AppTransactionPorts, "idempotency"> {
|
|
218
218
|
return {
|
|
219
219
|
todos: createDrizzleTodoRepository(db),
|
|
@@ -264,10 +264,10 @@ async function prepare(client: Client): Promise<void> {
|
|
|
264
264
|
dbProvider: `import type { beignetServerOnly } from "@beignet/core/server-only";
|
|
265
265
|
import { createProvider } from "@beignet/core/providers";
|
|
266
266
|
import {
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
createDrizzleSqliteIdempotencyPort,
|
|
268
|
+
createDrizzleSqliteUnitOfWork,
|
|
269
269
|
type DbPort,
|
|
270
|
-
} from "@beignet/provider-drizzle
|
|
270
|
+
} from "@beignet/provider-db-drizzle/sqlite";
|
|
271
271
|
import type { AppPorts } from "@/ports";
|
|
272
272
|
import { ensureDatabaseReady } from "./database-ready";
|
|
273
273
|
import { createRepositories } from "./repositories";
|
|
@@ -282,21 +282,21 @@ export const starterDatabaseProvider = createProvider<{
|
|
|
282
282
|
const dbPort = ports.db;
|
|
283
283
|
if (!dbPort) {
|
|
284
284
|
throw new Error(
|
|
285
|
-
"starterDatabaseProvider requires a db port. Register
|
|
285
|
+
"starterDatabaseProvider requires a db port. Register createDrizzleSqliteProvider({ schema }) before it.",
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
const repositories = createRepositories(dbPort.db);
|
|
290
|
-
const idempotency =
|
|
290
|
+
const idempotency = createDrizzleSqliteIdempotencyPort(dbPort.db);
|
|
291
291
|
|
|
292
292
|
const providedPorts: Pick<AppPorts, "idempotency" | "todos" | "uow"> = {
|
|
293
293
|
...repositories,
|
|
294
294
|
idempotency,
|
|
295
|
-
uow:
|
|
295
|
+
uow: createDrizzleSqliteUnitOfWork({
|
|
296
296
|
db: dbPort.db,
|
|
297
297
|
createTransactionPorts: (tx) => ({
|
|
298
298
|
...createRepositories(tx),
|
|
299
|
-
idempotency:
|
|
299
|
+
idempotency: createDrizzleSqliteIdempotencyPort(tx),
|
|
300
300
|
}),
|
|
301
301
|
}),
|
|
302
302
|
};
|
|
@@ -316,7 +316,7 @@ import { migrate } from "drizzle-orm/libsql/migrator";
|
|
|
316
316
|
import { env } from "@/lib/env";
|
|
317
317
|
|
|
318
318
|
if (
|
|
319
|
-
!env.
|
|
319
|
+
!env.SQLITE_DB_URL.startsWith("file:") &&
|
|
320
320
|
process.env.BEIGNET_ALLOW_DATABASE_RESET !== "true"
|
|
321
321
|
) {
|
|
322
322
|
throw new Error(
|
|
@@ -335,8 +335,8 @@ const tables = [
|
|
|
335
335
|
] as const;
|
|
336
336
|
|
|
337
337
|
const client = createClient({
|
|
338
|
-
url: env.
|
|
339
|
-
authToken: env.
|
|
338
|
+
url: env.SQLITE_DB_URL,
|
|
339
|
+
authToken: env.SQLITE_DB_AUTH_TOKEN,
|
|
340
340
|
});
|
|
341
341
|
|
|
342
342
|
try {
|
package/dist/templates/server.js
CHANGED
|
@@ -4,7 +4,7 @@ export function serverProviders(ctx) {
|
|
|
4
4
|
'import type { beignetServerOnly } from "@beignet/core/server-only";',
|
|
5
5
|
'import { createDevtoolsProvider } from "@beignet/devtools";',
|
|
6
6
|
'import { createAuthBetterAuthProvider } from "@beignet/provider-auth-better-auth";',
|
|
7
|
-
'import {
|
|
7
|
+
'import { createDrizzleSqliteProvider } from "@beignet/provider-db-drizzle/sqlite";',
|
|
8
8
|
hasIntegration(ctx, "inngest")
|
|
9
9
|
? 'import { inngestProvider } from "@beignet/provider-inngest";'
|
|
10
10
|
: undefined,
|
|
@@ -24,7 +24,7 @@ export function serverProviders(ctx) {
|
|
|
24
24
|
"\tcreateDevtoolsProvider(),",
|
|
25
25
|
"\tcreateAuthBetterAuthProvider<AuthUser, AuthSessionMetadata>(auth),",
|
|
26
26
|
"\tloggerPinoProvider,",
|
|
27
|
-
"\
|
|
27
|
+
"\tdrizzleSqliteProvider,",
|
|
28
28
|
"\tstarterDatabaseProvider,",
|
|
29
29
|
hasIntegration(ctx, "inngest") ? "\tinngestProvider," : undefined,
|
|
30
30
|
hasIntegration(ctx, "resend") ? "\tmailResendProvider," : undefined,
|
|
@@ -34,7 +34,7 @@ export function serverProviders(ctx) {
|
|
|
34
34
|
].filter((entry) => Boolean(entry));
|
|
35
35
|
return `${imports.join("\n")}
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const drizzleSqliteProvider = createDrizzleSqliteProvider({ schema });
|
|
38
38
|
|
|
39
39
|
export const providers = [
|
|
40
40
|
${entries.join("\n")}
|
|
@@ -143,8 +143,8 @@ export const env = createEnv({
|
|
|
143
143
|
.default("local-dev-better-auth-secret-change-me"),
|
|
144
144
|
BETTER_AUTH_URL: z.string().url().default("http://localhost:3000"),
|
|
145
145
|
BETTER_AUTH_TRUSTED_ORIGINS: z.string().optional(),
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
SQLITE_DB_URL: z.string().default("file:local.db"),
|
|
147
|
+
SQLITE_DB_AUTH_TOKEN: z.string().optional(),
|
|
148
148
|
LOG_LEVEL: z
|
|
149
149
|
.enum(["trace", "debug", "info", "warn", "error", "fatal"])
|
|
150
150
|
.default("info"),
|
|
@@ -336,9 +336,9 @@ export const server = await createNextServer({
|
|
|
336
336
|
ports: appPorts,
|
|
337
337
|
providers,
|
|
338
338
|
providerConfig: {
|
|
339
|
-
"drizzle-
|
|
340
|
-
DB_URL: env.
|
|
341
|
-
DB_AUTH_TOKEN: env.
|
|
339
|
+
"drizzle-sqlite": {
|
|
340
|
+
DB_URL: env.SQLITE_DB_URL,
|
|
341
|
+
DB_AUTH_TOKEN: env.SQLITE_DB_AUTH_TOKEN,
|
|
342
342
|
},
|
|
343
343
|
},
|
|
344
344
|
hooks: [createIdempotencyHooks<AppContext>()],
|
|
@@ -420,8 +420,8 @@ import * as schema from "@/infra/db/schema";
|
|
|
420
420
|
import { env } from "@/lib/env";
|
|
421
421
|
|
|
422
422
|
const client = createClient({
|
|
423
|
-
url: env.
|
|
424
|
-
authToken: env.
|
|
423
|
+
url: env.SQLITE_DB_URL,
|
|
424
|
+
authToken: env.SQLITE_DB_AUTH_TOKEN,
|
|
425
425
|
});
|
|
426
426
|
|
|
427
427
|
// Auth routes can be the first thing to touch the database, before any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/templates/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE,MAAM,UAAU,eAAe,CAAC,GAAoB;I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;;;;;CAuBZ;IACC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BV;IACC,cAAc,EAAE;;;;;CAKjB;CACA,CAAC;AAEF,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beignet/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for creating and maintaining Beignet apps.",
|
|
6
6
|
"main": "./dist/lib.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript": "^5.3.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@beignet/core": "^0.0.
|
|
69
|
+
"@beignet/core": "^0.0.9",
|
|
70
70
|
"@clack/prompts": "^1.5.1",
|
|
71
71
|
"@stricli/core": "^1.2.7",
|
|
72
72
|
"jiti": "^2.7.0"
|
package/src/create.ts
CHANGED
|
@@ -95,7 +95,7 @@ export async function createProject(
|
|
|
95
95
|
* Providers that ship in every starter. They used to be `--integrations`
|
|
96
96
|
* choices, so passing them gets a pointed error instead of a generic one.
|
|
97
97
|
*/
|
|
98
|
-
const baseProviderNames = new Set(["better-auth", "drizzle-
|
|
98
|
+
const baseProviderNames = new Set(["better-auth", "drizzle-sqlite", "pino"]);
|
|
99
99
|
|
|
100
100
|
function resolveIntegrations(
|
|
101
101
|
explicitIntegrations: IntegrationName[],
|