Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
6d4c9f390a | |||
3fc3421857 | |||
e1803dabfa | |||
282d8b2b93 | |||
76dd9707fe | |||
269e54c717 | |||
dd33a359c3 | |||
0caaac2a67 | |||
14a043be1e | |||
de44be741d | |||
d15500d5a0 | |||
7e99fd703f |
950
package-lock.json
generated
950
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsrun",
|
"name": "@gitzone/tsrun",
|
||||||
"version": "1.2.13",
|
"version": "1.2.19",
|
||||||
"description": "run typescript programs efficiently",
|
"description": "run typescript programs efficiently",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
@ -15,15 +15,16 @@
|
|||||||
"build": "(tsbuild)"
|
"build": "(tsbuild)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.29",
|
||||||
"@types/node": "^15.12.4",
|
"@types/node": "^17.0.21",
|
||||||
|
"node-fetch": "^3.2.2",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartfile": "^8.0.10",
|
"@pushrocks/smartfile": "^9.0.6",
|
||||||
"ts-node": "^10.0.0",
|
"ts-node": "^10.7.0",
|
||||||
"typescript": "^4.3.4"
|
"typescript": "^4.6.2"
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -1,2 +1,10 @@
|
|||||||
const textToPost: string = 'Test runs!';
|
const textToPost: string = 'Test runs!';
|
||||||
console.log(textToPost);
|
console.log(textToPost);
|
||||||
|
|
||||||
|
const run = async () => {
|
||||||
|
// lets test esm
|
||||||
|
console.warn('remember to enable esm checks once TypeScript 4.5 is released.')
|
||||||
|
// const nodeFetch = await import('node-fetch');
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
24
ts/index.ts
24
ts/index.ts
@ -4,27 +4,18 @@ import { CompilerOptions } from 'typescript';
|
|||||||
|
|
||||||
const defaultTsNodeOptions: tsNode.CreateOptions = {
|
const defaultTsNodeOptions: tsNode.CreateOptions = {
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
lib: ['es2017'],
|
lib: ['dom'],
|
||||||
target: <any>'es2017', // Script Target should be a string -> 2 is for ES2015
|
target: <any>'es2020', // Script Target should be a string -> 2 is for ES2015
|
||||||
experimentalDecorators: true,
|
experimentalDecorators: true,
|
||||||
esModuleInterop: true,
|
esModuleInterop: true,
|
||||||
|
strictNullChecks: false,
|
||||||
|
moduleResolution: <any>'node12',
|
||||||
|
module: <any>'es2020',
|
||||||
|
importsNotUsedAsValues: <any>'preserve',
|
||||||
} as CompilerOptions,
|
} as CompilerOptions,
|
||||||
skipIgnore: true,
|
skipIgnore: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (process.argv.includes('--web')) {
|
|
||||||
const previousCompilerOptions = defaultTsNodeOptions.compilerOptions as CompilerOptions;
|
|
||||||
defaultTsNodeOptions.compilerOptions = {
|
|
||||||
...previousCompilerOptions,
|
|
||||||
lib: ['es2016', 'es2017', 'dom'],
|
|
||||||
target: <any>'es2017', // Script Target should be a string -> 2 is for ES2015
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv.includes('--nocache')) {
|
|
||||||
// currently caching is not used
|
|
||||||
}
|
|
||||||
|
|
||||||
tsNode.register(defaultTsNodeOptions);
|
tsNode.register(defaultTsNodeOptions);
|
||||||
|
|
||||||
export const runCli = async () => {
|
export const runCli = async () => {
|
||||||
@ -34,6 +25,7 @@ export const runCli = async () => {
|
|||||||
const pathToTsFile = process.argv[2];
|
const pathToTsFile = process.argv[2];
|
||||||
|
|
||||||
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||||
process.argv.shift();
|
process.argv.splice(2, 1);
|
||||||
|
// console.log(process.argv);
|
||||||
import(pathToLoad);
|
import(pathToLoad);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user