diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a95dfb6..8ebc8b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,13 +24,14 @@ mirror: - docker - notpriv -snyk: - image: registry.gitlab.com/hosttoday/ht-docker-node:snyk +audit: + image: registry.gitlab.com/hosttoday/ht-docker-node:npmci stage: security script: - npmci npm prepare - npmci command npm install --ignore-scripts - - npmci command snyk test + - npmci command npm config set registry https://registry.npmjs.org + - npmci command npm audit --audit-level=high tags: - lossless - docker diff --git a/cli.js b/cli.js index c33c571..a89c9c5 100644 --- a/cli.js +++ b/cli.js @@ -1,3 +1,4 @@ #!/usr/bin/env node -process.env.CLI_CALL_TSBUILD = 'true' -var index = require("./dist_ts/index.js"); +process.env.CLI_CALL = 'true'; +const cliTool = require('./dist_ts/index'); +cliTool.runCli(); diff --git a/cli.ts.js b/cli.ts.js index d23ac69..f700436 100644 --- a/cli.ts.js +++ b/cli.ts.js @@ -1,4 +1,5 @@ #!/usr/bin/env node -process.env.CLI_CALL_TSBUILD = 'true'; +process.env.CLI_CALL = 'true'; require('@gitzone/tsrun'); -require('./ts/index'); +const cliTool = require('./ts/index'); +cliTool.runCli(); diff --git a/package.json b/package.json index 062f53a..92b81df 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": false, "description": "TypeScript nightly to easily make use of latest features", "main": "dist_ts/index.js", - "typings": "dist/index.d.ts", + "typings": "dist_ts/index.d.ts", "bin": { "tsbuild": "cli.js" }, @@ -45,8 +45,7 @@ "ts/**/*", "ts_web/**/*", "dist/**/*", - "dist_bundle/**/*", - "dist_web/**/*", + "dist_*/**/*", "dist_ts/**/*", "dist_ts_web/**/*", "assets/**/*", @@ -54,4 +53,4 @@ "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index d5b2c70..b786701 100644 --- a/readme.md +++ b/readme.md @@ -67,7 +67,6 @@ tsn.compileGlobStringObject( [![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks) - ## 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). :) diff --git a/test/assets/output/tocompile.d.ts b/test/assets/output/tocompile.d.ts index 4a26d2d..82c0231 100644 --- a/test/assets/output/tocompile.d.ts +++ b/test/assets/output/tocompile.d.ts @@ -1,5 +1,5 @@ declare class test2 { - test: string[]; - constructor(); + test: string[]; + constructor(); } declare const run: () => Promise; diff --git a/ts/index.ts b/ts/index.ts index 77e0ad4..599ab25 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,3 +1,2 @@ export * from './tsbuild.exports'; - -import './tsbuild.cli'; +export * from './tsbuild.cli'; \ No newline at end of file diff --git a/ts/tsbuild.cli.ts b/ts/tsbuild.cli.ts index 36b6efb..d98be4c 100644 --- a/ts/tsbuild.cli.ts +++ b/ts/tsbuild.cli.ts @@ -1,46 +1,46 @@ import * as plugins from './tsbuild.plugins'; import * as tsbuild from './tsbuild.exports'; -const tsbuildCli = new plugins.smartcli.Smartcli(); +export const runCli = async () => { + const tsbuildCli = new plugins.smartcli.Smartcli(); -/** - * the standard task compiles anything in ts/ directory to dist directory - */ -tsbuildCli.standardTask().subscribe(async argvArg => { - if (process.env.CLI_CALL_TSBUILD === 'true') { + /** + * the standard task compiles anything in ts/ directory to dist directory + */ + tsbuildCli.standardTask().subscribe(async (argvArg) => { tsbuild.compileGlobStringObject( { - './ts/**/*.ts': './dist_ts' + './ts/**/*.ts': './dist_ts', }, {}, process.cwd(), argvArg ); - } -}); + }); -/** - * the custom command compiles any customDir to dist_customDir - */ -tsbuildCli.addCommand('custom').subscribe(async argvArg => { - const listedDirectories = argvArg._; - listedDirectories.shift(); - const compilationCommandObject: { [key: string]: string } = {}; - for (const directory of listedDirectories) { - compilationCommandObject[`./${directory}/**/*.ts`] = `./dist_${directory}`; - } - await tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg); -}); + /** + * the custom command compiles any customDir to dist_customDir + */ + tsbuildCli.addCommand('custom').subscribe(async (argvArg) => { + const listedDirectories = argvArg._; + listedDirectories.shift(); + const compilationCommandObject: { [key: string]: string } = {}; + for (const directory of listedDirectories) { + compilationCommandObject[`./${directory}/**/*.ts`] = `./dist_${directory}`; + } + await tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg); + }); -tsbuildCli.addCommand('element').subscribe(async argvArg => { - await tsbuild.compileGlobStringObject( - { - './ts_web/**/*.ts': 'dist_ts_web' - }, - {}, - process.cwd(), - { web: true } - ); -}); + tsbuildCli.addCommand('element').subscribe(async (argvArg) => { + await tsbuild.compileGlobStringObject( + { + './ts_web/**/*.ts': 'dist_ts_web', + }, + {}, + process.cwd(), + { web: true } + ); + }); -tsbuildCli.startParse(); + tsbuildCli.startParse(); +};