diff --git a/packages/devextreme-angular-generator/gulpfile.js b/packages/devextreme-angular-generator/gulpfile.js index 0080ff498..f3a6410d7 100644 --- a/packages/devextreme-angular-generator/gulpfile.js +++ b/packages/devextreme-angular-generator/gulpfile.js @@ -21,17 +21,18 @@ gulp.task('npm.pack', gulp.series( //------------Main------------ -var buildTask = gulp.series( +var buildTask = (tsProject = 'tsconfig.json') => gulp.series( () => gulp.src(TEMPLATES_FILES_PATTERN).pipe(gulp.dest(path.join(DIST_PATH, 'templates'))), () => gulp.src(SRC_FILES_PATTERN) .pipe(sourcemaps.init()) - .pipe(typescript('tsconfig.json')) + .pipe(typescript(tsProject)) .pipe(sourcemaps.write('.')) .pipe(gulp.dest(DIST_PATH)) ); -gulp.task('build', buildTask); -gulp.task('default', buildTask); +gulp.task('build', buildTask()); +gulp.task('build:local', buildTask('tsconfig.local.json')); +gulp.task('default', buildTask()); //------------Testing------------ diff --git a/packages/devextreme-angular-generator/package.json b/packages/devextreme-angular-generator/package.json index ae292dc92..c103be81c 100644 --- a/packages/devextreme-angular-generator/package.json +++ b/packages/devextreme-angular-generator/package.json @@ -1,7 +1,7 @@ { "author": "Developer Express Inc.", "name": "devextreme-angular-generator", - "version": "2.1.1", + "version": "2.1.2", "description": "Angular UI and visualization components based on DevExtreme widgets", "repository": { "type": "git", @@ -15,6 +15,7 @@ "scripts": { "gulp": "npx --node-options='--max_old_space_size=8048' gulp", "build": "npm run gulp -- build", + "build:local": "npm run gulp -- build:local", "test": "npm run gulp -- test", "test:dev": "npm run gulp -- run.tests", "pack": "npm run gulp -- build && npm run gulp -- npm.pack" @@ -36,7 +37,7 @@ "@types/dot": "^1.1.5", "@types/jasmine": "2.8.19", "@types/mkdirp": "^0.5.2", - "@types/node": "~8.10.66", + "@types/node": "^18.17.5", "@types/yargs": "^6.6.0", "del": "^2.2.2", "gulp": "^4.0.2", diff --git a/packages/devextreme-angular-generator/src/component-names-generator.ts b/packages/devextreme-angular-generator/src/component-names-generator.ts index 2a3551a10..bf00e588c 100644 --- a/packages/devextreme-angular-generator/src/component-names-generator.ts +++ b/packages/devextreme-angular-generator/src/component-names-generator.ts @@ -2,7 +2,7 @@ import fs = require('fs'); import path = require('path'); export default class ComponentNamesGenerator { - private _encoding = 'utf8'; + private _encoding: BufferEncoding = 'utf8'; private _config; diff --git a/packages/devextreme-angular-generator/src/dot-generator.ts b/packages/devextreme-angular-generator/src/dot-generator.ts index ce124fce2..d691cc4e9 100644 --- a/packages/devextreme-angular-generator/src/dot-generator.ts +++ b/packages/devextreme-angular-generator/src/dot-generator.ts @@ -23,7 +23,7 @@ export function createTemplateFromString(templateString: string) { } export default class DoTGenerator { - private _encoding = 'utf8'; + private _encoding: BufferEncoding = 'utf8'; createTemplate(templateFilePath: string) { logger('Create doT template from ' + templateFilePath); let templateString = fs.readFileSync(templateFilePath, this._encoding); @@ -63,7 +63,7 @@ export default class DoTGenerator { let filePath = path.join(metadataFolderPath, fileName); logger('Read data from ' + filePath); - let data = fs.readFileSync(filePath, this._encoding); + let data = fs.readFileSync(filePath, { encoding: this._encoding }); logger('Apply template'); let result = template(JSON.parse(data)); const widgetName = path.parse(filePath).name; diff --git a/packages/devextreme-angular-generator/src/facade-generator.ts b/packages/devextreme-angular-generator/src/facade-generator.ts index d6ebf5b48..abcef3874 100644 --- a/packages/devextreme-angular-generator/src/facade-generator.ts +++ b/packages/devextreme-angular-generator/src/facade-generator.ts @@ -4,7 +4,7 @@ import logger from './logger'; import inflector = require('inflector-js'); export default class FacadeGenerator { - private _encoding = 'utf8'; + private _encoding: BufferEncoding = 'utf8'; generate(config) { Object.keys(config.facades).forEach(facadeFilePath => { logger('Generate facade: ' + facadeFilePath); diff --git a/packages/devextreme-angular-generator/src/metadata-generator.ts b/packages/devextreme-angular-generator/src/metadata-generator.ts index b9704fc65..6e73055f7 100644 --- a/packages/devextreme-angular-generator/src/metadata-generator.ts +++ b/packages/devextreme-angular-generator/src/metadata-generator.ts @@ -111,10 +111,10 @@ export interface IObjectStore { } export class FSObjectStore implements IObjectStore { - private _encoding = 'utf8'; + private _encoding: BufferEncoding = 'utf8'; read(filePath) { logger(`Read from file: ${filePath}`); - let dataString = fs.readFileSync(filePath, this._encoding); + let dataString = fs.readFileSync(filePath, { encoding: this._encoding }); logger('Parse data'); return JSON.parse(dataString); } diff --git a/packages/devextreme-angular-generator/src/module.facade-generator.ts b/packages/devextreme-angular-generator/src/module.facade-generator.ts index c07fa3e6e..2e58c8822 100644 --- a/packages/devextreme-angular-generator/src/module.facade-generator.ts +++ b/packages/devextreme-angular-generator/src/module.facade-generator.ts @@ -4,7 +4,7 @@ import logger from './logger'; let inflector = require('inflector-js'); export default class FacadeGenerator { - private _encoding = 'utf8'; + private _encoding: BufferEncoding = 'utf8'; prepareModuleName(fileName: string) { fileName = fileName.replace(/-/g, '_'); diff --git a/packages/devextreme-angular-generator/tsconfig.local.json b/packages/devextreme-angular-generator/tsconfig.local.json new file mode 100644 index 000000000..fd367fadc --- /dev/null +++ b/packages/devextreme-angular-generator/tsconfig.local.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "skipLibCheck": true, + "target": "ES5", + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "inlineSources": true, + "removeComments": false, + "declaration": true, + "noUnusedParameters": true, + "noUnusedLocals": true + } +}