bun-query-builder 0.1.2

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,6 @@
1
+ import type { ModelRecord } from './schema';
2
+ export declare function loadModels(options: LoadModelsOptions): Promise<ModelRecord>;
3
+ export declare interface LoadModelsOptions {
4
+ cwd?: string
5
+ modelsDir: string
6
+ }
package/dist/meta.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { ModelRecord } from './schema';
2
+ export declare function buildSchemaMeta(models: ModelRecord): SchemaMeta;
3
+ export declare interface SchemaMeta {
4
+ modelToTable: Record<string, string>
5
+ tableToModel: Record<string, string>
6
+ primaryKeys: Record<string, string>
7
+ relations?: Record<string, {
8
+ hasOne?: Record<string, string>
9
+ hasMany?: Record<string, string>
10
+ belongsTo?: Record<string, string>
11
+ belongsToMany?: Record<string, string>
12
+ }>
13
+ scopes?: Record<string, Record<string, (qb: any, value?: any) => any>>
14
+ }
@@ -0,0 +1,65 @@
1
+ import type { ModelRecord } from './schema';
2
+ import type { SupportedDialect } from './types';
3
+ export declare function buildMigrationPlan(models: ModelRecord, options: InferenceOptions): MigrationPlan;
4
+ export declare function generateSql(plan: MigrationPlan): string[];
5
+ /**
6
+ * Helper function to convert SQL statements array to a single string (for backward compatibility)
7
+ */
8
+ export declare function generateSqlString(plan: MigrationPlan): string;
9
+ /**
10
+ * Helper function to convert diff SQL statements array to a single string (for backward compatibility)
11
+ */
12
+ export declare function generateDiffSqlString(previous: MigrationPlan | undefined, next: MigrationPlan): string;
13
+ /**
14
+ * Compute a stable hash for a migration plan. Useful for snapshotting.
15
+ */
16
+ export declare function hashMigrationPlan(plan: MigrationPlan): string;
17
+ /**
18
+ * Generate safe, additive-only SQL to migrate from a previous plan to a new plan.
19
+ * - Creates new tables
20
+ * - Adds new columns (no drops or type/nullable/default changes)
21
+ * - Adds new foreign keys for newly added columns
22
+ * - Adds new indexes and unique indexes
23
+ *
24
+ * If there is no previous plan or the dialect changed, generates full SQL.
25
+ */
26
+ export declare function generateDiffSql(previous: MigrationPlan | undefined, next: MigrationPlan): string[];
27
+ export declare interface ColumnPlan {
28
+ name: string
29
+ type: NormalizedColumnType
30
+ isPrimaryKey: boolean
31
+ isUnique: boolean
32
+ isNullable: boolean
33
+ hasDefault: boolean
34
+ defaultValue?: PrimitiveDefault
35
+ references?: { table: string, column: string }
36
+ }
37
+ export declare interface IndexPlan {
38
+ name: string
39
+ columns: string[]
40
+ type: 'index' | 'unique'
41
+ }
42
+ export declare interface TablePlan {
43
+ table: string
44
+ columns: ColumnPlan[]
45
+ indexes: IndexPlan[]
46
+ }
47
+ export declare interface MigrationPlan {
48
+ dialect: SupportedDialect
49
+ tables: TablePlan[]
50
+ }
51
+ export declare interface InferenceOptions {
52
+ dialect: SupportedDialect
53
+ }
54
+ export type PrimitiveDefault = string | number | boolean | bigint | Date
55
+ export type NormalizedColumnType = | 'string'
56
+ | 'text'
57
+ | 'boolean'
58
+ | 'integer'
59
+ | 'bigint'
60
+ | 'float'
61
+ | 'double'
62
+ | 'decimal'
63
+ | 'date'
64
+ | 'datetime'
65
+ | 'json'
@@ -0,0 +1,220 @@
1
+ /**
2
+ * # `defineModel(model)`
3
+ *
4
+ * Freezes and returns a model definition with strong inference for attributes
5
+ * and options.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const Post = defineModel({
10
+ * name: 'Post',
11
+ * attributes: {
12
+ * title: { validation: { rule: {} // isLength({ min: 1 }) } },
13
+ * },
14
+ * })
15
+ * ```
16
+ */
17
+ export declare function defineModel<const T extends ModelDefinition>(model: T): T;
18
+ /**
19
+ * # `defineModels(models)`
20
+ *
21
+ * Freezes and returns a record of model definitions, preserving literal keys so
22
+ * downstream types (like `DatabaseSchema`) can map model names to table names.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const models = defineModels({ User, Post })
27
+ * ```
28
+ */
29
+ export declare function defineModels<const T extends ModelRecord>(models: T): T;
30
+ /**
31
+ * # `Attribute`
32
+ *
33
+ * Describes a model column and its validation/meta options.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const User = defineModel({
38
+ * name: 'User',
39
+ * attributes: {
40
+ * email: { validation: { rule: {} // isEmail() }, unique: true },
41
+ * age: { validation: { rule: {} // isInt({ min: 0 }) }, default: 0 },
42
+ * }
43
+ * })
44
+ * ```
45
+ */
46
+ export declare interface Attribute {
47
+ default?: string | number | boolean | Date
48
+ unique?: boolean
49
+ order?: number
50
+ hidden?: boolean
51
+ fillable?: boolean
52
+ guarded?: boolean
53
+ factory?: (faker: unknown) => any
54
+ validation: {
55
+ rule: ValidationType
56
+ message?: ValidatorMessage
57
+ }
58
+ }
59
+ export declare interface AttributesElements {
60
+
61
+ }
62
+ /**
63
+ * # `CompositeIndex`
64
+ *
65
+ * Describes a named multi-column index.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * { name: 'user_email_unique', columns: ['email'] }
70
+ * ```
71
+ */
72
+ export declare interface CompositeIndex {
73
+ name: string
74
+ columns: string[]
75
+ }
76
+ export declare interface Base {
77
+
78
+ }
79
+ /**
80
+ * # `ModelOptions`
81
+ *
82
+ * Declarative model definition used to build a typed `DatabaseSchema`.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const User = defineModel({
87
+ * name: 'User',
88
+ * table: 'users',
89
+ * primaryKey: 'id',
90
+ * attributes: {
91
+ * id: { validation: { rule: {} // isInt() } },
92
+ * email: { validation: { rule: {} // isEmail() }, unique: true },
93
+ * },
94
+ * indexes: [{ name: 'users_email_unique', columns: ['email'] }],
95
+ * })
96
+ * ```
97
+ */
98
+ export declare interface ModelOptions extends Base {
99
+ name: string
100
+ description?: string
101
+ table?: string
102
+ primaryKey?: string
103
+ autoIncrement?: boolean
104
+ indexes?: CompositeIndex[]
105
+ traits?: Record<string, unknown>
106
+ attributes?: AttributesElements
107
+ hasOne?: HasOne<ModelNames> | ModelNames[]
108
+ hasMany?: HasMany<ModelNames> | ModelNames[]
109
+ belongsTo?: BelongsTo<ModelNames> | ModelNames[]
110
+ belongsToMany?: BelongsToMany<ModelNames> | ModelNames[]
111
+ hasOneThrough?: HasOneThrough<ModelNames> | ModelNames[]
112
+ morphOne?: MorphOne<ModelNames> | ModelNames
113
+ morphMany?: MorphMany<ModelNames>[] | ModelNames[]
114
+ morphTo?: MorphTo
115
+ scopes?: {
116
+ [key: string]: (value: any) => any
117
+ }
118
+ get?: {
119
+ [key: string]: (value: any) => any
120
+ }
121
+ set?: {
122
+ [key: string]: (value: any) => any
123
+ }
124
+ }
125
+ /**
126
+ * # `ValidatorMessage`
127
+ *
128
+ * Map of field identifiers to custom error messages returned by validators.
129
+ */
130
+ export type ValidatorMessage = Record<string, string>
131
+ /**
132
+ * # `ValidationType`
133
+ *
134
+ * External validator rule type (compatible with ts-validation). Kept broad to
135
+ * avoid a hard dependency while still enabling type inference via rule shape.
136
+ */
137
+ export type ValidationType = unknown
138
+ export type ModelNames = string
139
+ /**
140
+ * # Relationship helpers
141
+ *
142
+ * Lightweight relationship declarations for model definitions. Each helper is a
143
+ * record keyed by relation name with the related model name as value.
144
+ */
145
+ export type HasOne<T extends string> = Record<string, T>
146
+ export type HasMany<T extends string> = Record<string, T>
147
+ export type BelongsTo<T extends string> = Record<string, T>
148
+ export type BelongsToMany<T extends string> = Record<string, T>
149
+ export type HasOneThrough<T extends string> = Record<string, T>
150
+ export type MorphOne<T extends string> = Record<string, T>
151
+ export type MorphMany<T extends string> = Record<string, T>
152
+ export type MorphTo = Record<string, unknown>
153
+ export type ModelDefinition = Readonly<ModelOptions>
154
+ /**
155
+ * # `ModelRecord`
156
+ *
157
+ * Collection of models keyed by model name. Kept flexible to preserve literal
158
+ * attribute keys and value types.
159
+ */
160
+ export type ModelRecord = Record<string, any>
161
+ /**
162
+ * # `InferAttributes<M>`
163
+ *
164
+ * Given a `ModelDefinition`, produces a record of attribute names to their
165
+ * inferred input type based on the validator rule shape.
166
+ */
167
+ declare type ExtractRuleInput<R> = R extends { validate: (value: infer T) => any }
168
+ ? T
169
+ : R extends { test: (value: infer T) => any }
170
+ ? T
171
+ : R extends { getRules: () => Array<{ test: (value: infer T) => any }> }
172
+ ? T
173
+ : unknown
174
+ export type InferAttributes<M extends ModelDefinition> = M extends {
175
+ attributes: infer A extends Record<string, { validation: { rule: any } }>
176
+ }
177
+ ? { [K in keyof A & string]: ExtractRuleInput<A[K]['validation']['rule']> }
178
+ : Record<string, unknown>
179
+ /**
180
+ * # `InferPrimaryKey<M>`
181
+ *
182
+ * Extracts a model's primary key field name, defaulting to `'id'`.
183
+ */
184
+ export type InferPrimaryKey<M extends ModelDefinition> = M extends {
185
+ primaryKey: infer K extends string
186
+ }
187
+ ? K
188
+ : 'id'
189
+ /**
190
+ * # `InferTableName<M>`
191
+ *
192
+ * Resolves the table name from a model: uses `table` when provided, otherwise
193
+ * falls back to a simple pluralized form of the model name.
194
+ */
195
+ export type InferTableName<M extends ModelDefinition> = M extends {
196
+ table: infer T extends string
197
+ }
198
+ ? T
199
+ : M extends { name: infer N extends string }
200
+ ? `${Lowercase<N>}s`
201
+ : string
202
+ /**
203
+ * # `DatabaseSchema<Models>`
204
+ *
205
+ * Maps model definitions to a concrete database schema shape containing the
206
+ * table columns and primary key. This is the primary input for the query
207
+ * builder's type-safety.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * const models = defineModels({ User, Post })
212
+ * type Schema = DatabaseSchema<typeof models>
213
+ * ```
214
+ */
215
+ export type DatabaseSchema<MRecord extends ModelRecord> = {
216
+ [MName in keyof MRecord & string as InferTableName<MRecord[MName]>]: {
217
+ columns: InferAttributes<MRecord[MName]>
218
+ primaryKey: InferPrimaryKey<MRecord[MName]>
219
+ };
220
+ }
@@ -0,0 +1,216 @@
1
+ /**
2
+ * # `TransactionBackoffConfig`
3
+ *
4
+ * Controls exponential backoff between transaction retry attempts.
5
+ *
6
+ * - `baseMs`: Initial delay in milliseconds used for the first retry.
7
+ * - `factor`: Multiplicative growth factor applied per attempt (e.g., 2 = doubles).
8
+ * - `maxMs`: Maximum delay cap in milliseconds; backoff never exceeds this value.
9
+ * - `jitter`: When true, adds a small randomization to the delay to reduce thundering herds.
10
+ *
11
+ * The delay for attempt n (1-indexed) is roughly: min(maxMs, baseMs * factor^(n-1)),
12
+ * optionally adjusted by jitter.
13
+ */
14
+ export declare interface TransactionBackoffConfig {
15
+ baseMs: number
16
+ factor: number
17
+ maxMs: number
18
+ jitter: boolean
19
+ }
20
+ /**
21
+ * # `TransactionDefaultsConfig`
22
+ *
23
+ * Default settings applied to transactional operations.
24
+ *
25
+ * - `retries`: Number of times a transaction may be retried on retriable errors
26
+ * (e.g., deadlocks, serialization failures).
27
+ * - `isolation`: Transaction isolation level.
28
+ * - 'read committed': Prevents dirty reads; non-repeatable reads possible.
29
+ * - 'repeatable read': Ensures stable snapshot for a transaction; phantom reads may vary by DB.
30
+ * - 'serializable': Highest isolation; transactions appear to run one-by-one.
31
+ * - `sqlStates`: Additional vendor error codes considered retriable.
32
+ * - `backoff`: Backoff configuration applied between retries.
33
+ */
34
+ export declare interface TransactionDefaultsConfig {
35
+ retries: number
36
+ isolation?: 'read committed' | 'repeatable read' | 'serializable'
37
+ sqlStates: string[]
38
+ backoff: TransactionBackoffConfig
39
+ }
40
+ /**
41
+ * # `TimestampConfig`
42
+ *
43
+ * Column naming conventions for timestamp fields used by helpers.
44
+ *
45
+ * - `createdAt`: Column name for row creation time (e.g., 'created_at').
46
+ * - `updatedAt`: Column name for last update time (e.g., 'updated_at').
47
+ * - `defaultOrderColumn`: Column used by helpers like `latest()`/`oldest()`.
48
+ */
49
+ export declare interface TimestampConfig {
50
+ createdAt: string
51
+ updatedAt: string
52
+ defaultOrderColumn: string
53
+ }
54
+ /**
55
+ * # `PaginationConfig`
56
+ *
57
+ * Defaults for result pagination helpers.
58
+ *
59
+ * - `defaultPerPage`: Default LIMIT used by paginate helpers when not specified.
60
+ * - `cursorColumn`: Default column used for cursor-based pagination (e.g., 'id').
61
+ */
62
+ export declare interface PaginationConfig {
63
+ defaultPerPage: number
64
+ cursorColumn: string
65
+ }
66
+ /**
67
+ * # `AliasingConfig`
68
+ *
69
+ * Controls how selected columns from joined relations are aliased.
70
+ *
71
+ * - `relationColumnAliasFormat`:
72
+ * - 'table_column': Aliases as `${table}_${column}` (e.g., `posts_title`).
73
+ * - 'table.dot.column': Aliases with dot notation (e.g., `posts.title`).
74
+ * - 'camelCase': Aliases as camelCase from `${table}_${column}` (e.g., `postsTitle`).
75
+ */
76
+ export declare interface AliasingConfig {
77
+ relationColumnAliasFormat: 'table_column' | 'table.dot.column' | 'camelCase'
78
+ }
79
+ /**
80
+ * # `RelationsConfig`
81
+ *
82
+ * Conventions for inferring foreign key names and singularization.
83
+ *
84
+ * - `foreignKeyFormat`:
85
+ * - 'singularParent_id': Uses `${singular(parent)}_id` (e.g., `user_id`).
86
+ * - 'parentId': Uses camelCase `parentId` (e.g., `userId`).
87
+ * - `singularizeStrategy`:
88
+ * - 'stripTrailingS': Naively remove trailing 's' when singularizing (default behavior when enabled elsewhere).
89
+ * - 'none': Do not singularize relation/table names.
90
+ */
91
+ export declare interface RelationsConfig {
92
+ foreignKeyFormat: 'singularParent_id' | 'parentId'
93
+ singularizeStrategy?: 'stripTrailingS' | 'none'
94
+ }
95
+ /**
96
+ * # `SqlConfig`
97
+ *
98
+ * Dialect-specific SQL toggles.
99
+ *
100
+ * - `randomFunction`:
101
+ * - 'RANDOM()': PostgreSQL/SQLite style function for random ordering.
102
+ * - 'RAND()': MySQL style function for random ordering.
103
+ * - `sharedLockSyntax`:
104
+ * - 'FOR SHARE': PostgreSQL style shared lock.
105
+ * - 'LOCK IN SHARE MODE': MySQL style shared lock.
106
+ * - `jsonContainsMode`:
107
+ * - 'operator': Use native operators when available (e.g., Postgres `@>`).
108
+ * - 'function': Use a function-based approach (e.g., `json_contains`) when operators are not available.
109
+ */
110
+ export declare interface SqlConfig {
111
+ randomFunction?: 'RANDOM()' | 'RAND()'
112
+ sharedLockSyntax?: 'FOR SHARE' | 'LOCK IN SHARE MODE'
113
+ jsonContainsMode?: 'operator' | 'function'
114
+ }
115
+ /**
116
+ * # `QueryHooks`
117
+ *
118
+ * Optional lifecycle hooks around query execution. These are invoked for any
119
+ * statement executed through the builder (select/insert/update/delete/raw).
120
+ */
121
+ export declare interface QueryHooks {
122
+ onQueryStart?: (event: { sql: string, params?: any[], kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => void
123
+ onQueryEnd?: (event: { sql: string, params?: any[], durationMs: number, rowCount?: number, kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => void
124
+ onQueryError?: (event: { sql: string, params?: any[], error: any, durationMs: number, kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => void
125
+ startSpan?: (event: { sql: string, params?: any[], kind?: 'select' | 'insert' | 'update' | 'delete' | 'raw' }) => { end: (error?: any) => void }
126
+ }
127
+ /**
128
+ * # `FeatureToggles`
129
+ *
130
+ * Optional features that may be enabled per instance.
131
+ *
132
+ * - `distinctOn`: Enables PostgreSQL-like `DISTINCT ON (...)` behavior in builders.
133
+ */
134
+ export declare interface FeatureToggles {
135
+ distinctOn: boolean
136
+ }
137
+ /**
138
+ * # `QueryBuilderConfig`
139
+ *
140
+ * Global configuration for the query builder.
141
+ *
142
+ * - `verbose`: Enables extra logging/diagnostics from the builder.
143
+ * - `dialect`: Target SQL dialect. See `SupportedDialect` for details.
144
+ * - `timestamps`: Timestamp column naming conventions.
145
+ * - `pagination`: Defaults for pagination helpers.
146
+ * - `aliasing`: How relation columns are aliased in SELECT lists.
147
+ * - `relations`: Foreign key naming and singularization conventions.
148
+ * - `transactionDefaults`: Default retry/backoff/isolation behavior for transactions.
149
+ * - `sql`: Dialect-specific SQL toggles.
150
+ * - `features`: Optional feature flags.
151
+ * - `debug.captureText`: When true, the builder exposes a `toText()` method to capture SQL text in memory for debugging.
152
+ */
153
+ export declare interface QueryBuilderConfig {
154
+ verbose: boolean
155
+ dialect: SupportedDialect
156
+ timestamps: TimestampConfig
157
+ pagination: PaginationConfig
158
+ aliasing: AliasingConfig
159
+ relations: RelationsConfig
160
+ transactionDefaults: TransactionDefaultsConfig
161
+ sql: SqlConfig
162
+ features: FeatureToggles
163
+ debug?: {
164
+ /** When true, capture query text for debugging via `toText()`. */
165
+ captureText: boolean
166
+ }
167
+ hooks?: QueryHooks
168
+ softDeletes?: {
169
+ /** When true, apply a default `WHERE deleted_at IS NULL` filter. */
170
+ enabled: boolean
171
+ /** Column name used for soft delete flag/timestamp. */
172
+ column: string
173
+ /** When true, default filter is applied unless `.withTrashed()` is called. */
174
+ defaultFilter: boolean
175
+ }
176
+ }
177
+ export declare interface CliOption {
178
+ verbose: boolean
179
+ }
180
+ export declare interface SqlOptions {
181
+ limit?: number
182
+ }
183
+ export declare interface WaitReadyOptions {
184
+ attempts?: number
185
+ delay?: number
186
+ }
187
+ export declare interface FileOptions {
188
+ params?: string
189
+ }
190
+ export declare interface IntrospectOptions {
191
+ verbose?: boolean
192
+ }
193
+ export declare interface MigrateOptions {
194
+ dialect?: SupportedDialect
195
+ state?: string
196
+ apply?: boolean
197
+ full?: boolean
198
+ }
199
+ export declare interface GenerateMigrationResult {
200
+ sql: string
201
+ sqlStatements: string[]
202
+ hasChanges: boolean
203
+ plan: any
204
+ }
205
+ export declare interface UnsafeOptions {
206
+ params?: string
207
+ }
208
+ /**
209
+ * # `SupportedDialect`
210
+ *
211
+ * The SQL dialect used to tailor generated SQL and certain features.
212
+ * - 'postgres': Uses `RANDOM()`, supports JSON operators (e.g. `@>`), `FOR SHARE`, `FOR UPDATE`, CTEs
213
+ * - 'mysql': Uses `RAND()`, shared locks via `LOCK IN SHARE MODE`
214
+ * - 'sqlite': Lightweight engine; some features are limited or emulated
215
+ */
216
+ export type SupportedDialect = 'postgres' | 'mysql' | 'sqlite'
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "bun-query-builder",
3
+ "type": "module",
4
+ "version": "0.1.2",
5
+ "description": "A simple yet performant query builder for TypeScript. Built with Bun.",
6
+ "author": "Chris Breuer <chris@stacksjs.org>",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/stacksjs/bun-query-builder#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/stacksjs/bun-query-builder.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/stacksjs/bun-query-builder/issues"
15
+ },
16
+ "keywords": [
17
+ "typescript",
18
+ "query-builder",
19
+ "bun",
20
+ "package"
21
+ ],
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js"
26
+ },
27
+ "./*": {
28
+ "import": "./dist/*"
29
+ }
30
+ },
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "bin": {
34
+ "query-builder": "./dist/bin/cli.js",
35
+ "qbx": "./dist/bin/cli.js",
36
+ "qb": "./dist/bin/cli.js"
37
+ },
38
+ "files": [
39
+ "README.md",
40
+ "dist"
41
+ ],
42
+ "scripts": {
43
+ "build": "bun --bun build.ts && bun run compile",
44
+ "compile": "bun build ./bin/cli.ts --compile --minify --outfile bin/query-builder",
45
+ "compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64",
46
+ "compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/query-builder-linux-x64",
47
+ "compile:linux-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/query-builder-linux-arm64",
48
+ "compile:windows-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/query-builder-windows-x64.exe",
49
+ "compile:darwin-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/query-builder-darwin-x64",
50
+ "compile:darwin-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/query-builder-darwin-arm64",
51
+ "zip": "bun run zip:all",
52
+ "zip:all": "bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:windows-x64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64",
53
+ "zip:linux-x64": "zip -j bin/query-builder-linux-x64.zip bin/query-builder-linux-x64",
54
+ "zip:linux-arm64": "zip -j bin/query-builder-linux-arm64.zip bin/query-builder-linux-arm64",
55
+ "zip:windows-x64": "zip -j bin/query-builder-windows-x64.zip bin/query-builder-windows-x64.exe",
56
+ "zip:darwin-x64": "zip -j bin/query-builder-darwin-x64.zip bin/query-builder-darwin-x64",
57
+ "zip:darwin-arm64": "zip -j bin/query-builder-darwin-arm64.zip bin/query-builder-darwin-arm64",
58
+ "fresh": "bunx rimraf node_modules/ bun.lock && bun i",
59
+ "prepublishOnly": "bun --bun run build && bun run compile:all && bun run zip",
60
+ "test": "bun test",
61
+ "lint": "bunx --bun eslint .",
62
+ "lint:fix": "bunx --bun eslint . --fix",
63
+ "changelog": "bunx logsmith --verbose",
64
+ "changelog:generate": "bunx logsmith --output CHANGELOG.md",
65
+ "release": "bun run changelog:generate && bunx bumpx prompt --recursive",
66
+ "postinstall": "bunx git-hooks",
67
+ "dev:docs": "bun --bun vitepress dev docs",
68
+ "build:docs": "bun --bun vitepress build docs",
69
+ "preview:docs": "bun --bun vitepress preview docs",
70
+ "typecheck": "bun --bun tsc --noEmit"
71
+ },
72
+ "dependencies": {
73
+ "@stacksjs/launchpad": "^0.6.4"
74
+ },
75
+ "devDependencies": {
76
+ "@stacksjs/bumpx": "^0.1.61",
77
+ "@stacksjs/docs": "^0.70.23",
78
+ "@stacksjs/eslint-config": "^4.14.0-beta.3",
79
+ "@stacksjs/gitlint": "^0.1.5",
80
+ "@stacksjs/logsmith": "^0.1.15",
81
+ "@types/bun": "^1.2.21",
82
+ "buddy-bot": "^0.8.10",
83
+ "bun-git-hooks": "^0.2.19",
84
+ "bun-plugin-dtsx": "0.9.5",
85
+ "bunfig": "^0.15.0",
86
+ "typescript": "^5.9.2"
87
+ },
88
+ "overrides": {
89
+ "unconfig": "0.3.10"
90
+ },
91
+ "git-hooks": {
92
+ "pre-commit": {
93
+ "staged-lint": {
94
+ "*.{js,ts,json,yaml,yml,md}": "bunx --bun eslint --fix"
95
+ }
96
+ },
97
+ "commit-msg": "bunx gitlint --edit .git/COMMIT_EDITMSG"
98
+ }
99
+ }