Compare commits

...

16 Commits

Author SHA1 Message Date
93a332ba50 2.1.6 2019-01-27 02:44:55 +01:00
109ba0b0ee fix(core): update 2019-01-27 02:44:54 +01:00
ee3ef5d6e9 2.1.5 2019-01-27 02:42:58 +01:00
d5852ce85d fix(core): update 2019-01-27 02:42:58 +01:00
f36dea3875 2.1.4 2018-12-11 01:58:39 +01:00
d36bf42f8b fix(core): update 2018-12-11 01:58:39 +01:00
730c739c14 2.1.3 2018-12-06 00:45:23 +01:00
dd1f007246 fix(core): update 2018-12-06 00:45:22 +01:00
41ca4805e6 2.1.2 2018-12-05 23:33:18 +01:00
68dcf1cca9 fix(core): update 2018-12-05 23:33:17 +01:00
53ba4a64b3 2.1.1 2018-12-05 23:32:28 +01:00
fa8dc2bec5 fix(core): update 2018-12-05 23:32:27 +01:00
1ef8a502e3 2.1.0 2018-12-05 23:29:01 +01:00
bbcb8e6b3f feat(cli options): now support --web for web compilations targeting Google Chrome 2018-12-05 23:29:01 +01:00
fee2a60162 2.0.22 2018-08-08 23:05:24 +02:00
0a2fee42ca fix(dependencies): update 2018-08-08 23:05:24 +02:00
11 changed files with 933 additions and 331 deletions

View File

@ -26,6 +26,7 @@ mirror:
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
@ -36,21 +37,11 @@ snyk:
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
@ -62,6 +53,7 @@ testLTS:
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
@ -118,6 +110,7 @@ pages:
stage: metadata
script:
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
@ -130,13 +123,3 @@ pages:
paths:
- public
allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

4
.snyk Normal file
View File

@ -0,0 +1,4 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.3
ignore: {}
patch: {}

1074
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@gitzone/tsbuild",
"version": "2.0.21",
"version": "2.1.6",
"private": false,
"description": "TypeScript nightly to easily make use of latest features",
"main": "dist/index.js",
@ -10,6 +10,7 @@
},
"scripts": {
"test": "tsrun test/test.ts",
"testCustom": "node cli.ts.js custom ts_web",
"build": "node cli.ts.js"
},
"repository": {
@ -26,15 +27,18 @@
},
"homepage": "https://gitlab.com/pushrocks/tsn#README",
"dependencies": {
"@pushrocks/smartfile": "^6.0.3",
"@pushrocks/smartlog": "^2.0.1",
"@pushrocks/smartcli": "^3.0.7",
"@pushrocks/smartfile": "^6.0.11",
"@pushrocks/smartlog": "^2.0.9",
"@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^2.0.5",
"typescript": "^2.9.2"
"typescript": "^3.2.2"
},
"devDependencies": {
"@gitzone/tsrun": "^1.1.9",
"@pushrocks/tapbundle": "^3.0.1",
"@types/node": "^10.5.3"
"@gitzone/tsrun": "^1.1.17",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.12",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.17.0"
}
}

View File

