Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgebodega committed Aug 1, 2022
2 parents 916dbdf + ea091c4 commit e50a9ef
Show file tree
Hide file tree
Showing 65 changed files with 3,028 additions and 4,308 deletions.
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
13 changes: 13 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Commitlint
on:
[push, pull_request]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
with:
configFile: .commitlintrc
7 changes: 1 addition & 6 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
- id: modules-cache
uses: actions/cache@v2.1.7
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
cache: yarn
- run: yarn install --frozen-lockfile
if: steps.modules-cache.outputs.cache-hit != 'true'
- run: yarn test:cov
- uses: coverallsapp/github-action@master
with:
Expand Down
37 changes: 29 additions & 8 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,43 @@ on:
pull_request:
branches: [ master, next ]
jobs:
quality:
name: Run checks for pull request
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
- id: modules-cache
uses: actions/cache@v2.1.7
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
cache: yarn
- run: yarn install --frozen-lockfile
if: steps.modules-cache.outputs.cache-hit != 'true'
- run: yarn format:ci
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint:ci
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn typecheck
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn test:ci
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: lts/gallium
- id: modules-cache
uses: actions/cache@v2.1.7
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
cache: yarn
- run: yarn install --frozen-lockfile
if: steps.modules-cache.outputs.cache-hit != 'true'
- name: Build package
run: yarn build
- run: yarn build
- uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
.sgcrc
jest.config.ts
logo.png
ormconfig.ts
test.db
tsconfig.build.json
tsconfig.json
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# [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)


### Bug Fixes

