@betterstart/cli 0.1.2 → 0.1.4
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/README.md +133 -0
- package/dist/cli.d.ts +1 -9
- package/dist/cli.js +13484 -354
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +24 -260
- package/dist/index.js +4 -11373
- package/dist/index.js.map +1 -1
- package/package.json +29 -42
- package/templates/schema.json +959 -0
- package/templates/tiptap/hooks/use-composed-ref.ts +43 -0
- package/templates/tiptap/hooks/use-cursor-visibility.ts +68 -0
- package/templates/tiptap/hooks/use-element-rect.ts +166 -0
- package/templates/tiptap/hooks/use-is-breakpoint.ts +32 -0
- package/templates/tiptap/hooks/use-menu-navigation.ts +182 -0
- package/templates/tiptap/hooks/use-scrolling.ts +64 -0
- package/templates/tiptap/hooks/use-throttled-callback.ts +146 -0
- package/templates/tiptap/hooks/use-tiptap-editor.ts +46 -0
- package/templates/tiptap/hooks/use-unmount.ts +21 -0
- package/templates/tiptap/hooks/use-window-size.ts +87 -0
- package/templates/tiptap/lib/tiptap-utils.ts +587 -0
- package/templates/tiptap/styles/_keyframe-animations.scss +91 -0
- package/templates/tiptap/styles/_variables.scss +296 -0
- package/templates/tiptap/tiptap-extension/node-background-extension.ts +138 -0
- package/templates/tiptap/tiptap-icons/align-center-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/align-justify-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/align-left-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/align-right-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/arrow-left-icon.tsx +24 -0
- package/templates/tiptap/tiptap-icons/ban-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/blockquote-icon.tsx +44 -0
- package/templates/tiptap/tiptap-icons/bold-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/chevron-down-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/close-icon.tsx +24 -0
- package/templates/tiptap/tiptap-icons/code-block-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/code2-icon.tsx +32 -0
- package/templates/tiptap/tiptap-icons/corner-down-left-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/external-link-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/heading-five-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/heading-four-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/heading-icon.tsx +24 -0
- package/templates/tiptap/tiptap-icons/heading-one-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/heading-six-icon.tsx +30 -0
- package/templates/tiptap/tiptap-icons/heading-three-icon.tsx +36 -0
- package/templates/tiptap/tiptap-icons/heading-two-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/highlighter-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/image-plus-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/italic-icon.tsx +24 -0
- package/templates/tiptap/tiptap-icons/link-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/list-icon.tsx +56 -0
- package/templates/tiptap/tiptap-icons/list-ordered-icon.tsx +56 -0
- package/templates/tiptap/tiptap-icons/list-todo-icon.tsx +50 -0
- package/templates/tiptap/tiptap-icons/moon-star-icon.tsx +30 -0
- package/templates/tiptap/tiptap-icons/redo2-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/strike-icon.tsx +28 -0
- package/templates/tiptap/tiptap-icons/subscript-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/sun-icon.tsx +58 -0
- package/templates/tiptap/tiptap-icons/superscript-icon.tsx +38 -0
- package/templates/tiptap/tiptap-icons/trash-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/underline-icon.tsx +26 -0
- package/templates/tiptap/tiptap-icons/undo2-icon.tsx +26 -0
- package/templates/tiptap/tiptap-node/blockquote-node/blockquote-node.scss +37 -0
- package/templates/tiptap/tiptap-node/code-block-node/code-block-node.scss +54 -0
- package/templates/tiptap/tiptap-node/heading-node/heading-node.scss +45 -0
- package/templates/tiptap/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.ts +10 -0
- package/templates/tiptap/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss +25 -0
- package/templates/tiptap/tiptap-node/image-node/image-node.scss +35 -0
- package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node-extension.ts +154 -0
- package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node.scss +249 -0
- package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node.tsx +522 -0
- package/templates/tiptap/tiptap-node/image-upload-node/index.tsx +1 -0
- package/templates/tiptap/tiptap-node/list-node/list-node.scss +208 -0
- package/templates/tiptap/tiptap-node/paragraph-node/paragraph-node.scss +273 -0
- package/templates/tiptap/tiptap-ui/blockquote-button/blockquote-button.tsx +104 -0
- package/templates/tiptap/tiptap-ui/blockquote-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/blockquote-button/use-blockquote.ts +252 -0
- package/templates/tiptap/tiptap-ui/code-block-button/code-block-button.tsx +106 -0
- package/templates/tiptap/tiptap-ui/code-block-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/code-block-button/use-code-block.ts +261 -0
- package/templates/tiptap/tiptap-ui/color-highlight-button/color-highlight-button.scss +49 -0
- package/templates/tiptap/tiptap-ui/color-highlight-button/color-highlight-button.tsx +153 -0
- package/templates/tiptap/tiptap-ui/color-highlight-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/color-highlight-button/use-color-highlight.ts +345 -0
- package/templates/tiptap/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +207 -0
- package/templates/tiptap/tiptap-ui/color-highlight-popover/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui/heading-button/heading-button.tsx +107 -0
- package/templates/tiptap/tiptap-ui/heading-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/heading-button/use-heading.ts +314 -0
- package/templates/tiptap/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +131 -0
- package/templates/tiptap/tiptap-ui/heading-dropdown-menu/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts +130 -0
- package/templates/tiptap/tiptap-ui/image-upload-button/image-upload-button.tsx +114 -0
- package/templates/tiptap/tiptap-ui/image-upload-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/image-upload-button/use-image-upload.ts +192 -0
- package/templates/tiptap/tiptap-ui/link-popover/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/link-popover/link-popover.tsx +285 -0
- package/templates/tiptap/tiptap-ui/link-popover/use-link-popover.ts +286 -0
- package/templates/tiptap/tiptap-ui/list-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/list-button/list-button.tsx +108 -0
- package/templates/tiptap/tiptap-ui/list-button/use-list.ts +329 -0
- package/templates/tiptap/tiptap-ui/list-dropdown-menu/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +123 -0
- package/templates/tiptap/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts +203 -0
- package/templates/tiptap/tiptap-ui/mark-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/mark-button/mark-button.tsx +107 -0
- package/templates/tiptap/tiptap-ui/mark-button/use-mark.ts +206 -0
- package/templates/tiptap/tiptap-ui/text-align-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/text-align-button/text-align-button.tsx +118 -0
- package/templates/tiptap/tiptap-ui/text-align-button/use-text-align.ts +212 -0
- package/templates/tiptap/tiptap-ui/undo-redo-button/index.tsx +2 -0
- package/templates/tiptap/tiptap-ui/undo-redo-button/undo-redo-button.tsx +105 -0
- package/templates/tiptap/tiptap-ui/undo-redo-button/use-undo-redo.ts +173 -0
- package/templates/tiptap/tiptap-ui-primitive/badge/badge-colors.scss +395 -0
- package/templates/tiptap/tiptap-ui-primitive/badge/badge-group.scss +16 -0
- package/templates/tiptap/tiptap-ui-primitive/badge/badge.scss +99 -0
- package/templates/tiptap/tiptap-ui-primitive/badge/badge.tsx +46 -0
- package/templates/tiptap/tiptap-ui-primitive/badge/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/button/button-colors.scss +429 -0
- package/templates/tiptap/tiptap-ui-primitive/button/button-group.scss +22 -0
- package/templates/tiptap/tiptap-ui-primitive/button/button.scss +314 -0
- package/templates/tiptap/tiptap-ui-primitive/button/button.tsx +102 -0
- package/templates/tiptap/tiptap-ui-primitive/button/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/card/card.scss +77 -0
- package/templates/tiptap/tiptap-ui-primitive/card/card.tsx +59 -0
- package/templates/tiptap/tiptap-ui-primitive/card/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/dropdown-menu.scss +63 -0
- package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx +95 -0
- package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/input/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/input/input.scss +45 -0
- package/templates/tiptap/tiptap-ui-primitive/input/input.tsx +18 -0
- package/templates/tiptap/tiptap-ui-primitive/popover/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/popover/popover.scss +63 -0
- package/templates/tiptap/tiptap-ui-primitive/popover/popover.tsx +33 -0
- package/templates/tiptap/tiptap-ui-primitive/separator/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/separator/separator.scss +23 -0
- package/templates/tiptap/tiptap-ui-primitive/separator/separator.tsx +33 -0
- package/templates/tiptap/tiptap-ui-primitive/spacer/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/spacer/spacer.tsx +21 -0
- package/templates/tiptap/tiptap-ui-primitive/toolbar/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/toolbar/toolbar.scss +98 -0
- package/templates/tiptap/tiptap-ui-primitive/toolbar/toolbar.tsx +113 -0
- package/templates/tiptap/tiptap-ui-primitive/tooltip/index.tsx +1 -0
- package/templates/tiptap/tiptap-ui-primitive/tooltip/tooltip.scss +43 -0
- package/templates/tiptap/tiptap-ui-primitive/tooltip/tooltip.tsx +223 -0
- package/templates/ui/accordion.tsx +52 -0
- package/templates/ui/alert-dialog.tsx +116 -0
- package/templates/ui/alert.tsx +48 -0
- package/templates/ui/aspect-ratio.tsx +7 -0
- package/templates/ui/avatar.tsx +46 -0
- package/templates/ui/badge.tsx +32 -0
- package/templates/ui/breadcrumb.tsx +98 -0
- package/templates/ui/button-group.tsx +77 -0
- package/templates/ui/button.tsx +48 -0
- package/templates/ui/calendar.tsx +176 -0
- package/templates/ui/card.tsx +54 -0
- package/templates/ui/carousel.tsx +234 -0
- package/templates/ui/chart.tsx +349 -0
- package/templates/ui/checkbox.tsx +27 -0
- package/templates/ui/collapsible.tsx +11 -0
- package/templates/ui/command.tsx +142 -0
- package/templates/ui/context-menu.tsx +188 -0
- package/templates/ui/curriculum-editor.tsx +601 -0
- package/templates/ui/date-picker.tsx +70 -0
- package/templates/ui/dialog.tsx +103 -0
- package/templates/ui/drawer.tsx +99 -0
- package/templates/ui/dropdown-menu.tsx +185 -0
- package/templates/ui/dynamic-list-field.tsx +95 -0
- package/templates/ui/empty.tsx +90 -0
- package/templates/ui/field.tsx +231 -0
- package/templates/ui/file-upload-example.tsx +113 -0
- package/templates/ui/form.tsx +172 -0
- package/templates/ui/hover-card.tsx +28 -0
- package/templates/ui/icon-picker.tsx +435 -0
- package/templates/ui/icons-data.ts +6 -0
- package/templates/ui/image-upload-field.tsx +360 -0
- package/templates/ui/input-group.tsx +160 -0
- package/templates/ui/input-otp.tsx +70 -0
- package/templates/ui/input.tsx +21 -0
- package/templates/ui/item.tsx +171 -0
- package/templates/ui/kbd.tsx +28 -0
- package/templates/ui/label.tsx +20 -0
- package/templates/ui/logo.tsx +113 -0
- package/templates/ui/markdown-editor.tsx +303 -0
- package/templates/ui/markdown-utils.ts +128 -0
- package/templates/ui/media-upload-field.tsx +255 -0
- package/templates/ui/menubar.tsx +230 -0
- package/templates/ui/navigation-menu.tsx +119 -0
- package/templates/ui/pagination.tsx +96 -0
- package/templates/ui/placeholder.tsx +25 -0
- package/templates/ui/popover.tsx +32 -0
- package/templates/ui/progress.tsx +24 -0
- package/templates/ui/radio-group.tsx +37 -0
- package/templates/ui/resizable.tsx +41 -0
- package/templates/ui/rich-text-editor.tsx +374 -0
- package/templates/ui/scroll-area.tsx +45 -0
- package/templates/ui/select.tsx +151 -0
- package/templates/ui/separator.tsx +25 -0
- package/templates/ui/sheet.tsx +120 -0
- package/templates/ui/sidebar.tsx +684 -0
- package/templates/ui/skeleton.tsx +7 -0
- package/templates/ui/slider.tsx +24 -0
- package/templates/ui/sonner.tsx +29 -0
- package/templates/ui/spinner.tsx +15 -0
- package/templates/ui/switch.tsx +28 -0
- package/templates/ui/table.tsx +93 -0
- package/templates/ui/tabs.tsx +54 -0
- package/templates/ui/textarea.tsx +20 -0
- package/templates/ui/toast.tsx +127 -0
- package/templates/ui/toggle-group.tsx +56 -0
- package/templates/ui/toggle.tsx +43 -0
- package/templates/ui/tooltip.tsx +31 -0
- package/templates/ui/use-mobile.tsx +19 -0
- package/templates/ui/video-upload-field.tsx +368 -0
- package/dist/chunk-G4KI4DVB.js +0 -179
- package/dist/chunk-G4KI4DVB.js.map +0 -1
- package/dist/chunk-NKRQYAS6.js +0 -260
- package/dist/chunk-NKRQYAS6.js.map +0 -1
- package/dist/chunk-QLVSHP7X.js +0 -235
- package/dist/chunk-QLVSHP7X.js.map +0 -1
- package/dist/chunk-WY6BC55D.js +0 -357
- package/dist/chunk-WY6BC55D.js.map +0 -1
- package/dist/config/index.d.ts +0 -93
- package/dist/config/index.js +0 -58
- package/dist/config/index.js.map +0 -1
- package/dist/core/index.d.ts +0 -415
- package/dist/core/index.js +0 -906
- package/dist/core/index.js.map +0 -1
- package/dist/import-resolver-BaZ-rzkH.d.ts +0 -123
- package/dist/logger-awLb347n.d.ts +0 -81
- package/dist/plugins/index.d.ts +0 -213
- package/dist/plugins/index.js +0 -365
- package/dist/plugins/index.js.map +0 -1
- package/dist/types-ByX_gl6y.d.ts +0 -232
- package/dist/types-eI549DEG.d.ts +0 -331
package/dist/chunk-WY6BC55D.js
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
// src/core/errors.ts
|
|
2
|
-
var CodegenError = class extends Error {
|
|
3
|
-
code;
|
|
4
|
-
context;
|
|
5
|
-
constructor(message, code, context) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = "CodegenError";
|
|
8
|
-
this.code = code;
|
|
9
|
-
this.context = context;
|
|
10
|
-
if (Error.captureStackTrace) {
|
|
11
|
-
Error.captureStackTrace(this, this.constructor);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Format error for display
|
|
16
|
-
*/
|
|
17
|
-
toString() {
|
|
18
|
-
let result = `[${this.code}] ${this.message}`;
|
|
19
|
-
if (this.context) {
|
|
20
|
-
result += `
|
|
21
|
-
Context: ${JSON.stringify(this.context, null, 2)}`;
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var SchemaValidationError = class extends CodegenError {
|
|
27
|
-
validationErrors;
|
|
28
|
-
constructor(message, validationErrors, context) {
|
|
29
|
-
super(message, "SCHEMA_VALIDATION_ERROR", context);
|
|
30
|
-
this.name = "SchemaValidationError";
|
|
31
|
-
this.validationErrors = validationErrors;
|
|
32
|
-
}
|
|
33
|
-
toString() {
|
|
34
|
-
let result = `[${this.code}] ${this.message}`;
|
|
35
|
-
if (this.validationErrors.length > 0) {
|
|
36
|
-
result += "\nValidation errors:";
|
|
37
|
-
for (const error of this.validationErrors) {
|
|
38
|
-
result += `
|
|
39
|
-
- ${error}`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var ConfigurationError = class extends CodegenError {
|
|
46
|
-
constructor(message, context) {
|
|
47
|
-
super(message, "CONFIGURATION_ERROR", context);
|
|
48
|
-
this.name = "ConfigurationError";
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var GeneratorError = class extends CodegenError {
|
|
52
|
-
generatorName;
|
|
53
|
-
constructor(message, generatorName, context) {
|
|
54
|
-
super(message, "GENERATOR_ERROR", context);
|
|
55
|
-
this.name = "GeneratorError";
|
|
56
|
-
this.generatorName = generatorName;
|
|
57
|
-
}
|
|
58
|
-
toString() {
|
|
59
|
-
return `[${this.code}] Generator "${this.generatorName}": ${this.message}`;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var PluginError = class extends CodegenError {
|
|
63
|
-
pluginName;
|
|
64
|
-
constructor(message, pluginName, context) {
|
|
65
|
-
super(message, "PLUGIN_ERROR", context);
|
|
66
|
-
this.name = "PluginError";
|
|
67
|
-
this.pluginName = pluginName;
|
|
68
|
-
}
|
|
69
|
-
toString() {
|
|
70
|
-
return `[${this.code}] Plugin "${this.pluginName}": ${this.message}`;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
var FileOperationError = class extends CodegenError {
|
|
74
|
-
filePath;
|
|
75
|
-
operation;
|
|
76
|
-
constructor(message, filePath, operation, context) {
|
|
77
|
-
super(message, "FILE_OPERATION_ERROR", context);
|
|
78
|
-
this.name = "FileOperationError";
|
|
79
|
-
this.filePath = filePath;
|
|
80
|
-
this.operation = operation;
|
|
81
|
-
}
|
|
82
|
-
toString() {
|
|
83
|
-
return `[${this.code}] Failed to ${this.operation} file "${this.filePath}": ${this.message}`;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var MissingFieldError = class extends CodegenError {
|
|
87
|
-
fieldName;
|
|
88
|
-
schemaName;
|
|
89
|
-
constructor(fieldName, schemaName, context) {
|
|
90
|
-
super(
|
|
91
|
-
`Missing required field "${fieldName}" in schema "${schemaName}"`,
|
|
92
|
-
"MISSING_FIELD_ERROR",
|
|
93
|
-
context
|
|
94
|
-
);
|
|
95
|
-
this.name = "MissingFieldError";
|
|
96
|
-
this.fieldName = fieldName;
|
|
97
|
-
this.schemaName = schemaName;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
var UnsupportedFieldTypeError = class extends CodegenError {
|
|
101
|
-
fieldType;
|
|
102
|
-
fieldName;
|
|
103
|
-
constructor(fieldType, fieldName, context) {
|
|
104
|
-
super(
|
|
105
|
-
`Unsupported field type "${fieldType}" for field "${fieldName}"`,
|
|
106
|
-
"UNSUPPORTED_FIELD_TYPE_ERROR",
|
|
107
|
-
context
|
|
108
|
-
);
|
|
109
|
-
this.name = "UnsupportedFieldTypeError";
|
|
110
|
-
this.fieldType = fieldType;
|
|
111
|
-
this.fieldName = fieldName;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
var ERROR_CODES = {
|
|
115
|
-
SCHEMA_VALIDATION_ERROR: "SCHEMA_VALIDATION_ERROR",
|
|
116
|
-
CONFIGURATION_ERROR: "CONFIGURATION_ERROR",
|
|
117
|
-
GENERATOR_ERROR: "GENERATOR_ERROR",
|
|
118
|
-
PLUGIN_ERROR: "PLUGIN_ERROR",
|
|
119
|
-
FILE_OPERATION_ERROR: "FILE_OPERATION_ERROR",
|
|
120
|
-
MISSING_FIELD_ERROR: "MISSING_FIELD_ERROR",
|
|
121
|
-
UNSUPPORTED_FIELD_TYPE_ERROR: "UNSUPPORTED_FIELD_TYPE_ERROR"
|
|
122
|
-
};
|
|
123
|
-
function isCodegenError(error) {
|
|
124
|
-
return error instanceof CodegenError;
|
|
125
|
-
}
|
|
126
|
-
function wrapError(error, code, message) {
|
|
127
|
-
if (isCodegenError(error)) {
|
|
128
|
-
return error;
|
|
129
|
-
}
|
|
130
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
131
|
-
return new CodegenError(message || errorMessage, code, { originalError: error });
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// src/core/logger.ts
|
|
135
|
-
var ConsoleLogger = class {
|
|
136
|
-
level = "info";
|
|
137
|
-
shouldLog(level) {
|
|
138
|
-
if (this.level === "silent") return false;
|
|
139
|
-
const levels = ["debug", "info", "warn", "error"];
|
|
140
|
-
const currentIndex = levels.indexOf(this.level);
|
|
141
|
-
const messageIndex = levels.indexOf(level);
|
|
142
|
-
return messageIndex >= currentIndex;
|
|
143
|
-
}
|
|
144
|
-
debug(message, ...args) {
|
|
145
|
-
if (this.shouldLog("debug")) {
|
|
146
|
-
console.log(`\x1B[90m[DEBUG]\x1B[0m ${message}`, ...args);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
info(message, ...args) {
|
|
150
|
-
if (this.shouldLog("info")) {
|
|
151
|
-
console.log(message, ...args);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
warn(message, ...args) {
|
|
155
|
-
if (this.shouldLog("warn")) {
|
|
156
|
-
console.warn(`\x1B[33m\u26A0\uFE0F ${message}\x1B[0m`, ...args);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
error(message, ...args) {
|
|
160
|
-
if (this.shouldLog("error")) {
|
|
161
|
-
console.error(`\x1B[31m\u274C ${message}\x1B[0m`, ...args);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
success(message, ...args) {
|
|
165
|
-
if (this.shouldLog("info")) {
|
|
166
|
-
console.log(`\x1B[32m\u2713 ${message}\x1B[0m`, ...args);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
step(stepNumber, message) {
|
|
170
|
-
if (this.shouldLog("info")) {
|
|
171
|
-
const emoji = this.getStepEmoji(stepNumber);
|
|
172
|
-
console.log(`${emoji} ${message}`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
stepComplete(message) {
|
|
176
|
-
if (this.shouldLog("info")) {
|
|
177
|
-
console.log(` \x1B[32m\u2713\x1B[0m ${message}`);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
setLevel(level) {
|
|
181
|
-
this.level = level;
|
|
182
|
-
}
|
|
183
|
-
getLevel() {
|
|
184
|
-
return this.level;
|
|
185
|
-
}
|
|
186
|
-
getStepEmoji(step) {
|
|
187
|
-
const emojis = ["1\uFE0F\u20E3", "2\uFE0F\u20E3", "3\uFE0F\u20E3", "4\uFE0F\u20E3", "5\uFE0F\u20E3", "6\uFE0F\u20E3", "7\uFE0F\u20E3", "8\uFE0F\u20E3", "9\uFE0F\u20E3", "\u{1F51F}"];
|
|
188
|
-
if (step >= 1 && step <= 10) {
|
|
189
|
-
return emojis[step - 1];
|
|
190
|
-
}
|
|
191
|
-
if (step >= 11 && step <= 15) {
|
|
192
|
-
return `1\uFE0F\u20E3${emojis[step - 11]}`;
|
|
193
|
-
}
|
|
194
|
-
return `${step}.`;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
var SilentLogger = class {
|
|
198
|
-
debug() {
|
|
199
|
-
}
|
|
200
|
-
info() {
|
|
201
|
-
}
|
|
202
|
-
warn() {
|
|
203
|
-
}
|
|
204
|
-
error() {
|
|
205
|
-
}
|
|
206
|
-
success() {
|
|
207
|
-
}
|
|
208
|
-
step() {
|
|
209
|
-
}
|
|
210
|
-
stepComplete() {
|
|
211
|
-
}
|
|
212
|
-
setLevel() {
|
|
213
|
-
}
|
|
214
|
-
getLevel() {
|
|
215
|
-
return "silent";
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
var BufferedLogger = class {
|
|
219
|
-
level = "info";
|
|
220
|
-
entries = [];
|
|
221
|
-
shouldLog(level) {
|
|
222
|
-
if (this.level === "silent") return false;
|
|
223
|
-
const levels = ["debug", "info", "warn", "error"];
|
|
224
|
-
const currentIndex = levels.indexOf(this.level);
|
|
225
|
-
const messageIndex = levels.indexOf(level);
|
|
226
|
-
return messageIndex >= currentIndex;
|
|
227
|
-
}
|
|
228
|
-
addEntry(level, message, args) {
|
|
229
|
-
this.entries.push({
|
|
230
|
-
level,
|
|
231
|
-
message,
|
|
232
|
-
args,
|
|
233
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
debug(message, ...args) {
|
|
237
|
-
if (this.shouldLog("debug")) {
|
|
238
|
-
this.addEntry("debug", message, args);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
info(message, ...args) {
|
|
242
|
-
if (this.shouldLog("info")) {
|
|
243
|
-
this.addEntry("info", message, args);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
warn(message, ...args) {
|
|
247
|
-
if (this.shouldLog("warn")) {
|
|
248
|
-
this.addEntry("warn", message, args);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
error(message, ...args) {
|
|
252
|
-
if (this.shouldLog("error")) {
|
|
253
|
-
this.addEntry("error", message, args);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
success(message, ...args) {
|
|
257
|
-
if (this.shouldLog("info")) {
|
|
258
|
-
this.addEntry("success", message, args);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
step(stepNumber, message) {
|
|
262
|
-
if (this.shouldLog("info")) {
|
|
263
|
-
this.addEntry("step", message, [stepNumber]);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
stepComplete(message) {
|
|
267
|
-
if (this.shouldLog("info")) {
|
|
268
|
-
this.addEntry("stepComplete", message, []);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
setLevel(level) {
|
|
272
|
-
this.level = level;
|
|
273
|
-
}
|
|
274
|
-
getLevel() {
|
|
275
|
-
return this.level;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Get all logged entries
|
|
279
|
-
*/
|
|
280
|
-
getEntries() {
|
|
281
|
-
return [...this.entries];
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Clear all logged entries
|
|
285
|
-
*/
|
|
286
|
-
clear() {
|
|
287
|
-
this.entries = [];
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
function createConsoleLogger(level = "info") {
|
|
291
|
-
const logger2 = new ConsoleLogger();
|
|
292
|
-
logger2.setLevel(level);
|
|
293
|
-
return logger2;
|
|
294
|
-
}
|
|
295
|
-
function createSilentLogger() {
|
|
296
|
-
return new SilentLogger();
|
|
297
|
-
}
|
|
298
|
-
function createBufferedLogger(level = "info") {
|
|
299
|
-
const logger2 = new BufferedLogger();
|
|
300
|
-
logger2.setLevel(level);
|
|
301
|
-
return logger2;
|
|
302
|
-
}
|
|
303
|
-
var globalLogger = createConsoleLogger();
|
|
304
|
-
function getLogger() {
|
|
305
|
-
return globalLogger;
|
|
306
|
-
}
|
|
307
|
-
function setLogger(logger2) {
|
|
308
|
-
globalLogger = logger2;
|
|
309
|
-
}
|
|
310
|
-
function resetLogger() {
|
|
311
|
-
globalLogger = createConsoleLogger();
|
|
312
|
-
}
|
|
313
|
-
var logger = {
|
|
314
|
-
get debug() {
|
|
315
|
-
return globalLogger.debug.bind(globalLogger);
|
|
316
|
-
},
|
|
317
|
-
get info() {
|
|
318
|
-
return globalLogger.info.bind(globalLogger);
|
|
319
|
-
},
|
|
320
|
-
get warn() {
|
|
321
|
-
return globalLogger.warn.bind(globalLogger);
|
|
322
|
-
},
|
|
323
|
-
get error() {
|
|
324
|
-
return globalLogger.error.bind(globalLogger);
|
|
325
|
-
},
|
|
326
|
-
get success() {
|
|
327
|
-
return globalLogger.success.bind(globalLogger);
|
|
328
|
-
},
|
|
329
|
-
get step() {
|
|
330
|
-
return globalLogger.step.bind(globalLogger);
|
|
331
|
-
},
|
|
332
|
-
get stepComplete() {
|
|
333
|
-
return globalLogger.stepComplete.bind(globalLogger);
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
export {
|
|
338
|
-
CodegenError,
|
|
339
|
-
SchemaValidationError,
|
|
340
|
-
ConfigurationError,
|
|
341
|
-
GeneratorError,
|
|
342
|
-
PluginError,
|
|
343
|
-
FileOperationError,
|
|
344
|
-
MissingFieldError,
|
|
345
|
-
UnsupportedFieldTypeError,
|
|
346
|
-
ERROR_CODES,
|
|
347
|
-
isCodegenError,
|
|
348
|
-
wrapError,
|
|
349
|
-
createConsoleLogger,
|
|
350
|
-
createSilentLogger,
|
|
351
|
-
createBufferedLogger,
|
|
352
|
-
getLogger,
|
|
353
|
-
setLogger,
|
|
354
|
-
resetLogger,
|
|
355
|
-
logger
|
|
356
|
-
};
|
|
357
|
-
//# sourceMappingURL=chunk-WY6BC55D.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/errors.ts","../src/core/logger.ts"],"sourcesContent":["/**\n * Custom error classes for the codegen package\n * Provides structured errors with codes and context for better debugging\n */\n\n/**\n * Base error class for all codegen errors\n */\nexport class CodegenError extends Error {\n readonly code: string\n readonly context?: unknown\n\n constructor(message: string, code: string, context?: unknown) {\n super(message)\n this.name = 'CodegenError'\n this.code = code\n this.context = context\n\n // Maintains proper stack trace for where error was thrown (only in V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor)\n }\n }\n\n /**\n * Format error for display\n */\n toString(): string {\n let result = `[${this.code}] ${this.message}`\n if (this.context) {\n result += `\\nContext: ${JSON.stringify(this.context, null, 2)}`\n }\n return result\n }\n}\n\n/**\n * Error thrown when schema validation fails\n */\nexport class SchemaValidationError extends CodegenError {\n readonly validationErrors: string[]\n\n constructor(message: string, validationErrors: string[], context?: unknown) {\n super(message, 'SCHEMA_VALIDATION_ERROR', context)\n this.name = 'SchemaValidationError'\n this.validationErrors = validationErrors\n }\n\n toString(): string {\n let result = `[${this.code}] ${this.message}`\n if (this.validationErrors.length > 0) {\n result += '\\nValidation errors:'\n for (const error of this.validationErrors) {\n result += `\\n - ${error}`\n }\n }\n return result\n }\n}\n\n/**\n * Error thrown when configuration is invalid or missing\n */\nexport class ConfigurationError extends CodegenError {\n constructor(message: string, context?: unknown) {\n super(message, 'CONFIGURATION_ERROR', context)\n this.name = 'ConfigurationError'\n }\n}\n\n/**\n * Error thrown during code generation\n */\nexport class GeneratorError extends CodegenError {\n readonly generatorName: string\n\n constructor(message: string, generatorName: string, context?: unknown) {\n super(message, 'GENERATOR_ERROR', context)\n this.name = 'GeneratorError'\n this.generatorName = generatorName\n }\n\n toString(): string {\n return `[${this.code}] Generator \"${this.generatorName}\": ${this.message}`\n }\n}\n\n/**\n * Error thrown when a plugin fails\n */\nexport class PluginError extends CodegenError {\n readonly pluginName: string\n\n constructor(message: string, pluginName: string, context?: unknown) {\n super(message, 'PLUGIN_ERROR', context)\n this.name = 'PluginError'\n this.pluginName = pluginName\n }\n\n toString(): string {\n return `[${this.code}] Plugin \"${this.pluginName}\": ${this.message}`\n }\n}\n\n/**\n * Error thrown when a file operation fails\n */\nexport class FileOperationError extends CodegenError {\n readonly filePath: string\n readonly operation: 'read' | 'write' | 'delete' | 'create'\n\n constructor(\n message: string,\n filePath: string,\n operation: 'read' | 'write' | 'delete' | 'create',\n context?: unknown\n ) {\n super(message, 'FILE_OPERATION_ERROR', context)\n this.name = 'FileOperationError'\n this.filePath = filePath\n this.operation = operation\n }\n\n toString(): string {\n return `[${this.code}] Failed to ${this.operation} file \"${this.filePath}\": ${this.message}`\n }\n}\n\n/**\n * Error thrown when a required field is missing\n */\nexport class MissingFieldError extends CodegenError {\n readonly fieldName: string\n readonly schemaName: string\n\n constructor(fieldName: string, schemaName: string, context?: unknown) {\n super(\n `Missing required field \"${fieldName}\" in schema \"${schemaName}\"`,\n 'MISSING_FIELD_ERROR',\n context\n )\n this.name = 'MissingFieldError'\n this.fieldName = fieldName\n this.schemaName = schemaName\n }\n}\n\n/**\n * Error thrown when a field type is not supported\n */\nexport class UnsupportedFieldTypeError extends CodegenError {\n readonly fieldType: string\n readonly fieldName: string\n\n constructor(fieldType: string, fieldName: string, context?: unknown) {\n super(\n `Unsupported field type \"${fieldType}\" for field \"${fieldName}\"`,\n 'UNSUPPORTED_FIELD_TYPE_ERROR',\n context\n )\n this.name = 'UnsupportedFieldTypeError'\n this.fieldType = fieldType\n this.fieldName = fieldName\n }\n}\n\n// ============================================================================\n// Error Codes\n// ============================================================================\n\nexport const ERROR_CODES = {\n SCHEMA_VALIDATION_ERROR: 'SCHEMA_VALIDATION_ERROR',\n CONFIGURATION_ERROR: 'CONFIGURATION_ERROR',\n GENERATOR_ERROR: 'GENERATOR_ERROR',\n PLUGIN_ERROR: 'PLUGIN_ERROR',\n FILE_OPERATION_ERROR: 'FILE_OPERATION_ERROR',\n MISSING_FIELD_ERROR: 'MISSING_FIELD_ERROR',\n UNSUPPORTED_FIELD_TYPE_ERROR: 'UNSUPPORTED_FIELD_TYPE_ERROR'\n} as const\n\n// ============================================================================\n// Error Utilities\n// ============================================================================\n\n/**\n * Check if an error is a CodegenError\n */\nexport function isCodegenError(error: unknown): error is CodegenError {\n return error instanceof CodegenError\n}\n\n/**\n * Wrap an unknown error in a CodegenError\n */\nexport function wrapError(error: unknown, code: string, message?: string): CodegenError {\n if (isCodegenError(error)) {\n return error\n }\n\n const errorMessage = error instanceof Error ? error.message : String(error)\n return new CodegenError(message || errorMessage, code, { originalError: error })\n}\n","/**\n * Logger abstraction for the codegen package\n * Replaces direct console.log calls to support library usage and testing\n */\n\n/**\n * Log levels\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'\n\n/**\n * Logger interface\n */\nexport interface Logger {\n debug(message: string, ...args: unknown[]): void\n info(message: string, ...args: unknown[]): void\n warn(message: string, ...args: unknown[]): void\n error(message: string, ...args: unknown[]): void\n success(message: string, ...args: unknown[]): void\n\n /**\n * Log a step in a process (e.g., \"1️⃣ Generating database schema...\")\n */\n step(stepNumber: number, message: string): void\n\n /**\n * Log a completed step\n */\n stepComplete(message: string): void\n\n /**\n * Set the log level\n */\n setLevel(level: LogLevel): void\n\n /**\n * Get the current log level\n */\n getLevel(): LogLevel\n}\n\n/**\n * Console logger implementation with colored output\n */\nclass ConsoleLogger implements Logger {\n private level: LogLevel = 'info'\n\n private shouldLog(level: LogLevel): boolean {\n if (this.level === 'silent') return false\n\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error']\n const currentIndex = levels.indexOf(this.level)\n const messageIndex = levels.indexOf(level)\n\n return messageIndex >= currentIndex\n }\n\n debug(message: string, ...args: unknown[]): void {\n if (this.shouldLog('debug')) {\n console.log(`\\x1b[90m[DEBUG]\\x1b[0m ${message}`, ...args)\n }\n }\n\n info(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n console.log(message, ...args)\n }\n }\n\n warn(message: string, ...args: unknown[]): void {\n if (this.shouldLog('warn')) {\n console.warn(`\\x1b[33m⚠️ ${message}\\x1b[0m`, ...args)\n }\n }\n\n error(message: string, ...args: unknown[]): void {\n if (this.shouldLog('error')) {\n console.error(`\\x1b[31m❌ ${message}\\x1b[0m`, ...args)\n }\n }\n\n success(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n console.log(`\\x1b[32m✓ ${message}\\x1b[0m`, ...args)\n }\n }\n\n step(stepNumber: number, message: string): void {\n if (this.shouldLog('info')) {\n const emoji = this.getStepEmoji(stepNumber)\n console.log(`${emoji} ${message}`)\n }\n }\n\n stepComplete(message: string): void {\n if (this.shouldLog('info')) {\n console.log(` \\x1b[32m✓\\x1b[0m ${message}`)\n }\n }\n\n setLevel(level: LogLevel): void {\n this.level = level\n }\n\n getLevel(): LogLevel {\n return this.level\n }\n\n private getStepEmoji(step: number): string {\n const emojis = ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣', '🔟']\n if (step >= 1 && step <= 10) {\n return emojis[step - 1]\n }\n if (step >= 11 && step <= 15) {\n return `1️⃣${emojis[step - 11]}`\n }\n return `${step}.`\n }\n}\n\n/**\n * Silent logger implementation for testing and library usage\n */\nclass SilentLogger implements Logger {\n debug(): void {}\n info(): void {}\n warn(): void {}\n error(): void {}\n success(): void {}\n step(): void {}\n stepComplete(): void {}\n setLevel(): void {}\n getLevel(): LogLevel {\n return 'silent'\n }\n}\n\n/**\n * Buffered logger that stores log messages for later retrieval\n */\nexport interface LogEntry {\n level: LogLevel | 'success' | 'step' | 'stepComplete'\n message: string\n args: unknown[]\n timestamp: Date\n}\n\nclass BufferedLogger implements Logger {\n private level: LogLevel = 'info'\n private entries: LogEntry[] = []\n\n private shouldLog(level: LogLevel): boolean {\n if (this.level === 'silent') return false\n\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error']\n const currentIndex = levels.indexOf(this.level)\n const messageIndex = levels.indexOf(level)\n\n return messageIndex >= currentIndex\n }\n\n private addEntry(level: LogEntry['level'], message: string, args: unknown[]): void {\n this.entries.push({\n level,\n message,\n args,\n timestamp: new Date()\n })\n }\n\n debug(message: string, ...args: unknown[]): void {\n if (this.shouldLog('debug')) {\n this.addEntry('debug', message, args)\n }\n }\n\n info(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n this.addEntry('info', message, args)\n }\n }\n\n warn(message: string, ...args: unknown[]): void {\n if (this.shouldLog('warn')) {\n this.addEntry('warn', message, args)\n }\n }\n\n error(message: string, ...args: unknown[]): void {\n if (this.shouldLog('error')) {\n this.addEntry('error', message, args)\n }\n }\n\n success(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n this.addEntry('success', message, args)\n }\n }\n\n step(stepNumber: number, message: string): void {\n if (this.shouldLog('info')) {\n this.addEntry('step', message, [stepNumber])\n }\n }\n\n stepComplete(message: string): void {\n if (this.shouldLog('info')) {\n this.addEntry('stepComplete', message, [])\n }\n }\n\n setLevel(level: LogLevel): void {\n this.level = level\n }\n\n getLevel(): LogLevel {\n return this.level\n }\n\n /**\n * Get all logged entries\n */\n getEntries(): LogEntry[] {\n return [...this.entries]\n }\n\n /**\n * Clear all logged entries\n */\n clear(): void {\n this.entries = []\n }\n}\n\n// ============================================================================\n// Factory Functions\n// ============================================================================\n\n/**\n * Create a console logger\n */\nexport function createConsoleLogger(level: LogLevel = 'info'): Logger {\n const logger = new ConsoleLogger()\n logger.setLevel(level)\n return logger\n}\n\n/**\n * Create a silent logger (for testing or library usage)\n */\nexport function createSilentLogger(): Logger {\n return new SilentLogger()\n}\n\n/**\n * Create a buffered logger (for testing)\n */\nexport function createBufferedLogger(\n level: LogLevel = 'info'\n): Logger & { getEntries(): LogEntry[]; clear(): void } {\n const logger = new BufferedLogger()\n logger.setLevel(level)\n return logger\n}\n\n// ============================================================================\n// Global Logger Instance\n// ============================================================================\n\n/**\n * Global logger instance\n * This is the default logger used throughout the package\n */\nlet globalLogger: Logger = createConsoleLogger()\n\n/**\n * Get the global logger\n */\nexport function getLogger(): Logger {\n return globalLogger\n}\n\n/**\n * Set the global logger\n */\nexport function setLogger(logger: Logger): void {\n globalLogger = logger\n}\n\n/**\n * Reset the global logger to the default console logger\n */\nexport function resetLogger(): void {\n globalLogger = createConsoleLogger()\n}\n\n// Export the logger as a convenience\nexport const logger = {\n get debug() {\n return globalLogger.debug.bind(globalLogger)\n },\n get info() {\n return globalLogger.info.bind(globalLogger)\n },\n get warn() {\n return globalLogger.warn.bind(globalLogger)\n },\n get error() {\n return globalLogger.error.bind(globalLogger)\n },\n get success() {\n return globalLogger.success.bind(globalLogger)\n },\n get step() {\n return globalLogger.step.bind(globalLogger)\n },\n get stepComplete() {\n return globalLogger.stepComplete.bind(globalLogger)\n }\n}\n"],"mappings":";AAQO,IAAM,eAAN,cAA2B,MAAM;AAAA,EAC7B;AAAA,EACA;AAAA,EAET,YAAY,SAAiB,MAAc,SAAmB;AAC5D,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,UAAU;AAGf,QAAI,MAAM,mBAAmB;AAC3B,YAAM,kBAAkB,MAAM,KAAK,WAAW;AAAA,IAChD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,WAAmB;AACjB,QAAI,SAAS,IAAI,KAAK,IAAI,KAAK,KAAK,OAAO;AAC3C,QAAI,KAAK,SAAS;AAChB,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B,QAAgB;AACpE,QAAMA,UAAS,IAAI,cAAc;AACjC,EAAAA,QAAO,SAAS,KAAK;AACrB,SAAOA;AACT;AAKO,SAAS,qBAA6B;AAC3C,SAAO,IAAI,aAAa;AAC1B;AAKO,SAAS,qBACd,QAAkB,QACoC;AACtD,QAAMA,UAAS,IAAI,eAAe;AAClC,EAAAA,QAAO,SAAS,KAAK;AACrB,SAAOA;AACT;AAUA,IAAI,eAAuB,oBAAoB;AAKxC,SAAS,YAAoB;AAClC,SAAO;AACT;AAKO,SAAS,UAAUA,SAAsB;AAC9C,iBAAeA;AACjB;AAKO,SAAS,cAAoB;AAClC,iBAAe,oBAAoB;AACrC;AAGO,IAAM,SAAS;AAAA,EACpB,IAAI,QAAQ;AACV,WAAO,aAAa,MAAM,KAAK,YAAY;AAAA,EAC7C;AAAA,EACA,IAAI,OAAO;AACT,WAAO,aAAa,KAAK,KAAK,YAAY;AAAA,EAC5C;AAAA,EACA,IAAI,OAAO;AACT,WAAO,aAAa,KAAK,KAAK,YAAY;AAAA,EAC5C;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,aAAa,MAAM,KAAK,YAAY;AAAA,EAC7C;AAAA,EACA,IAAI,UAAU;AACZ,WAAO,aAAa,QAAQ,KAAK,YAAY;AAAA,EAC/C;AAAA,EACA,IAAI,OAAO;AACT,WAAO,aAAa,KAAK,KAAK,YAAY;AAAA,EAC5C;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,aAAa,aAAa,KAAK,YAAY;AAAA,EACpD;AACF;","names":["logger"]}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export { C as CONFIG_FILE_NAMES, I as ImportResolver, e as checkPaths, d as defineConfig, f as findConfigFile, b as findProjectRoot, a as loadConfig, l as loadConfigFile, c as resolveConfig, r as resolvePaths, v as validateConfig } from '../import-resolver-BaZ-rzkH.js';
|
|
2
|
-
import { I as ImportPaths, P as Preset, U as UserConfig } from '../types-eI549DEG.js';
|
|
3
|
-
export { B as BetterstartConfig, j as BetterstartPlugin, C as CustomGenerator, b as DatabaseConfig, D as DatabaseProvider, k as DeepPartial, F as FieldTypeHandler, p as GenerateOptions, h as GeneratedFile, G as GeneratorConfig, e as GeneratorName, n as GeneratorOptions, o as InitOptions, O as OutputPaths, i as PluginCommand, g as PluginContext, f as PluginHooks, a as ProjectPaths, m as ProjectType, q as RemoveOptions, l as ResolvedConfig, R as ResolvedPaths, d as UIConfig, c as UIFramework } from '../types-eI549DEG.js';
|
|
4
|
-
import '../logger-awLb347n.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Project presets for common project structures
|
|
8
|
-
* Each preset provides default configuration for a specific project type
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Default output paths
|
|
13
|
-
*/
|
|
14
|
-
declare const DEFAULT_OUTPUT_PATHS: {
|
|
15
|
-
actions: string;
|
|
16
|
-
hooks: string;
|
|
17
|
-
components: string;
|
|
18
|
-
pages: string;
|
|
19
|
-
emails: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Default database configuration
|
|
23
|
-
*/
|
|
24
|
-
declare const DEFAULT_DATABASE_CONFIG: {
|
|
25
|
-
provider: "drizzle";
|
|
26
|
-
schemaFile: string;
|
|
27
|
-
migrationsDir: string;
|
|
28
|
-
autoMigrate: boolean;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Default UI configuration
|
|
32
|
-
*/
|
|
33
|
-
declare const DEFAULT_UI_CONFIG: {
|
|
34
|
-
framework: "shadcn";
|
|
35
|
-
components: {
|
|
36
|
-
path: string;
|
|
37
|
-
adminPath: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Monorepo import paths (for @betterstart/* packages)
|
|
42
|
-
*/
|
|
43
|
-
declare const MONOREPO_IMPORT_PATHS: ImportPaths;
|
|
44
|
-
/**
|
|
45
|
-
* Standalone import paths (for @/ alias in single Next.js apps)
|
|
46
|
-
*/
|
|
47
|
-
declare const STANDALONE_IMPORT_PATHS: ImportPaths;
|
|
48
|
-
/**
|
|
49
|
-
* Default generator configuration
|
|
50
|
-
*/
|
|
51
|
-
declare const DEFAULT_GENERATOR_CONFIG: {
|
|
52
|
-
core: string[];
|
|
53
|
-
optional: string[];
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Next.js monorepo preset (Turborepo/pnpm style)
|
|
57
|
-
* Similar to the current betterstart structure
|
|
58
|
-
*/
|
|
59
|
-
declare const nextjsMonorepoPreset: Preset;
|
|
60
|
-
/**
|
|
61
|
-
* Standalone Next.js preset
|
|
62
|
-
* For single Next.js apps without monorepo structure
|
|
63
|
-
*/
|
|
64
|
-
declare const nextjsStandalonePreset: Preset;
|
|
65
|
-
/**
|
|
66
|
-
* Custom/minimal preset
|
|
67
|
-
* Provides minimal defaults, user must configure paths
|
|
68
|
-
*/
|
|
69
|
-
declare const customPreset: Preset;
|
|
70
|
-
/**
|
|
71
|
-
* All available presets
|
|
72
|
-
*/
|
|
73
|
-
declare const presets: Record<string, Preset>;
|
|
74
|
-
/**
|
|
75
|
-
* Get a preset by name
|
|
76
|
-
*/
|
|
77
|
-
declare function getPreset(name: string): Preset | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* Get all preset names
|
|
80
|
-
*/
|
|
81
|
-
declare function getPresetNames(): string[];
|
|
82
|
-
/**
|
|
83
|
-
* Auto-detect the best preset for a project
|
|
84
|
-
* @param cwd - The project root directory
|
|
85
|
-
* @returns The detected preset or 'custom' if none match
|
|
86
|
-
*/
|
|
87
|
-
declare function detectPreset(cwd: string): Preset;
|
|
88
|
-
/**
|
|
89
|
-
* Get the default configuration based on project detection
|
|
90
|
-
*/
|
|
91
|
-
declare function getDefaultConfig(cwd: string): UserConfig;
|
|
92
|
-
|
|
93
|
-
export { DEFAULT_DATABASE_CONFIG, DEFAULT_GENERATOR_CONFIG, DEFAULT_OUTPUT_PATHS, DEFAULT_UI_CONFIG, ImportPaths, MONOREPO_IMPORT_PATHS, Preset, STANDALONE_IMPORT_PATHS, UserConfig, customPreset, detectPreset, getDefaultConfig, getPreset, getPresetNames, nextjsMonorepoPreset, nextjsStandalonePreset, presets };
|
package/dist/config/index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CONFIG_FILE_NAMES,
|
|
3
|
-
checkPaths,
|
|
4
|
-
defineConfig,
|
|
5
|
-
findConfigFile,
|
|
6
|
-
findProjectRoot,
|
|
7
|
-
loadConfig,
|
|
8
|
-
loadConfigFile,
|
|
9
|
-
resolveConfig,
|
|
10
|
-
resolvePaths,
|
|
11
|
-
validateConfig
|
|
12
|
-
} from "../chunk-QLVSHP7X.js";
|
|
13
|
-
import {
|
|
14
|
-
DEFAULT_DATABASE_CONFIG,
|
|
15
|
-
DEFAULT_GENERATOR_CONFIG,
|
|
16
|
-
DEFAULT_OUTPUT_PATHS,
|
|
17
|
-
DEFAULT_UI_CONFIG,
|
|
18
|
-
ImportResolver,
|
|
19
|
-
MONOREPO_IMPORT_PATHS,
|
|
20
|
-
STANDALONE_IMPORT_PATHS,
|
|
21
|
-
customPreset,
|
|
22
|
-
detectPreset,
|
|
23
|
-
getDefaultConfig,
|
|
24
|
-
getPreset,
|
|
25
|
-
getPresetNames,
|
|
26
|
-
nextjsMonorepoPreset,
|
|
27
|
-
nextjsStandalonePreset,
|
|
28
|
-
presets
|
|
29
|
-
} from "../chunk-NKRQYAS6.js";
|
|
30
|
-
import "../chunk-WY6BC55D.js";
|
|
31
|
-
export {
|
|
32
|
-
CONFIG_FILE_NAMES,
|
|
33
|
-
DEFAULT_DATABASE_CONFIG,
|
|
34
|
-
DEFAULT_GENERATOR_CONFIG,
|
|
35
|
-
DEFAULT_OUTPUT_PATHS,
|
|
36
|
-
DEFAULT_UI_CONFIG,
|
|
37
|
-
ImportResolver,
|
|
38
|
-
MONOREPO_IMPORT_PATHS,
|
|
39
|
-
STANDALONE_IMPORT_PATHS,
|
|
40
|
-
checkPaths,
|
|
41
|
-
customPreset,
|
|
42
|
-
defineConfig,
|
|
43
|
-
detectPreset,
|
|
44
|
-
findConfigFile,
|
|
45
|
-
findProjectRoot,
|
|
46
|
-
getDefaultConfig,
|
|
47
|
-
getPreset,
|
|
48
|
-
getPresetNames,
|
|
49
|
-
loadConfig,
|
|
50
|
-
loadConfigFile,
|
|
51
|
-
nextjsMonorepoPreset,
|
|
52
|
-
nextjsStandalonePreset,
|
|
53
|
-
presets,
|
|
54
|
-
resolveConfig,
|
|
55
|
-
resolvePaths,
|
|
56
|
-
validateConfig
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|