Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb3b918521 | |||
ba9eaa5091 | |||
0e281ab257 | |||
0e14522287 | |||
4d93e2e728 | |||
ce9a350521 | |||
df9c7204c7 | |||
568472e715 | |||
0ba6863e28 | |||
d5c63cd24c | |||
460babd675 | |||
98cde0edb4 | |||
1d5766435a | |||
92ac844954 | |||
9ae4f9f82b | |||
3df2922085 | |||
3eb29c729e | |||
cadc2cd629 | |||
399ee0b4ca | |||
ac5d8d1614 | |||
6349753cce | |||
3897e15a7e | |||
2582710e8f | |||
4cd06d040d | |||
5eb3ba901a | |||
dd5b101224 | |||
972583a3a7 | |||
ef3c636976 | |||
b1ec59e042 |
@ -26,6 +26,7 @@ mirror:
|
||||
snyk:
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
@ -33,24 +34,39 @@ snyk:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
sast:
|
||||
stage: security
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
||||
variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
allow_failure: true
|
||||
services:
|
||||
- docker:stable-dind
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
||||
--volume "$PWD:/code"
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
||||
artifacts:
|
||||
reports:
|
||||
sast: gl-sast-report.json
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -62,6 +78,7 @@ testLTS:
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -118,6 +135,7 @@ pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g typedoc typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||
tags:
|
||||
@ -130,13 +148,3 @@ pages:
|
||||
paths:
|
||||
- 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
|
||||
|
2
.snyk
2
.snyk
@ -1,4 +1,4 @@
|
||||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||
version: v1.12.0
|
||||
version: v1.13.4
|
||||
ignore: {}
|
||||
patch: {}
|
||||
|
19
dist/index.js
vendored
19
dist/index.js
vendored
@ -4,15 +4,20 @@ const path = require("path");
|
||||
const tsNode = require("ts-node");
|
||||
const defaultTsNodeOptions = {
|
||||
compilerOptions: {
|
||||
lib: ['es2016', 'es2017'],
|
||||
target: 'es2015',
|
||||
experimentalDecorators: true
|
||||
lib: ['es2017'],
|
||||
target: 'es2017',
|
||||
experimentalDecorators: true,
|
||||
esModuleInterop: true
|
||||
},
|
||||
skipIgnore: true,
|
||||
cacheDirectory: path.join(__dirname, '../tscache')
|
||||
skipIgnore: true
|
||||
};
|
||||
if (process.argv.includes('--web')) {
|
||||
const previousCompilerOptions = defaultTsNodeOptions.compilerOptions;
|
||||
defaultTsNodeOptions.compilerOptions = Object.assign({}, previousCompilerOptions, { lib: ['es2016', 'es2017', 'dom'], target: 'es2015' // Script Target should be a string -> 2 is for ES2015
|
||||
});
|
||||
}
|
||||
if (process.argv.includes('--nocache')) {
|
||||
defaultTsNodeOptions.cache = false;
|
||||
// currently caching is not used
|
||||
}
|
||||
tsNode.register(defaultTsNodeOptions);
|
||||
if (process.env.CLI_CALL_TSRUN) {
|
||||
@ -23,4 +28,4 @@ if (process.env.CLI_CALL_TSRUN) {
|
||||
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||
Promise.resolve().then(() => require(pathToLoad));
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZCQUE2QjtBQUM3QixrQ0FBa0M7QUFHbEMsTUFBTSxvQkFBb0IsR0FBbUI7SUFDM0MsZUFBZSxFQUFtQjtRQUNoQyxHQUFHLEVBQUUsQ0FBQyxRQUFRLEVBQUUsUUFBUSxDQUFDO1FBQ3pCLE1BQU0sRUFBTyxRQUFRO1FBQ3JCLHNCQUFzQixFQUFFLElBQUk7S0FDN0I7SUFDRCxVQUFVLEVBQUUsSUFBSTtJQUNoQixjQUFjLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDO0NBQ25ELENBQUM7QUFFRixJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBQyxFQUFFO0l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SUFDMUIsR0FBRyxFQUFFLENBQUMsUUFBUSxFQUFFLFFBQVEsRUFBRSxLQUFLLENBQUMsRUFDaEMsTUFBTSxFQUFPLFFBQVEsQ0FBQyxzREFBc0Q7T0FDN0UsQ0FBQztDQUNIO0FBRUQsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxXQUFXLENBQUMsRUFBRTtJQUN0QyxnQ0FBZ0M7Q0FDakM7QUFFRCxNQUFNLENBQUMsUUFBUSxDQUFDLG9CQUFvQixDQUFDLENBQUM7QUFFdEMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLGNBQWMsRUFBRTtJQUM5Qix5QkFBeUI7SUFDekIscUNBQXFDO0lBQ3JDLHNDQUFzQztJQUN0QyxNQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRXJDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQzFELHFDQUFPLFVBQVUsR0FBRTtDQUNwQiJ9
|
@ -1,11 +1,17 @@
|
||||
{
|
||||
"npmts": {
|
||||
},
|
||||
"npmts": {},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [
|
||||
"@gitzone/npmts",
|
||||
"ts-node"
|
||||
],
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "gitzone",
|
||||
"gitrepo": "tsrun",
|
||||
"shortDescription": "run typescript programs efficiently",
|
||||
"npmPackagename": "@gitzone/tsrun",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
1039
package-lock.json
generated
1039
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsrun",
|
||||
"version": "1.1.9",
|
||||
"version": "1.2.6",
|
||||
"description": "run typescript programs efficiently",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
@ -10,18 +10,20 @@
|
||||
"tsrun": "./cli.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "(npmts --notest && node ./cli.js test/test.ts)",
|
||||
"test": "(tsbuild && node ./cli.js test/test.ts)",
|
||||
"format": "(gitzone format)",
|
||||
"build": "echo \"Not needed for now\"",
|
||||
"postinstall": "(node ./cli.js scripts/postinstall.ts)"
|
||||
"build": "(tsbuild)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^10.5.1"
|
||||
"@types/node": "^11.13.0",
|
||||
"tslint": "^5.15.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile": "^6.0.3",
|
||||
"ts-node": "^7.0.0",
|
||||
"typescript": "^2.9.1"
|
||||
"@gitzone/tsbuild": "^2.1.8",
|
||||
"@pushrocks/smartfile": "^7.0.2",
|
||||
"ts-node": "^8.0.3",
|
||||
"typescript": "^3.4.2"
|
||||
},
|
||||
"private": false
|
||||
}
|
||||
|
41
readme.md
41
readme.md
@ -1,29 +1,38 @@
|
||||
# tsrun
|
||||
# @gitzone/tsrun
|
||||
run typescript programs efficiently
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/@gitzone/tsrun)
|
||||
[](https://GitLab.com/gitzone/tsrun)
|
||||
[](https://github.com/gitzone/tsrun)
|
||||
[](https://gitzone.gitlab.io/tsrun/)
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsrun)
|
||||
* [gitlab.com (source)](https://gitlab.com/gitzone/tsrun)
|
||||
* [github.com (source mirror)](https://github.com/gitzone/tsrun)
|
||||
* [docs (typedoc)](https://gitzone.gitlab.io/tsrun/)
|
||||
|
||||
## Status for master
|
||||
[](https://GitLab.com/gitzone/tsrun/commits/master)
|
||||
[](https://GitLab.com/gitzone/tsrun/commits/master)
|
||||
[](https://gitlab.com/gitzone/tsrun/commits/master)
|
||||
[](https://gitlab.com/gitzone/tsrun/commits/master)
|
||||
[](https://www.npmjs.com/package/@gitzone/tsrun)
|
||||
[](https://www.bithound.io/github/gitzonetools/tsrun/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/gitzonetools/tsrun)
|
||||
[](https://snyk.io/test/npm/@gitzone/tsrun)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
To simply run a TypeScript file on the fly type
|
||||
|
||||
> licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
```typescript
|
||||
tsrun myfiletorun.ts
|
||||
```
|
||||
|
||||
There are options available:
|
||||
|
||||
- `--web` will inject browser types. this is useful when testing code with polyfills on node, but that is meant for the browser later on.
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://git.zone)
|
||||
[](https://maintainedby.lossless.com)
|
||||
|
@ -1,10 +0,0 @@
|
||||
// This file takes care of some postinstall actions like clearing the TypeScript cache.
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as path from 'path';
|
||||
|
||||
const run = async () => {
|
||||
const tsCacheDir = path.join(__dirname, '../tscache');
|
||||
await smartfile.fs.ensureEmptyDir(tsCacheDir);
|
||||
}
|
||||
|
||||
run();
|
25
ts/index.ts
25
ts/index.ts
@ -3,17 +3,26 @@ import * as tsNode from 'ts-node';
|
||||
import { CompilerOptions } from 'typescript';
|
||||
|
||||
const defaultTsNodeOptions: tsNode.Options = {
|
||||
compilerOptions: <CompilerOptions>{
|
||||
lib: ['es2016', 'es2017'],
|
||||
target: <any>'es2015', // Script Target should be a string -> 2 is for ES2015
|
||||
experimentalDecorators: true
|
||||
},
|
||||
skipIgnore: true,
|
||||
cacheDirectory: path.join(__dirname, '../tscache')
|
||||
compilerOptions: {
|
||||
lib: ['es2017'],
|
||||
target: <any>'es2017', // Script Target should be a string -> 2 is for ES2015
|
||||
experimentalDecorators: true,
|
||||
esModuleInterop: true
|
||||
} as CompilerOptions,
|
||||
skipIgnore: true
|
||||
};
|
||||
|
||||
if (process.argv.includes('--web')) {
|
||||
const previousCompilerOptions = defaultTsNodeOptions.compilerOptions as CompilerOptions;
|
||||
defaultTsNodeOptions.compilerOptions = {
|
||||
...previousCompilerOptions,
|
||||
lib: ['es2016', 'es2017', 'dom'],
|
||||
target: <any>'es2015' // Script Target should be a string -> 2 is for ES2015
|
||||
};
|
||||
}
|
||||
|
||||
if (process.argv.includes('--nocache')) {
|
||||
defaultTsNodeOptions.cache = false;
|
||||
// currently caching is not used
|
||||
}
|
||||
|
||||
tsNode.register(defaultTsNodeOptions);
|
||||
|
16
tslint.json
16
tslint.json
@ -1,3 +1,17 @@
|
||||
{
|
||||
"extends": "tslint-config-standard"
|
||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||
"rules": {
|
||||
"semicolon": [true, "always"],
|
||||
"no-console": false,
|
||||
"ordered-imports": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"member-ordering": {
|
||||
"options":{
|
||||
"order": [
|
||||
"static-method"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultSeverity": "warning"
|
||||
}
|
||||
|
Reference in New Issue
Block a user