Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
dda03bad45 | |||
a0b9f8d8f3 | |||
da823e51d5 | |||
b68aa06941 |
5
package-lock.json
generated
5
package-lock.json
generated
@ -1,16 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbuild",
|
"name": "@gitzone/tsbuild",
|
||||||
"version": "2.1.55",
|
"version": "2.1.57",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@gitzone/tsbuild",
|
"name": "@gitzone/tsbuild",
|
||||||
"version": "2.1.55",
|
"version": "2.1.57",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/early": "^3.0.6",
|
"@pushrocks/early": "^3.0.6",
|
||||||
"@pushrocks/smartcli": "^3.0.14",
|
"@pushrocks/smartcli": "^3.0.14",
|
||||||
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartfile": "^9.0.6",
|
"@pushrocks/smartfile": "^9.0.6",
|
||||||
"@pushrocks/smartlog": "^2.0.44",
|
"@pushrocks/smartlog": "^2.0.44",
|
||||||
"@pushrocks/smartpath": "^5.0.4",
|
"@pushrocks/smartpath": "^5.0.4",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbuild",
|
"name": "@gitzone/tsbuild",
|
||||||
"version": "2.1.55",
|
"version": "2.1.57",
|
||||||
"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",
|
||||||
@ -30,6 +30,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/early": "^3.0.6",
|
"@pushrocks/early": "^3.0.6",
|
||||||
"@pushrocks/smartcli": "^3.0.14",
|
"@pushrocks/smartcli": "^3.0.14",
|
||||||
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartfile": "^9.0.6",
|
"@pushrocks/smartfile": "^9.0.6",
|
||||||
"@pushrocks/smartlog": "^2.0.44",
|
"@pushrocks/smartlog": "^2.0.44",
|
||||||
"@pushrocks/smartpath": "^5.0.4",
|
"@pushrocks/smartpath": "^5.0.4",
|
||||||
|
@ -16,17 +16,12 @@ export const compilerOptionsDefault: CompilerOptions = {
|
|||||||
module: plugins.typescript.ModuleKind.ES2020,
|
module: plugins.typescript.ModuleKind.ES2020,
|
||||||
target: plugins.typescript.ScriptTarget.ES2020,
|
target: plugins.typescript.ScriptTarget.ES2020,
|
||||||
moduleResolution: plugins.typescript.ModuleResolutionKind.Node12,
|
moduleResolution: plugins.typescript.ModuleResolutionKind.Node12,
|
||||||
lib: [],
|
lib: ['lib.dom.d.ts'],
|
||||||
noImplicitAny: true,
|
noImplicitAny: true,
|
||||||
esModuleInterop: true,
|
esModuleInterop: true,
|
||||||
importsNotUsedAsValues: plugins.typescript.ImportsNotUsedAsValues.Preserve
|
importsNotUsedAsValues: plugins.typescript.ImportsNotUsedAsValues.Preserve
|
||||||
};
|
};
|
||||||
|
|
||||||
export const compilerOptionsWebDefault: CompilerOptions = {
|
|
||||||
...compilerOptionsDefault,
|
|
||||||
lib: [...compilerOptionsDefault.lib, 'lib.dom.d.ts']
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* merges compilerOptions with the default compiler options
|
* merges compilerOptions with the default compiler options
|
||||||
*/
|
*/
|
||||||
@ -34,17 +29,9 @@ export const mergeCompilerOptions = (
|
|||||||
customTsOptions: CompilerOptions,
|
customTsOptions: CompilerOptions,
|
||||||
argvArg?: any
|
argvArg?: any
|
||||||
): CompilerOptions => {
|
): CompilerOptions => {
|
||||||
const defaultOptionsToMerge = (() => {
|
|
||||||
if (argvArg && argvArg.web) {
|
|
||||||
return compilerOptionsWebDefault;
|
|
||||||
} else {
|
|
||||||
return compilerOptionsDefault;
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
// create merged options
|
// create merged options
|
||||||
const mergedOptions: CompilerOptions = {
|
const mergedOptions: CompilerOptions = {
|
||||||
...defaultOptionsToMerge,
|
...compilerOptionsDefault,
|
||||||
...customTsOptions,
|
...customTsOptions,
|
||||||
...argvArg && argvArg.skiplibcheck ? {
|
...argvArg && argvArg.skiplibcheck ? {
|
||||||
skipLibCheck: true
|
skipLibCheck: true
|
||||||
@ -66,11 +53,17 @@ export const mergeCompilerOptions = (
|
|||||||
/**
|
/**
|
||||||
* the internal main compiler function that compiles the files
|
* the internal main compiler function that compiles the files
|
||||||
*/
|
*/
|
||||||
export const compiler = (
|
export const compiler = async (
|
||||||
fileNames: string[],
|
fileNames: string[],
|
||||||
options: plugins.typescript.CompilerOptions,
|
options: plugins.typescript.CompilerOptions,
|
||||||
argvArg?: any
|
argvArg?: any
|
||||||
): Promise<any[]> => {
|
): Promise<any[]> => {
|
||||||
|
if (options.skipLibCheck) {
|
||||||
|
console.log('? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?')
|
||||||
|
console.log('You are skipping libcheck... Is that really wanted?');
|
||||||
|
console.log('? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?')
|
||||||
|
await plugins.smartdelay.delayFor(5000);
|
||||||
|
}
|
||||||
console.log(`Compiling ${fileNames.length} files...`);
|
console.log(`Compiling ${fileNames.length} files...`);
|
||||||
const done = plugins.smartpromise.defer<any[]>();
|
const done = plugins.smartpromise.defer<any[]>();
|
||||||
const program = plugins.typescript.createProgram(fileNames, options);
|
const program = plugins.typescript.createProgram(fileNames, options);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import * as smartcli from '@pushrocks/smartcli';
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import * as smartfile from '@pushrocks/smartfile';
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as smartpath from '@pushrocks/smartpath';
|
import * as smartpath from '@pushrocks/smartpath';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import typescript from 'typescript';
|
import typescript from 'typescript';
|
||||||
|
|
||||||
export { smartcli, smartfile, smartpath, smartpromise, typescript };
|
export { smartcli, smartdelay, smartfile, smartpath, smartpromise, typescript };
|
||||||
|
Reference in New Issue
Block a user