Skip to content

Commit e50a9ef

Browse files
committed
Merge branch 'next'
2 parents 916dbdf + ea091c4 commit e50a9ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3028
-4308
lines changed

.commitlintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.github/workflows/commitlint.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Commitlint
2+
on:
3+
[push, pull_request]
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
- uses: wagoid/commitlint-github-action@v5
12+
with:
13+
configFile: .commitlintrc

.github/workflows/coverage.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@ jobs:
1313
- uses: actions/setup-node@v3
1414
with:
1515
node-version: lts/gallium
16-
- id: modules-cache
17-
uses: actions/[email protected]
18-
with:
19-
path: '**/node_modules'
20-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
16+
cache: yarn
2117
- run: yarn install --frozen-lockfile
22-
if: steps.modules-cache.outputs.cache-hit != 'true'
2318
- run: yarn test:cov
2419
- uses: coverallsapp/github-action@master
2520
with:

.github/workflows/quality.yml

+29-8
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,43 @@ on:
55
pull_request:
66
branches: [ master, next ]
77
jobs:
8-
quality:
9-
name: Run checks for pull request
8+
format:
109
runs-on: ubuntu-latest
1110
steps:
1211
- uses: actions/checkout@v3
1312
- uses: actions/setup-node@v3
1413
with:
1514
node-version: lts/gallium
16-
- id: modules-cache
17-
uses: actions/[email protected]
18-
with:
19-
path: '**/node_modules'
20-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
15+
cache: yarn
2116
- run: yarn install --frozen-lockfile
22-
if: steps.modules-cache.outputs.cache-hit != 'true'
2317
- run: yarn format:ci
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-node@v3
23+
with:
24+
node-version: lts/gallium
25+
cache: yarn
26+
- run: yarn install --frozen-lockfile
2427
- run: yarn lint:ci
28+
typecheck:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: actions/setup-node@v3
33+
with:
34+
node-version: lts/gallium
35+
cache: yarn
36+
- run: yarn install --frozen-lockfile
2537
- run: yarn typecheck
38+
test:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
- uses: actions/setup-node@v3
43+
with:
44+
node-version: lts/gallium
45+
cache: yarn
46+
- run: yarn install --frozen-lockfile
2647
- run: yarn test:ci

