Skip to content

Commit

Permalink
chore: release packages (#114)
Browse files Browse the repository at this point in the history
* refactor(parser): refactor handlers to work with ioc (di) (#96)

Add TypeDI to enable working with IoC to enable convenient DI

* feat(parser): add regex functionality/handler (#98)

Add 'randexp' to enable generating a random string that matches a given RegExp

* fix(parser): fix import and handler priority of regex + randexp

* feat(reflect): add regex to mock decorator value options

Add 'randexp' to enable generating a random string that matches a given RegExp

* test(mockingbird-ts): check mock generation with regex

* test(mockingbird-ts): update snapshot of mock generator

* fix(parser): fix import and handler priority of regex + randexp

* feat(reflect): add regex to mock decorator value options

Add 'randexp' to enable generating a random string that matches a given RegExp

* test(mockingbird-ts): check mock generation with regex

* test(mockingbird-ts): update snapshot of mock generator

* feat(common): add regex constructor to exact value

Add RegExp to be part of the possible values in the mock decorator (exact value)

* style(reflect): add method signature for regex

Add method signature for RegExp value

* test(mockingbird-ts): check mock generation with regex

* test(mockingbird-ts): update snapshot of mock generator

* feat(logger): add initial working module (#104)

* feat(logger): add initial working module

Add basic logger module

* chore(logger): add eslint files

* chore(logger): add lint scripts

* feat(fixtures): add basic fixtures (and snapshots) functionality  (#105)

* feat(fixtures): add basic fixtures module, skeleton and basic logic

* refactor(fixtures): improve logic, change types/interfaces, add ioc typedi

* refactor(fixtures): redesign classes and rearrange files, improve error texts

* style(fixtures): functions name changes + adding deps

* chore: rearrange dependencies and modules exported files (#106)

* refactor(parser): add mock generator and remove analyzer (#107)

* refactor(parser): add mock generator and remove analyzer

Add MockGenerator
Remove ClassAnalyzer moving all the logics into ClassParser

BREAKING CHANGE: 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 3bcde46 fixtures package

* chore: update yarn lock dependencies (#110)

* chore: update codecov coverarge target to 90% (#111)

* chore(packages): version packages [skip ci]

 - @mockinbird/common@2.0.3-rc.0
 - @mockinbird/logger@0.0.1-rc.0
 - mockingbird-ts@2.1.2-rc.0
 - @mockinbird/parser@3.0.2-rc.0
 - @mockinbird/reflect@3.0.2-rc.0

* chore: release packages (with new name yayy)

* chore: changes package names scope

* chore: change mockinbird to mockingbird namespace scope (#116)

* chore: change mockinbird to mockingbird namespace scope

* refactor: change from mockingbird-ts to mockingbird in test-classes

* chore: update manypkg and fix versions (#117)

* chore(packages): version packages [skip ci]

 - @mockingbird/common@2.0.3-rc.1
 - @mockingbird/logger@0.0.1-rc.1
 - mockingbird@2.1.2-rc.2
 - @mockingbird/parser@3.0.2-rc.1
 - @mockingbird/reflect@3.0.2-rc.1

* chore: fix sample to work with the new package (#118)

* chore: remove mockingbird-ts strings (#119)

* chore: replace everything from mockingbird-ts to mockingbird

* chore: replace everything from mockingbird-ts to mockingbird #2

* chore(sample): replace sample version

* chore(packages): version packages [skip ci]

 - @mockingbird/common@2.0.3-rc.2
 - mockingbird@2.1.2-rc.3
 - @mockingbird/parser@3.0.2-rc.2
 - @mockingbird/reflect@3.0.2-rc.2

* chore(packages): version packages [skip ci]

 - @mockingbird/common@2.0.3-rc.3
 - mockingbird@2.1.2-rc.4
 - @mockingbird/parser@3.0.2-rc.3
 - @mockingbird/reflect@3.0.2-rc.3

* chore(packages): version packages [skip ci]

 - @mockingbird/common@2.0.3
 - @mockingbird/logger@0.0.1
 - mockingbird@2.1.2
 - @mockingbird/parser@3.0.2
 - @mockingbird/reflect@3.0.2
  • Loading branch information
omermorad committed Dec 8, 2021
1 parent e2abf12 commit c6f521f
Show file tree
Hide file tree
Showing 80 changed files with 1,311 additions and 612 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[![ISC license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![npm version](http://img.shields.io/npm/v/mockingbird-ts.svg?style=flat)](https://npmjs.org/package/mockingbird-ts "View this project on npm")
[![npm version](http://img.shields.io/npm/v/mockingbird.svg?style=flat)](https://npmjs.org/package/mockingbird "View this project on npm")
[![Codecov Coverage](https://img.shields.io/codecov/c/github/omermorad/mockingbird/master.svg?style=flat-square)](https://codecov.io/gh/omermorad/mockingbird)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![ci](https://github.com/omermorad/mockingbird/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/omermorad/mockingbird/actions)

<p align="center">
<img width="450" src="https://raw.githubusercontent.com/omermorad/mockingbird-ts/master/docs/logo.png" alt="Mockingbird Logo" />
<img width="450" src="https://raw.githubusercontent.com/omermorad/mockingbird/master/docs/logo.png" alt="Mockingbird Logo" />

<h1 align="center">Mockingbird</h1>

Expand All @@ -21,7 +21,11 @@
## Installation

```bash
npm i mockingbird-ts
npm i -D mockingbird
```

```bash
yarn add -D mockingbird
```

## What is "Mocking Library"?
Expand Down Expand Up @@ -57,7 +61,7 @@ class BirdEntity {
```

```typescript
import { Mock, MockFactory } from 'mockingbird-ts';
import { Mock, MockFactory } from 'mockingbird';

// BirdEntity could be an interface or a class
class BirdEntityMock implements BirdEntity {
Expand All @@ -78,7 +82,7 @@ const lotsOfBirds = MockFactory(BirdEntityMock).many(3);
## Documentation
**[Jump to the full documentation and explore the full API](https://github.com/omermorad/faker.ts/blob/master/docs/README.md)**

**There's also an example, [you can find it under the sample folder](https://github.com/omermorad/mockingbird-ts/tree/master/sample)**
**There's also an example, [you can find it under the sample folder](https://github.com/omermorad/mockingbird/tree/master/sample)**

## Playground

Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ coverage:
status:
project:
default:
target: 95%
target: 90%
patch:
default:
target: 95%
12 changes: 6 additions & 6 deletions docs/mock-decorator.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ actual `faker` instance.
So the result of the following code:

```typescript
import { MockFactory } from 'mockingbird-ts';
import { MockFactory } from 'mockingbird';

class Person {
@Mock(faker => faker.internet.email())
Expand All @@ -53,7 +53,7 @@ When using the `Mock` decorator without any value will generate a random value i
So the result of the following code:

```typescript
import { MockFactory } from 'mockingbird-ts';
import { MockFactory } from 'mockingbird';

class Person {
@Mock()
Expand Down Expand Up @@ -91,7 +91,7 @@ Passing a class will generate an object with the matching keys (decorated by the
So the result of the following code:

```typescript
import { MockFactory } from 'mockingbird-ts';
import { MockFactory } from 'mockingbird';

class Dog {
@Mock(faker => faker.name.firstName())
Expand Down Expand Up @@ -137,7 +137,7 @@ value that has been passed
So the result of the following code:

```typescript
import { MockFactory } from 'mockingbird-ts';
import { MockFactory } from 'mockingbird';

class Person {
@Mock('John')
Expand Down Expand Up @@ -171,7 +171,7 @@ Passing an enum object to the `Mock` decorator will generate a random value from
So the result of the following code:

```typescript
import {MockFactory} from 'mockingbird-ts';
import {MockFactory} from 'mockingbird';

enum Mood {
Happy = 'happy',
Expand Down Expand Up @@ -201,7 +201,7 @@ Will be:
Just as it is possible to move a class as a parameter, so it is also possible to pass an "array" of classes:

```typescript
import {MockFactory} from 'mockingbird-ts';
import {MockFactory} from 'mockingbird';

class Dog {
@Mock()
Expand Down
2 changes: 1 addition & 1 deletion docs/mock-factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Returns `MockBuilder` when invoked.
Consider the following class (we will use it in the following examples of each method):

```typescript
import { Mock } from 'mockingbird-ts';
import { Mock } from 'mockingbird';

export class Bird {
@Mock((faker) => faker.random.name())
Expand Down
7 changes: 6 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ const base = require('./jest.config.base');
module.exports = {
...base,
roots: ['<rootDir>'],
projects: ['<rootDir>/packages/mockingbird', '<rootDir>/packages/reflect', '<rootDir>/packages/parser'],
projects: [
'<rootDir>/packages/mockingbird',
'<rootDir>/packages/reflect',
'<rootDir>/packages/parser',
'<rootDir>/packages/logger',
],
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mockingbird-ts",
"name": "mockingbird-monorepo",
"private": true,
"version": "0.0.0",
"license": "MIT",
Expand Down Expand Up @@ -54,7 +54,7 @@
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@commitlint/config-lerna-scopes": "^12.1.4",
"@manypkg/cli": "^0.18.0",
"@manypkg/cli": "^0.19.1",
"@types/faker": "^5.5.7",
"@types/jest": "26.0.24",
"@types/node": "^12.20.15",
Expand Down
79 changes: 65 additions & 14 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,68 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.0.2](https://github.com/omermorad/mockingbird/compare/@mockinbird/common@2.0.1...@mockinbird/common@2.0.2) (2021-08-21)
## [2.0.3](https://github.com/omermorad/mockingbird/compare/@mockingbird/common@2.0.3-rc.3...@mockingbird/common@2.0.3) (2021-12-08)

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





## [2.0.3-rc.3](https://github.com/omermorad/mockingbird/compare/@mockingbird/common@2.0.3-rc.1...@mockingbird/common@2.0.3-rc.3) (2021-11-18)

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





## [2.0.3-rc.2](https://github.com/omermorad/mockingbird/compare/@mockingbird/common@2.0.3-rc.1...@mockingbird/common@2.0.3-rc.2) (2021-11-18)

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





## 2.0.3-rc.1 (2021-11-17)


### Features

* **common:** add regex constructor to exact value ([10263fb](https://github.com/omermorad/mockingbird/commit/10263fb17287eb86516bd4778960586106011c2f))



## 2.1.1 (2021-08-21)



# 2.1.0 (2021-08-21)





## 2.0.3-rc.0 (2021-11-13)

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





## [2.0.2](https://github.com/omermorad/mockingbird/compare/@mockingbird/common@2.0.1...@mockingbird/common@2.0.2) (2021-08-21)

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





## 2.0.1 (2021-08-21)

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



Expand All @@ -24,7 +75,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### chore

* **release:** release version v2.0.0 ([#53](https://github.com/omermorad/mockingbird-ts/issues/53)) ([f598ef3](https://github.com/omermorad/mockingbird-ts/commit/f598ef35d5b9111f66202f119b8961314483f4fb)), closes [#51](https://github.com/omermorad/mockingbird-ts/issues/51) [#40](https://github.com/omermorad/mockingbird-ts/issues/40) [#42](https://github.com/omermorad/mockingbird-ts/issues/42) [#37](https://github.com/omermorad/mockingbird-ts/issues/37) [#46](https://github.com/omermorad/mockingbird-ts/issues/46) [#47](https://github.com/omermorad/mockingbird-ts/issues/47) [#49](https://github.com/omermorad/mockingbird-ts/issues/49) [#50](https://github.com/omermorad/mockingbird-ts/issues/50) [#52](https://github.com/omermorad/mockingbird-ts/issues/52) [#54](https://github.com/omermorad/mockingbird-ts/issues/54) [#42](https://github.com/omermorad/mockingbird-ts/issues/42) [#55](https://github.com/omermorad/mockingbird-ts/issues/55) [#42](https://github.com/omermorad/mockingbird-ts/issues/42) [#56](https://github.com/omermorad/mockingbird-ts/issues/56) [#57](https://github.com/omermorad/mockingbird-ts/issues/57) [#58](https://github.com/omermorad/mockingbird-ts/issues/58) [#59](https://github.com/omermorad/mockingbird-ts/issues/59) [#60](https://github.com/omermorad/mockingbird-ts/issues/60) [#42](https://github.com/omermorad/mockingbird-ts/issues/42) [#61](https://github.com/omermorad/mockingbird-ts/issues/61) [#62](https://github.com/omermorad/mockingbird-ts/issues/62) [#64](https://github.com/omermorad/mockingbird-ts/issues/64) [#63](https://github.com/omermorad/mockingbird-ts/issues/63) [#67](https://github.com/omermorad/mockingbird-ts/issues/67) [#68](https://github.com/omermorad/mockingbird-ts/issues/68)
* **release:** release version v2.0.0 ([#53](https://github.com/omermorad/mockingbird/issues/53)) ([f598ef3](https://github.com/omermorad/mockingbird/commit/f598ef35d5b9111f66202f119b8961314483f4fb)), closes [#51](https://github.com/omermorad/mockingbird/issues/51) [#40](https://github.com/omermorad/mockingbird/issues/40) [#42](https://github.com/omermorad/mockingbird/issues/42) [#37](https://github.com/omermorad/mockingbird/issues/37) [#46](https://github.com/omermorad/mockingbird/issues/46) [#47](https://github.com/omermorad/mockingbird/issues/47) [#49](https://github.com/omermorad/mockingbird/issues/49) [#50](https://github.com/omermorad/mockingbird/issues/50) [#52](https://github.com/omermorad/mockingbird/issues/52) [#54](https://github.com/omermorad/mockingbird/issues/54) [#42](https://github.com/omermorad/mockingbird/issues/42) [#55](https://github.com/omermorad/mockingbird/issues/55) [#42](https://github.com/omermorad/mockingbird/issues/42) [#56](https://github.com/omermorad/mockingbird/issues/56) [#57](https://github.com/omermorad/mockingbird/issues/57) [#58](https://github.com/omermorad/mockingbird/issues/58) [#59](https://github.com/omermorad/mockingbird/issues/59) [#60](https://github.com/omermorad/mockingbird/issues/60) [#42](https://github.com/omermorad/mockingbird/issues/42) [#61](https://github.com/omermorad/mockingbird/issues/61) [#62](https://github.com/omermorad/mockingbird/issues/62) [#64](https://github.com/omermorad/mockingbird/issues/64) [#63](https://github.com/omermorad/mockingbird/issues/63) [#67](https://github.com/omermorad/mockingbird/issues/67) [#68](https://github.com/omermorad/mockingbird/issues/68)


### BREAKING CHANGES
Expand Down Expand Up @@ -56,12 +107,12 @@ MockGenerator. Add fluent API and ability to persist mock data



# [2.0.0-alpha.2](https://github.com/omermorad/mockingbird-ts/compare/@mockinbird/types@2.0.0-alpha.1...@mockinbird/types@2.0.0-alpha.2) (2021-07-23)
# [2.0.0-alpha.2](https://github.com/omermorad/mockingbird/compare/@mockingbird/types@2.0.0-alpha.1...@mockingbird/types@2.0.0-alpha.2) (2021-07-23)


### Bug Fixes

* **types:** change the values inside 'files' array in package.json ([a858cb4](https://github.com/omermorad/mockingbird-ts/commit/a858cb47ef8e80d87686724d4125bd213a77ecad))
* **types:** change the values inside 'files' array in package.json ([a858cb4](https://github.com/omermorad/mockingbird/commit/a858cb47ef8e80d87686724d4125bd213a77ecad))



Expand All @@ -72,40 +123,40 @@ MockGenerator. Add fluent API and ability to persist mock data

### Bug Fixes

* **types:** add build to export a js file to include the faker instance (for runtime) ([#61](https://github.com/omermorad/mockingbird-ts/issues/61)) ([f4e3092](https://github.com/omermorad/mockingbird-ts/commit/f4e3092e683eb9c288d4e879113e71f74ec5038a))
* **types:** add build to export a js file to include the faker instance (for runtime) ([#61](https://github.com/omermorad/mockingbird/issues/61)) ([f4e3092](https://github.com/omermorad/mockingbird/commit/f4e3092e683eb9c288d4e879113e71f74ec5038a))


### Features

* **mockingbird-ts:** add mock factory fluent/builder api ([#60](https://github.com/omermorad/mockingbird-ts/issues/60)) ([cc5710d](https://github.com/omermorad/mockingbird-ts/commit/cc5710ded33401cae25782bb8e87efe1355024aa)), closes [#42](https://github.com/omermorad/mockingbird-ts/issues/42)
* **mockingbird:** add mock factory fluent/builder api ([#60](https://github.com/omermorad/mockingbird/issues/60)) ([cc5710d](https://github.com/omermorad/mockingbird/commit/cc5710ded33401cae25782bb8e87efe1355024aa)), closes [#42](https://github.com/omermorad/mockingbird/issues/42)


### Reverts

* **repo:** release packages ([7f9390d](https://github.com/omermorad/mockingbird-ts/commit/7f9390d051f9c9c9c3eb172f4db8a9fe533b03c4))
* **repo:** release packages ([7f9390d](https://github.com/omermorad/mockingbird/commit/7f9390d051f9c9c9c3eb172f4db8a9fe533b03c4))


### BREAKING CHANGES

* **mockingbird-ts:** MockGenerator is not exported anymore, use MockFactory instead
* **mockingbird:** MockGenerator is not exported anymore, use MockFactory instead





# Change Log
# [2.0.0-alpha.0](https://github.com/omermorad/mockingbird-ts/compare/@mockinbird/types@2.0.0...@mockinbird/types@2.0.0-alpha.0) (2021-07-22)
# [2.0.0-alpha.0](https://github.com/omermorad/mockingbird/compare/@mockingbird/types@2.0.0...@mockingbird/types@2.0.0-alpha.0) (2021-07-22)

### Features

* **mockingbird-ts:** add mock factory fluent/builder api ([#60](https://github.com/omermorad/mockingbird-ts/issues/60)) ([cc5710d](https://github.com/omermorad/mockingbird-ts/commit/cc5710ded33401cae25782bb8e87efe1355024aa)), closes [#42](https://github.com/omermorad/mockingbird-ts/issues/42)
* **mockingbird:** add mock factory fluent/builder api ([#60](https://github.com/omermorad/mockingbird/issues/60)) ([cc5710d](https://github.com/omermorad/mockingbird/commit/cc5710ded33401cae25782bb8e87efe1355024aa)), closes [#42](https://github.com/omermorad/mockingbird/issues/42)


### Reverts

* **repo:** release packages ([7f9390d](https://github.com/omermorad/mockingbird-ts/commit/7f9390d051f9c9c9c3eb172f4db8a9fe533b03c4))
* **repo:** release packages ([7f9390d](https://github.com/omermorad/mockingbird/commit/7f9390d051f9c9c9c3eb172f4db8a9fe533b03c4))


### BREAKING CHANGES

* **mockingbird-ts:** MockGenerator is not exported anymore, use MockFactory instead
* **mockingbird:** MockGenerator is not exported anymore, use MockFactory instead
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mockinbird/common",
"version": "2.0.2",
"name": "@mockingbird/common",
"version": "2.0.3",
"license": "MIT",
"description": "Mockingbird Common Package",
"main": "dist/index.js",
Expand Down Expand Up @@ -37,10 +37,10 @@
"CHANGELOG.md"
],
"dependencies": {
"@types/faker": "^5.5.7",
"faker": "^5.5.3"
},
"devDependencies": {
"@types/faker": "^5.5.7",
"ts-loader": "^6.2.2",
"ts-node": "8.10.2",
"tsconfig-paths": "^3.9.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ObjectLiteral {
}
export type Class<T = any> = new (...args: any[]) => T;

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

export type MultiClass = { type: Class; count: number };

Expand Down
2 changes: 2 additions & 0 deletions packages/logger/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
jest.config.js
3 changes: 3 additions & 0 deletions packages/logger/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc"
}
27 changes: 27 additions & 0 deletions packages/logger/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

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

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





## 0.0.1-rc.1 (2021-11-17)


### Features

* **logger:** add initial working module ([#104](https://github.com/omermorad/mockingbird/issues/104)) ([6b6e69d](https://github.com/omermorad/mockingbird/commit/6b6e69d9169268d6d2468b4871dbefcc158d0539))





## 0.0.1-rc.0 (2021-11-13)

**Note:** Version bump only for package @mockingbird/logger
1 change: 1 addition & 0 deletions packages/logger/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src';
Loading

0 comments on commit c6f521f

Please sign in to comment.