@uql/core 3.7.9 → 3.7.10
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
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [3.7.
|
|
6
|
+
## [3.7.10](https://github.com/rogerpadilla/uql/compare/@uql/core@3.7.9...@uql/core@3.7.10) (2026-01-05)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
-
*
|
|
11
|
+
* Integrate jiti for robust TypeScript configuration loading and update migration tool paths to `@uql/core/migrate`. ([8bc4971](https://github.com/rogerpadilla/uql/commit/8bc497128d4bc35c8dfdf01a48d7b1e3ac2d08d6))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -20,6 +20,10 @@ All notable changes to this project will be documented in this file. Please add
|
|
|
20
20
|
|
|
21
21
|
date format is [yyyy-mm-dd]
|
|
22
22
|
|
|
23
|
+
## [3.7.10] - 2026-01-04
|
|
24
|
+
### Improvements
|
|
25
|
+
- **Robust Config Loading**: Integrated `jiti` into the CLI configuration loader. This allows `uql-migrate` to natively support TypeScript configuration files (`uql.config.ts`) and properly resolve ESM/CJS interop logic across all node environments (Node.js, Bun, etc.) without requiring custom runtime flags.
|
|
26
|
+
|
|
23
27
|
## [3.7.9] - 2026-01-04
|
|
24
28
|
- **Manual Migrations**: Updated the root README to explicitly document the `generate` command for creating manual incremental migrations (`npx uql-migrate generate <name>`), ensuring developers know how to create empty migration files efficiently.
|
|
25
29
|
|
|
@@ -121,7 +125,7 @@ Reflect major changes in the package structure and dependencies.
|
|
|
121
125
|
- **Package Unification**: Unified all database adapters (`mysql`, `postgres`, `maria`, `sqlite`, `mongo`) and `express` middleware into a single core package: `@uql/core`.
|
|
122
126
|
- **Scoped Naming**:
|
|
123
127
|
- `@uql/core`: The main ORM engine and all database adapters.
|
|
124
|
-
- `@uql/migrate`: The database migration system (formerly `nukak-migrate`).
|
|
128
|
+
- `@uql/core/migrate`: The database migration system (formerly `nukak-migrate`).
|
|
125
129
|
- **Improved API Surface**:
|
|
126
130
|
- Database-specific logic is now accessible via sub-paths (e.g., `import { ... } from '@uql/core/postgres'`).
|
|
127
131
|
- Unified `NamingStrategy` and `QueryContext` across all unified adapters.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { stat } from 'node:fs/promises';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { createJiti } from 'jiti';
|
|
4
4
|
export async function loadConfig(customPath) {
|
|
5
|
+
const jiti = createJiti(process.cwd());
|
|
5
6
|
if (customPath) {
|
|
6
7
|
const fullPath = resolve(process.cwd(), customPath);
|
|
7
8
|
const exists = await stat(fullPath)
|
|
@@ -10,10 +11,9 @@ export async function loadConfig(customPath) {
|
|
|
10
11
|
if (!exists) {
|
|
11
12
|
throw new Error(`Could not find uql configuration file at ${customPath}`);
|
|
12
13
|
}
|
|
13
|
-
const fileUrl = pathToFileURL(fullPath).href;
|
|
14
14
|
try {
|
|
15
|
-
const config = await import(
|
|
16
|
-
return config
|
|
15
|
+
const config = await jiti.import(fullPath, { default: true });
|
|
16
|
+
return config;
|
|
17
17
|
}
|
|
18
18
|
catch (error) {
|
|
19
19
|
throw new Error(`Could not load configuration file at ${customPath}: ${error.message}`);
|
|
@@ -26,9 +26,8 @@ export async function loadConfig(customPath) {
|
|
|
26
26
|
.then(() => true)
|
|
27
27
|
.catch(() => false);
|
|
28
28
|
if (exists) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
return config.default ?? config;
|
|
29
|
+
const config = await jiti.import(fullPath, { default: true });
|
|
30
|
+
return config;
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
throw new Error('Could not find uql configuration file. Create a uql.config.ts or uql.config.js file in your project root.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-config.js","sourceRoot":"","sources":["../../src/migrate/cli-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli-config.js","sourceRoot":"","sources":["../../src/migrate/cli-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAmB;IAClD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEvC,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC;aAChC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,4CAA4C,UAAU,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9D,OAAO,MAAgB,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,wCAAwC,UAAU,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACrG,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAEnG,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC;aAChC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9D,OAAO,MAAgB,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,2GAA2G,CAC5G,CAAC;AACJ,CAAC"}
|
package/dist/migrate/cli.js
CHANGED
|
@@ -195,9 +195,9 @@ export async function runSync(migrator, args) {
|
|
|
195
195
|
}
|
|
196
196
|
export function printHelp() {
|
|
197
197
|
console.log(`
|
|
198
|
-
@uql/migrate - Database migration tool for uql ORM
|
|
198
|
+
@uql/core/migrate - Database migration tool for uql ORM
|
|
199
199
|
|
|
200
|
-
Usage: @uql/migrate <command> [options]
|
|
200
|
+
Usage: @uql/core/migrate <command> [options]
|
|
201
201
|
|
|
202
202
|
Commands:
|
|
203
203
|
up Run all pending migrations
|
|
@@ -235,13 +235,13 @@ Configuration:
|
|
|
235
235
|
};
|
|
236
236
|
|
|
237
237
|
Examples:
|
|
238
|
-
@uql/migrate up
|
|
239
|
-
@uql/migrate up --step 1
|
|
240
|
-
@uql/migrate down
|
|
241
|
-
@uql/migrate down --step 3
|
|
242
|
-
@uql/migrate status
|
|
243
|
-
@uql/migrate generate add_users_table
|
|
244
|
-
@uql/migrate generate:entities initial_schema
|
|
238
|
+
@uql/core/migrate up
|
|
239
|
+
@uql/core/migrate up --step 1
|
|
240
|
+
@uql/core/migrate down
|
|
241
|
+
@uql/core/migrate down --step 3
|
|
242
|
+
@uql/core/migrate status
|
|
243
|
+
@uql/core/migrate generate add_users_table
|
|
244
|
+
@uql/core/migrate generate:entities initial_schema
|
|
245
245
|
`);
|
|
246
246
|
}
|
|
247
247
|
//# sourceMappingURL=cli.js.map
|
package/dist/migrate/migrator.js
CHANGED
|
@@ -554,7 +554,7 @@ export class Migrator {
|
|
|
554
554
|
* Generate migration file content
|
|
555
555
|
*/
|
|
556
556
|
generateMigrationContent(name) {
|
|
557
|
-
return /*ts*/ `import type { SqlQuerier } from '@uql/migrate';
|
|
557
|
+
return /*ts*/ `import type { SqlQuerier } from '@uql/core/migrate';
|
|
558
558
|
|
|
559
559
|
/**
|
|
560
560
|
* Migration: ${name}
|
|
@@ -588,7 +588,7 @@ export default {
|
|
|
588
588
|
generateMigrationContentWithStatements(name, upStatements, downStatements) {
|
|
589
589
|
const upSql = upStatements.map((s) => /*ts*/ ` await querier.run(\`${s}\`);`).join('\n');
|
|
590
590
|
const downSql = downStatements.map((s) => /*ts*/ ` await querier.run(\`${s}\`);`).join('\n');
|
|
591
|
-
return /*ts*/ `import type { SqlQuerier } from '@uql/migrate';
|
|
591
|
+
return /*ts*/ `import type { SqlQuerier } from '@uql/core/migrate';
|
|
592
592
|
|
|
593
593
|
/**
|
|
594
594
|
* Migration: ${name}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"homepage": "https://uql.app",
|
|
4
4
|
"description": "One Language. Frontend to Backend.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.7.
|
|
6
|
+
"version": "3.7.10",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"clean": "rimraf dist *.tsbuildinfo"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"jiti": "^2.6.1",
|
|
54
55
|
"reflect-metadata": "^0.2.2",
|
|
55
56
|
"sqlstring": "^2.3.3",
|
|
56
57
|
"sqlstring-sqlite": "^0.1.1",
|
|
@@ -143,5 +144,5 @@
|
|
|
143
144
|
"publishConfig": {
|
|
144
145
|
"access": "public"
|
|
145
146
|
},
|
|
146
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "53a8ef0e2eb62d6e236262a4552f998d77dbd5bb"
|
|
147
148
|
}
|