Compare commits
No commits in common. "master" and "v1.2.47" have entirely different histories.
@ -1,66 +0,0 @@
|
|||||||
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
|
|
@ -1,124 +0,0 @@
|
|||||||
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
|
|
34
changelog.md
34
changelog.md
@ -1,39 +1,5 @@
|
|||||||
# Changelog
|
# 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)
|
## 2024-06-24 - 1.2.47 - fix(core)
|
||||||
Remove GitLab CI configuration and update dependencies
|
Remove GitLab CI configuration and update dependencies
|
||||||
|
|
||||||
|
19
package.json
19
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@git.zone/tsrun",
|
"name": "@git.zone/tsrun",
|
||||||
"version": "1.3.3",
|
"version": "1.2.47",
|
||||||
"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",
|
||||||
@ -11,9 +11,9 @@
|
|||||||
"tsrun": "./cli.js"
|
"tsrun": "./cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(pnpm run build && node ./cli.js test/test.js sayhello)",
|
"test": "(tsbuild && node ./cli.js test/test.js sayhello)",
|
||||||
"format": "(gitzone format)",
|
"format": "(gitzone format)",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "(tsbuild)",
|
||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -25,7 +25,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/smartfile": "^11.0.21",
|
"@push.rocks/smartfile": "^11.0.21",
|
||||||
"@push.rocks/smartshell": "^3.0.5",
|
"@push.rocks/smartshell": "^3.0.5",
|
||||||
"tsx": "^4.19.2"
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "5.4.5"
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
"files": [
|
"files": [
|
||||||
@ -42,13 +43,5 @@
|
|||||||
],
|
],
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 1 chrome versions"
|
"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"
|
|
||||||
}
|
}
|
||||||
|
1668
pnpm-lock.yaml
generated
1668
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
37
readme.md
37
readme.md
@ -1,28 +1,26 @@
|
|||||||
# @gitzone/tsrun
|
# @gitzone/tsrun
|
||||||
|
|
||||||
run typescript programs efficiently
|
run typescript programs efficiently
|
||||||
|
|
||||||
## Availabililty and Links
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsrun)
|
||||||
- [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsrun)
|
* [gitlab.com (source)](https://gitlab.com/gitzone/tsrun)
|
||||||
- [gitlab.com (source)](https://gitlab.com/gitzone/tsrun)
|
* [github.com (source mirror)](https://github.com/gitzone/tsrun)
|
||||||
- [github.com (source mirror)](https://github.com/gitzone/tsrun)
|
* [docs (typedoc)](https://gitzone.gitlab.io/tsrun/)
|
||||||
- [docs (typedoc)](https://gitzone.gitlab.io/tsrun/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
|
||||||
| Status Category | Status Badge |
|
Status Category | Status Badge
|
||||||
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
-- | --
|
||||||
| GitLab Pipelines | [](https://lossless.cloud) |
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
| GitLab Pipline Test Coverage | [](https://lossless.cloud) |
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
| npm | [](https://lossless.cloud) |
|
npm | [](https://lossless.cloud)
|
||||||
| Snyk | [](https://lossless.cloud) |
|
Snyk | [](https://lossless.cloud)
|
||||||
| TypeScript Support | [](https://lossless.cloud) |
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
| node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/) |
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
| Code Style | [](https://lossless.cloud) |
|
Code Style | [](https://lossless.cloud)
|
||||||
| PackagePhobia (total standalone install weight) | [](https://lossless.cloud) |
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
| PackagePhobia (package size on registry) | [](https://lossless.cloud) |
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
| BundlePhobia (total size when bundled) | [](https://lossless.cloud) |
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -45,6 +43,5 @@ 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.
|
||||||
|
|
||||||
## Legal
|
## Legal
|
||||||
|
|
||||||
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
|
> 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)
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsrun',
|
name: '@git.zone/tsrun',
|
||||||
version: '1.3.3',
|
version: '1.2.47',
|
||||||
description: 'run typescript programs efficiently'
|
description: 'run typescript programs efficiently'
|
||||||
}
|
}
|
||||||
|
20
ts/index.ts
20
ts/index.ts
@ -22,7 +22,21 @@ export const runCli = async (pathArg?: string) => {
|
|||||||
// thus when pathArg is specifed -> we only splice 2
|
// 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
|
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');
|
// lets setup things for execution
|
||||||
const unregister = tsx.register();
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
await import(absolutePathToTsFile);
|
executor: 'bash',
|
||||||
|
});
|
||||||
|
|
||||||
|
const tsNodeLoaderPath = plugins.path.join(__dirname, 'loader.js');
|
||||||
|
// 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;
|
||||||
|
})
|
||||||
|
: ''
|
||||||
|
}`
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
23
ts/loader.ts
Normal file
23
ts/loader.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import * as plugins from './plugins.js';
|
||||||
|
import type { CompilerOptions } from 'typescript';
|
||||||
|
|
||||||
|
const defaultTsNodeOptions: plugins.tsNode.CreateOptions = {
|
||||||
|
compilerOptions: {
|
||||||
|
lib: ['dom'],
|
||||||
|
target: <any>'es2022', // Script Target should be a string -> 2 is for ES2015
|
||||||
|
experimentalDecorators: true,
|
||||||
|
useDefineForClassFields: false,
|
||||||
|
esModuleInterop: true,
|
||||||
|
strictNullChecks: false,
|
||||||
|
moduleResolution: <any>'nodenext',
|
||||||
|
module: <any>'nodenext',
|
||||||
|
verbatimModuleSyntax: true,
|
||||||
|
} as CompilerOptions,
|
||||||
|
esm: true,
|
||||||
|
skipIgnore: true,
|
||||||
|
transpileOnly: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const { resolve, load, getFormat, transformSource } = plugins.tsNode.createEsmHooks(
|
||||||
|
plugins.tsNode.register(defaultTsNodeOptions)
|
||||||
|
) as any;
|
@ -1 +0,0 @@
|
|||||||
export const cwd = process.cwd();
|
|
@ -5,7 +5,11 @@ import * as url from 'url';
|
|||||||
export { path, url };
|
export { path, url };
|
||||||
|
|
||||||
// @pushrocks scope
|
// @pushrocks scope
|
||||||
import * as smartfile from '@push.rocks/smartfile';
|
|
||||||
import * as smartshell from '@push.rocks/smartshell';
|
import * as smartshell from '@push.rocks/smartshell';
|
||||||
|
|
||||||
export { smartfile, smartshell };
|
export { smartshell };
|
||||||
|
|
||||||
|
// third party scope
|
||||||
|
import * as tsNode from 'ts-node';
|
||||||
|
|
||||||
|
export { tsNode };
|
||||||
|
@ -3,12 +3,7 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false,
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "NodeNext",
|
"module": "ES2022",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "nodenext"
|
||||||
"esModuleInterop": true,
|
}
|
||||||
"verbatimModuleSyntax": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"dist_*/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user