Compare commits

...

42 Commits

Author SHA1 Message Date
f0bdfa9a65 1.2.45 2023-08-26 13:32:29 +02:00
a88cf067a1 fix(core): update 2023-08-26 13:32:28 +02:00
c5cd30e20e 1.2.44 2023-07-13 02:53:32 +02:00
02eb0c5435 fix(core): update 2023-07-13 02:53:31 +02:00
6ab3ed21e0 1.2.43 2023-07-13 01:33:17 +02:00
2f5374be50 fix(core): update 2023-07-13 01:33:17 +02:00
1577265f6b 1.2.42 2023-06-03 16:44:04 +02:00
3b9532bb70 fix(core): update 2023-06-03 16:44:04 +02:00
bcb1ccc6e7 1.2.41 2023-06-03 16:10:38 +02:00
1dde4c8277 fix(core): update 2023-06-03 16:10:37 +02:00
3a6fc44fbb 1.2.40 2023-06-03 16:09:01 +02:00
a0d523513b fix(core): update 2023-06-03 16:09:01 +02:00
0715f88189 1.2.39 2022-10-20 14:15:04 +02:00
4a50ae3b00 fix(core): update 2022-10-20 14:15:04 +02:00
2b7c3b78f6 1.2.38 2022-10-12 17:21:04 +02:00
142667ac87 fix(core): update 2022-10-12 17:21:03 +02:00
9e55126adf 1.2.37 2022-06-14 21:42:07 +02:00
5271f0153e fix(core): update 2022-06-14 21:42:07 +02:00
ba0aaf2793 1.2.36 2022-06-14 21:33:04 +02:00
1f46e387e7 fix(core): update 2022-06-14 21:33:03 +02:00
03625bfca4 1.2.35 2022-06-02 00:23:45 +02:00
cc92e3e9ca fix(core): update 2022-06-02 00:23:45 +02:00
c1e66d498a 1.2.34 2022-05-25 10:55:36 +02:00
bfbb802e88 fix(core): update 2022-05-25 10:55:35 +02:00
655fd8b92e 1.2.33 2022-05-25 10:11:15 +02:00
a240cdfde1 fix(core): update 2022-05-25 10:11:14 +02:00
2af7682cf0 1.2.32 2022-03-24 18:47:16 +01:00
c62619bd27 fix(core): update 2022-03-24 18:47:16 +01:00
ffaf54f1de 1.2.31 2022-03-13 00:02:20 +01:00
2c6b955819 fix(core): update 2022-03-13 00:02:20 +01:00
9bb13e1ede 1.2.30 2022-03-13 00:01:40 +01:00
d9bd5e5340 fix(core): update 2022-03-13 00:01:40 +01:00
b76de3e04d 1.2.29 2022-03-12 22:54:05 +01:00
808726d1df fix(core): update 2022-03-12 22:54:04 +01:00
d011f10b9b 1.2.28 2022-03-12 21:59:15 +01:00
d1baa20aad fix(core): update 2022-03-12 21:59:14 +01:00
71779693d7 1.2.27 2022-03-12 21:52:14 +01:00
1113251aea fix(core): update 2022-03-12 21:52:14 +01:00
e41cd896bb 1.2.26 2022-03-12 19:13:56 +01:00
ba44007fb2 fix(core): update 2022-03-12 19:13:56 +01:00
8d1362f14b 1.2.25 2022-03-12 18:54:20 +01:00
61ceb03962 fix(core): update 2022-03-12 18:54:19 +01:00
16 changed files with 1487 additions and 3173 deletions

View File

@ -12,29 +12,25 @@ stages:
- release - release
- metadata - metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm install --production --ignore-scripts - npmci command pnpm audit --audit-level=high --prod
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags: tags:
- lossless
- docker - docker
allow_failure: true allow_failure: true
@ -42,11 +38,10 @@ auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev - npmci command pnpm audit --audit-level=high --dev
tags: tags:
- lossless
- docker - docker
allow_failure: true allow_failure: true
@ -57,7 +52,6 @@ auditDevDependencies:
testStable: testStable:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -68,10 +62,9 @@ testStable:
testBuild: testBuild:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci command npm run build - npmci npm build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
@ -97,10 +90,9 @@ codequality:
only: only:
- tags - tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- lossless - lossless
- docker - docker
@ -120,11 +112,9 @@ trigger:
pages: pages:
stage: metadata stage: metadata
script: script:
- npmci node install lts - npmci node install stable
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless - lossless
- docker - docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

