Skip to content

Commit 7020a72

Browse files
merge: release 0.3.1 (#382)
2 parents 15d6bdb + ba88a60 commit 7020a72

Some content is hidden

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

62 files changed

+10971
-9001
lines changed

.eslintrc.js

-32
This file was deleted.

.eslintrc.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
parser: '@typescript-eslint/parser'
2+
plugins:
3+
- '@typescript-eslint'
4+
parserOptions:
5+
ecmaVersion: 2018
6+
sourceType: module
7+
project:
8+
- ./tsconfig.json
9+
- ./tsconfig.spec.json
10+
extends:
11+
- 'plugin:@typescript-eslint/recommended'
12+
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
13+
- 'plugin:jest/recommended'
14+
- 'prettier'
15+
- 'prettier/@typescript-eslint'
16+
rules:
17+
'@typescript-eslint/explicit-member-accessibility': off
18+
'@typescript-eslint/no-angle-bracket-type-assertion': off
19+
'@typescript-eslint/no-parameter-properties': off
20+
'@typescript-eslint/explicit-function-return-type': off
21+
'@typescript-eslint/member-delimiter-style': off
22+
'@typescript-eslint/no-inferrable-types': off
23+
'@typescript-eslint/no-explicit-any': off
24+
'@typescript-eslint/member-ordering': 'error'
25+
# TODO: Remove these and fixed issues once we merged all the current PRs.
26+
'@typescript-eslint/ban-types': off
27+
'@typescript-eslint/no-unsafe-return': off
28+
'@typescript-eslint/no-unsafe-assignment': off
29+
'@typescript-eslint/no-unsafe-call': off
30+
'@typescript-eslint/no-unsafe-member-access': off
31+
'@typescript-eslint/explicit-module-boundary-types': off
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CD
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
name: Publish to NPM
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- uses: actions/setup-node@v1
12+
with:
13+
registry-url: https://registry.npmjs.org
14+
- run: npm ci --ignore-scripts
15+
- run: npm run prettier:check
16+
- run: npm run lint:check
17+
- run: npm run test:ci
18+
- run: npm run build
19+
- run: cp LICENSE build/LICENSE
20+
- run: cp README.md build/README.md
21+
- run: jq 'del(.devDependencies) | del(.scripts)' package.json > build/package.json
22+
- run: npm publish ./build
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
on: push
3+
jobs:
4+
checks:
5+
name: Linters
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v1
9+
- uses: actions/setup-node@v1
10+
- run: npm ci --ignore-scripts
11+
- run: npm run prettier:check
12+
- run: npm run lint:check
13+
tests:
14+
name: Tests
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [8.x, 10.x, 12.x, 14.x]
19+
steps:
20+
- uses: actions/checkout@v1
21+
- name: Setting up Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
- run: npm ci --ignore-scripts
24+
- run: npm run test:ci
25+
- run: npm install codecov -g
26+
- run: codecov -f ./coverage/clover.xml -t ${{ secrets.CODECOV_TOKEN }}
27+
build:
28+
name: Build
29+
needs: [tests, checks]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v1
33+
- uses: actions/setup-node@v1
34+
- run: npm ci --ignore-scripts
35+
- run: npm run build

.gitignore

+51-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
1-
build/
2-
node_modules/
3-
coverage/
4-
npm-debug.log
1+
# Log files
2+
logs
3+
*.log
4+
*.tmp
5+
*.tmp.*
6+
log.txt
7+
npm-debug.log*
8+
9+
# Testing output
10+
lib-cov/**
11+
coverage/**
12+
13+
# Environment files
14+
.env
15+
16+
# Dependency directories
17+
node_modules
18+
19+
# MacOS related files
20+
*.DS_Store
21+
.AppleDouble
22+
.LSOverride
23+
._*
24+
UserInterfaceState.xcuserstate
25+
26+
# Windows related files
27+
Thumbs.db
28+
Desktop.ini
29+
$RECYCLE.BIN/
30+
31+
# IDE - Sublime
32+
*.sublime-project
33+
*.sublime-workspace
34+
35+
# IDE - VSCode
36+
.vscode/**
37+
!.vscode/tasks.json
38+
!.vscode/launch.json
39+
40+
# IDE - IntelliJ
541
.idea
6-
.vscode
42+
43+
# Compilation output folders
44+
dist/
45+
build/
46+
tmp/
47+
out-tsc/
48+
temp
49+
50+
# Files for playing around locally
51+
playground.ts
52+
playground.js

.prettierrc.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
printWidth: 120
2+
tabWidth: 2
3+
useTabs: false
4+
semi: true
5+
singleQuote: true
6+
trailingComma: es5
7+
bracketSpacing: true
8+
arrowParens: avoid

.travis.yml

-7
This file was deleted.

CHANGELOG.md

+66-36
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
1-
# Changelog and release notes
1+
# Changelog
22

3+
_This changelog follows the [keep a changelog][keep-a-changelog]_ format to maintain a human readable changelog.
34

4-
### 0.2.3 [BREAKING CHANGE]
5+
### [0.3.1][v0.3.1] - 2020-07-29
6+
7+
#### Added
8+
9+
- table of content added to readme
10+
11+
#### Changed
12+
13+
- moved from Mocha to Jest
14+
- added Prettier for code formatting
15+
- added Eslint for linting
16+
- updated CI configuration
17+
- removed some unused dev dependencies
18+
- updated dependencies to latest version
19+
20+
#### Fixed
21+
22+
- circular dependency fixed
23+
- dev dependencies removed from package.json before publishing (no more security warnings)
24+
- transformer oder is deterministic now (#231)
25+
- fix prototype pollution issue (#367)
26+
27+
### [0.2.3][v0.2.3] [BREAKING CHANGE]
528

629
#### Changed
730

831
- `enableImplicitConversion` has been added and imlplicit value conversion is disabled by default.
932
- reverted #234 - fix: write properties with defined default values on prototype which broke the `@Exclude` decorator.
1033

11-
### 0.2.2 [BREAKING CHANGE]
34+
### [0.2.2][v0.2.2] [BREAKING CHANGE]
1235

1336
> **NOTE:** This version is deprecated.
1437
@@ -18,103 +41,110 @@ This version has introduced a breaking-change when this library is used with cla
1841

1942
- implicity type conversion between values.
2043

21-
### 0.2.1
44+
### [0.2.1][v0.2.1]
2245

2346
> **NOTE:** This version is deprecated.
2447
2548
#### Added
2649

27-
- add option to strip unkown properties via using the `excludeExtraneousValues` option
50+
- add option to strip unkown properties via using the `excludeExtraneousValues` option
2851

29-
### 0.2.0 [BREAKING CHANGE]
52+
### [0.2.0][v0.2.0] [BREAKING CHANGE]
3053

3154
#### Added
3255

33-
- add documentation for using `Set`s and `Map`s
34-
- add opotion to pass a discriminator function to convert values into different types based on custom conditions
35-
- added support for polymorphism based on a named type property
56+
- add documentation for using `Set`s and `Map`s
57+
- add opotion to pass a discriminator function to convert values into different types based on custom conditions
58+
- added support for polymorphism based on a named type property
3659

3760
#### Fixed
3861

39-
- fix bug when transforming `null` values as primitives
62+
- fix bug when transforming `null` values as primitives
4063

4164
### 0.1.10
4265

4366
#### Fixed
4467

45-
- improve MetadataStorage perf by changing from Arrays to ES6 Maps by @sheiidan
46-
- fixed getAncestor issue with unknown nested properties by @247GradLabs
68+
- improve MetadataStorage perf by changing from Arrays to ES6 Maps by @sheiidan
69+
- fixed getAncestor issue with unknown nested properties by @247GradLabs
4770

4871
### 0.1.9
4972

5073
#### Fixed
5174

52-
- objects with `null` prototype are converted properly now
53-
- objects with unknown non primitive properties are converted properly now
54-
- corrected a typo in the README.md
55-
- fixed the deserialize example in the README.md
75+
- objects with `null` prototype are converted properly now
76+
- objects with unknown non primitive properties are converted properly now
77+
- corrected a typo in the README.md
78+
- fixed the deserialize example in the README.md
5679

5780
### 0.1.4
5881

5982
#### Added
6083

61-
- added `TransformClassToPlain` and `TransformClassToClass` decorators
84+
- added `TransformClassToPlain` and `TransformClassToClass` decorators
6285

6386
### 0.1.0
6487

6588
#### Added
6689

67-
- renamed library from `constructor-utils` to `class-transformer`
68-
- completely renamed most of names
69-
- renamed all main methods: `plainToConstructor` now is `plainToClass` and `constructorToPlain` is `classToPlain`, etc.
70-
- `plainToConstructorArray` method removed - now `plainToClass` handles it
71-
- `@Skip()` decorator renamed to `@Exclude()`
72-
- added `@Expose` decorator
73-
- added lot of new options: groups, versioning, custom names, etc.
74-
- methods and getters that should be exposed must be decorated with `@Expose` decorator
75-
- added `excludedPrefix` to class transform options that allows exclude properties that start with one of the given prefix
90+
- renamed library from `constructor-utils` to `class-transformer`
91+
- completely renamed most of names
92+
- renamed all main methods: `plainToConstructor` now is `plainToClass` and `constructorToPlain` is `classToPlain`, etc.
93+
- `plainToConstructorArray` method removed - now `plainToClass` handles it
94+
- `@Skip()` decorator renamed to `@Exclude()`
95+
- added `@Expose` decorator
96+
- added lot of new options: groups, versioning, custom names, etc.
97+
- methods and getters that should be exposed must be decorated with `@Expose` decorator
98+
- added `excludedPrefix` to class transform options that allows exclude properties that start with one of the given prefix
7699

77100
### 0.0.22
78101

79102
#### Fixed
80103

81-
- fixed array with primitive types being converted
104+
- fixed array with primitive types being converted
82105

83106
### 0.0.18-0.0.21
84107

85108
#### Fixed
86109

87-
- fixed bugs when getters are not converted with es6 target
110+
- fixed bugs when getters are not converted with es6 target
88111

89112
### 0.0.17
90113

91114
#### Fixed
92115

93-
- fixed issue #4
94-
- added type guessing during transformation from constructor to plain object
95-
- added sample with generics
116+
- fixed issue #4
117+
- added type guessing during transformation from constructor to plain object
118+
- added sample with generics
96119

97120
### 0.0.16
98121

99122
#### Changed
100123

101-
- renamed `constructor-utils/constructor-utils` to `constructor-utils` package namespace
124+
- renamed `constructor-utils/constructor-utils` to `constructor-utils` package namespace
102125

103126
### 0.0.15
104127

105128
#### Removed
106129

107-
- removed code mappings from package
130+
- removed code mappings from package
108131

109132
### 0.0.14
110133

111134
#### Removed
112135

113-
- removed `import "reflect-metadata"` from source code. Now reflect metadata should be included like any other shims.
136+
- removed `import "reflect-metadata"` from source code. Now reflect metadata should be included like any other shims.
114137

115138
### 0.0.13
116139

117140
#### Changed
118141

119-
- Library has changed its name from `serializer.ts` to `constructor-utils`.
120-
- Added `constructor-utils` namespace.
142+
- Library has changed its name from `serializer.ts` to `constructor-utils`.
143+
- Added `constructor-utils` namespace.
144+
145+
[v0.3.1]: https://github.com/typestack/class-transformer/compare/v0.2.3...v0.3.1
146+
[v0.2.3]: https://github.com/typestack/class-transformer/compare/v0.2.2...v0.2.3
147+
[v0.2.2]: https://github.com/typestack/class-transformer/compare/v0.2.1...v0.2.2
148+
[v0.2.1]: https://github.com/typestack/class-transformer/compare/v0.2.0...v0.2.1
149+
[v0.2.0]: https://github.com/typestack/class-transformer/compare/v0.1.10...v0.2.0
150+
[keep-a-changelog]: https://keepachangelog.com/en/1.0.0/

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2015-2016 Umed Khudoiberdiev
3+
Copyright (c) 2015-2020 Umed Khudoiberdiev
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)