orchid-orm 1.5.19 → 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/.turbo/turbo-test.log +26 -0
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/codegen/appCodeUpdater.test.ts +17 -8
- package/src/codegen/appCodeUpdater.ts +20 -9
- package/src/orm.test.ts +12 -4
- package/src/transaction.test.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -2314,12 +2314,22 @@ var __spreadValues = (a, b) => {
|
|
|
2314
2314
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2315
2315
|
class AppCodeUpdaterError extends Error {
|
|
2316
2316
|
}
|
|
2317
|
-
const appCodeUpdater = (
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2317
|
+
const appCodeUpdater = ({
|
|
2318
|
+
tablePath,
|
|
2319
|
+
baseTablePath,
|
|
2320
|
+
baseTableName,
|
|
2321
|
+
mainFilePath
|
|
2322
|
+
}) => {
|
|
2323
|
+
return async ({ ast, options, basePath, cache: cacheObject }) => {
|
|
2324
|
+
const params = {
|
|
2325
|
+
tablePath(name) {
|
|
2326
|
+
const file = tablePath(name);
|
|
2327
|
+
return resolvePath(basePath, file);
|
|
2328
|
+
},
|
|
2329
|
+
baseTablePath: resolvePath(basePath, baseTablePath),
|
|
2330
|
+
baseTableName: baseTableName || "BaseTable",
|
|
2331
|
+
mainFilePath: resolvePath(basePath, mainFilePath)
|
|
2332
|
+
};
|
|
2323
2333
|
const promises = [
|
|
2324
2334
|
updateMainFile(params.mainFilePath, params.tablePath, ast, options),
|
|
2325
2335
|
updateTableFile(__spreadProps(__spreadValues({}, params), { ast }))
|
|
@@ -2335,6 +2345,7 @@ const appCodeUpdater = (config) => {
|
|
|
2335
2345
|
await Promise.all(promises);
|
|
2336
2346
|
};
|
|
2337
2347
|
};
|
|
2348
|
+
const resolvePath = (basePath, filePath) => path.isAbsolute(filePath) ? filePath : path.resolve(basePath, filePath);
|
|
2338
2349
|
|
|
2339
2350
|
export { AppCodeUpdaterError, appCodeUpdater, createBaseTable, createRepo, orchidORM };
|
|
2340
2351
|
//# sourceMappingURL=index.mjs.map
|