Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: version 3.0.0 #127

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
03595b7
style(reflect): change import path (#123)
omermorad Dec 11, 2021
b2b0230
refactor(parser): fix types and dependencies (#125)
omermorad Dec 11, 2021
e07cc13
build: add preconstruct (#126)
omermorad Dec 11, 2021
c0d5c70
chore: change codecov target [skip ci]
omermorad Dec 13, 2021
b18df26
chore: change release branch name to next
omermorad Dec 13, 2021
0bf071f
refactor(common): change basic types
omermorad Dec 13, 2021
81b0be7
refactor(mockingbird): remove redundant types, change exports
omermorad Dec 13, 2021
a6374f5
refactor(parser): change handlers order and handlers logic
omermorad Dec 13, 2021
27a2c58
refactor(reflect): change the types of mock decorator can take
omermorad Dec 13, 2021
24cab0c
chore: update packages types and contributors
omermorad Dec 13, 2021
253e677
chore(packages): version packages [skip ci]
omermorad Dec 13, 2021
d3b06a1
build: change build strategy of packages (exclude common)
omermorad Dec 14, 2021
0f30527
chore(packages): version packages [skip ci]
omermorad Dec 14, 2021
f4a65bd
chore: change lerna settings
omermorad Dec 14, 2021
13a7adc
ci: add tests report to ci
omermorad Dec 14, 2021
00e1132
ci: temp change to test instead of cov
omermorad Dec 14, 2021
9bfda2e
chore: tsconfig and exports (#131)
omermorad Dec 14, 2021
c99387d
refactor(parser): remove faker locale option
omermorad Dec 14, 2021
3d5ca77
refactor(mockingbird): remove faker locale option
omermorad Dec 14, 2021
5d2628d
ci: bring back coverage and reports
omermorad Dec 14, 2021
0dd5754
chore(packages): version packages [skip ci]
omermorad Dec 14, 2021
6988b18
build: change build strategy remove preconstruct
omermorad Dec 14, 2021
6c80992
Merge pull request #132 from omermorad/build/change-strategy
omermorad Dec 14, 2021
859bb82
chore: add ignore to coverage - dist and js files
omermorad Dec 14, 2021
a86d0af
revert: change build strategy remove preconstruct
omermorad Dec 14, 2021
bfc3ae2
build: change build strategy remove preconstruct (#133)
omermorad Dec 14, 2021
4338fb2
chore(packages): version packages [skip ci]
omermorad Dec 14, 2021
9370127
chore: update old faker package to a new one (#136)
omermorad Jan 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- release
- next

jobs:
build-and-test:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Yarn Init
- name: Restore Cache
id: yarn-cache
uses: actions/cache@v2
with:
Expand All @@ -41,19 +41,32 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-

- name: Yarn Init
run: yarn

- name: Lint Commit Message
run: |
yarn add -D -W @commitlint/config-conventional
echo $(git log -1 --pretty=format:"%s") | yarn commitlint
run: echo $(git log -1 --pretty=format:"%s") | npx commitlint

- name: Lint
run: lerna exec --parallel -- yarn lint

- name: Build
run: yarn build

- name: Test
run: yarn test:cov
env:
JEST_JUNIT_OUTPUT_NAME: 'junit.xml'

- name: Tests Report (Sync)
uses: dorny/test-reporter@v1
if: failure()
with:
reporter: 'jest-junit'
name: 'Tests Report'
path: 'junit.xml'
list-tests: 'failed'
fail-on-error: false

- name: Build
run: yarn build

- name: Upload Report to Codecov
uses: codecov/codecov-action@v1
Expand Down
14 changes: 14 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
]
}
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ coverage:
target: 90%
patch:
default:
target: 95%
target: 90%
6 changes: 3 additions & 3 deletions jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module.exports = {
testEnvironment: 'node',
collectCoverage: false,
coveragePathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/node_modules/',
'<rootDir/>/index.js',
'dist',
'node_modules',
'jest.config.js',
],
coverageReporters: [
'text',
Expand Down
6 changes: 4 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"version": "independent",
"command": {
"publish": {
"allowBranch": ["master", "release"],
"allowBranch": ["master", "next"],
"message": "chore(packages): release packages [skip ci]",
"conventionalCommits": true
},
"version": {
"allowBranch": ["master", "release"],
"allowBranch": ["master", "next"],
"message": "chore(packages): version packages [skip ci]",
"conventionalCommits": true
}
},
"ignoreChanges": ["sample"],
"useWorkspaces": true,
"npmClient": "yarn",
"packages": [
"!sample",
"packages/*"
]
}
25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"readme": "https://github.com/omermorad/mockingbird/README.md",
"scripts": {
"prepare": "husky install",
"build": "lerna run build --stream",
"build": "lerna run build",
"watch": "lerna exec -- watch",
"test": "jest --runInBand && yarn test:sample",
"test:sample": "export NODE_ENV=test && cd sample/mockingbird-typeorm && yarn test",
"test:cov": "jest --coverage --runInBand --reporters=jest-junit",
"lint": "lerna run lint --since HEAD"
"test:cov": "jest --coverage --reporters=jest-junit",
"lint": "lerna run lint"
},
"files": [
"dist",
Expand All @@ -51,9 +51,14 @@
"README.md"
],
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.16.4",
"@babel/preset-env": "^7.16.4",
"@babel/preset-typescript": "^7.16.0",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@commitlint/config-conventional": "^15.0.0",
"@commitlint/config-lerna-scopes": "^12.1.4",
"@faker-js/faker": "^5.5.3",
"@manypkg/cli": "^0.19.1",
"@types/faker": "^5.5.7",
"@types/jest": "26.0.24",
Expand All @@ -69,7 +74,6 @@
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^23.11.0",
"eslint-plugin-prettier": "^3.1.3",
"faker": "^5.5.3",
"husky": "^7.0.1",
"jest": "27.0.6",
"jest-gherkin": "^0.0.0",
Expand All @@ -86,9 +90,6 @@
"tslint-config-airbnb": "^5.11.2",
"typescript": "^3.9.7"
},
"publishConfig": {
"access": "public"
},
"lint-staged": {
"*.ts": [
"eslint --ext .ts --fix"
Expand All @@ -101,5 +102,11 @@
},
"workspaces": [
"packages/*"
]
],
"preconstruct": {
"packages": [
"!packages/common",
"packages/*"
]
}
}
65 changes: 65 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,71 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.0.0-rc.3](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-14)


### Reverts

* change build strategy remove preconstruct ([a86d0af](https://github.com/omermorad/mockingbird/commit/a86d0afe3c99100e04fcb2eef9217171aa895da9))





# [3.0.0-rc.2](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-14)

**Note:** Version bump only for package @mockingbird/common





# [3.0.0-rc.1](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-14)

**Note:** Version bump only for package @mockingbird/common





# [3.0.0-rc.0](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-13)


### chore

* release packages ([#114](https://github.com/omermorad/mockingbird/issues/114)) ([c6f521f](https://github.com/omermorad/mockingbird/commit/c6f521f42dbb12c9e3a4e0441484ce5aa6a4c4e6)), closes [#96](https://github.com/omermorad/mockingbird/issues/96) [#98](https://github.com/omermorad/mockingbird/issues/98) [#104](https://github.com/omermorad/mockingbird/issues/104) [#105](https://github.com/omermorad/mockingbird/issues/105) [#106](https://github.com/omermorad/mockingbird/issues/106) [#107](https://github.com/omermorad/mockingbird/issues/107) [#110](https://github.com/omermorad/mockingbird/issues/110) [#111](https://github.com/omermorad/mockingbird/issues/111) [#116](https://github.com/omermorad/mockingbird/issues/116) [#117](https://github.com/omermorad/mockingbird/issues/117) [#118](https://github.com/omermorad/mockingbird/issues/118) [#119](https://github.com/omermorad/mockingbird/issues/119) [#2](https://github.com/omermorad/mockingbird/issues/2)


### Code Refactoring

* **common:** change basic types ([0bf071f](https://github.com/omermorad/mockingbird/commit/0bf071f5338ff2cd75ef20185be7edf868f60bea))


### BREAKING CHANGES

* **common:** Change ObjectLiteral, add enum types and remove MultiClass
Change some names
* ClassAnalayzer has been removed and all the logic has been moved to ClassParser

* test(parser): add (move) mock generator integration test

* chore(parser): config jest and typescript to run integration test

* fix(mockingbird-ts): use mock generator differently (singleton)

Remove mock generator from mockingbird-ts and import it from @mockinbird/parser instead
mock generator acts as a singleton now

* refactor(mockingbird-ts): fix mock factory

* chore(mockingbird-ts): config jest to collect coverage properly

* revert: revert commit 3bcde461 fixtures package





## [2.0.3](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-08)

**Note:** Version bump only for package @mockingbird/common
Expand Down
12 changes: 4 additions & 8 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
{
"name": "@mockingbird/common",
"version": "2.0.3",
"version": "3.0.0-rc.3",
"license": "MIT",
"description": "Mockingbird Common Package",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"contributors": [
{
"name": "Omer Morad",
"email": "[email protected]"
},
{
"name": "Idan Ptichi",
"email": "[email protected]"
}
],
"repository": {
Expand All @@ -28,8 +24,8 @@
"build": "tsc",
"watch": "tsc --watch",
"test": "exit 0;",
"lint": "eslint 'src/index.ts'",
"lint:fix": "eslint 'src/index.ts' --fix"
"lint": "eslint 'src/**/*.ts'",
"lint:fix": "eslint 'src/**/*.ts' --fix"
},
"files": [
"dist",
Expand Down
13 changes: 8 additions & 5 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ export type Faker = FakerStatic;
export const Faker = faker;

export interface ObjectLiteral {
[key: string]: any;
[key: string]: unknown;
}

export type Class<T = any> = new (...args: any[]) => T;

export type ExactValue = string | number | boolean | ObjectLiteral | Date | RegExp;
export type AbsoluteValue = string | number | boolean | ObjectLiteral | RegExp | Date;

export type FakerCallback = (faker: Faker) => any;

export type MultiClass = { type: Class; count: number };
export type LazyType<T = any> = () => Class<T>;

export type EnumObject = { enum: Record<string, unknown> };
export type Enum<E> = Record<keyof E, number | string> & { [key: number]: string };

export type Callback = (faker: Faker) => any;
export type LazyEnum<E = any> = { enum: () => Enum<E> };

export type ClassLiteral<TClass = any> = { [K in keyof TClass]: TClass[K] };

Expand Down
8 changes: 4 additions & 4 deletions packages/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"baseUrl": "./",
"rootDir": "./src",
"outDir": "./dist",
"target": "es5"
"rootDir": "src",
"baseUrl": ".",
"outDir": "dist",
"target": "es6"
},
"exclude": [
"index.ts",
Expand Down
4 changes: 4 additions & 0 deletions packages/faker.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '@faker-js/faker' {
import faker from 'faker';
export default faker;
}
50 changes: 50 additions & 0 deletions packages/logger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,56 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.0.0-rc.2](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-14)


### Reverts

* change build strategy remove preconstruct ([a86d0af](https://github.com/omermorad/mockingbird/commit/a86d0afe3c99100e04fcb2eef9217171aa895da9))





# [1.0.0-rc.1](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-14)

**Note:** Version bump only for package @mockingbird/logger





# 1.0.0-rc.0 (2021-12-13)


### chore

* release packages ([#114](https://github.com/omermorad/mockingbird/issues/114)) ([c6f521f](https://github.com/omermorad/mockingbird/commit/c6f521f42dbb12c9e3a4e0441484ce5aa6a4c4e6)), closes [#96](https://github.com/omermorad/mockingbird/issues/96) [#98](https://github.com/omermorad/mockingbird/issues/98) [#104](https://github.com/omermorad/mockingbird/issues/104) [#105](https://github.com/omermorad/mockingbird/issues/105) [#106](https://github.com/omermorad/mockingbird/issues/106) [#107](https://github.com/omermorad/mockingbird/issues/107) [#110](https://github.com/omermorad/mockingbird/issues/110) [#111](https://github.com/omermorad/mockingbird/issues/111) [#116](https://github.com/omermorad/mockingbird/issues/116) [#117](https://github.com/omermorad/mockingbird/issues/117) [#118](https://github.com/omermorad/mockingbird/issues/118) [#119](https://github.com/omermorad/mockingbird/issues/119) [#2](https://github.com/omermorad/mockingbird/issues/2)


### BREAKING CHANGES

* ClassAnalayzer has been removed and all the logic has been moved to ClassParser

* test(parser): add (move) mock generator integration test

* chore(parser): config jest and typescript to run integration test

* fix(mockingbird-ts): use mock generator differently (singleton)

Remove mock generator from mockingbird-ts and import it from @mockinbird/parser instead
mock generator acts as a singleton now

* refactor(mockingbird-ts): fix mock factory

* chore(mockingbird-ts): config jest to collect coverage properly

* revert: revert commit 3bcde461 fixtures package





## [0.0.1](https://github.com/omermorad/mockingbird/compare/@mockingbird/[email protected]...@mockingbird/[email protected]) (2021-12-08)

**Note:** Version bump only for package @mockingbird/logger
Expand Down
Loading