4
cli.child.ts Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env node
process.env.CLI_CALL = 'true';
import * as cliTool from './ts/index.js';
cliTool.runCli();

View File

@ -1,5 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL = 'true'; process.env.CLI_CALL = 'true';
await import('@gitzone/tsrun');
const cliTool = await import('./ts/index.js'); import * as tsrun from '@gitzone/tsrun';
cliTool.runCli(); tsrun.runPath('./cli.child.js', import.meta.url);

View File

@ -10,7 +10,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "gitzone", "gitscope": "gitzone",
"gitrepo": "tsrun", "gitrepo": "tsrun",
"shortDescription": "run typescript programs efficiently", "description": "run typescript programs efficiently",
"npmPackagename": "@gitzone/tsrun", "npmPackagename": "@gitzone/tsrun",
"license": "MIT" "license": "MIT"
} }

3046
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tsrun", "name": "@git.zone/tsrun",
"version": "1.2.24", "version": "1.2.45",
"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",
@ -13,21 +13,20 @@
"scripts": { "scripts": {
"test": "(tsbuild && node ./cli.js test/test.js sayhello)", "test": "(tsbuild && node ./cli.js test/test.js sayhello)",
"format": "(gitzone format)", "format": "(gitzone format)",
"build": "(tsbuild)" "build": "(tsbuild)",
"buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.43", "@gitzone/tsbuild": "^2.1.66",
"@pushrocks/smartcli": "^3.0.14", "@push.rocks/smartcli": "^4.0.8",
"@types/node": "^17.0.21", "@types/node": "^20.5.6",
"node-fetch": "^3.2.2", "node-fetch": "^3.3.2"
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartfile": "^9.0.6", "@push.rocks/smartfile": "^10.0.30",
"@pushrocks/smartshell": "^2.0.30", "@push.rocks/smartshell": "^3.0.3",
"ts-node": "^10.7.0", "ts-node": "^10.9.1",
"typescript": "4.7.0-dev.20220311" "typescript": "5.1.6"
}, },
"private": false, "private": false,
"files": [ "files": [

1375
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,6 @@ Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](htt
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@gitzone/tsrun)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@gitzone/tsrun)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@gitzone/tsrun)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@gitzone/tsrun)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@gitzone/tsrun)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@gitzone/tsrun)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage
@ -43,7 +42,6 @@ We are always happy for code contributions. If you are not the code contributing
For further information read the linked docs at the top of this readme. For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) ## Legal
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

View File

@ -2,13 +2,13 @@ const textToPost: string = 'Test runs!';
console.log(textToPost); console.log(textToPost);
const run = async () => { const run = async () => {
const smartcli = await import('@pushrocks/smartcli'); const smartcli = await import('@push.rocks/smartcli');
const smartcliInstance = new smartcli.Smartcli(); const smartcliInstance = new smartcli.Smartcli();
console.log(process.argv) console.log(process.argv);
smartcliInstance.addCommand('sayhello').subscribe(async argvArg => { smartcliInstance.addCommand('sayhello').subscribe(async (argvArg) => {
console.log('hello there'); console.log('hello there');
}) });
smartcliInstance.startParse(); smartcliInstance.startParse();
} };
run(); run();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@git.zone/tsrun',
version: '1.2.45',
description: 'run typescript programs efficiently'
}

View File

