@razvan11/paladin 1.0.7 → 1.0.8
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/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { database } from './functions/database';
|
|
|
14
14
|
export { default as config } from './functions/config';
|
|
15
15
|
export { default as validator } from './functions/validator';
|
|
16
16
|
export { default as env } from './functions/env';
|
|
17
|
+
export { getDataSourceForCLI } from './functions/database';
|
|
17
18
|
export { render, renderElement, createRenderer } from './functions/render';
|
|
18
19
|
export { LayoutView, PageLoader, type LayoutViewProps, } from './components/LayoutView';
|
|
19
20
|
export { asset, publicAsset, setAssetBasePath, getAssetBasePath, } from './functions/asset';
|
package/dist/index.js
CHANGED
|
@@ -19981,6 +19981,18 @@ function database(options2 = {}) {
|
|
|
19981
19981
|
return constructor;
|
|
19982
19982
|
};
|
|
19983
19983
|
}
|
|
19984
|
+
function getDataSourceForCLI(DatabaseClass, url) {
|
|
19985
|
+
const options2 = databaseRegistry.get(DatabaseClass);
|
|
19986
|
+
const instance = new DatabaseClass(url);
|
|
19987
|
+
const source = instance.getSource();
|
|
19988
|
+
if (options2?.migrations) {
|
|
19989
|
+
source.setOptions({
|
|
19990
|
+
migrations: [options2.migrations + "/*.ts"],
|
|
19991
|
+
migrationsTableName: options2.migrationsTable || "migrations"
|
|
19992
|
+
});
|
|
19993
|
+
}
|
|
19994
|
+
return source;
|
|
19995
|
+
}
|
|
19984
19996
|
// src/functions/config.ts
|
|
19985
19997
|
var getContainer6 = () => globalThis.container;
|
|
19986
19998
|
function config() {
|
|
@@ -21024,6 +21036,7 @@ export {
|
|
|
21024
21036
|
options,
|
|
21025
21037
|
logger,
|
|
21026
21038
|
inject,
|
|
21039
|
+
getDataSourceForCLI,
|
|
21027
21040
|
getAssetBasePath,
|
|
21028
21041
|
get,
|
|
21029
21042
|
env2 as env,
|