@stacksjs/database 0.56.35 → 0.57.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.
- package/dist/factory/index.d.ts +2 -0
- package/dist/factory/index.mjs +20 -0
- package/dist/index.d.ts +3 -7
- package/dist/index.mjs +3 -25
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.mjs +2 -0
- package/dist/seeder/index.d.ts +2 -0
- package/dist/seeder/index.mjs +3 -0
- package/package.json +9 -9
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as storage from "@stacksjs/storage";
|
|
2
|
+
const { fs } = storage;
|
|
3
|
+
function generateFactoryFile(modelName, fileName, path) {
|
|
4
|
+
const generateMethodName = "generate";
|
|
5
|
+
const factoryCode = `import faker from 'faker';
|
|
6
|
+
import type { SeedData } from '@stacksjs/types'
|
|
7
|
+
|
|
8
|
+
function ${generateMethodName}(): SeedData {
|
|
9
|
+
return {
|
|
10
|
+
// fields here
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { ${generateMethodName} };
|
|
15
|
+
`;
|
|
16
|
+
fs.writeFileSync(`${path}/${fileName}`, factoryCode);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
generateFactoryFile
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare function seed(): Promise<void>;
|
|
6
|
-
|
|
7
|
-
export { generateFactoryFile, migrate, seed };
|
|
1
|
+
export * from './factory';
|
|
2
|
+
export * from './migrations';
|
|
3
|
+
export * from './seeder';
|
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function generateFactoryFile(modelName, fileName, path) {
|
|
5
|
-
const generateMethodName = "generate";
|
|
6
|
-
const factoryCode = `import faker from 'faker';
|
|
7
|
-
import type { SeedData } from '@stacksjs/types'
|
|
8
|
-
|
|
9
|
-
function ${generateMethodName}(): SeedData {
|
|
10
|
-
return {
|
|
11
|
-
// fields here
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { ${generateMethodName} };
|
|
16
|
-
`;
|
|
17
|
-
fs.writeFileSync(`${path}/${fileName}`, factoryCode);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const migrate = "wip";
|
|
21
|
-
|
|
22
|
-
async function seed() {
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { generateFactoryFile, migrate, seed };
|
|
1
|
+
export * from "./factory/index.mjs";
|
|
2
|
+
export * from "./migrations/index.mjs";
|
|
3
|
+
export * from "./seeder/index.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/database",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.57.2",
|
|
5
5
|
"packageManager": "pnpm@8.6.5",
|
|
6
6
|
"description": "The Stacks database integration.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@stacksjs/faker": "0.
|
|
46
|
-
"@stacksjs/path": "0.
|
|
47
|
-
"@stacksjs/query-builder": "0.
|
|
48
|
-
"@stacksjs/storage": "0.
|
|
49
|
-
"@stacksjs/strings": "0.
|
|
50
|
-
"@stacksjs/utils": "0.
|
|
45
|
+
"@stacksjs/faker": "0.57.2",
|
|
46
|
+
"@stacksjs/path": "0.57.2",
|
|
47
|
+
"@stacksjs/query-builder": "0.57.2",
|
|
48
|
+
"@stacksjs/storage": "0.57.2",
|
|
49
|
+
"@stacksjs/strings": "0.57.2",
|
|
50
|
+
"@stacksjs/utils": "0.57.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@stacksjs/config": "0.
|
|
53
|
+
"@stacksjs/config": "0.57.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@stacksjs/development": "0.
|
|
56
|
+
"@stacksjs/development": "0.57.2"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "unbuild",
|