@ -17,4 +17,4 @@ class test2 {
const run = () => __awaiter(this, void 0, void 0, function* () {
return 'hi';
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9jb21waWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdG9jb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUEsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNwQixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ3JCO0lBRUU7UUFEQSxTQUFJLEdBQWEsRUFBRSxDQUFDO1FBRWxCLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDcEIsQ0FBQztDQUNGO0FBRUQsTUFBTSxHQUFHLEdBQUcsR0FBMEIsRUFBRTtJQUN0QyxPQUFPLElBQUksQ0FBQztBQUNkLENBQUMsQ0FBQSxDQUFDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9jb21waWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdG9jb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUEsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUNwQixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ3JCLE1BQU0sS0FBSztJQUVUO1FBREEsU0FBSSxHQUFhLEVBQUUsQ0FBQztRQUVsQixPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3BCLENBQUM7Q0FDRjtBQUVELE1BQU0sR0FBRyxHQUFHLEdBQTBCLEVBQUU7SUFDdEMsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDLENBQUEsQ0FBQyJ9

View File

@ -1,9 +1,3 @@
export * from './tsbuild.exports';
import * as tsbuild from './tsbuild.exports';
if (process.env.CLI_CALL_TSBUILD === 'true') {
tsbuild.compileGlobStringObject({
'./ts/**/*.ts': './dist'
});
}
import './tsbuild.cli';

View File

@ -19,13 +19,26 @@ export const compilerOptionsDefault: CompilerOptions = {
target: plugins.typescript.ScriptTarget.ES2015
};
export const compilerOptionsWebDefault: CompilerOptions = {
...compilerOptionsDefault,
lib: [...compilerOptionsDefault.lib, 'lib.dom.d.ts']
};
/**
* merges compilerOptions with the default compiler options
*/
export const mergeCompilerOptions = function(customTsOptions: CompilerOptions): CompilerOptions {
export const mergeCompilerOptions = (customTsOptions: CompilerOptions, argvArg?: any): CompilerOptions => {
const defaultOptionsToMerge = (() => {
if (argvArg && argvArg.web) {
return compilerOptionsWebDefault;
} else {
return compilerOptionsDefault;
}
})();
// create merged options
let mergedOptions: CompilerOptions = {
...compilerOptionsDefault,
...defaultOptionsToMerge,
...customTsOptions
};
@ -37,7 +50,8 @@ export const mergeCompilerOptions = function(customTsOptions: CompilerOptions):
*/
export const compiler = (
fileNames: string[],
options: plugins.typescript.CompilerOptions
options: plugins.typescript.CompilerOptions,
argvArg?: any,
): Promise<any[]> => {
console.log(`Compiling ${fileNames.length} files...`);
let done = plugins.smartpromise.defer<any[]>();

40
ts/tsbuild.cli.ts Normal file
View File

@ -0,0 +1,40 @@
import * as plugins from './tsbuild.plugins';
import * as tsbuild from './tsbuild.exports';
const tsbuildCli = new plugins.smartcli.Smartcli();
/**
* the standard task compiles anything in ts/ directory to dist directory
*/
tsbuildCli.standardTask().subscribe(argvArg => {
if (process.env.CLI_CALL_TSBUILD === 'true') {
tsbuild.compileGlobStringObject(
{
'./ts/**/*.ts': './dist'
},
{},
process.cwd(),
argvArg
);
}
});
/**
* the custom command compiles any customDir to dist_customDir
*/
tsbuildCli.addCommand('custom').subscribe(argvArg => {
const listedDirectories = argvArg._;
listedDirectories.shift();
const compilationCommandObject: {[key: string]: string} = {};
for (const directory of listedDirectories) {
compilationCommandObject['./' + directory] = './dist_' + directory;
};
tsbuild.compileGlobStringObject(
compilationCommandObject,
{},
process.cwd(),
argvArg
);
})
tsbuildCli.startParse();

View File

@ -8,9 +8,10 @@ export * from './tsbuild.classes.compiler';
*/
export let compileFileArray = (
fileStringArrayArg: string[],
compilerOptionsArg: CompilerOptions = {}
compilerOptionsArg: CompilerOptions = {},
argvArg?: any,
): Promise<any[]> => {
return compiler(fileStringArrayArg, mergeCompilerOptions(compilerOptionsArg));
return compiler(fileStringArrayArg, mergeCompilerOptions(compilerOptionsArg, argvArg), argvArg);
};
/**
@ -23,30 +24,33 @@ export let compileFileArray = (
export let compileGlobStringObject = async (
globStringObjectArg: any,
tsOptionsArg: CompilerOptions = {},
cwdArg: string = process.cwd()
cwdArg: string = process.cwd(),
argvArg?: any,
) => {
let compiledFiles = [];
for (let keyArg in globStringObjectArg) {
console.log(
`TypeScript assignment: transpile from ${keyArg} to ${globStringObjectArg[keyArg]}`
);
const fileTreeArray = await plugins.smartfile.fs.listFileTree(cwdArg, keyArg);
let absoluteFilePathArray: string[] = plugins.smartpath.transform.toAbsolute(
fileTreeArray,
cwdArg
);
let destDir: string = plugins.smartpath.transform.toAbsolute(
globStringObjectArg[keyArg],
cwdArg
);
tsOptionsArg = {
...tsOptionsArg,
outDir: destDir
};
compiledFiles = compiledFiles.concat(
compiledFiles,
await compileFileArray(absoluteFilePathArray, tsOptionsArg)
);
for (const keyArg in globStringObjectArg) {
if(globStringObjectArg[keyArg]) {
console.log(
`TypeScript assignment: transpile from ${keyArg} to ${globStringObjectArg[keyArg]}`
);
const fileTreeArray = await plugins.smartfile.fs.listFileTree(cwdArg, keyArg);
let absoluteFilePathArray: string[] = plugins.smartpath.transform.toAbsolute(
fileTreeArray,
cwdArg
);
let destDir: string = plugins.smartpath.transform.toAbsolute(
globStringObjectArg[keyArg],
cwdArg
);
tsOptionsArg = {
...tsOptionsArg,
outDir: destDir
};
compiledFiles = compiledFiles.concat(
compiledFiles,
await compileFileArray(absoluteFilePathArray, tsOptionsArg, argvArg)
);
}
}
return compiledFiles;
};

View File

@ -1,6 +1,7 @@
import * as smartcli from '@pushrocks/smartcli';
import * as smartfile from '@pushrocks/smartfile';
import * as smartpath from '@pushrocks/smartpath';
import * as smartpromise from '@pushrocks/smartpromise';
import * as typescript from 'typescript';
export { smartfile, smartpath, smartpromise, typescript };
export { smartcli, smartfile, smartpath, smartpromise, typescript };

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
}
"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"
}