Compare commits

...

14 Commits

Author SHA1 Message Date
7ee9935a9a 2.1.29 2022-01-19 17:59:08 +01:00
5128d450bc fix(core): update 2022-01-19 17:59:07 +01:00
8708b1442d 2.1.28 2021-10-06 13:33:35 +02:00
0e39dfecba fix(core): update 2021-10-06 13:33:35 +02:00
b4e8accad6 2.1.27 2021-09-08 22:18:27 +02:00
1415d66ffb fix(core): update 2021-09-08 22:18:26 +02:00
38e3eed003 2.1.26 2021-08-17 12:13:52 +02:00
466095ed26 fix(core): update 2021-08-17 12:13:51 +02:00
3d8041fdde 2.1.25 2020-08-10 22:10:20 +00:00
f021525f9e fix(core): update 2020-08-10 22:10:20 +00:00
63fa2e84d4 2.1.24 2020-05-14 09:51:22 +00:00
af66bd8ff1 fix(core): update 2020-05-14 09:51:22 +00:00
53f4e402f5 2.1.23 2020-04-30 09:02:43 +00:00
2f57c26b87 fix(core): update 2020-04-30 09:02:43 +00:00
17 changed files with 2639 additions and 962 deletions

@ -24,13 +24,14 @@ mirror:
- docker - docker
- notpriv - notpriv
snyk: audit:
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - 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: tags:
- lossless - lossless
- docker - docker

5
cli.js

@ -1,3 +1,4 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL_TSBUILD = 'true' process.env.CLI_CALL = 'true';
var index = require("./dist_ts/index.js"); const cliTool = require('./dist_ts/index');
cliTool.runCli();

@ -1,4 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
process.env.CLI_CALL_TSBUILD = 'true'; process.env.CLI_CALL = 'true';
require('@gitzone/tsrun'); require('@gitzone/tsrun');
require('./ts/index'); const cliTool = require('./ts/index');
cliTool.runCli();

