orchid-orm 1.5.20 → 1.5.21
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 +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/codegen/appCodeUpdater.test.ts +7 -3
- package/src/codegen/appCodeUpdater.ts +14 -10
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -435,6 +435,6 @@ declare type AppCodeUpdaterConfig = {
|
|
|
435
435
|
baseTableName: string;
|
|
436
436
|
mainFilePath: string;
|
|
437
437
|
};
|
|
438
|
-
declare const appCodeUpdater: (
|
|
438
|
+
declare const appCodeUpdater: ({ tablePath, baseTablePath, baseTableName, mainFilePath, }: SetOptional<AppCodeUpdaterConfig, 'baseTableName'>) => AppCodeUpdater;
|
|
439
439
|
|
|
440
440
|
export { AppCodeUpdaterConfig, AppCodeUpdaterError, DbTable, MapMethods, MapQueryMethods, MethodsBase, OrchidORM, QueryMethods, Repo, Table, TableClass, TableClasses, TableToDb, appCodeUpdater, createBaseTable, createRepo, orchidORM };
|
package/dist/index.js
CHANGED
|
@@ -2341,16 +2341,22 @@ var __spreadValues = (a, b) => {
|
|
|
2341
2341
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2342
2342
|
class AppCodeUpdaterError extends Error {
|
|
2343
2343
|
}
|
|
2344
|
-
const appCodeUpdater = (
|
|
2344
|
+
const appCodeUpdater = ({
|
|
2345
|
+
tablePath,
|
|
2346
|
+
baseTablePath,
|
|
2347
|
+
baseTableName,
|
|
2348
|
+
mainFilePath
|
|
2349
|
+
}) => {
|
|
2345
2350
|
return async ({ ast, options, basePath, cache: cacheObject }) => {
|
|
2346
|
-
const params =
|
|
2347
|
-
baseTableName: config.baseTableName || "BaseTable",
|
|
2351
|
+
const params = {
|
|
2348
2352
|
tablePath(name) {
|
|
2349
|
-
const file =
|
|
2350
|
-
return
|
|
2353
|
+
const file = tablePath(name);
|
|
2354
|
+
return resolvePath(basePath, file);
|
|
2351
2355
|
},
|
|
2352
|
-
|
|
2353
|
-
|
|
2356
|
+
baseTablePath: resolvePath(basePath, baseTablePath),
|
|
2357
|
+
baseTableName: baseTableName || "BaseTable",
|
|
2358
|
+
mainFilePath: resolvePath(basePath, mainFilePath)
|
|
2359
|
+
};
|
|
2354
2360
|
const promises = [
|
|
2355
2361
|
updateMainFile(params.mainFilePath, params.tablePath, ast, options),
|
|
2356
2362
|
updateTableFile(__spreadProps(__spreadValues({}, params), { ast }))
|
|
@@ -2366,6 +2372,7 @@ const appCodeUpdater = (config) => {
|
|
|
2366
2372
|
await Promise.all(promises);
|
|
2367
2373
|
};
|
|
2368
2374
|
};
|
|
2375
|
+
const resolvePath = (basePath, filePath) => path__namespace.isAbsolute(filePath) ? filePath : path__namespace.resolve(basePath, filePath);
|
|
2369
2376
|
|
|
2370
2377
|
Object.defineProperty(exports, 'columnTypes', {
|
|
2371
2378
|
enumerable: true,
|