@ -1,26 +1,42 @@
import * as plugins from './plugins.js'; import * as plugins from './plugins.js';
const __dirname = plugins.path.dirname(plugins.url.fileURLToPath(import.meta.url));
import { dirname } from 'path'; export const runPath = async (pathArg: string, fromFileUrl?: string) => {
import { fileURLToPath } from 'url'; pathArg = fromFileUrl
? plugins.path.join(plugins.path.dirname(plugins.url.fileURLToPath(fromFileUrl)), pathArg)
: pathArg;
await runCli(pathArg);
};
const __dirname = dirname(fileURLToPath(import.meta.url)); export const runCli = async (pathArg?: string) => {
export const runCli = async () => {
// 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 relativePathToTsFile = pathArg ? pathArg : process.argv[2];
const absolutePathToTsFile = plugins.path.isAbsolute(relativePathToTsFile)
? relativePathToTsFile
: plugins.path.join(process.cwd(), relativePathToTsFile);
const tsNodeLoaderPath = plugins.path.join(__dirname, 'loader.js') // we want to have command line arguments available in the child process.
const pathToLoad = plugins.path.join(process.cwd(), pathToTsFile); // when we have a path sepcified through a function there is one argeument less to pay respect to.
process.argv.splice(0, 3); // this ensures transparent arguments for the child process // thus when pathArg is specifed -> we only splice 2
pathArg ? process.argv.splice(0, 2) : process.argv.splice(0, 3); // this ensures transparent arguments for the child process
// lets setup things for execution
const smartshellInstance = new plugins.smartshell.Smartshell({ const smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash' executor: 'bash',
}); });
smartshellInstance.exec(`node --loader ${tsNodeLoaderPath} ${pathToLoad} ${process.argv.length > 0 ? process.argv.reduce((prevArg, currentArg) => { const tsNodeLoaderPath = plugins.path.join(__dirname, 'loader.js');
return prevArg + ' ' + currentArg; // note: -> reduce on emtpy array does not work
}) : ''}`); // thus check needed before reducing the argv array
smartshellInstance.exec(
`node --loader ${tsNodeLoaderPath} ${absolutePathToTsFile} ${
process.argv.length > 0
? process.argv.reduce((prevArg, currentArg) => {
return prevArg + ' ' + currentArg;
})
: ''
}`
);
}; };

View File

@ -4,17 +4,20 @@ import type { CompilerOptions } from 'typescript';
const defaultTsNodeOptions: plugins.tsNode.CreateOptions = { const defaultTsNodeOptions: plugins.tsNode.CreateOptions = {
compilerOptions: { compilerOptions: {
lib: ['dom'], lib: ['dom'],
target: <any>'es2020', // Script Target should be a string -> 2 is for ES2015 target: <any>'es2022', // Script Target should be a string -> 2 is for ES2015
experimentalDecorators: true, experimentalDecorators: true,
useDefineForClassFields: false,
esModuleInterop: true, esModuleInterop: true,
strictNullChecks: false, strictNullChecks: false,
moduleResolution: <any>'node12', moduleResolution: <any>'nodenext',
module: <any>'ESNext', module: <any>'nodenext',
importsNotUsedAsValues: <any>'preserve', verbatimModuleSyntax: true,
} as CompilerOptions, } as CompilerOptions,
esm: true, esm: true,
skipIgnore: true, skipIgnore: true,
transpileOnly: true transpileOnly: true,
}; };
export const { resolve, load, getFormat, transformSource } = plugins.tsNode.createEsmHooks(plugins.tsNode.register(defaultTsNodeOptions)) as any; export const { resolve, load, getFormat, transformSource } = plugins.tsNode.createEsmHooks(
plugins.tsNode.register(defaultTsNodeOptions)
) as any;

View File

@ -1,15 +1,15 @@
// @pushrocks scope // node native
import * as smartshell from '@pushrocks/smartshell'; import * as path from 'path';
import * as url from 'url';
export { export { path, url };
smartshell
} // @pushrocks scope
import * as smartshell from '@push.rocks/smartshell';
export { smartshell };
// third party scope // third party scope
import * as path from 'path';
import * as tsNode from 'ts-node'; import * as tsNode from 'ts-node';
export { export { tsNode };
path,
tsNode
}

View File

@ -1,7 +1,9 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022", "module": "ES2022",
"target": "ES2020", "moduleResolution": "nodenext"
"moduleResolution": "Node12"
} }
} }

View File

@ -1,17 +0,0 @@
{
"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"
}