Compare commits
82 Commits
Author | SHA1 | Date | |
---|---|---|---|
2bba5f75e6 | |||
74bb4a9837 | |||
3286776b48 | |||
bec80e6862 | |||
c2e406964d | |||
c3e3b2d050 | |||
3a68f74c4e | |||
8f4292f402 | |||
61a82f0d03 | |||
2c8f262c0a | |||
bd5ec7ca76 | |||
857882807f | |||
6bfc8a1961 | |||
15f4502083 | |||
5efd905068 | |||
ae01679474 | |||
f0bdfa9a65 | |||
a88cf067a1 | |||
c5cd30e20e | |||
02eb0c5435 | |||
6ab3ed21e0 | |||
2f5374be50 | |||
1577265f6b | |||
3b9532bb70 | |||
bcb1ccc6e7 | |||
1dde4c8277 | |||
3a6fc44fbb | |||
a0d523513b | |||
0715f88189 | |||
4a50ae3b00 | |||
2b7c3b78f6 | |||
142667ac87 | |||
9e55126adf | |||
5271f0153e | |||
ba0aaf2793 | |||
1f46e387e7 | |||
03625bfca4 | |||
cc92e3e9ca | |||
c1e66d498a | |||
bfbb802e88 | |||
655fd8b92e | |||
a240cdfde1 | |||
2af7682cf0 | |||
c62619bd27 | |||
ffaf54f1de | |||
2c6b955819 | |||
9bb13e1ede | |||
d9bd5e5340 | |||
b76de3e04d | |||
808726d1df | |||
d011f10b9b | |||
d1baa20aad | |||
71779693d7 | |||
1113251aea | |||
e41cd896bb | |||
ba44007fb2 | |||
8d1362f14b | |||
61ceb03962 | |||
ab3ec90245 | |||
b51cda08c4 | |||
b8332e1de4 | |||
da9a73bc79 | |||
26bf39abae | |||
b66b2083ab | |||
e40c0151bc | |||
fe97fcd193 | |||
5174d9ccc6 | |||
e89c3eda66 | |||
6d4c9f390a | |||
3fc3421857 | |||
e1803dabfa | |||
282d8b2b93 | |||
76dd9707fe | |||
269e54c717 | |||
dd33a359c3 | |||
0caaac2a67 | |||
14a043be1e | |||
de44be741d | |||
d15500d5a0 | |||
7e99fd703f | |||
fa5462c0bc | |||
f8736d3556 |
66
.gitea/workflows/default_nottags.yaml
Normal file
66
.gitea/workflows/default_nottags.yaml
Normal file
@ -0,0 +1,66 @@
|
||||
name: Default (not tags)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags-ignore:
|
||||
- '**'
|
||||
|
||||
env:
|
||||
IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
|
||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
||||
|
||||
jobs:
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install pnpm and npmci
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
|
||||
- name: Run npm prepare
|
||||
run: npmci npm prepare
|
||||
|
||||
- name: Audit production dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --prod
|
||||
continue-on-error: true
|
||||
|
||||
- name: Audit development dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --dev
|
||||
continue-on-error: true
|
||||
|
||||
test:
|
||||
if: ${{ always() }}
|
||||
needs: security
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Test stable
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm test
|
||||
|
||||
- name: Test build
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm build
|
124
.gitea/workflows/default_tags.yaml
Normal file
124
.gitea/workflows/default_tags.yaml
Normal file
@ -0,0 +1,124 @@
|
||||
name: Default (tags)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci
|
||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
|
||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
||||
|
||||
jobs:
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Audit production dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --prod
|
||||
continue-on-error: true
|
||||
|
||||
- name: Audit development dependencies
|
||||
run: |
|
||||
npmci command npm config set registry https://registry.npmjs.org
|
||||
npmci command pnpm audit --audit-level=high --dev
|
||||
continue-on-error: true
|
||||
|
||||
test:
|
||||
if: ${{ always() }}
|
||||
needs: security
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Test stable
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm test
|
||||
|
||||
- name: Test build
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
npmci npm build
|
||||
|
||||
release:
|
||||
needs: test
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Release
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm publish
|
||||
|
||||
metadata:
|
||||
needs: test
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ env.IMAGE }}
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare
|
||||
run: |
|
||||
pnpm install -g pnpm
|
||||
pnpm install -g @ship.zone/npmci
|
||||
npmci npm prepare
|
||||
|
||||
- name: Code quality
|
||||
run: |
|
||||
npmci command npm install -g typescript
|
||||
npmci npm install
|
||||
|
||||
- name: Trigger
|
||||
run: npmci trigger
|
||||
|
||||
- name: Build docs and upload artifacts
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
pnpm install -g @git.zone/tsdoc
|
||||
npmci command tsdoc
|
||||
continue-on-error: true
|
127
.gitlab-ci.yml
127
.gitlab-ci.yml
@ -1,127 +0,0 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
audit:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
4
.snyk
4
.snyk
@ -1,4 +0,0 @@
|
||||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||
version: v1.13.4
|
||||
ignore: {}
|
||||
patch: {}
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,28 +2,10 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${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"
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -15,7 +15,7 @@
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm"]
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Lossless GmbH (hello@lossless.com)
|
||||
Copyright (c) 2018 Task Venture Capital GmbH (hello@task.vc)
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
138
changelog.md
Normal file
138
changelog.md
Normal file
@ -0,0 +1,138 @@
|
||||
# Changelog
|
||||
|
||||
## 2024-10-27 - 1.3.3 - fix(core)
|
||||
removed unused import statement in ts/plugins.ts
|
||||
|
||||
- Cleanup: Removed an unused import statement for tsImport from tsx/esm/api
|
||||
|
||||
## 2024-10-27 - 1.3.2 - fix(core)
|
||||
Replace ts-node with tsx for module handling
|
||||
|
||||
- Removed ts-node and its loader, using tsx for module imports
|
||||
- Simplified import logic by replacing tsx register API call
|
||||
- Updated dependencies in package.json by removing ts-node and typescript
|
||||
|
||||
## 2024-10-27 - 1.3.1 - fix(core)
|
||||
Add console.log to show ts-node options in use
|
||||
|
||||
- Added a console log statement in the ts/loader.ts to display the default ts-node options being used.
|
||||
|
||||
## 2024-10-27 - 1.3.0 - feat(ci)
|
||||
Add Gitea workflows for build and release.
|
||||
|
||||
- Added .gitea/workflows/default_nottags.yaml for non-tag events.
|
||||
- Added .gitea/workflows/default_tags.yaml for tag-based events.
|
||||
- Updated build scripts in package.json to use pnpm.
|
||||
- Refactored imports and exports in TypeScript source for better modularity.
|
||||
|
||||
## 2024-06-24 - 1.2.49 - fix(core)
|
||||
Minor maintenance updates with version bump
|
||||
|
||||
|
||||
## 2024-06-24 - 1.2.48 - fix(dependencies)
|
||||
Update TypeScript dependency version
|
||||
|
||||
- Updated TypeScript from version 5.4.5 to 5.5.2 to include latest features and fixes.
|
||||
|
||||
## 2024-06-24 - 1.2.47 - fix(core)
|
||||
Remove GitLab CI configuration and update dependencies
|
||||
|
||||
- Removed the .gitlab-ci.yml file.
|
||||
- Updated @git.zone/tsbuild from ^2.1.69 to ^2.1.80.
|
||||
- Updated @push.rocks/smartcli from ^4.0.8 to ^4.0.11.
|
||||
- Updated @types/node from ^20.5.6 to ^20.14.8.
|
||||
- Updated @push.rocks/smartfile from ^10.0.30 to ^11.0.21.
|
||||
- Updated @push.rocks/smartshell from ^3.0.3 to ^3.0.5.
|
||||
- Updated ts-node from ^10.9.1 to ^10.9.2.
|
||||
- Updated typescript from 5.1.6 to 5.4.5.
|
||||
|
||||
## 2023-08-26 - 1.2.44 to 1.2.46 - Core Updates and Fixes
|
||||
Several internal updates and fixes to the core functionality.
|
||||
|
||||
- Continuous core updates for improved performance and bug fixes
|
||||
|
||||
## 2023-07-13 - 1.2.42 to 1.2.44 - Core Updates and Fixes
|
||||
Addressing minor bugs and improving core operations.
|
||||
|
||||
- Several bug fixes to enhance stability
|
||||
|
||||
## 2023-06-03 - 1.2.39 to 1.2.42 - Core and Stability Improvements
|
||||
Focus on refining core processes and fixing issues.
|
||||
|
||||
- Significant fixes for better core performance
|
||||
|
||||
## 2022-10-12 - 1.2.37 to 1.2.39 - Core Updates
|
||||
Series of bug fixes to maintain core functionality.
|
||||
|
||||
- Addressed minor bugs in core areas
|
||||
|
||||
## 2022-06-02 - 1.2.34 to 1.2.37 - Core Maintenance
|
||||
Routine updates to address and fix core issues.
|
||||
|
||||
- Bug fixes for better core stability
|
||||
|
||||
## 2022-03-11 to 2022-03-13 - 1.2.18 to 1.2.33 - Core Enhancements
|
||||
Multiple updates focusing on resolving core issues and maintaining performance.
|
||||
|
||||
- Continuous improvements and fixes in the core functions
|
||||
|
||||
## 2021-10-06 - 1.2.18 to 1.2.19 - Core Updates
|
||||
Minor fixes to keep up with core performance.
|
||||
|
||||
- Addressed core issues for improved functionality
|
||||
|
||||
## 2021-06-23 to 2021-06-24 - 1.2.12 to 1.2.17 - Core Improvements
|
||||
Series of updates addressing core functionality.
|
||||
|
||||
- Enhanced core features and fixed known bugs
|
||||
|
||||
## 2020-06-01 - 1.2.8 to 1.2.11 - Core Stability
|
||||
Fixes focusing on ensuring core stability.
|
||||
|
||||
- Stability improvements in core components
|
||||
|
||||
## 2019-07-17 - 1.2.6 to 1.2.7 - Core Updates
|
||||
Minor fixes targeting the core framework.
|
||||
|
||||
- Adjusted core components to enhance performance
|
||||
|
||||
## 2019-04-08 to 2019-07-17 - 1.2.2 to 1.2.6 - ES2017 Compatibility and Core Fixes
|
||||
Updated core to support ES2017 and addressed various core issues.
|
||||
|
||||
- Updated environment compatibility
|
||||
- Fixed several core issues
|
||||
|
||||
## 2018-12-06 - 1.1.13 to 1.1.17 - Core Fixes
|
||||
Routine updates addressing core bugs and issues.
|
||||
|
||||
- Multiple fixes to core functionality
|
||||
|
||||
## 2018-08-08 - 1.1.11 to 1.1.12 - Dependency Updates
|
||||
Updated dependencies critical for core performance.
|
||||
|
||||
- Enhanced dependencies for better performance
|
||||
|
||||
## 2018-07-13 - 1.1.4 to 1.1.10 - Various Updates
|
||||
Multiple updates focused on documentation, dependencies, and core functions.
|
||||
|
||||
- Fixed documentation
|
||||
- Updated core
|
||||
- Removed obsolete dependencies
|
||||
|
||||
## 2018-06-30 to 2018-07-03 - 1.0.8 to 1.1.3 - Feature and Core Fixes
|
||||
Introduced new features and addressed core issues.
|
||||
|
||||
- Enabled new CLI options
|
||||
- Resolved core issues for better functionality
|
||||
|
||||
## 2018-06-25 - 1.0.4 to 1.0.7 - Core and Security Improvements
|
||||
Made core improvements and updated security features.
|
||||
|
||||
- Added security files
|
||||
- Fixed core argument parsing issues
|
||||
|
||||
## 2018-06-04 - 1.0.1 to 1.0.3 - Initial Fixes and Improvements
|
||||
Initial setup and fixes to existing issues.
|
||||
|
||||
- Moved dependencies to dev
|
||||
- Fixed package details
|
4
cli.child.ts
Normal file
4
cli.child.ts
Normal file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
import * as cliTool from './ts/index.js';
|
||||
cliTool.runCli();
|
2
cli.js
2
cli.js
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
const cliTool = require('./dist_ts/index');
|
||||
const cliTool = await import('./dist_ts/index.js');
|
||||
cliTool.runCli();
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
require('@gitzone/tsrun');
|
||||
const cliTool = require('./ts/index');
|
||||
cliTool.runCli();
|
||||
|
||||
import * as tsrun from '@gitzone/tsrun';
|
||||
tsrun.runPath('./cli.child.js', import.meta.url);
|
||||
|
@ -1 +0,0 @@
|
||||
.gitignore: ../gitignore/
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
31
dist/index.js
vendored
31
dist/index.js
vendored
@ -1,31 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const tsNode = require("ts-node");
|
||||
const defaultTsNodeOptions = {
|
||||
compilerOptions: {
|
||||
lib: ['es2017'],
|
||||
target: 'es2017',
|
||||
experimentalDecorators: true,
|
||||
esModuleInterop: true
|
||||
},
|
||||
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')) {
|
||||
// currently caching is not used
|
||||
}
|
||||
tsNode.register(defaultTsNodeOptions);
|
||||
if (process.env.CLI_CALL_TSRUN) {
|
||||
// contents of argv array
|
||||
// process.argv[0] -> node Executable
|
||||
// process.argv[1] -> tsrun executable
|
||||
const pathToTsFile = process.argv[2];
|
||||
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||
Promise.resolve().then(() => require(pathToLoad));
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZCQUE2QjtBQUM3QixrQ0FBa0M7QUFHbEMsTUFBTSxvQkFBb0IsR0FBbUI7SUFDM0MsZUFBZSxFQUFFO1FBQ2YsR0FBRyxFQUFFLENBQUMsUUFBUSxDQUFDO1FBQ2YsTUFBTSxFQUFPLFFBQVE7UUFDckIsc0JBQXNCLEVBQUUsSUFBSTtRQUM1QixlQUFlLEVBQUUsSUFBSTtLQUNIO0lBQ3BCLFVBQVUsRUFBRSxJQUFJO0NBQ2pCLENBQUM7QUFFRixJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxFQUFFO0lBQ2xDLE1BQU0sdUJBQXVCLEdBQUcsb0JBQW9CLENBQUMsZUFBa0MsQ0FBQztJQUN4RixvQkFBb0IsQ0FBQyxlQUFlLHFCQUMvQix1QkFBdUIsSUFDMUIsR0FBRyxFQUFFLENBQUMsUUFBUSxFQUFFLFFBQVEsRUFBRSxLQUFLLENBQUMsRUFDaEMsTUFBTSxFQUFPLFFBQVEsQ0FBQyxzREFBc0Q7T0FDN0UsQ0FBQztDQUNIO0FBRUQsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxXQUFXLENBQUMsRUFBRTtJQUN0QyxnQ0FBZ0M7Q0FDakM7QUFFRCxNQUFNLENBQUMsUUFBUSxDQUFDLG9CQUFvQixDQUFDLENBQUM7QUFFdEMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLGNBQWMsRUFBRTtJQUM5Qix5QkFBeUI7SUFDekIscUNBQXFDO0lBQ3JDLHNDQUFzQztJQUN0QyxNQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRXJDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQzFELHFDQUFPLFVBQVUsR0FBRTtDQUNwQiJ9
|
1
dist_ts/index.d.ts
vendored
1
dist_ts/index.d.ts
vendored
@ -1 +0,0 @@
|
||||
export declare const runCli: () => Promise<void>;
|
@ -1,51 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.runCli = void 0;
|
||||
const path = __importStar(require("path"));
|
||||
const tsNode = __importStar(require("ts-node"));
|
||||
const defaultTsNodeOptions = {
|
||||
compilerOptions: {
|
||||
lib: ['es2017'],
|
||||
target: 'es2017',
|
||||
experimentalDecorators: true,
|
||||
esModuleInterop: true
|
||||
},
|
||||
skipIgnore: true
|
||||
};
|
||||
if (process.argv.includes('--web')) {
|
||||
const previousCompilerOptions = defaultTsNodeOptions.compilerOptions;
|
||||
defaultTsNodeOptions.compilerOptions = Object.assign(Object.assign({}, previousCompilerOptions), { lib: ['es2016', 'es2017', 'dom'], target: 'es2017' // Script Target should be a string -> 2 is for ES2015
|
||||
});
|
||||
}
|
||||
if (process.argv.includes('--nocache')) {
|
||||
// currently caching is not used
|
||||
}
|
||||
tsNode.register(defaultTsNodeOptions);
|
||||
exports.runCli = async () => {
|
||||
// contents of argv array
|
||||
// process.argv[0] -> node Executable
|
||||
// process.argv[1] -> tsrun executable
|
||||
const pathToTsFile = process.argv[2];
|
||||
const pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||
Promise.resolve().then(() => __importStar(require(pathToLoad)));
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkNBQTZCO0FBQzdCLGdEQUFrQztBQUdsQyxNQUFNLG9CQUFvQixHQUF5QjtJQUNqRCxlQUFlLEVBQUU7UUFDZixHQUFHLEVBQUUsQ0FBQyxRQUFRLENBQUM7UUFDZixNQUFNLEVBQU8sUUFBUTtRQUNyQixzQkFBc0IsRUFBRSxJQUFJO1FBQzVCLGVBQWUsRUFBRSxJQUFJO0tBQ0g7SUFDcEIsVUFBVSxFQUFFLElBQUk7Q0FDakIsQ0FBQztBQUVGLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLEVBQUU7SUFDbEMsTUFBTSx1QkFBdUIsR0FBRyxvQkFBb0IsQ0FBQyxlQUFrQyxDQUFDO0lBQ3hGLG9CQUFvQixDQUFDLGVBQWUsbUNBQy9CLHVCQUF1QixLQUMxQixHQUFHLEVBQUUsQ0FBQyxRQUFRLEVBQUUsUUFBUSxFQUFFLEtBQUssQ0FBQyxFQUNoQyxNQUFNLEVBQU8sUUFBUSxDQUFDLHNEQUFzRDtPQUM3RSxDQUFDO0NBQ0g7QUFFRCxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBQyxFQUFFO0lBQ3RDLGdDQUFnQztDQUNqQztBQUVELE1BQU0sQ0FBQyxRQUFRLENBQUMsb0JBQW9CLENBQUMsQ0FBQztBQUV6QixRQUFBLE1BQU0sR0FBRyxLQUFLLElBQUksRUFBRTtJQUMvQix5QkFBeUI7SUFDekIscUNBQXFDO0lBQ3JDLHNDQUFzQztJQUN0QyxNQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRXJDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQzFELGtEQUFPLFVBQVUsSUFBRTtBQUNyQixDQUFDLENBQUEifQ==
|
@ -10,7 +10,7 @@
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "gitzone",
|
||||
"gitrepo": "tsrun",
|
||||
"shortDescription": "run typescript programs efficiently",
|
||||
"description": "run typescript programs efficiently",
|
||||
"npmPackagename": "@gitzone/tsrun",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
1114
package-lock.json
generated
1114
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@ -1,29 +1,31 @@
|
||||
{
|
||||
"name": "@gitzone/tsrun",
|
||||
"version": "1.2.12",
|
||||
"name": "@git.zone/tsrun",
|
||||
"version": "1.3.3",
|
||||
"description": "run typescript programs efficiently",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"tsrun": "./cli.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "(tsbuild && node ./cli.js test/test.ts)",
|
||||
"test": "(pnpm run build && node ./cli.js test/test.js sayhello)",
|
||||
"format": "(gitzone format)",
|
||||
"build": "(tsbuild)"
|
||||
"build": "(tsbuild --web --allowimplicitany)",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.24",
|
||||
"@types/node": "^14.0.6",
|
||||
"tslint": "^6.1.2",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"@git.zone/tsbuild": "^2.1.80",
|
||||
"@push.rocks/smartcli": "^4.0.11",
|
||||
"@types/node": "^20.14.8",
|
||||
"node-fetch": "^3.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile": "^7.0.12",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "^3.9.3"
|
||||
"@push.rocks/smartfile": "^11.0.21",
|
||||
"@push.rocks/smartshell": "^3.0.5",
|
||||
"tsx": "^4.19.2"
|
||||
},
|
||||
"private": false,
|
||||
"files": [
|
||||
@ -37,5 +39,16 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitlab.com/gitzone/tsrun.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/gitzone/tsrun/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/gitzone/tsrun#readme"
|
||||
}
|
||||
|
1221
pnpm-lock.yaml
generated
Normal file
1221
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
0
readme.hints.md
Normal file
0
readme.hints.md
Normal file
42
readme.md
42
readme.md
@ -1,27 +1,28 @@
|
||||
# @gitzone/tsrun
|
||||
|
||||
run typescript programs efficiently
|
||||
|
||||
## 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/)
|
||||
|
||||
- [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
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
Snyk | [](https://lossless.cloud)
|
||||
TypeScript Support | [](https://lossless.cloud)
|
||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
| Status Category | Status Badge |
|
||||
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| GitLab Pipelines | [](https://lossless.cloud) |
|
||||
| GitLab Pipline Test Coverage | [](https://lossless.cloud) |
|
||||
| npm | [](https://lossless.cloud) |
|
||||
| Snyk | [](https://lossless.cloud) |
|
||||
| TypeScript Support | [](https://lossless.cloud) |
|
||||
| node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/) |
|
||||
| Code Style | [](https://lossless.cloud) |
|
||||
| PackagePhobia (total standalone install weight) | [](https://lossless.cloud) |
|
||||
| PackagePhobia (package size on registry) | [](https://lossless.cloud) |
|
||||
| BundlePhobia (total size when bundled) | [](https://lossless.cloud) |
|
||||
|
||||
## Usage
|
||||
|
||||
@ -37,14 +38,13 @@ 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.
|
||||
|
||||
|
||||
## Contribution
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
||||
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)
|
||||
## Legal
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
|
||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
12
test/test.ts
12
test/test.ts
@ -1,2 +1,14 @@
|
||||
const textToPost: string = 'Test runs!';
|
||||
console.log(textToPost);
|
||||
|
||||
const run = async () => {
|
||||
const smartcli = await import('@push.rocks/smartcli');
|
||||
const smartcliInstance = new smartcli.Smartcli();
|
||||
console.log(process.argv);
|
||||
smartcliInstance.addCommand('sayhello').subscribe(async (argvArg) => {
|
||||
console.log('hello there');
|
||||
});
|
||||
smartcliInstance.startParse();
|
||||
};
|
||||
|
||||
run();
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tsrun',
|
||||
version: '1.3.3',
|
||||
description: 'run typescript programs efficiently'
|
||||
}
|
50
ts/index.ts
50
ts/index.ts
@ -1,38 +1,28 @@
|
||||
import * as path from 'path';
|
||||
import * as tsNode from 'ts-node';
|
||||
import { CompilerOptions } from 'typescript';
|
||||
import * as plugins from './plugins.js';
|
||||
const __dirname = plugins.path.dirname(plugins.url.fileURLToPath(import.meta.url));
|
||||
|
||||
const defaultTsNodeOptions: tsNode.CreateOptions = {
|
||||
compilerOptions: {
|
||||
lib: ['es2017'],
|
||||
target: <any>'es2017', // Script Target should be a string -> 2 is for ES2015
|
||||
experimentalDecorators: true,
|
||||
esModuleInterop: true
|
||||
} as CompilerOptions,
|
||||
skipIgnore: true
|
||||
export const runPath = async (pathArg: string, fromFileUrl?: string) => {
|
||||
pathArg = fromFileUrl
|
||||
? plugins.path.join(plugins.path.dirname(plugins.url.fileURLToPath(fromFileUrl)), pathArg)
|
||||
: pathArg;
|
||||
await runCli(pathArg);
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
export const runCli = async () => {
|
||||
export const runCli = async (pathArg?: string) => {
|
||||
// contents of argv array
|
||||
// process.argv[0] -> node 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 pathToLoad = path.join(process.cwd(), pathToTsFile);
|
||||
import(pathToLoad);
|
||||
// we want to have command line arguments available in the child process.
|
||||
// when we have a path sepcified through a function there is one argeument less to pay respect to.
|
||||
// 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
|
||||
|
||||
const tsx = await import('tsx/esm/api');
|
||||
const unregister = tsx.register();
|
||||
await import(absolutePathToTsFile);
|
||||
};
|
||||
|
1
ts/paths.ts
Normal file
1
ts/paths.ts
Normal file
@ -0,0 +1 @@
|
||||
export const cwd = process.cwd();
|
11
ts/plugins.ts
Normal file
11
ts/plugins.ts
Normal file
@ -0,0 +1,11 @@
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
|
||||
export { path, url };
|
||||
|
||||
// @pushrocks scope
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
import * as smartshell from '@push.rocks/smartshell';
|
||||
|
||||
export { smartfile, smartshell };
|
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
17
tslint.json
17
tslint.json
@ -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"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user