3380
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,17 +1,17 @@
{ {
"name": "@gitzone/tsbuild", "name": "@gitzone/tsbuild",
"version": "2.1.22", "version": "2.1.29",
"private": false, "private": false,
"description": "TypeScript nightly to easily make use of latest features", "description": "TypeScript nightly to easily make use of latest features",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist/index.d.ts", "typings": "dist_ts/index.d.ts",
"bin": { "bin": {
"tsbuild": "cli.js" "tsbuild": "./cli.js"
}, },
"scripts": { "scripts": {
"test": "tsrun test/test.ts", "test": "tsrun test/test.ts",
"testCustom": "node cli.ts.js custom ts_web", "testCustom": "node cli.ts.js custom ts_web",
"build": "node cli.ts.js" "build": "node cli.ts.js --web"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -27,26 +27,26 @@
}, },
"homepage": "https://gitlab.com/pushrocks/tsn#README", "homepage": "https://gitlab.com/pushrocks/tsn#README",
"dependencies": { "dependencies": {
"@pushrocks/smartcli": "^3.0.7", "@pushrocks/early": "^3.0.6",
"@pushrocks/smartfile": "^7.0.2", "@pushrocks/smartcli": "^3.0.14",
"@pushrocks/smartlog": "^2.0.19", "@pushrocks/smartfile": "^8.0.10",
"@pushrocks/smartpath": "^4.0.1", "@pushrocks/smartlog": "^2.0.44",
"@pushrocks/smartpromise": "^3.0.2", "@pushrocks/smartpath": "^4.0.3",
"typescript": "^3.5.2" "@pushrocks/smartpromise": "^3.1.6",
"typescript": "^4.4.2"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsrun": "^1.2.8", "@gitzone/tsrun": "^1.2.17",
"@pushrocks/tapbundle": "^3.0.13", "@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^12.7.2", "@types/node": "^16.7.13",
"tslint": "^5.19.0", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
"ts_web/**/*", "ts_web/**/*",
"dist/**/*", "dist/**/*",
"dist_bundle/**/*", "dist_*/**/*",
"dist_web/**/*",
"dist_ts/**/*", "dist_ts/**/*",
"dist_ts_web/**/*", "dist_ts_web/**/*",
"assets/**/*", "assets/**/*",

@ -67,7 +67,6 @@ tsn.compileGlobStringObject(
[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks) [![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks)
## Contribution ## 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). :) 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). :)

@ -1,5 +1 @@
declare class test2 { export {};
test: string[];
constructor();
}
declare const run: () => Promise<string>;

@ -1,5 +1,31 @@
"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 (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
console.log('test'); console.log('test');
console.log('test2'); console.log('test2');
const early = __importStar(require("@pushrocks/early"));
early.start();
early.stop();
const tocompile2_1 = require("./tocompile2");
console.log(tocompile2_1.anExportedString);
class test2 { class test2 {
constructor() { constructor() {
this.test = []; this.test = [];
@ -9,4 +35,4 @@ class test2 {
const run = async () => { const run = async () => {
return 'hi'; return 'hi';
}; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9jb21waWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdG9jb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDcEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNyQixNQUFNLEtBQUs7SUFFVDtRQURBLFNBQUksR0FBYSxFQUFFLENBQUM7UUFFbEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNwQixDQUFDO0NBQ0Y7QUFFRCxNQUFNLEdBQUcsR0FBRyxLQUFLLElBQXFCLEVBQUU7SUFDdEMsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDLENBQUMifQ== //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9jb21waWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdG9jb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDcEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUVyQix3REFBMEM7QUFFMUMsS0FBSyxDQUFDLEtBQUssRUFBRSxDQUFDO0FBQ2QsS0FBSyxDQUFDLElBQUksRUFBRSxDQUFDO0FBRWIsNkNBQThDO0FBQzlDLE9BQU8sQ0FBQyxHQUFHLENBQUMsNkJBQWdCLENBQUMsQ0FBQztBQUU5QixNQUFNLEtBQUs7SUFFVDtRQURBLFNBQUksR0FBYSxFQUFFLENBQUM7UUFFbEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNwQixDQUFDO0NBQ0Y7QUFFRCxNQUFNLEdBQUcsR0FBRyxLQUFLLElBQXFCLEVBQUU7SUFDdEMsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDLENBQUMifQ==

@ -0,0 +1 @@
export declare const anExportedString = "exported string";

@ -1,2 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.anExportedString = void 0;
console.log('hello'); console.log('hello');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9jb21waWxlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RvY29tcGlsZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQyJ9 exports.anExportedString = 'exported string';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9jb21waWxlMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RvY29tcGlsZTIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNSLFFBQUEsZ0JBQWdCLEdBQUcsaUJBQWlCLENBQUMifQ==

@ -1,5 +1,14 @@
console.log('test'); console.log('test');
console.log('test2'); console.log('test2');
import * as early from '@pushrocks/early';
early.start();
early.stop();
import {anExportedString} from './tocompile2';
console.log(anExportedString);
class test2 { class test2 {
test: string[] = []; test: string[] = [];
constructor() { constructor() {

@ -1 +1,2 @@
console.log('hello'); console.log('hello');
export const anExportedString = 'exported string';

@ -1,3 +1,5 @@
import * as early from '@pushrocks/early';
early.start('tsbuild');
export * from './tsbuild.exports'; export * from './tsbuild.exports';
export * from './tsbuild.cli';
import './tsbuild.cli'; early.stop();

@ -17,7 +17,8 @@ export const compilerOptionsDefault: CompilerOptions = {
lib: ['lib.es2017.d.ts'], lib: ['lib.es2017.d.ts'],
noImplicitAny: false, noImplicitAny: false,
esModuleInterop: true, esModuleInterop: true,
target: plugins.typescript.ScriptTarget.ES2017 target: plugins.typescript.ScriptTarget.ES2017,
importsNotUsedAsValues: plugins.typescript.ImportsNotUsedAsValues.Preserve
}; };
export const compilerOptionsWebDefault: CompilerOptions = { export const compilerOptionsWebDefault: CompilerOptions = {
@ -43,7 +44,10 @@ export const mergeCompilerOptions = (
// create merged options // create merged options
const mergedOptions: CompilerOptions = { const mergedOptions: CompilerOptions = {
...defaultOptionsToMerge, ...defaultOptionsToMerge,
...customTsOptions ...customTsOptions,
...argvArg && argvArg.skiplibcheck ? {
skipLibCheck: true
} : {},
}; };
return mergedOptions; return mergedOptions;

@ -1,28 +1,27 @@
import * as plugins from './tsbuild.plugins'; import * as plugins from './tsbuild.plugins';
import * as tsbuild from './tsbuild.exports'; 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 * the standard task compiles anything in ts/ directory to dist directory
*/ */
tsbuildCli.standardTask().subscribe(async argvArg => { tsbuildCli.standardTask().subscribe(async (argvArg) => {
if (process.env.CLI_CALL_TSBUILD === 'true') {
tsbuild.compileGlobStringObject( tsbuild.compileGlobStringObject(
{ {
'./ts/**/*.ts': './dist_ts' './ts/**/*.ts': './dist_ts',
}, },
{}, {},
process.cwd(), process.cwd(),
argvArg argvArg
); );
} });
});
/** /**
* the custom command compiles any customDir to dist_customDir * the custom command compiles any customDir to dist_customDir
*/ */
tsbuildCli.addCommand('custom').subscribe(async argvArg => { tsbuildCli.addCommand('custom').subscribe(async (argvArg) => {
const listedDirectories = argvArg._; const listedDirectories = argvArg._;
listedDirectories.shift(); listedDirectories.shift();
const compilationCommandObject: { [key: string]: string } = {}; const compilationCommandObject: { [key: string]: string } = {};
@ -30,17 +29,18 @@ tsbuildCli.addCommand('custom').subscribe(async argvArg => {
compilationCommandObject[`./${directory}/**/*.ts`] = `./dist_${directory}`; compilationCommandObject[`./${directory}/**/*.ts`] = `./dist_${directory}`;
} }
await tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg); await tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg);
}); });
tsbuildCli.addCommand('element').subscribe(async argvArg => { tsbuildCli.addCommand('element').subscribe(async (argvArg) => {
await tsbuild.compileGlobStringObject( await tsbuild.compileGlobStringObject(
{ {
'./ts_web/**/*.ts': 'dist_ts_web' './ts_web/**/*.ts': 'dist_ts_web',
}, },
{}, {},
process.cwd(), process.cwd(),
{ web: true } { web: true }
); );
}); });
tsbuildCli.startParse(); tsbuildCli.startParse();
};

@ -27,18 +27,18 @@ export let compileGlobStringObject = async (
cwdArg: string = process.cwd(), cwdArg: string = process.cwd(),
argvArg?: any argvArg?: any
) => { ) => {
let compiledFiles = []; let compiledFiles: plugins.smartfile.Smartfile[] = [];
for (const keyArg in globStringObjectArg) { for (const keyArg in globStringObjectArg) {
if (globStringObjectArg[keyArg]) { if (globStringObjectArg[keyArg]) {
console.log( console.log(
`TypeScript assignment: transpile from ${keyArg} to ${globStringObjectArg[keyArg]}` `TypeScript assignment: transpile from ${keyArg} to ${globStringObjectArg[keyArg]}`
); );
const fileTreeArray = await plugins.smartfile.fs.listFileTree(cwdArg, keyArg); const fileTreeArray = await plugins.smartfile.fs.listFileTree(cwdArg, keyArg);
let absoluteFilePathArray: string[] = plugins.smartpath.transform.toAbsolute( const absoluteFilePathArray: string[] = plugins.smartpath.transform.toAbsolute(
fileTreeArray, fileTreeArray,
cwdArg cwdArg
); );
let destDir: string = plugins.smartpath.transform.toAbsolute( const destDir: string = plugins.smartpath.transform.toAbsolute(
globStringObjectArg[keyArg], globStringObjectArg[keyArg],
cwdArg cwdArg
); );

@ -1,14 +0,0 @@
{
"compilerOptions": {
"outDir": "dist_ts/",
"module": "commonjs",
"target": "es2015",
"lib":[
"es2016",
"es2017"
]
},
"include": [
"ts/**/*.ts"
]
}