.github/workflows/release.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@ jobs:
1414
- uses: actions/setup-node@v3
1515
with:
1616
node-version: lts/gallium
17-
- id: modules-cache
18-
uses: actions/[email protected]
19-
with:
20-
path: '**/node_modules'
21-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
17+
cache: yarn
2218
- run: yarn install --frozen-lockfile
23-
if: steps.modules-cache.outputs.cache-hit != 'true'
24-
- name: Build package
25-
run: yarn build
19+
- run: yarn build
2620
- uses: cycjimmy/semantic-release-action@v3
2721
env:
2822
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
.sgcrc
1212
jest.config.ts
1313
logo.png
14-
ormconfig.ts
1514
test.db
1615
tsconfig.build.json
1716
tsconfig.json

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# [5.0.0-next.2](https://github.com/jorgebodega/typeorm-seeding/compare/v5.0.0-next.1...v5.0.0-next.2) (2022-08-01)
2+
3+
4+
### Bug Fixes
5+
6+
* add factory deprecation notice ([8d75e05](https://github.com/jorgebodega/typeorm-seeding/commit/8d75e05e43b35e770f7c14437a1e6b04c8fffd01))
7+
8+
# [5.0.0-next.1](https://github.com/jorgebodega/typeorm-seeding/compare/v4.0.0...v5.0.0-next.1) (2022-07-13)
9+
10+
11+
### Bug Fixes
12+
13+
* update dependency glob to v8 ([2d3c996](https://github.com/jorgebodega/typeorm-seeding/commit/2d3c99635fcfdd667b38a4bed60d663145dd619b))
14+
15+
16+
### Features
17+
18+
* removed unused command and add some more tests ([ea6649e](https://github.com/jorgebodega/typeorm-seeding/commit/ea6649e98261d62907118448b047987cbebcd2c7))
19+
* use typeorm 0.3 ([aa0153b](https://github.com/jorgebodega/typeorm-seeding/commit/aa0153bd050c60ab94f9979eff4e5ab9bec81645))
20+
21+
22+
### BREAKING CHANGES
23+
24+
* Removed config command
25+
* Connection API is deprecated and removed.
26+
127
# [4.0.0](https://github.com/jorgebodega/typeorm-seeding/compare/v3.2.0...v4.0.0) (2022-03-23)
228

329

README.md

+6-37
Original file line numberDiff line numberDiff line change
@@ -404,42 +404,11 @@ Add the following scripts to your `package.json` file to configure them.
404404

405405
```json
406406
"scripts": {
407-
"seed:config": "typeorm-seeding config",
408407
"seed:run": "typeorm-seeding seed",
409408
...
410409
}
411410
```
412411

413-
## `config`
414-
415-
This command just print the connection configuration.
416-
417-
```bash
418-
typeorm-seeding config
419-
```
420-
421-
Example result
422-
423-
```json
424-
{
425-
"name": "default",
426-
"type": "sqlite",
427-
"database": "/home/jorgebodega/projects/typeorm-seeding/test.db",
428-
"entities": ["sample/entities/**/*{.ts,.js}"],
429-
"seeders": ["sample/seeders/**/*{.ts,.js}"],
430-
"defaultSeeder": "RootSeeder"
431-
}
432-
```
433-
434-
##### Options
435-
436-
| Option | Default | Description |
437-
| ---------------------- | --------------------- | ---------------------------------------------------------------------------- |
438-
| `--seed` or `-s` | null | Option to specify a seeder class to run individually. (Only on seed command) |
439-
| `--connection` or `-c` | TypeORM default value | Name of the TypeORM connection. Required if there are multiple connections. |
440-
| `--configName` or `-n` | TypeORM default value | Name to the TypeORM config file. |
441-
| `--root` or `-r` | TypeORM default value | Path to the TypeORM config file. |
442-
443412
## `seed`
444413

445414
This command execute a seeder, that could be specified as a parameter.
@@ -452,12 +421,12 @@ The name of the seeder to execute (either set with the `--seed` option or with d
452421

453422
##### Options
454423

455-
| Option | Default | Description |
456-
| ---------------------- | ------------------------------------ | --------------------------------------------------------------------------- |
457-
| `--seed` or `-s` | Default seeder specified config file | Option to specify a seeder class to run individually. |
458-
| `--connection` or `-c` | TypeORM default value | Name of the TypeORM connection. Required if there are multiple connections. |
459-
| `--configName` or `-n` | TypeORM default value | Name to the TypeORM config file. |
460-
| `--root` or `-r` | TypeORM default value | Path to the TypeORM config file. |
424+
| Option | Default | Description |
425+
| ---------------------- | ------------------------------------ | ----------------------------------------------------- |
426+
| `--seed` or `-s` | Default seeder specified config file | Option to specify a seeder class to run individually. |
427+
| `--dataSource` or `-d` | | Path of the data source |
428+
| `--configName` or `-n` | TypeORM default value | Name to the TypeORM config file. |
429+
| `--root` or `-r` | TypeORM default value | Path to the TypeORM config file. |
461430

462431
# Testing features
463432

jest.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
22
collectCoverageFrom: ['src/**/!(*.d).ts'],
33
preset: 'ts-jest',
4-
setupFiles: ['<rootDir>/test/jest-setup.ts'],
54
testEnvironment: 'node',
65
}

ormconfig.ts

-18
This file was deleted.

package.json

+19-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jorgebodega/typeorm-seeding",
3-
"version": "4.0.0",
3+
"version": "5.0.0-next.2",
44
"description": "🌱 A delightful way to seed test data into your database.",
55
"license": "MIT",
66
"author": "Gery Hirschfeld <[email protected]> (https://github.com/hirsch88)",
@@ -36,44 +36,39 @@
3636
"typecheck": "tsc --noEmit"
3737
},
3838
"devDependencies": {
39-
"@faker-js/faker": "6.0.0",
39+
"@faker-js/faker": "7.3.0",
4040
"@semantic-release/changelog": "6.0.1",
4141
"@semantic-release/git": "10.0.1",
42-
"@tsconfig/node16": "1.0.2",
42+
"@tsconfig/node16": "1.0.3",
4343
"@types/bcryptjs": "2.4.2",
44-
"@types/chalk": "2.2.0",
4544
"@types/glob": "7.2.0",
46-
"@types/jest": "27.4.1",
47-
"@types/node": "17.0.17",
45+
"@types/jest": "28.1.6",
4846
"@types/yargs": "17.0.10",
49-
"@typescript-eslint/eslint-plugin": "5.15.0",
50-
"@typescript-eslint/parser": "5.15.0",
47+
"@typescript-eslint/eslint-plugin": "5.31.0",
48+
"@typescript-eslint/parser": "5.31.0",
5149
"bcryptjs": "2.4.3",
52-
"eslint": "8.11.0",
50+
"eslint": "8.21.0",
5351
"eslint-config-prettier": "8.5.0",
54-
"eslint-plugin-import": "2.25.4",
55-
"jest": "27.5.1",
56-
"prettier": "2.6.0",
52+
"eslint-plugin-import": "2.26.0",
53+
"jest": "28.1.3",
54+
"prettier": "2.7.1",
5755
"rimraf": "3.0.2",
58-
"semantic-release": "19.0.2",
59-
"sqlite3": "5.0.2",
60-
"ts-jest": "27.1.3",
61-
"ts-node": "10.7.0",
62-
"typeorm": "0.2.41",
63-
"typescript": "4.6.2"
56+
"semantic-release": "19.0.3",
57+
"sqlite3": "5.0.11",
58+
"ts-jest": "28.0.7",
59+
"ts-node": "10.9.1",
60+
"typeorm": "0.3.7",
61+
"typescript": "4.7.4"
6462
},
6563
"dependencies": {
6664
"chalk": "4.1.2",
67-
"glob": "7.2.0",
65+
"glob": "8.0.3",
6866
"ora": "5.4.1",
6967
"reflect-metadata": "0.1.13",
70-
"yargs": "17.4.0"
68+
"yargs": "17.5.1"
7169
},
7270
"peerDependencies": {
73-
"typeorm": "^0.2.41"
74-
},
75-
"resolutions": {
76-
"mem": ">=4.0.0"
71+
"typeorm": "^0.3.0"
7772
},
7873
"engines": {
7974
"node": ">=14"

src/cli.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/usr/bin/env node
22
/* istanbul ignore file */
33
import 'reflect-metadata'
4-
import * as yargs from 'yargs'
4+
import yargs from 'yargs'
55
import { SeedCommand } from './commands/seed.command'
6-
import { ConfigCommand } from './commands/config.command'
76

87
yargs
98
.usage('Usage: $0 <command> [options]')
10-
.command(new ConfigCommand())
119
.command(new SeedCommand())
1210
.recommendCommands()
1311
.demandCommand(1)

src/commands/config.command.ts

-56
This file was deleted.

0 commit comments

Comments
 (0)