Skip to content

Commit

Permalink
feat: faker.ts initial (#6)
Browse files Browse the repository at this point in the history
* wip: initial package

* docs(api): add initial package api description

* docs: update main readme

* fix(signatures): remove redundant signature for Date type overload

* refactor: general refactor

* wip: added more docs + minimal refactor

* refactor: general refactor and naming

* refactor(handlers): change handlers interface and structure, broke into 3 different for objects

* test: unit tests + integration (#4)

* test(fixture-factory, class-processor): first commit of unit tests - fixture-factory, class-processor

* test(class-processor, primitive-value-handler): class processor, primitive values tests added

* test: refactored tests

* refactor: changed some names and added some contributors to package.json

* chore(package.lock): add package-lock.json file

* style(handlers): change the names to inspectors

* style(handlers): change the names to inspectors

* refactor: tests and general structure (#7)

* refactor: naming

* refactor(FML): mega refactor

* refactor(handlers): logics and more handlers

* fix(primitives): throw an error when type mismatch

* fix(circularity): remove circularity protection because reflect-metadata protection

* test(handlers): added unit test for callback handler

* test(handlers): add enum unit test and fix callback one

* test(handlers): add some more tests for handlers

* refactor(naming): changed some names

* test: more coverage and renaming

* chore(release-settings): change strategy to work with v-* and not with master

* test(reflector): add class reflector test coverage

* test: added integration test, increased coverage

* docs(api): update api documentation

* refactor: god rid of some redundant checks, change class-type name, change tsconfig target

* renames & 2nd phase todos (#8)

* refactor: renames and add second phase todos

* fix: add 'unknown' overlap to property dto

* ci: add commit lint validation

* docs(readme): update main readme file

* chore(deps): update peer deps

* test: fixture factory test

* test(coverage): ladies and gents, coverage is now 100%

* ci(releaserc): add 'alpha' branch to pre-release

Co-authored-by: amit.wagner <wagner.amit@gmail.com>
Co-authored-by: idanpt <idanpt@gmail.com>
  • Loading branch information
3 people committed Jan 28, 2021
2 parents 4633310 + 5682bb4 commit 714fc05
Show file tree
Hide file tree
Showing 56 changed files with 19,426 additions and 0 deletions.
138 changes: 138 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,138 @@
version: 2.1

orbs:
codecov: codecov/codecov@1.0.2

defaults: &defaults
working_directory: ~/repo

docker:
- image: circleci/node:erbium

jobs:
install:
<<: *defaults

steps:
- checkout

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
- v1-dependencies-

- run:
name: Install
command: npm ci

- persist_to_workspace:
root: ~/repo
paths: .

lint-commit-message:
<<: *defaults
steps:
- checkout

- attach_workspace:
at: ~/repo

- run:
name: Define environment variable with lastest commit's message
command: |
echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV
source $BASH_ENV
- run:
name: Lint Commit Message
command: echo "$COMMIT_MESSAGE" | npx commitlint

test:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo

- run:
name: Test
command: npm run test:ci
environment:
JEST_JUNIT_OUTPUT_DIR: ./coverage

- store_test_results:
path: ./coverage

- store_artifacts:
path: ./coverage

- codecov/upload:
file: ./coverage/cobertura-coverage.xml

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package-lock.json" }}

build:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo

- run:
name: Build
command: npm run build
environment:
NODE_ENV: 'test'

- persist_to_workspace:
root: ~/repo
paths: .

release:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo

- run:
name: Semantic Release
command: npx semantic-release

workflows:
version: 2.1

test-and-release:
jobs:
- install

- lint-commit-message:
requires:
- install

- test:
requires:
- install

- build:
requires:
- install

- approve:
type: approval
requires:
- test
- build
# filters:
# tags:
# only: /^v.*/
# branches:
# ignore: /.*/

- release:
requires:
- approve
# filters:
# tags:
# only: /^v.*/
# branches:
# ignore: /.*/
7 changes: 7 additions & 0 deletions .eslintignore
@@ -0,0 +1,7 @@
node_modules/*
coverage/*
dist
dist/*
*.js
*.d.ts
index.ts
65 changes: 65 additions & 0 deletions .eslintrc
@@ -0,0 +1,65 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"prettier"
],
"parserOptions": {
"ecmaVersion": 8
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts"
]
},
"import/resolver": {
"node": {
"extensions": [
".ts"
]
},
"typescript": {
"alwaysTryTypes": true
}
},
"import/extensions": 0
},
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-useless-constructor": "off",
"prettier/prettier": [
"error",
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "es5"
}
],
"react/forbid-prop-types": 0,
"no-unused-expressions": 0,
"one-var": 0,
"no-underscore-dangle": [
0,
{
"allow": []
}
],
"global-require": 0,
"new-cap": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"import/extensions": 0,
"@typescript-eslint/camelcase": 0,
"camelcase": "off",
"consistent-return": 0,
"import/prefer-default-export": 0,
"lines-between-class-members": "off"
},
"env": {
"jest": true
}
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1 @@
* omer.moradd@gmail.com
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,29 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

16 changes: 16 additions & 0 deletions .github/stale.yml
@@ -0,0 +1,16 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
38 changes: 38 additions & 0 deletions .gitignore
@@ -0,0 +1,38 @@
# compiled output
dist
node_modules

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

.npmrc
junit.xml
.gitconfig
2 changes: 2 additions & 0 deletions .npmignore
@@ -0,0 +1,2 @@
.eslintrc
.editorconfig
35 changes: 35 additions & 0 deletions .releaserc.json
@@ -0,0 +1,35 @@
{
"branches": [
"master",
"next",
{
"name": "alpha",
"prerelease": true
}
],
"repositoryUrl": "https://github.com/omermorad/faker.ts.git",
"debug": "true",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,6 @@
# 1.0.0-alpha.1 (2021-01-28)


### Features

* faker.ts alpha release ([#11](https://github.com/omermorad/faker.ts/issues/11)) ([67511b7](https://github.com/omermorad/faker.ts/commit/67511b7bc7792e06ac54c752b0ac96ee5337fd35)), closes [#4](https://github.com/omermorad/faker.ts/issues/4) [#7](https://github.com/omermorad/faker.ts/issues/7) [#8](https://github.com/omermorad/faker.ts/issues/8)

0 comments on commit 714fc05

Please sign in to comment.