* add factory deprecation notice ([8d75e05](https://github.com/jorgebodega/typeorm-seeding/commit/8d75e05e43b35e770f7c14437a1e6b04c8fffd01))

# [5.0.0-next.1](https://github.com/jorgebodega/typeorm-seeding/compare/v4.0.0...v5.0.0-next.1) (2022-07-13)


### Bug Fixes

* update dependency glob to v8 ([2d3c996](https://github.com/jorgebodega/typeorm-seeding/commit/2d3c99635fcfdd667b38a4bed60d663145dd619b))


### Features

* removed unused command and add some more tests ([ea6649e](https://github.com/jorgebodega/typeorm-seeding/commit/ea6649e98261d62907118448b047987cbebcd2c7))
* use typeorm 0.3 ([aa0153b](https://github.com/jorgebodega/typeorm-seeding/commit/aa0153bd050c60ab94f9979eff4e5ab9bec81645))


### BREAKING CHANGES

* Removed config command
* Connection API is deprecated and removed.

# [4.0.0](https://github.com/jorgebodega/typeorm-seeding/compare/v3.2.0...v4.0.0) (2022-03-23)


Expand Down
43 changes: 6 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,42 +404,11 @@ Add the following scripts to your `package.json` file to configure them.

```json
"scripts": {
"seed:config": "typeorm-seeding config",
"seed:run": "typeorm-seeding seed",
...
}
```

## `config`

This command just print the connection configuration.

```bash
typeorm-seeding config
```

Example result

```json
{
"name": "default",
"type": "sqlite",
"database": "/home/jorgebodega/projects/typeorm-seeding/test.db",
"entities": ["sample/entities/**/*{.ts,.js}"],
"seeders": ["sample/seeders/**/*{.ts,.js}"],
"defaultSeeder": "RootSeeder"
}
```

##### Options

| Option | Default | Description |
| ---------------------- | --------------------- | ---------------------------------------------------------------------------- |
| `--seed` or `-s` | null | Option to specify a seeder class to run individually. (Only on seed command) |
| `--connection` or `-c` | TypeORM default value | Name of the TypeORM connection. Required if there are multiple connections. |
| `--configName` or `-n` | TypeORM default value | Name to the TypeORM config file. |
| `--root` or `-r` | TypeORM default value | Path to the TypeORM config file. |

## `seed`

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

##### Options

| Option | Default | Description |
| ---------------------- | ------------------------------------ | --------------------------------------------------------------------------- |
| `--seed` or `-s` | Default seeder specified config file | Option to specify a seeder class to run individually. |
| `--connection` or `-c` | TypeORM default value | Name of the TypeORM connection. Required if there are multiple connections. |
| `--configName` or `-n` | TypeORM default value | Name to the TypeORM config file. |
| `--root` or `-r` | TypeORM default value | Path to the TypeORM config file. |
| Option | Default | Description |
| ---------------------- | ------------------------------------ | ----------------------------------------------------- |
| `--seed` or `-s` | Default seeder specified config file | Option to specify a seeder class to run individually. |
| `--dataSource` or `-d` | | Path of the data source |
| `--configName` or `-n` | TypeORM default value | Name to the TypeORM config file. |
| `--root` or `-r` | TypeORM default value | Path to the TypeORM config file. |

# Testing features

Expand Down
1 change: 0 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export default {
collectCoverageFrom: ['src/**/!(*.d).ts'],
preset: 'ts-jest',
setupFiles: ['<rootDir>/test/jest-setup.ts'],
testEnvironment: 'node',
}
18 changes: 0 additions & 18 deletions ormconfig.ts

This file was deleted.

43 changes: 19 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jorgebodega/typeorm-seeding",
"version": "4.0.0",
"version": "5.0.0-next.2",
"description": "🌱 A delightful way to seed test data into your database.",
"license": "MIT",
"author": "Gery Hirschfeld <gery.hirschfeld@w3tec.ch> (https://github.com/hirsch88)",
Expand Down Expand Up @@ -36,44 +36,39 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@faker-js/faker": "6.0.0",
"@faker-js/faker": "7.3.0",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"@tsconfig/node16": "1.0.2",
"@tsconfig/node16": "1.0.3",
"@types/bcryptjs": "2.4.2",
"@types/chalk": "2.2.0",
"@types/glob": "7.2.0",
"@types/jest": "27.4.1",
"@types/node": "17.0.17",
"@types/jest": "28.1.6",
"@types/yargs": "17.0.10",
"@typescript-eslint/eslint-plugin": "5.15.0",
"@typescript-eslint/parser": "5.15.0",
"@typescript-eslint/eslint-plugin": "5.31.0",
"@typescript-eslint/parser": "5.31.0",
"bcryptjs": "2.4.3",
"eslint": "8.11.0",
"eslint": "8.21.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"jest": "27.5.1",
"prettier": "2.6.0",
"eslint-plugin-import": "2.26.0",
"jest": "28.1.3",
"prettier": "2.7.1",
"rimraf": "3.0.2",
"semantic-release": "19.0.2",
"sqlite3": "5.0.2",
"ts-jest": "27.1.3",
"ts-node": "10.7.0",
"typeorm": "0.2.41",
"typescript": "4.6.2"
"semantic-release": "19.0.3",
"sqlite3": "5.0.11",
"ts-jest": "28.0.7",
"ts-node": "10.9.1",
"typeorm": "0.3.7",
"typescript": "4.7.4"
},
"dependencies": {
"chalk": "4.1.2",
"glob": "7.2.0",
"glob": "8.0.3",
"ora": "5.4.1",
"reflect-metadata": "0.1.13",
"yargs": "17.4.0"
"yargs": "17.5.1"
},
"peerDependencies": {
"typeorm": "^0.2.41"
},
"resolutions": {
"mem": ">=4.0.0"
"typeorm": "^0.3.0"
},
"engines": {
"node": ">=14"
Expand Down
4 changes: 1 addition & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env node
/* istanbul ignore file */
import 'reflect-metadata'
import * as yargs from 'yargs'
import yargs from 'yargs'
import { SeedCommand } from './commands/seed.command'
import { ConfigCommand } from './commands/config.command'

yargs
.usage('Usage: $0 <command> [options]')
.command(new ConfigCommand())
.command(new SeedCommand())
.recommendCommands()
.demandCommand(1)
Expand Down
56 changes: 0 additions & 56 deletions src/commands/config.command.ts

This file was deleted.

Loading

0 comments on commit e50a9ef

Please sign in to comment.