Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
90a97cb0eb | |||
5bacff743d | |||
f5d4b9ff5b | |||
4e68019aa9 | |||
022a919adf | |||
d52315382e | |||
5210b09c04 | |||
8e2695a06f | |||
7e8fe1bcba | |||
c603ae0c87 | |||
4e70a1ef1a | |||
74df4b7b2b | |||
51808f230a |
@ -117,8 +117,9 @@ pages:
|
|||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-node:npmci
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g npmpage
|
- npmci command npm install -g typedoc
|
||||||
- npmci command npmpage
|
- npmci npm install
|
||||||
|
- npmci command typedoc --out public/ ts/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
@ -128,3 +129,14 @@ pages:
|
|||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
windowsCompatibility:
|
||||||
|
image: stefanscherer/node-windows:10-build-tools
|
||||||
|
stage: metadata
|
||||||
|
script:
|
||||||
|
- npm install & npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- windows
|
||||||
|
allow_failure: true
|
||||||
|
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -1,14 +1,20 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const tsNode = require("./tsnode");
|
const tsNode = require("ts-node");
|
||||||
tsNode.register({
|
const defaultTsNodeOptions = {
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
lib: ['es2016', 'es2017']
|
lib: ['es2016', 'es2017'],
|
||||||
|
target: 'es2015',
|
||||||
|
experimentalDecorators: true
|
||||||
},
|
},
|
||||||
skipIgnore: true,
|
skipIgnore: true,
|
||||||
cacheDirectory: path.join(__dirname, '../tscache')
|
cacheDirectory: path.join(__dirname, '../tscache')
|
||||||
});
|
};
|
||||||
|
if (process.argv.includes('--nocache')) {
|
||||||
|
defaultTsNodeOptions.cache = false;
|
||||||
|
}
|
||||||
|
tsNode.register(defaultTsNodeOptions);
|
||||||
if (process.env.CLI_CALL_TSRUN) {
|
if (process.env.CLI_CALL_TSRUN) {
|
||||||
// contents of argv array
|
// contents of argv array
|
||||||
// process.argv[0] -> node Executable
|
// process.argv[0] -> node Executable
|
||||||
@ -17,4 +23,4 @@ if (process.env.CLI_CALL_TSRUN) {
|
|||||||
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||||
Promise.resolve().then(() => require(pathToLoad));
|
Promise.resolve().then(() => require(pathToLoad));
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZCQUE2QjtBQUM3QixtQ0FBbUM7QUFFbkMsTUFBTSxDQUFDLFFBQVEsQ0FBQztJQUNkLGVBQWUsRUFBRTtRQUNmLEdBQUcsRUFBRSxDQUFFLFFBQVEsRUFBRSxRQUFRLENBQUU7S0FDNUI7SUFDRCxVQUFVLEVBQUUsSUFBSTtJQUNoQixjQUFjLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDO0NBQ25ELENBQUMsQ0FBQztBQUVILElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLEVBQUU7SUFDOUIseUJBQXlCO0lBQ3pCLHFDQUFxQztJQUNyQyxzQ0FBc0M7SUFDdEMsTUFBTSxZQUFZLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQTtJQUVwQyxNQUFNLFVBQVUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsRUFBRSxZQUFZLENBQUMsQ0FBQztJQUMxRCxxQ0FBTyxVQUFVLEdBQUU7Q0FDcEIifQ==
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZCQUE2QjtBQUM3QixrQ0FBa0M7QUFHbEMsTUFBTSxvQkFBb0IsR0FBbUI7SUFDM0MsZUFBZSxFQUFtQjtRQUNoQyxHQUFHLEVBQUUsQ0FBQyxRQUFRLEVBQUUsUUFBUSxDQUFDO1FBQ3pCLE1BQU0sRUFBTyxRQUFRO1FBQ3JCLHNCQUFzQixFQUFFLElBQUk7S0FDN0I7SUFDRCxVQUFVLEVBQUUsSUFBSTtJQUNoQixjQUFjLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDO0NBQ25ELENBQUM7QUFFRixJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBQyxFQUFFO0lBQ3RDLG9CQUFvQixDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7Q0FDcEM7QUFFRCxNQUFNLENBQUMsUUFBUSxDQUFDLG9CQUFvQixDQUFDLENBQUM7QUFFdEMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLGNBQWMsRUFBRTtJQUM5Qix5QkFBeUI7SUFDekIscUNBQXFDO0lBQ3JDLHNDQUFzQztJQUN0QyxNQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRXJDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQzFELHFDQUFPLFVBQVUsR0FBRTtDQUNwQiJ9
|
99
dist/tsnode.d.ts
vendored
99
dist/tsnode.d.ts
vendored
@ -1,99 +0,0 @@
|
|||||||
import { BaseError } from 'make-error';
|
|
||||||
import * as _ts from 'typescript';
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
export declare const INSPECT_CUSTOM: string | symbol;
|
|
||||||
/**
|
|
||||||
* Common TypeScript interfaces between versions.
|
|
||||||
*/
|
|
||||||
export interface TSCommon {
|
|
||||||
version: typeof _ts.version;
|
|
||||||
sys: typeof _ts.sys;
|
|
||||||
ScriptSnapshot: typeof _ts.ScriptSnapshot;
|
|
||||||
displayPartsToString: typeof _ts.displayPartsToString;
|
|
||||||
createLanguageService: typeof _ts.createLanguageService;
|
|
||||||
getDefaultLibFilePath: typeof _ts.getDefaultLibFilePath;
|
|
||||||
getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics;
|
|
||||||
flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText;
|
|
||||||
transpileModule: typeof _ts.transpileModule;
|
|
||||||
ModuleKind: typeof _ts.ModuleKind;
|
|
||||||
ScriptTarget: typeof _ts.ScriptTarget;
|
|
||||||
findConfigFile: typeof _ts.findConfigFile;
|
|
||||||
readConfigFile: typeof _ts.readConfigFile;
|
|
||||||
parseJsonConfigFileContent: typeof _ts.parseJsonConfigFileContent;
|
|
||||||
formatDiagnostics: typeof _ts.formatDiagnostics;
|
|
||||||
formatDiagnosticsWithColorAndContext: typeof _ts.formatDiagnosticsWithColorAndContext;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Export the current version.
|
|
||||||
*/
|
|
||||||
export declare const VERSION: any;
|
|
||||||
/**
|
|
||||||
* Registration options.
|
|
||||||
*/
|
|
||||||
export interface Options {
|
|
||||||
pretty?: boolean | null;
|
|
||||||
typeCheck?: boolean | null;
|
|
||||||
transpileOnly?: boolean | null;
|
|
||||||
files?: boolean | null;
|
|
||||||
cache?: boolean | null;
|
|
||||||
cacheDirectory?: string;
|
|
||||||
compiler?: string;
|
|
||||||
ignore?: string | string[];
|
|
||||||
project?: string;
|
|
||||||
skipIgnore?: boolean | null;
|
|
||||||
skipProject?: boolean | null;
|
|
||||||
compilerOptions?: object;
|
|
||||||
ignoreDiagnostics?: number | string | Array<number | string>;
|
|
||||||
readFile?: (path: string) => string | undefined;
|
|
||||||
fileExists?: (path: string) => boolean;
|
|
||||||
transformers?: _ts.CustomTransformers;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Information retrieved from type info check.
|
|
||||||
*/
|
|
||||||
export interface TypeInfo {
|
|
||||||
name: string;
|
|
||||||
comment: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Default register options.
|
|
||||||
*/
|
|
||||||
export declare const DEFAULTS: Options;
|
|
||||||
/**
|
|
||||||
* Split a string array of values.
|
|
||||||
*/
|
|
||||||
export declare function split(value: string | undefined): string[];
|
|
||||||
/**
|
|
||||||
* Parse a string as JSON.
|
|
||||||
*/
|
|
||||||
export declare function parse(value: string | undefined): object | undefined;
|
|
||||||
/**
|
|
||||||
* Replace backslashes with forward slashes.
|
|
||||||
*/
|
|
||||||
export declare function normalizeSlashes(value: string): string;
|
|
||||||
/**
|
|
||||||
* TypeScript diagnostics error.
|
|
||||||
*/
|
|
||||||
export declare class TSError extends BaseError {
|
|
||||||
diagnosticText: string;
|
|
||||||
diagnosticCodes: number[];
|
|
||||||
name: string;
|
|
||||||
constructor(diagnosticText: string, diagnosticCodes: number[]);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return type for registering `ts-node`.
|
|
||||||
*/
|
|
||||||
export interface Register {
|
|
||||||
cwd: string;
|
|
||||||
extensions: string[];
|
|
||||||
cachedir: string;
|
|
||||||
ts: TSCommon;
|
|
||||||
compile(code: string, fileName: string, lineOffset?: number): string;
|
|
||||||
getTypeInfo(code: string, fileName: string, position: number): TypeInfo;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Register TypeScript compiler.
|
|
||||||
*/
|
|
||||||
export declare function register(opts?: Options): Register;
|
|
439
dist/tsnode.js
vendored
439
dist/tsnode.js
vendored
File diff suppressed because one or more lines are too long
99
package-lock.json
generated
99
package-lock.json
generated
@ -1,21 +1,62 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsrun",
|
"name": "@gitzone/tsrun",
|
||||||
"version": "1.0.18",
|
"version": "1.1.6",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/fs-extra": {
|
"@pushrocks/smartfile": {
|
||||||
"version": "5.0.0",
|
"version": "6.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartfile/-/smartfile-6.0.3.tgz",
|
||||||
"integrity": "sha512-qtxDULQKUenuaDLW003CgC+0T0eiAfH3BrH+vSt87GLzbz5EZ6Ox6mv9rMttvhDOatbb9nYh0E1m7ydoYwUrAg==",
|
"integrity": "sha512-oYnLQzY/R6kVNerbWY4WwnPvdxXldrzMPWcB9j0aAdSDSqGwBEO1/ZFTQuNzN5MmPopoYmJrc06ZmI6dm4OJmw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
|
"@pushrocks/smartrequest": "^1.0.15",
|
||||||
|
"@types/fs-extra": "^5.0.3",
|
||||||
|
"@types/vinyl": "^2.0.2",
|
||||||
|
"fs-extra": "^6.0.1",
|
||||||
|
"glob": "^7.1.2",
|
||||||
|
"js-yaml": "^3.10.0",
|
||||||
|
"smartpath": "^3.2.8",
|
||||||
|
"vinyl-file": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/fs-extra": {
|
||||||
|
"version": "5.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz",
|
||||||
|
"integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fs-extra": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.2",
|
||||||
|
"jsonfile": "^4.0.0",
|
||||||
|
"universalify": "^0.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@pushrocks/smartpromise": {
|
||||||
|
"version": "2.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartpromise/-/smartpromise-2.0.5.tgz",
|
||||||
|
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
||||||
|
},
|
||||||
|
"@pushrocks/smartrequest": {
|
||||||
|
"version": "1.0.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartrequest/-/smartrequest-1.0.15.tgz",
|
||||||
|
"integrity": "sha512-nM+ctwMOs3gPJvw3cGouBimKQxCM93bnmv2+Jk9cbT29/UVVI/UjIdAU3OnUYFpzq496/QUAQD0kNsmYNkqmhQ==",
|
||||||
|
"requires": {
|
||||||
|
"smartq": "^1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.3.0",
|
"version": "10.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.1.tgz",
|
||||||
"integrity": "sha512-hWzNviaVFIr1TqcRA8ou49JaSHp+Rfabmnqg2kNvusKqLhPU0rIsGPUj5WJJ7ld4Bb7qdgLmIhLfCD1qS08IVA=="
|
"integrity": "sha512-AFLl1IALIuyt6oK4AYZsgWVJ/5rnyzQWud7IebaZWWV3YmgtPZkQmYio9R5Ze/2pdd7XfqF5bP+hWS11mAKoOQ=="
|
||||||
},
|
},
|
||||||
"@types/vinyl": {
|
"@types/vinyl": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
@ -146,16 +187,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
|
||||||
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
|
"integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
|
||||||
},
|
},
|
||||||
"fs-extra": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==",
|
|
||||||
"requires": {
|
|
||||||
"graceful-fs": "^4.1.2",
|
|
||||||
"jsonfile": "^4.0.0",
|
|
||||||
"universalify": "^0.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fs.realpath": {
|
"fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
@ -356,33 +387,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
|
||||||
"integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs="
|
"integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs="
|
||||||
},
|
},
|
||||||
"require-reload": {
|
|
||||||
"version": "0.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/require-reload/-/require-reload-0.2.2.tgz",
|
|
||||||
"integrity": "sha1-KadZGEbK+RtuijzamRaD+V+NfUI="
|
|
||||||
},
|
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
},
|
},
|
||||||
"smartfile": {
|
|
||||||
"version": "4.2.28",
|
|
||||||
"resolved": "https://registry.npmjs.org/smartfile/-/smartfile-4.2.28.tgz",
|
|
||||||
"integrity": "sha512-zUeAOLYftz8xLfKTs9U1NOuNPTA9jlvTQNr7lDIv84kXnr1AEpDb2Xwy1MdK1w733sBil/RkxtezrkvgRVAnNg==",
|
|
||||||
"requires": {
|
|
||||||
"@types/fs-extra": "5.0.0",
|
|
||||||
"@types/vinyl": "^2.0.2",
|
|
||||||
"fs-extra": "^5.0.0",
|
|
||||||
"glob": "^7.1.2",
|
|
||||||
"js-yaml": "^3.10.0",
|
|
||||||
"require-reload": "0.2.2",
|
|
||||||
"smartpath": "^3.2.8",
|
|
||||||
"smartq": "^1.1.6",
|
|
||||||
"smartrequest": "^1.0.8",
|
|
||||||
"vinyl-file": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"smartpath": {
|
"smartpath": {
|
||||||
"version": "3.2.8",
|
"version": "3.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/smartpath/-/smartpath-3.2.8.tgz",
|
"resolved": "https://registry.npmjs.org/smartpath/-/smartpath-3.2.8.tgz",
|
||||||
@ -400,14 +409,6 @@
|
|||||||
"util.promisify": "^1.0.0"
|
"util.promisify": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"smartrequest": {
|
|
||||||
"version": "1.0.13",
|
|
||||||
"resolved": "https://registry.npmjs.org/smartrequest/-/smartrequest-1.0.13.tgz",
|
|
||||||
"integrity": "sha512-OHrvzaxaA8Z8bJr33yxnyJF35nrWyaumsajqXm2Zkv0/2hfWO1NQAj02VVV51rLQfmtU0Hex7Nk19SoC8nOmYg==",
|
|
||||||
"requires": {
|
|
||||||
"smartq": "^1.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"source-map": {
|
"source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsrun",
|
"name": "@gitzone/tsrun",
|
||||||
"version": "1.0.18",
|
"version": "1.1.6",
|
||||||
"description": "run typescript programs efficiently",
|
"description": "run typescript programs efficiently",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -16,10 +16,10 @@
|
|||||||
"postinstall": "(node ./cli.js scripts/postinstall.ts)"
|
"postinstall": "(node ./cli.js scripts/postinstall.ts)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^10.3.0"
|
"@types/node": "^10.5.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"smartfile": "^4.2.28",
|
"@pushrocks/smartfile": "^6.0.3",
|
||||||
"ts-node": "^7.0.0",
|
"ts-node": "^7.0.0",
|
||||||
"typescript": "^2.9.1"
|
"typescript": "^2.9.1"
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// This file takes care of some postinstall actions like clearing the TypeScript cache.
|
// This file takes care of some postinstall actions like clearing the TypeScript cache.
|
||||||
import * as smartfile from 'smartfile';
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
const run = async () => {
|
const run = async () => {
|
||||||
|
21
ts/index.ts
21
ts/index.ts
@ -1,20 +1,29 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as tsNode from 'ts-node';
|
import * as tsNode from 'ts-node';
|
||||||
|
import { CompilerOptions } from 'typescript';
|
||||||
|
|
||||||
tsNode.register({
|
const defaultTsNodeOptions: tsNode.Options = {
|
||||||
compilerOptions: {
|
compilerOptions: <CompilerOptions>{
|
||||||
lib: [ 'es2016', 'es2017' ]
|
lib: ['es2016', 'es2017'],
|
||||||
|
target: <any>'es2015', // Script Target should be a string -> 2 is for ES2015
|
||||||
|
experimentalDecorators: true
|
||||||
},
|
},
|
||||||
skipIgnore: true,
|
skipIgnore: true,
|
||||||
cacheDirectory: path.join(__dirname, '../tscache')
|
cacheDirectory: path.join(__dirname, '../tscache')
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (process.argv.includes('--nocache')) {
|
||||||
|
defaultTsNodeOptions.cache = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
tsNode.register(defaultTsNodeOptions);
|
||||||
|
|
||||||
if (process.env.CLI_CALL_TSRUN) {
|
if (process.env.CLI_CALL_TSRUN) {
|
||||||
// contents of argv array
|
// contents of argv array
|
||||||
// process.argv[0] -> node Executable
|
// process.argv[0] -> node Executable
|
||||||
// process.argv[1] -> tsrun executable
|
// process.argv[1] -> tsrun executable
|
||||||
const pathToTsFile = process.argv[2]
|
const pathToTsFile = process.argv[2];
|
||||||
|
|
||||||
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||||
import(pathToLoad);
|
import(pathToLoad);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user