fix(core): update
This commit is contained in:
		
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -15,8 +15,6 @@ node_modules/ | ||||
|  | ||||
| # builds | ||||
| dist/ | ||||
| dist_web/ | ||||
| dist_serve/ | ||||
| dist_ts_web/ | ||||
| dist_*/ | ||||
|  | ||||
| # custom | ||||
| @@ -1,12 +1,10 @@ | ||||
| # gitzone ci_default | ||||
| image: registry.gitlab.com/hosttoday/ht-docker-node:npmci | ||||
| variables: | ||||
|   GIT_STRATEGY: clone | ||||
|  | ||||
| cache: | ||||
|   paths: | ||||
|     - .npmci_cache/ | ||||
|   key: "$CI_BUILD_STAGE" | ||||
|   key: '$CI_BUILD_STAGE' | ||||
|  | ||||
| stages: | ||||
|   - security | ||||
| @@ -22,17 +20,19 @@ mirror: | ||||
|   script: | ||||
|     - npmci git mirror | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| snyk: | ||||
|   image: registry.gitlab.com/hosttoday/ht-docker-node:snyk | ||||
|   stage: security | ||||
|   script: | ||||
|     - npmci npm prepare | ||||
|     - npmci command npm install -g snyk | ||||
|     - npmci command npm install --ignore-scripts | ||||
|     - npmci command snyk test | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| @@ -49,6 +49,7 @@ testStable: | ||||
|     - npmci npm test | ||||
|   coverage: /\d+.?\d+?\%\s*coverage/ | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - priv | ||||
|  | ||||
| @@ -56,22 +57,24 @@ testBuild: | ||||
|   stage: test | ||||
|   script: | ||||
|     - npmci npm prepare | ||||
|   - npmci node install lts | ||||
|     - npmci node install stable | ||||
|     - npmci npm install | ||||
|     - npmci command npm run build | ||||
|   coverage: /\d+.?\d+?\%\s*coverage/ | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| release: | ||||
|   stage: release | ||||
|   script: | ||||
|   - npmci node install lts | ||||
|     - npmci node install stable | ||||
|     - npmci npm publish | ||||
|   only: | ||||
|     - tags | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| @@ -83,9 +86,11 @@ codequality: | ||||
|   allow_failure: true | ||||
|   script: | ||||
|     - npmci command npm install -g tslint typescript | ||||
|     - npmci npm prepare | ||||
|     - npmci npm install | ||||
|     - npmci command "tslint -c tslint.json ./ts/**/*.ts" | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - priv | ||||
|  | ||||
| @@ -96,20 +101,20 @@ trigger: | ||||
|   only: | ||||
|     - tags | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| pages: | ||||
|   image: hosttoday/ht-docker-dbase:npmci | ||||
|   services: | ||||
|    - docker:18-dind | ||||
|   stage: metadata | ||||
|   script: | ||||
|     - npmci node install lts | ||||
|     - npmci command npm install -g @gitzone/tsdoc | ||||
|     - npmci npm prepare | ||||
|     - npmci npm install | ||||
|     - npmci command tsdoc | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|   only: | ||||
|   | ||||
							
								
								
									
										29
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| { | ||||
|   "version": "0.2.0", | ||||
|   "configurations": [ | ||||
|     { | ||||
|       "name": "current file", | ||||
|       "type": "node", | ||||
|       "request": "launch", | ||||
|       "args": [ | ||||
|         "${relativeFile}" | ||||
|       ], | ||||
|       "runtimeArgs": ["-r", "@gitzone/tsrun"], | ||||
|       "cwd": "${workspaceRoot}", | ||||
|       "protocol": "inspector", | ||||
|       "internalConsoleOptions": "openOnSessionStart" | ||||
|     }, | ||||
|     { | ||||
|       "name": "test.ts", | ||||
|       "type": "node", | ||||
|       "request": "launch", | ||||
|       "args": [ | ||||
|         "test/test.ts" | ||||
|       ], | ||||
|       "runtimeArgs": ["-r", "@gitzone/tsrun"], | ||||
|       "cwd": "${workspaceRoot}", | ||||
|       "protocol": "inspector", | ||||
|       "internalConsoleOptions": "openOnSessionStart" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										26
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| { | ||||
|   "json.schemas": [ | ||||
|     { | ||||
|       "fileMatch": ["/npmextra.json"], | ||||
|       "schema": { | ||||
|         "type": "object", | ||||
|         "properties": { | ||||
|           "npmci": { | ||||
|             "type": "object", | ||||
|             "description": "settings for npmci" | ||||
|           }, | ||||
|           "gitzone": { | ||||
|             "type": "object", | ||||
|             "description": "settings for gitzone", | ||||
|             "properties": { | ||||
|               "projectType": { | ||||
|                 "type": "string", | ||||
|                 "enum": ["website", "element", "service", "npm"] | ||||
|               } | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										75
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										75
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,75 +0,0 @@ | ||||
| # @gitzone/tsbuild | ||||
| TypeScript nightly to easily make use of latest features | ||||
|  | ||||
| ## Availabililty and Links | ||||
| * [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tsbuild) | ||||
| * [gitlab.com (source)](https://gitlab.com/gitzone/tsbuild) | ||||
| * [github.com (source mirror)](https://github.com/gitzone/tsbuild) | ||||
| * [docs (typedoc)](https://gitzone.gitlab.io/tsbuild/) | ||||
|  | ||||
| ## Status for master | ||||
| [](https://gitlab.com/gitzone/tsbuild/commits/master) | ||||
| [](https://gitlab.com/gitzone/tsbuild/commits/master) | ||||
| [](https://www.npmjs.com/package/@gitzone/tsbuild) | ||||
| [](https://snyk.io/test/npm/@gitzone/tsbuild) | ||||
| [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||
| [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||
| [](https://prettier.io/) | ||||
|  | ||||
| ## Usage | ||||
|  | ||||
| Tsn uses the **next** tagged npm version of typescript | ||||
|  | ||||
| ```typescript | ||||
| import * as tsn from 'tsn'; | ||||
|  | ||||
| let myGlobStringObject = { | ||||
|   './myTsFolder/**/*.ts': './myDestinationFolder/', | ||||
|   './someOtherTsFolder/**/*.ts': './myOtherDestinationFolder/' | ||||
| }; | ||||
|  | ||||
| let tsOptions = { | ||||
|   target: tsn.ScriptTarget.ES2015, | ||||
|   module: tsn.ModuleKind.CommonJS | ||||
| }; | ||||
|  | ||||
| /* | ||||
| note: since this only works in code, here are the target numbers | ||||
| enum ScriptTarget { | ||||
|         ES3 = 0, | ||||
|         ES5 = 1, | ||||
|         ES2015 = 2, | ||||
|         ES2016 = 3, | ||||
|         ES2017 = 4, | ||||
|         ESNext = 5, | ||||
|         Latest = 5, | ||||
| } | ||||
|  | ||||
| and here are the module kinds | ||||
| enum ModuleKind { | ||||
|         None = 0, | ||||
|         CommonJS = 1, | ||||
|         AMD = 2, | ||||
|         UMD = 3, | ||||
|         System = 4, | ||||
|         ES2015 = 5, | ||||
|     } | ||||
| */ | ||||
|  | ||||
| let myCwd = process.cwd(); | ||||
|  | ||||
| tsn.compileGlobStringObject( | ||||
|   myGlobStringObject, // the glob string object describing from where to compile what to where | ||||
|   tsOptions, // the options for TypeScript | ||||
|   myCwd // a custom cwd, optional, defaults to process.cwd() | ||||
| ); | ||||
| ``` | ||||
|  | ||||
| [](https://push.rocks) | ||||
|  | ||||
| For further information read the linked docs at the top of this readme. | ||||
|  | ||||
| > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | ||||
| | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | ||||
|  | ||||
| [](https://maintainedby.lossless.com) | ||||
| @@ -4,6 +4,7 @@ | ||||
|     "npmAccessLevel": "public" | ||||
|   }, | ||||
|   "gitzone": { | ||||
|     "projectType": "npm", | ||||
|     "module": { | ||||
|       "githost": "gitlab.com", | ||||
|       "gitscope": "gitzone", | ||||
|   | ||||
							
								
								
									
										16
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								package.json
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ | ||||
|   "version": "2.1.20", | ||||
|   "private": false, | ||||
|   "description": "TypeScript nightly to easily make use of latest features", | ||||
|   "main": "dist/index.js", | ||||
|   "main": "dist_ts/index.js", | ||||
|   "typings": "dist/index.d.ts", | ||||
|   "bin": { | ||||
|     "tsbuild": "cli.js" | ||||
| @@ -42,12 +42,14 @@ | ||||
|     "tslint-config-prettier": "^1.18.0" | ||||
|   }, | ||||
|   "files": [ | ||||
|     "ts/*", | ||||
|     "ts_web/*", | ||||
|     "dist/*", | ||||
|     "dist_web/*", | ||||
|     "dist_ts_web/*", | ||||
|     "assets/*", | ||||
|     "ts/**/*", | ||||
|     "ts_web/**/*", | ||||
|     "dist/**/*", | ||||
|     "dist_bundle/**/*", | ||||
|     "dist_web/**/*", | ||||
|     "dist_ts/**/*", | ||||
|     "dist_ts_web/**/*", | ||||
|     "assets/**/*", | ||||
|     "cli.js", | ||||
|     "npmextra.json", | ||||
|     "readme.md" | ||||
|   | ||||
| @@ -12,7 +12,7 @@ export const compilerOptionsDefault: CompilerOptions = { | ||||
|   experimentalDecorators: true, | ||||
|   inlineSourceMap: true, | ||||
|   noEmitOnError: true, | ||||
|   outDir: 'dist/', | ||||
|   outDir: 'dist_ts/', | ||||
|   module: plugins.typescript.ModuleKind.CommonJS, | ||||
|   lib: ['lib.es2017.d.ts'], | ||||
|   noImplicitAny: false, | ||||
| @@ -41,7 +41,7 @@ export const mergeCompilerOptions = ( | ||||
|   })(); | ||||
|  | ||||
|   // create merged options | ||||
|   let mergedOptions: CompilerOptions = { | ||||
|   const mergedOptions: CompilerOptions = { | ||||
|     ...defaultOptionsToMerge, | ||||
|     ...customTsOptions | ||||
|   }; | ||||
| @@ -58,22 +58,22 @@ export const compiler = ( | ||||
|   argvArg?: any | ||||
| ): Promise<any[]> => { | ||||
|   console.log(`Compiling ${fileNames.length} files...`); | ||||
|   let done = plugins.smartpromise.defer<any[]>(); | ||||
|   let program = plugins.typescript.createProgram(fileNames, options); | ||||
|   let emitResult = program.emit(); | ||||
|   const done = plugins.smartpromise.defer<any[]>(); | ||||
|   const program = plugins.typescript.createProgram(fileNames, options); | ||||
|   const emitResult = program.emit(); | ||||
|  | ||||
|   // implement check only | ||||
|   /*let emitResult = program.emit(undefined,(args) => { | ||||
|     console.log(args) | ||||
|   });*/ | ||||
|  | ||||
|   let allDiagnostics = plugins.typescript | ||||
|   const allDiagnostics = plugins.typescript | ||||
|     .getPreEmitDiagnostics(program) | ||||
|     .concat(emitResult.diagnostics); | ||||
|   allDiagnostics.forEach(diagnostic => { | ||||
|     if (diagnostic.file) { | ||||
|       let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); | ||||
|       let message = plugins.typescript.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); | ||||
|       const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start!); | ||||
|       const message = plugins.typescript.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); | ||||
|       console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); | ||||
|     } else { | ||||
|       console.log( | ||||
| @@ -82,7 +82,7 @@ export const compiler = ( | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   let exitCode = emitResult.emitSkipped ? 1 : 0; | ||||
|   const exitCode = emitResult.emitSkipped ? 1 : 0; | ||||
|   if (exitCode === 0) { | ||||
|     console.log('TypeScript emit succeeded!'); | ||||
|     done.resolve(emitResult.emittedFiles); | ||||
|   | ||||
| @@ -10,7 +10,7 @@ tsbuildCli.standardTask().subscribe(async argvArg => { | ||||
|   if (process.env.CLI_CALL_TSBUILD === 'true') { | ||||
|     tsbuild.compileGlobStringObject( | ||||
|       { | ||||
|         './ts/**/*.ts': './dist' | ||||
|         './ts/**/*.ts': './dist_ts' | ||||
|       }, | ||||
|       {}, | ||||
|       process.cwd(), | ||||
| @@ -33,9 +33,14 @@ tsbuildCli.addCommand('custom').subscribe(async argvArg => { | ||||
| }); | ||||
|  | ||||
| tsbuildCli.addCommand('element').subscribe(async argvArg => { | ||||
|   await tsbuild.compileGlobStringObject({ | ||||
|     "./ts_web/**/*.ts": "dist_ts_web" | ||||
|   }, {}, process.cwd(), {web: true}); | ||||
|   await tsbuild.compileGlobStringObject( | ||||
|     { | ||||
|       './ts_web/**/*.ts': 'dist_ts_web' | ||||
|     }, | ||||
|     {}, | ||||
|     process.cwd(), | ||||
|     { web: true } | ||||
|   ); | ||||
| }); | ||||
|  | ||||
| tsbuildCli.startParse(); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "compilerOptions": { | ||||
|     "outDir": "dist/", | ||||
|     "outDir": "dist_ts/", | ||||
|     "module": "commonjs", | ||||
|     "target": "es2015", | ||||
|     "lib":[ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user