Skip to content
This repository was archived by the owner on Nov 13, 2020. It is now read-only.

Commit 4af087c

Browse files
committed
Merge chore_update_dependencies
2 parents fed13e9 + be58748 commit 4af087c

23 files changed

+4636
-1597
lines changed

.gflowrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"production": "production",
3+
"develop": "master",
4+
"charBranchNameSeparator": "_",
5+
"remote": "origin",
6+
"ignores": [],
7+
"syncAfterFinish": false,
8+
"postFinish": "",
9+
"skipTest": false,
10+
"branchTypes": {
11+
"feat": "feat",
12+
"fix": "fix",
13+
"chore": "chore",
14+
"docs": "docs"
15+
},
16+
"refs": {}
17+
}

.lintstagedrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"concurrent": true,
3+
"linters": {
4+
"*.ts": [
5+
"prettier --parser typescript --write",
6+
"git add"
7+
]
8+
}
9+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
docs
3+
node_modules
4+
*-lock.json
5+
*.lock

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 140,
3+
"bracketSpacing": false
4+
}

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
language: node_js
2+
cache:
3+
directories:
4+
- ~/.npm
25
notifications:
36
email: false
47
node_js:
8+
- '9'
59
- 'node'
610
- '8'
7-
- '7'
8-
- '6'
911
after_success:
10-
- npm run coveralls:travis
11-
- sh ./sh/prepublish.sh && semantic-release pre && sh ./sh/publish.sh
12+
- npm run travis-deploy-once "npm run semantic-release"
13+
- npm run travis-coveralls
1214
branches:
1315
except:
14-
- /^v\d+\.\d+\.\d+$/
15-
sudo: false
16+
- /^v\d+\.\d+\.\d+$/

package.json

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
77
"scripts": {
8-
"clean": "rimraf 'test/**/*.{js,js.map}' 'src/**/*.{js,js.map}'",
9-
"tslint": "tslint 'src/**/*.ts?(x)'",
10-
"test": "npm run clean && npm run tsc && npm run tslint && NODE_ENV=test nyc --reporter=html --reporter=text _mocha --recursive",
11-
"coveralls:travis": "nyc report --reporter=text-lcov | coveralls",
8+
"precommit": "lint-staged",
9+
"postcommit": "git update-index --again",
10+
"prepublishOnly": "gflow release post",
11+
"gflow-release-pre": "",
12+
"semantic-release": "semantic-release",
13+
"travis-deploy-once": "travis-deploy-once",
14+
"travis-coveralls": "nyc report --reporter=text-lcov | coveralls",
15+
"tslint": "tslint --project tsconfig.json",
16+
"test": "npm run tsc && npm run tslint && cross-env NODE_ENV=test nyc --reporter=html --reporter=text _mocha --recursive",
1217
"tsc": "tsc --project tsconfig.json",
13-
"tsc:compile": "rimraf ./lib && tsc --project tsconfig.compile.json",
14-
"doc:serve": "concurrently \"tsc --project tsconfig.compile.json -w\" \"docsify serve ./docs\" \"cd docs/_build && nodemon --delay 2.5 -e ts --watch ../../lib build-api.js\"",
18+
"build": "tsc --project tsconfig.compile.json",
1519
"doc:build": "exit 0",
16-
"prepublish": "npm run tsc:compile"
20+
"prettier": "prettier '{src,test}/**/*.ts' --write"
1721
},
1822
"repository": {
1923
"type": "git",
20-
"url": "https://github.com/Romakita/ts-json-properties.git"
24+
"url": "https://github.com/TypedProject/ts-json-properties.git"
2125
},
2226
"keywords": [
2327
"ts",
@@ -30,21 +34,27 @@
3034
"author": "Romakita",
3135
"license": "MIT",
3236
"bugs": {
33-
"url": "https://github.com/Romakita/ts-json-properties/issues"
37+
"url": "https://github.com/TypedProject/ts-json-properties/issues"
3438
},
35-
"homepage": "https://github.com/romakita/json-properties",
39+
"homepage": "https://github.com/TypedProject/ts-json-properties",
3640
"devDependencies": {
3741
"@types/chai": "^4.0.8",
38-
"@types/mocha": "^2.2.44",
39-
"@types/node": "^8.0.54",
42+
"@types/mocha": "^5.2.5",
43+
"@types/node": "^10.5.7",
4044
"chai": "^4.1.2",
4145
"coveralls": "^3.0.0",
42-
"mocha": "^4.0.1",
43-
"nyc": "^11.4.0",
44-
"semantic-release": "^7.0.2",
45-
"ts-node": "^3.3.0",
46+
"cross-env": "^5.2.0",
47+
"gflow": "^2.1.7",
48+
"husky": "^0.14.3",
49+
"lint-staged": "^7.2.0",
50+
"mocha": "^5.2.0",
51+
"nyc": "^12.0.2",
52+
"prettier": "^1.14.0",
53+
"semantic-release": "^15.9.5",
54+
"travis-deploy-once": "^5.0.2",
55+
"ts-node": "^7.0.0",
4656
"tslint": "^5.8.0",
47-
"typescript": "^2.5.0"
57+
"typescript": "^3.0.1"
4858
},
4959
"directories": {
5060
"lib": "lib",
@@ -54,9 +64,5 @@
5464
"release": {
5565
"debug": false,
5666
"branch": "production"
57-
},
58-
"gflow": {
59-
"master": "master",
60-
"production": "production"
6167
}
62-
}
68+
}

readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Ts.JsonProperties
22

3-
[![Build Status](https://travis-ci.org/Romakita/ts-json-properties.svg?branch=master)](https://travis-ci.org/Romakita/ts-json-properties)
4-
[![Coverage Status](https://coveralls.io/repos/github/Romakita/ts-json-properties/badge.svg?branch=master)](https://coveralls.io/github/Romakita/ts-json-properties?branch=master)
5-
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.svg?v=100)](https://github.com/ellerbrock/typescript-badges/)
3+
[![Build Status](https://travis-ci.org/TypedProject/ts-json-properties.svg?branch=master)](https://travis-ci.org/TypedProject/ts-json-properties)
4+
[![Coverage Status](https://coveralls.io/repos/github/TypedProject/ts-json-properties/badge.svg?branch=master)](https://coveralls.io/github/TypedProject/ts-json-properties?branch=master)
5+
![npm](https://img.shields.io/npm/dm/ts-json-properties.svg)
6+
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.svg?v=100)](https://github.com/ellerbrock/typescript-badges/)
67
[![Package Quality](http://npm.packagequality.com/shield/ts-json-properties.png)](http://packagequality.com/#?package=ts-json-properties)
78
[![npm version](https://badge.fury.io/js/ts-json-properties.svg)](https://badge.fury.io/js/ts-json-properties)
89
[![Dependencies](https://david-dm.org/romakita/ts-json-properties.svg)](https://david-dm.org/romakita/ts-json-properties#info=dependencies)
910
[![img](https://david-dm.org/romakita/ts-json-properties/dev-status.svg)](https://david-dm.org/romakita/ts-json-properties/#info=devDependencies)
1011
[![img](https://david-dm.org/romakita/ts-json-properties/peer-status.svg)](https://david-dm.org/romakita/ts-json-properties/#info=peerDependenciess)
1112
[![Known Vulnerabilities](https://snyk.io/test/github/romakita/ts-json-properties/badge.svg)](https://snyk.io/test/github/romakita/ts-json-properties)
13+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
14+
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
1215

1316
> Use typescript decorator to retrieve a property from properties.json and load it on class attribute.
1417
@@ -20,6 +23,7 @@
2023
* `Properties.get()` : resolve expression and values the attribute (programmatic).
2124

2225
## Installation
26+
2327
```bash
2428
npm install -g typescript
2529
npm install ts-json-properties

sh/prepublish.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

sh/publish.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/decorators/constant.ts

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
import {Properties} from "../utils/Properties";
22

33
export function Constant(expression: string) {
4-
5-
return (target: any, propertyKey: string) => {
6-
7-
if (delete target[propertyKey]) {
8-
9-
let constant: any;
10-
11-
Object.defineProperty(target, propertyKey, {
12-
13-
get: function () {
14-
constant = Object.freeze(constant !== undefined ? constant : Properties.get(expression));
15-
return constant;
16-
},
17-
18-
enumerable: true,
19-
configurable: true
20-
});
21-
}
22-
23-
};
24-
}
4+
return (target: any, propertyKey: string) => {
5+
if (delete target[propertyKey]) {
6+
let constant: any;
7+
8+
Object.defineProperty(target, propertyKey, {
9+
get: function() {
10+
constant = Object.freeze(constant !== undefined ? constant : Properties.get(expression));
11+
return constant;
12+
},
13+
14+
enumerable: true,
15+
configurable: true
16+
});
17+
}
18+
};
19+
}

0 commit comments

Comments
 (0)