@jorgebodega/typeorm-seeding 6.0.0-next.4 → 6.0.0-next.5
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/.commitlintrc +5 -0
- package/CHANGELOG.md +33 -0
- package/README.md +10 -0
- package/dist/commands/seed.command.js +1 -1
- package/dist/commands/seed.command.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/commandUtils.js +1 -1
- package/dist/utils/commandUtils.js.map +1 -1
- package/package.json +45 -44
- package/pnpm-lock.yaml +378 -373
package/.commitlintrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [6.0.0-next.5](https://github.com/jorgebodega/typeorm-seeding/compare/v6.0.0-next.4...v6.0.0-next.5) (2023-01-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* glob pattern on Windows ([1246b1c](https://github.com/jorgebodega/typeorm-seeding/commit/1246b1c5683419086b59b1e44bcec3e8f2af05d3))
|
|
7
|
+
|
|
8
|
+
# [6.0.0](https://github.com/jorgebodega/typeorm-seeding/compare/v5.0.2...v6.0.0) (2022-11-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### chore
|
|
12
|
+
|
|
13
|
+
* remove factory definitions ([f2ede7c](https://github.com/jorgebodega/typeorm-seeding/commit/f2ede7c952a106db98ef817e6c9fc34a1a79dd96))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add support for multiple paths on cli ([6ffb5dd](https://github.com/jorgebodega/typeorm-seeding/commit/6ffb5dd00dcb83c06b62a616855b344ab01f2096))
|
|
19
|
+
* force major version ([73ade47](https://github.com/jorgebodega/typeorm-seeding/commit/73ade475e1a1f44764d4090b04fe2abf9fcbe61b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* Force version 6
|
|
25
|
+
* remove all factory related code in favor of @jorgebodega/typeorm-factory
|
|
26
|
+
|
|
1
27
|
# [6.0.0-next.4](https://github.com/jorgebodega/typeorm-seeding/compare/v6.0.0-next.3...v6.0.0-next.4) (2022-11-02)
|
|
2
28
|
|
|
3
29
|
# [6.0.0-next.3](https://github.com/jorgebodega/typeorm-seeding/compare/v6.0.0-next.2...v6.0.0-next.3) (2022-10-15)
|
|
@@ -39,6 +65,13 @@
|
|
|
39
65
|
|
|
40
66
|
* remove all factory related code in favor of @jorgebodega/typeorm-factory
|
|
41
67
|
|
|
68
|
+
## [5.0.2](https://github.com/jorgebodega/typeorm-seeding/compare/v5.0.1...v5.0.2) (2022-09-05)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* glob pattern on Windows ([1246b1c](https://github.com/jorgebodega/typeorm-seeding/commit/1246b1c5683419086b59b1e44bcec3e8f2af05d3))
|
|
74
|
+
|
|
42
75
|
## [5.0.1](https://github.com/jorgebodega/typeorm-seeding/compare/v5.0.0...v5.0.1) (2022-08-18)
|
|
43
76
|
|
|
44
77
|
|
package/README.md
CHANGED
|
@@ -102,6 +102,16 @@ class UserSeeder extends Seeder {
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
This seeder class must be exported as default to be handled by the CLI.
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
export default class UserSeeder extends Seeder {
|
|
109
|
+
async run(dataSource: DataSource) {
|
|
110
|
+
...
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
105
115
|
## `run`
|
|
106
116
|
|
|
107
117
|
This function is the one that needs to be defined when extending the class.
|
|
@@ -33,7 +33,7 @@ async function run(paths) {
|
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
35
|
spinner.fail('Could not load seeders!');
|
|
36
|
-
throw new errors_1.SeederImportationError('Could not load seeders!', { cause: error });
|
|
36
|
+
throw new errors_1.SeederImportationError('Could not load default seeders!', { cause: error });
|
|
37
37
|
}
|
|
38
38
|
spinner.info(`Executing seeders...`);
|
|
39
39
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.command.js","sourceRoot":"","sources":["../../src/commands/seed.command.ts"],"names":[],"mappings":";;;;AAAA,yCAAmC;AACnC,yCAAmC;AACnC,sDAAqB;AAErB,sCAAkD;AAClD,qFAAiF;AACjF,yEAAqE;AACrE,wCAAsD;AAGtD,oCAA0D;AAE1D,KAAK,UAAU,GAAG,CAAC,KAAe;IAChC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAwB,CAAA;IACrD,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAA;IAE1E,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IACnC,IAAI,UAAuB,CAAA;IAC3B,IAAI;QACF,MAAM,cAAc,GAAG,IAAA,mBAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QAE9D,UAAU,GAAG,MAAM,oBAAY,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;QAE9D,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;KACrC;IAAC,OAAO,KAAU,EAAE;QACnB,OAAO,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAA;QAC/C,MAAM,IAAI,uDAA0B,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;KAC1F;IAED,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAClC,IAAI,OAAiC,CAAA;IACrC,IAAI;QACF,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,yBAAiB,CAAC,CAAA;QAEpD,OA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,gDAAgD,CAAC;KACvE,MAAM,CAAC,GAAG,CAAC,CAAA;AAEP,KAAK,UAAU,SAAS,CAAC,IAAc;IAC5C,MAAM,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AACpC,CAAC;AAFD,8BAEC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ class CommandUtils {
|
|
|
31
31
|
return CommandUtils_1.CommandUtils.loadDataSource(dataSourceFilePath);
|
|
32
32
|
}
|
|
33
33
|
static async loadSeeders(seederPaths) {
|
|
34
|
-
const seederFileExports = await Promise.all(seederPaths.map((seederFile) => Promise.resolve().then(() => __importStar(require(
|
|
34
|
+
const seederFileExports = await Promise.all(seederPaths.map((seederFile) => { var _a; return _a = seederFile, Promise.resolve().then(() => __importStar(require(_a))); })).then((seederExports) => {
|
|
35
35
|
return seederExports.map((seederExport) => seederExport.default).filter((seederExport) => Boolean(seederExport));
|
|
36
36
|
});
|
|
37
37
|
if (seederFileExports.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandUtils.js","sourceRoot":"","sources":["../../src/utils/commandUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gEAAmF;AACnF,sCAAkC;AAGlC,MAAa,YAAY;IACvB,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,kBAA0B;QACpD,OAAO,2BAAmB,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAA;IAC/D,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,WAAqB;QAC5C,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"commandUtils.js","sourceRoot":"","sources":["../../src/utils/commandUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gEAAmF;AACnF,sCAAkC;AAGlC,MAAa,YAA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|
6
|
+
"contributors": [
|
|
7
|
+
"Jorge Bodega <jorge.bodega.f@gmail.com> (https://github.com/jorgebodega)"
|
|
8
|
+
],
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"chalk": "4.1.2",
|
|
11
|
+
"commander": "9.4.1",
|
|
12
|
+
"glob": "8.0.3",
|
|
13
|
+
"ora": "5.4.1",
|
|
14
|
+
"tslib": "2.4.1"
|
|
15
|
+
},
|
|
16
|
+
"description": "🌱 A delightful way to seed test data into your database.",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@faker-js/faker": "7.6.0",
|
|
19
|
+
"@jorgebodega/typeorm-factory": "1.4.0",
|
|
20
|
+
"@tsconfig/node16": "1.0.3",
|
|
21
|
+
"@types/glob": "8.0.0",
|
|
22
|
+
"@types/jest": "29.2.5",
|
|
23
|
+
"@types/node": "18.11.18",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "5.48.0",
|
|
25
|
+
"@typescript-eslint/parser": "5.48.0",
|
|
26
|
+
"eslint": "8.31.0",
|
|
27
|
+
"eslint-config-prettier": "8.6.0",
|
|
28
|
+
"eslint-plugin-import": "2.26.0",
|
|
29
|
+
"jest": "29.3.1",
|
|
30
|
+
"prettier": "2.8.1",
|
|
31
|
+
"rimraf": "3.0.2",
|
|
32
|
+
"sqlite3": "5.1.4",
|
|
33
|
+
"ts-jest": "29.0.3",
|
|
34
|
+
"ts-node": "10.9.1",
|
|
35
|
+
"typeorm": "0.3.11",
|
|
36
|
+
"typescript": "4.9.4"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=14"
|
|
40
|
+
},
|
|
4
41
|
"keywords": [
|
|
5
42
|
"typeorm",
|
|
6
43
|
"seed",
|
|
7
44
|
"seeding",
|
|
8
45
|
"orm"
|
|
9
46
|
],
|
|
10
|
-
"description": "🌱 A delightful way to seed test data into your database.",
|
|
11
47
|
"license": "MIT",
|
|
12
|
-
"author": "Gery Hirschfeld <gery.hirschfeld@w3tec.ch> (https://github.com/hirsch88)",
|
|
13
|
-
"contributors": [
|
|
14
|
-
"Jorge Bodega <jorge.bodega.f@gmail.com> (https://github.com/jorgebodega)"
|
|
15
|
-
],
|
|
16
48
|
"main": "dist/index.js",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
49
|
+
"name": "@jorgebodega/typeorm-seeding",
|
|
50
|
+
"packageManager": "pnpm@7.22.0",
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"typeorm": "^0.3.0"
|
|
20
53
|
},
|
|
21
54
|
"repository": {
|
|
22
55
|
"type": "git",
|
|
@@ -37,38 +70,6 @@
|
|
|
37
70
|
"test:watch": "jest --watch",
|
|
38
71
|
"typecheck": "tsc --noEmit"
|
|
39
72
|
},
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"@jorgebodega/typeorm-factory": "1.3.0",
|
|
43
|
-
"@tsconfig/node16": "1.0.3",
|
|
44
|
-
"@types/glob": "8.0.0",
|
|
45
|
-
"@types/jest": "29.2.1",
|
|
46
|
-
"@types/node": "18.11.8",
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "5.42.0",
|
|
48
|
-
"@typescript-eslint/parser": "5.42.0",
|
|
49
|
-
"eslint": "8.26.0",
|
|
50
|
-
"eslint-config-prettier": "8.5.0",
|
|
51
|
-
"eslint-plugin-import": "2.26.0",
|
|
52
|
-
"jest": "29.2.2",
|
|
53
|
-
"prettier": "2.7.1",
|
|
54
|
-
"rimraf": "3.0.2",
|
|
55
|
-
"sqlite3": "5.1.2",
|
|
56
|
-
"ts-jest": "29.0.3",
|
|
57
|
-
"ts-node": "10.9.1",
|
|
58
|
-
"typeorm": "0.3.10",
|
|
59
|
-
"typescript": "4.8.4"
|
|
60
|
-
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"chalk": "4.1.2",
|
|
63
|
-
"commander": "9.4.1",
|
|
64
|
-
"glob": "8.0.3",
|
|
65
|
-
"ora": "5.4.1",
|
|
66
|
-
"tslib": "2.4.1"
|
|
67
|
-
},
|
|
68
|
-
"peerDependencies": {
|
|
69
|
-
"typeorm": "^0.3.0"
|
|
70
|
-
},
|
|
71
|
-
"engines": {
|
|
72
|
-
"node": ">=14"
|
|
73
|
-
}
|
|
73
|
+
"types": "dist/index.d.ts",
|
|
74
|
+
"version": "6.0.0-next.5"
|
|
74
75
|
}
|