Skip to content

Commit 5dfcc90

Browse files
Merge branch 'master' into feat/transform-prop-dec-on-class
2 parents 1371f6b + 3b1ece6 commit 5dfcc90

File tree

7 files changed

+1952
-1877
lines changed

7 files changed

+1952
-1877
lines changed

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@
4141
"github": {
4242
"release": true
4343
},
44-
"increment": "conventional:@favoloso/emoji",
45-
"scripts": {
46-
"changelog": "./node_modules/.bin/conventional-changelog -p @favoloso/emoji | tail -n +3",
47-
"beforeStage": "./node_modules/.bin/conventional-changelog -p @favoloso/emoji -i CHANGELOG.md -s"
44+
"plugins": {
45+
"@release-it/conventional-changelog": {
46+
"preset": "@favoloso/emoji",
47+
"infile": "CHANGELOG.md"
48+
}
4849
}
4950
},
5051
"publishConfig": {
@@ -59,17 +60,18 @@
5960
"@babel/preset-typescript": "^7.6.0",
6061
"@babel/template": "^7.6.0",
6162
"@babel/types": "^7.6.3",
62-
"@favoloso/conventional-changelog-emoji": "^0.9.0",
63+
"@favoloso/conventional-changelog-emoji": "^0.10.0",
64+
"@release-it/conventional-changelog": "^1.1.0",
6365
"@types/jest": "^24.0.19",
6466
"babel-test": "^0.2.3",
6567
"conventional-changelog-cli": "^2.0.25",
66-
"husky": "^1.3.1",
68+
"husky": "^4.2.3",
6769
"jest": "^24.9.0",
6870
"jest-file-snapshot": "^0.3.7",
69-
"release-it": "^10.3.1",
71+
"release-it": "^12.6.3",
7072
"typescript": "^3.6.4"
7173
},
7274
"dependencies": {
7375
"@babel/helper-plugin-utils": "^7.0.0"
7476
}
75-
}
77+
}

src/metadata/serializeType.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as t from '@babel/types';
1+
import { types as t } from '@babel/core';
22
import { NodePath } from '@babel/traverse';
33

44
type InferArray<T> = T extends Array<infer A> ? A : never;
@@ -176,6 +176,7 @@ function serializeTypeNode(className: string, node: t.TSType): SerializedType {
176176
}
177177

178178
case 'TSNumberKeyword':
179+
case 'TSBigIntKeyword' as any: // Still not in ``@babel/core` typings
179180
return t.identifier('Number');
180181

181182
case 'TSSymbolKeyword':

test/__fixtures__/nest-injection/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
44

55
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
66

7-
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }
7+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
88

99
import { AppService } from './app.service';
1010
export let AppController = (_dec = Controller(), _dec2 = Reflect.metadata("design:type", Function), _dec3 = Reflect.metadata("design:paramtypes", [typeof AppService === "undefined" ? Object : AppService]), _dec4 = Inject(), _dec5 = Reflect.metadata("design:type", typeof AppService === "undefined" ? Object : AppService), _dec6 = Inject(), _dec7 = Reflect.metadata("design:type", typeof AppService === "undefined" ? Object : AppService), _dec8 = Get(), _dec9 = Reflect.metadata("design:type", Function), _dec10 = Reflect.metadata("design:paramtypes", []), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = (_temp = class AppController {

test/__fixtures__/type-serialization/code.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Sample {
4646
p14: (string | (string | null)),
4747
p15: Object,
4848
p16: any,
49+
p17: bigint,
4950
) {}
5051

5152
/**

test/__fixtures__/type-serialization/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { Decorate } from './Decorate';
66
const sym = Symbol();
77
let Sample = (_dec = Decorate(), _dec2 = Reflect.metadata("design:type", Function), _dec3 = Reflect.metadata("design:paramtypes", [typeof String === "undefined" ? Object : String, typeof Number === "undefined" ? Object : Number, Number, String, Boolean, String, Number, typeof Object === "undefined" ? Object : Object, Function, String, Object, typeof Function === "undefined" ? Object : Function, void 0, void 0, Object, Function, Boolean, Boolean, String]), _dec4 = function (target, key) {
88
return Arg()(target, key, 0);
9-
}, _dec5 = Reflect.metadata("design:type", Function), _dec6 = Reflect.metadata("design:paramtypes", [typeof Symbol === "undefined" ? Object : Symbol, Object, String, void 0, String, String, typeof Maybe === "undefined" ? Object : Maybe, Object, Object, Array, Array, void 0, Boolean, void 0, String, typeof Object === "undefined" ? Object : Object, Object]), _dec7 = Decorate(), _dec8 = Reflect.metadata("design:type", Function), _dec9 = Reflect.metadata("design:paramtypes", [typeof Decorate.Name === "undefined" ? Object : Decorate.Name, typeof Decorate.Name === "undefined" ? Object : Decorate.Name]), _dec10 = Decorate(), _dec11 = Reflect.metadata("design:type", Function), _dec12 = Reflect.metadata("design:paramtypes", [String]), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Sample {
9+
}, _dec5 = Reflect.metadata("design:type", Function), _dec6 = Reflect.metadata("design:paramtypes", [typeof Symbol === "undefined" ? Object : Symbol, Object, String, void 0, String, String, typeof Maybe === "undefined" ? Object : Maybe, Object, Object, Array, Array, void 0, Boolean, void 0, String, typeof Object === "undefined" ? Object : Object, Object, Number]), _dec7 = Decorate(), _dec8 = Reflect.metadata("design:type", Function), _dec9 = Reflect.metadata("design:paramtypes", [typeof Decorate.Name === "undefined" ? Object : Decorate.Name, typeof Decorate.Name === "undefined" ? Object : Decorate.Name]), _dec10 = Decorate(), _dec11 = Reflect.metadata("design:type", Function), _dec12 = Reflect.metadata("design:paramtypes", [String]), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Sample {
1010
constructor(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18 = 'abc') {
1111
this.p0 = p0;
1212
}
1313

14-
method(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) {}
14+
method(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) {}
1515
/**
1616
* Member Expression
1717
*/

test/__node__/self-reference/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
88

99
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
1010

11-
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }
11+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
1212

1313
let Self = (_dec = injectable(), _dec2 = (0, _lib.inject)(), _dec3 = Reflect.metadata("design:type", Object), _dec(_class = (_class2 = (_temp = class Self {
1414
constructor() {

0 commit comments

Comments
 (0)