This commit is contained in:
crusader 2018-05-16 19:05:37 +09:00
parent 06967e23c9
commit 3e578d164e
7 changed files with 6120 additions and 101 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
/dist-server /dist-server
/tmp /tmp
/out-tsc /out-tsc
/docs
# dependencies # dependencies
/node_modules /node_modules

9
.make-package.js Normal file
View File

@ -0,0 +1,9 @@
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString());
delete packageJson.devDependencies;
delete packageJson.scripts;
packageJson.private = false;
fs.writeFileSync('./dist/package.json', JSON.stringify(packageJson, null, 2));

View File

@ -1,3 +0,0 @@
tsconfig.json
tslint.json
src

21
License Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

6138
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,11 @@
{ {
"name": "@loafer/core", "name": "@loafer/core",
"description": "Core module of loafer", "description": "Core module of loafer",
"version": "0.0.3", "version": "0.0.1",
"license": "MIT", "license": "MIT",
"private": false, "private": true,
"main": "./index.js",
"typings": "./index.d.ts",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.loafle.net/loafer/typescript/core.git" "url": "https://git.loafle.net/loafer/typescript/core.git"
@ -14,17 +16,26 @@
"keywords": [], "keywords": [],
"author": "Loafle <loafer@loafle.com>", "author": "Loafle <loafer@loafle.com>",
"scripts": { "scripts": {
"compile": "npm run clean && tsc -p .", "generate:package": "node .make-package.js",
"watch": "tsc -w -p .", "generate:doc": "rimraf docs && typedoc --out docs --target es6 --theme minimal --mode file src",
"clean": "rm -rf dist" "bundle": "rimraf dist && tsc",
"build": "npm run bundle && npm run generate:package && npm run generate:doc"
}, },
"dependencies": { "dependencies": {
"reflect-metadata": "^0.1.12" "reflect-metadata": "^0.1.12"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "~8.0.0", "@types/jest": "^22.2.3",
"ts-node": "~4.0.1", "@types/node": "^9.3.0",
"tslint": "~5.9.1", "jest": "^22.4.3",
"typescript": "~2.5.3" "prettier": "^1.12.1",
"rimraf": "^2.6.2",
"ts-jest": "^22.4.6",
"ts-node": "^6.0.3",
"tslint": "^5.10.0",
"tslint-config-prettier": "^1.12.0",
"tslint-config-standard": "^7.0.0",
"typedoc": "^0.11.1",
"typescript": "^2.8.3"
} }
} }

View File

@ -1,16 +1,16 @@
import { // import {
TypeUtil, // TypeUtil,
} from '../util/TypeUtil'; // } from '../util/TypeUtil';
import { Class } from './Class'; import { Class } from './Class';
import { Executable } from './Executable'; import { Executable } from './Executable';
export class Constructor extends Executable { export class Constructor extends Executable {
private _rawConstructor: Function; // private _rawConstructor: Function;
public constructor(declaringClazz: Class, parameterTypes?: any[]) { public constructor(declaringClazz: Class, parameterTypes?: any[]) {
super(declaringClazz, CONSTRUCTOR_NAME, parameterTypes); super(declaringClazz, CONSTRUCTOR_NAME, parameterTypes);
this._rawConstructor = TypeUtil.getPrototype(declaringClazz.getType())[CONSTRUCTOR_NAME]; // this._rawConstructor = TypeUtil.getPrototype(declaringClazz.getType())[CONSTRUCTOR_NAME];
} }
public newInstance(...args: any[]): any { public newInstance(...args: any[]): any {