From a1c727ba8e2694b8a87c6d6666469047cda81846 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 10:54:23 +0300 Subject: [PATCH 01/12] add generate-angular, generate-react gulp tasks --- build/gulp/generator.js | 45 ----------- build/gulp/generator/gulpfile.js | 80 +++++++++++++++++++ .../ts-configs/angular.tsconfig.json | 15 ++++ .../ts-configs}/preact.tsconfig.json | 0 .../generator/ts-configs/react.tsconfig.json | 16 ++++ build/gulp/transpile.js | 4 +- gulpfile.js | 2 +- 7 files changed, 114 insertions(+), 48 deletions(-) delete mode 100644 build/gulp/generator.js create mode 100644 build/gulp/generator/gulpfile.js create mode 100644 build/gulp/generator/ts-configs/angular.tsconfig.json rename build/gulp/{ => generator/ts-configs}/preact.tsconfig.json (100%) create mode 100644 build/gulp/generator/ts-configs/react.tsconfig.json diff --git a/build/gulp/generator.js b/build/gulp/generator.js deleted file mode 100644 index a3cb9e2ead85..000000000000 --- a/build/gulp/generator.js +++ /dev/null @@ -1,45 +0,0 @@ -const gulp = require('gulp'); -const { generateComponents } = require('devextreme-generator/component-compiler'); -const generator = require('devextreme-generator/preact-generator').default; -const ts = require('gulp-typescript'); -const lint = require('gulp-eslint'); -const plumber = require('gulp-plumber'); -const gulpIf = require('gulp-if'); - -const SRC = 'js/renovation/**/*.tsx'; -const DEST = 'js/renovation/'; - -const knownErrors = [ - 'Cannot find module \'preact\'.', - 'Cannot find module \'preact/hooks\'.' -]; - -gulp.task('generate-components', function() { - const tsProject = ts.createProject('build/gulp/preact.tsconfig.json'); - generator.defaultOptionsModule = 'js/core/options/utils'; - - return gulp.src(SRC) - .pipe(generateComponents(generator)) - .pipe(plumber(()=>null)) - .pipe(tsProject({ - error(e) { - if(!knownErrors.some(i => e.message.endsWith(i))) { - console.log(e.message); - } - }, - finish() {} - })) - .pipe(gulpIf(file => file.extname === '.js', - lint({ - quiet: true, - fix: true, - useEslintrc: true - }) - )) - .pipe(lint.format()) - .pipe(gulp.dest(DEST)); -}); - -gulp.task('generate-components-watch', gulp.series('generate-components', function() { - gulp.watch([SRC], gulp.series('generate-components')); -})); diff --git a/build/gulp/generator/gulpfile.js b/build/gulp/generator/gulpfile.js new file mode 100644 index 000000000000..bd339fe4e1ea --- /dev/null +++ b/build/gulp/generator/gulpfile.js @@ -0,0 +1,80 @@ +const gulp = require('gulp'); +const { generateComponents } = require('devextreme-generator/component-compiler'); +const generator = require('devextreme-generator/preact-generator').default; +const ts = require('gulp-typescript'); +const lint = require('gulp-eslint'); +const plumber = require('gulp-plumber'); +const gulpIf = require('gulp-if'); +const merge = require('merge-stream'); +const babel = require('gulp-babel'); + +const SRC = 'js/renovation/**/*.tsx'; +const DEST = 'js/renovation/'; + +const GLOB_TS = require('../ts').GLOB_TS; +const COMMON_SRC = ['js/**/*.*', '!' + GLOB_TS]; + +const knownErrors = [ + 'Cannot find module \'preact\'.', + 'Cannot find module \'preact/hooks\'.' +]; + +gulp.task('generate-components', function() { + const tsProject = ts.createProject('build/gulp/generator/ts-configs/preact.tsconfig.json'); + generator.defaultOptionsModule = 'js/core/options/utils'; + + return gulp.src(SRC) + .pipe(generateComponents(generator)) + .pipe(plumber(()=>null)) + .pipe(tsProject({ + error(e) { + if(!knownErrors.some(i => e.message.endsWith(i))) { + console.log(e.message); + } + }, + finish() {} + })) + .pipe(gulpIf(file => file.extname === '.js', + lint({ + quiet: true, + fix: true, + useEslintrc: true + }) + )) + .pipe(lint.format()) + .pipe(gulp.dest(DEST)); +}); + +function addGenerationTask(approach, knownErrors = []) { + const generator = require(`devextreme-generator/${approach}-generator`).default; + gulp.task(`generate-${approach}`, function() { + const tsProject = ts.createProject(`build/gulp/generator/ts-configs/${approach}.tsconfig.json`); + generator.defaultOptionsModule = 'js/core/options/utils'; + + return merge( + gulp.src(COMMON_SRC), + gulp.src('js/**/*.tsx') + .pipe(generateComponents(generator)) + .pipe(plumber(() => null)) + .pipe(tsProject({ + error(e) { + if(!knownErrors.some(i => e.message.endsWith(i))) { + console.log(e.message); + } + }, + finish() { } + })) + ).pipe(babel()) + .pipe(gulp.dest(`artifacts/${approach}`)); + }); +} + +addGenerationTask('react', ['Cannot find module \'csstype\'.']); +addGenerationTask('angular', [ + 'Cannot find module \'@angular/core\'.', + 'Cannot find module \'@angular/common\'.' +]); + +gulp.task('generate-components-watch', gulp.series('generate-components', function() { + gulp.watch([SRC], gulp.series('generate-components')); +})); diff --git a/build/gulp/generator/ts-configs/angular.tsconfig.json b/build/gulp/generator/ts-configs/angular.tsconfig.json new file mode 100644 index 000000000000..a30645532a74 --- /dev/null +++ b/build/gulp/generator/ts-configs/angular.tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2016", + "module": "ESNext", + "strict": false, + "jsx": "react", + "esModuleInterop": false, + "typeRoots": ["node_modules/@types"], + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true + }, + "exclude": [ + "node_modules" + ] +} diff --git a/build/gulp/preact.tsconfig.json b/build/gulp/generator/ts-configs/preact.tsconfig.json similarity index 100% rename from build/gulp/preact.tsconfig.json rename to build/gulp/generator/ts-configs/preact.tsconfig.json diff --git a/build/gulp/generator/ts-configs/react.tsconfig.json b/build/gulp/generator/ts-configs/react.tsconfig.json new file mode 100644 index 000000000000..4def24ba58c7 --- /dev/null +++ b/build/gulp/generator/ts-configs/react.tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2016", + "module": "ESNext", + "strict": false, + "esModuleInterop": false, + "typeRoots": ["node_modules/@types"], + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true, + "jsx": "react", + "declaration": true + }, + "exclude": [ + "node_modules" + ] +} diff --git a/build/gulp/transpile.js b/build/gulp/transpile.js index 92bf4a24bbb8..1f587953a077 100644 --- a/build/gulp/transpile.js +++ b/build/gulp/transpile.js @@ -8,10 +8,10 @@ const notify = require('gulp-notify'); const context = require('./context.js'); -require('./generator'); +require('./generator/gulpfile'); const GLOB_TS = require('./ts').GLOB_TS; -const SRC = ['js/**/*.*', '!' + GLOB_TS, '!js/**/*.tsx', '!js/component_declaration/*.ts']; +const SRC = ['js/**/*.*', '!' + GLOB_TS, '!js/**/*.tsx']; const TESTS_PATH = 'testing'; const TESTS_SRC = TESTS_PATH + '/**/*.js'; diff --git a/gulpfile.js b/gulpfile.js index 47b947859072..0bb5d29bea1a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,7 +21,7 @@ require('./build/gulp/vendor'); require('./build/gulp/ts'); require('./build/gulp/localization'); require('./build/gulp/style-compiler'); -require('./build/gulp/generator'); +require('./build/gulp/generator/gulpfile'); require('./build/gulp/scss/tasks'); const TEST_CI = Boolean(process.env['DEVEXTREME_TEST_CI']); From b60b112640c1a8883dba0c7ca0497ace05311381 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 10:56:15 +0300 Subject: [PATCH 02/12] import click and hover --- js/renovation/widget.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/renovation/widget.tsx b/js/renovation/widget.tsx index 8bad2433780f..3e7c94232fb9 100644 --- a/js/renovation/widget.tsx +++ b/js/renovation/widget.tsx @@ -11,6 +11,10 @@ import { Ref, Slot, } from 'devextreme-generator/component_declaration/common'; + +import '../events/click'; +import '../events/hover'; + import { active, dxClick, focus, hover, keyboard, resize, visibility } from '../events/short'; import { each } from '../core/utils/iterator'; import { extend } from '../core/utils/extend'; @@ -170,7 +174,7 @@ export default class Widget extends JSXComponent { active.on(this.widgetRef, ({ event }) => { this._active = true; - onActive?.(event); + onActive!(event); }, ({ event }) => { this._active = false; From 01d1b040869acd6e83d856857e40aaee7301e4f3 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 11:05:22 +0300 Subject: [PATCH 03/12] add angular and react apps to playground --- playground/angular/app/app.component.html | 7 +++ playground/angular/app/app.component.ts | 27 +++++++++++ playground/angular/config.js | 56 +++++++++++++++++++++++ playground/angular/index.html | 32 +++++++++++++ playground/react/App.js | 13 ++++++ playground/react/config.js | 38 +++++++++++++++ playground/react/index.html | 26 +++++++++++ playground/react/index.js | 9 ++++ 8 files changed, 208 insertions(+) create mode 100644 playground/angular/app/app.component.html create mode 100644 playground/angular/app/app.component.ts create mode 100644 playground/angular/config.js create mode 100644 playground/angular/index.html create mode 100644 playground/react/App.js create mode 100644 playground/react/config.js create mode 100644 playground/react/index.html create mode 100644 playground/react/index.js diff --git a/playground/angular/app/app.component.html b/playground/angular/app/app.component.html new file mode 100644 index 000000000000..a257b1fb71bd --- /dev/null +++ b/playground/angular/app/app.component.html @@ -0,0 +1,7 @@ + + diff --git a/playground/angular/app/app.component.ts b/playground/angular/app/app.component.ts new file mode 100644 index 000000000000..3ec70bb38012 --- /dev/null +++ b/playground/angular/app/app.component.ts @@ -0,0 +1,27 @@ +import { NgModule, Component } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { DxButtonModule } from 'devextreme/renovation/button'; + +@Component({ + providers: [], + selector: 'demo-app', + styleUrls: [], + templateUrl: './app/app.component.html', +}) +export class AppComponent { + onClick() { + alert('clicked'); + } +} +@NgModule({ + imports: [ + BrowserModule, + DxButtonModule, + ], + declarations: [AppComponent], + bootstrap: [AppComponent], +}) +export class AppModule {} + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/playground/angular/config.js b/playground/angular/config.js new file mode 100644 index 000000000000..1389a22cc5fe --- /dev/null +++ b/playground/angular/config.js @@ -0,0 +1,56 @@ +System.config({ + transpiler: 'ts', + typescriptOptions: { + module: 'commonjs', + emitDecoratorMetadata: true, + experimentalDecorators: true + }, + meta: { + 'typescript': { + 'exports': 'ts' + } + }, + paths: { + 'npm:': 'https://unpkg.com/' + }, + map: { + 'ts': 'npm:plugin-typescript@8.0.0/lib/plugin.js', + 'typescript': 'npm:typescript@3.4.5/lib/typescript.js', + + '@angular/core': 'npm:@angular/core@8.0.0/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common@8.0.0/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler@8.0.0/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser@8.0.0/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@8.0.0/bundles/platform-browser-dynamic.umd.js', + '@angular/router': 'npm:@angular/router@8.0.0/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms@8.0.0/bundles/forms.umd.js', + '@angular/common/http': 'npm:@angular/common@8.0.0/bundles/common-http.umd.js', + 'tslib': 'npm:tslib/tslib.js', + + 'rxjs': 'npm:rxjs@6.3.3', + 'rxjs/operators': 'npm:rxjs@6.3.3/operators', + + 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', + 'quill': 'npm:quill@1.3.6/dist/quill.js', + 'devextreme': '../../artifacts/angular' + }, + packages: { + 'app': { + main: './app.component.ts', + defaultExtension: 'ts' + }, + 'devextreme': { + defaultExtension: 'js', + }, + 'devextreme/events': { + defaultExtension: 'js', + main: 'index.js' + }, + 'devextreme/events/utils': { + defaultExtension: 'js', + main: 'index.js' + }, + 'rxjs': { main: 'index.js', defaultExtension: 'js' }, + 'rxjs/operators': { main: 'index.js', defaultExtension: 'js' }, + } +}); diff --git a/playground/angular/index.html b/playground/angular/index.html new file mode 100644 index 000000000000..ff5488eb409c --- /dev/null +++ b/playground/angular/index.html @@ -0,0 +1,32 @@ + + + + + DevExtreme Demo + + + + + + + + + + + + + + + + + + + +
+ Loading... +
+ + + diff --git a/playground/react/App.js b/playground/react/App.js new file mode 100644 index 000000000000..3f94f2bb8d2f --- /dev/null +++ b/playground/react/App.js @@ -0,0 +1,13 @@ +import React from 'react'; +import Button from 'devextreme/renovation/button'; + +const App = () => { + return ; +}; + +export default App; diff --git a/playground/react/config.js b/playground/react/config.js new file mode 100644 index 000000000000..7e22edd015cb --- /dev/null +++ b/playground/react/config.js @@ -0,0 +1,38 @@ +System.config({ + transpiler: 'plugin-babel', + paths: { + 'npm:': 'https://unpkg.com/' + }, + defaultExtension: 'js', + map: { + 'react': 'npm:react@16/umd/react.development.js', + 'react-dom': 'npm:react-dom@16/umd/react-dom.development.js', + 'prop-types': 'npm:prop-types/prop-types.js', + + 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', + 'quill': 'npm:quill@1.3.6/dist/quill.js', + + // SystemJS plugins + 'plugin-babel': 'npm:systemjs-plugin-babel@0/plugin-babel.js', + 'systemjs-babel-build': 'npm:systemjs-plugin-babel@0/systemjs-babel-browser.js', + 'devextreme': '../../artifacts/react' + }, + packages: { + 'devextreme': { + defaultExtension: 'js', + }, + 'devextreme/events': { + defaultExtension: 'js', + main: 'index.js' + }, + 'devextreme/events/utils': { + defaultExtension: 'js', + main: 'index.js' + } + }, + babelOptions: { + sourceMaps: false, + stage0: true, + react: true + } +}); diff --git a/playground/react/index.html b/playground/react/index.html new file mode 100644 index 000000000000..bb6fbcd1a4d3 --- /dev/null +++ b/playground/react/index.html @@ -0,0 +1,26 @@ + + + + + DevExtreme Demo + + + + + + + + + + + + + +
+
+
+ + + diff --git a/playground/react/index.js b/playground/react/index.js new file mode 100644 index 000000000000..b107ab858276 --- /dev/null +++ b/playground/react/index.js @@ -0,0 +1,9 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; + +import App from './App.js'; + +ReactDOM.render( + , + document.getElementById('app') +); From 22414fc5fec918aee7d0d0e63dc17cc6a1997929 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 15:26:55 +0300 Subject: [PATCH 04/12] add readme and tsconfig --- playground/angular/README.md | 13 +++++ playground/angular/tsconfig.json | 29 +++++++++++ playground/angular/tslint.json | 83 ++++++++++++++++++++++++++++++++ playground/react/README.md | 13 +++++ 4 files changed, 138 insertions(+) create mode 100644 playground/angular/README.md create mode 100644 playground/angular/tsconfig.json create mode 100644 playground/angular/tslint.json create mode 100644 playground/react/README.md diff --git a/playground/angular/README.md b/playground/angular/README.md new file mode 100644 index 000000000000..86ba728e291f --- /dev/null +++ b/playground/angular/README.md @@ -0,0 +1,13 @@ +# README + +## Run Example + +Install packages using the following command: + + npm install + +After instalation generate components and build scripts + + npx gulp generate-angular + +Setup a local web server and run this application in it. diff --git a/playground/angular/tsconfig.json b/playground/angular/tsconfig.json new file mode 100644 index 000000000000..aed9b644f22b --- /dev/null +++ b/playground/angular/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "module": "esnext", + "moduleResolution": "node", + "importHelpers": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "app/**/*.ts" + ], + "angularCompilerOptions": { + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true + } + } diff --git a/playground/angular/tslint.json b/playground/angular/tslint.json new file mode 100644 index 000000000000..2f1da5abad49 --- /dev/null +++ b/playground/angular/tslint.json @@ -0,0 +1,83 @@ +{ + "extends": "tslint:recommended", + "rules": { + "array-type": false, + "arrow-parens": false, + "deprecation": { + "severity": "warning" + }, + "component-class-suffix": true, + "contextual-lifecycle": true, + "directive-class-suffix": true, + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ], + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "interface-name": false, + "max-classes-per-file": false, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-consecutive-blank-lines": false, + "no-empty": false, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-switch-case-fall-through": true, + "no-var-requires": false, + "object-literal-key-quotes": [ + true, + "as-needed" + ], + "object-literal-sort-keys": false, + "ordered-imports": false, + "quotemark": [ + true, + "single" + ], + "trailing-comma": false, + "no-conflicting-lifecycle": true, + "no-host-metadata-property": true, + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "template-banana-in-box": true, + "template-no-negated-async": true, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true + }, + "rulesDirectory": [ + "codelyzer" + ] + } \ No newline at end of file diff --git a/playground/react/README.md b/playground/react/README.md new file mode 100644 index 000000000000..9297faa4d0c8 --- /dev/null +++ b/playground/react/README.md @@ -0,0 +1,13 @@ +# README + +## Run Example + +Install packages using the following command: + + npm install + +After instalation generate components and build scripts + + npx gulp generate-react + +Setup a local web server and run this application in it. From f84acafb9475610b6f6fb36935d794e2277668dd Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 16:01:47 +0300 Subject: [PATCH 05/12] fix support import in pointer module --- js/events/pointer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/events/pointer.js b/js/events/pointer.js index 54e58b03967b..6d4fc9a8d207 100644 --- a/js/events/pointer.js +++ b/js/events/pointer.js @@ -1,4 +1,4 @@ -import support from '../core/utils/support'; +import * as support from '../core/utils/support'; import { each } from '../core/utils/iterator'; import browser from '../core/utils/browser'; import devices from '../core/devices'; From e56f672246a5333889ef4408ac498f7727afd554 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 16:12:41 +0300 Subject: [PATCH 06/12] update generator-version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b07285ecd608..1035d2e003ce 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "cldr-numbers-full": "latest", "cldrjs": "^0.5.0", "del": "^2.2.2", - "devextreme-generator": "^1.0.34", + "devextreme-generator": "^1.0.35", "devextreme-internal-tools": "~1.2.24", "enzyme": "^3.11.0", "enzyme-adapter-preact-pure": "^2.2.0", From f8faebf7204d7eb1bd18f9c31d2433582df2488e Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 16:21:23 +0300 Subject: [PATCH 07/12] rollback extra change --- js/renovation/widget.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/renovation/widget.tsx b/js/renovation/widget.tsx index 3e7c94232fb9..f3cb66b47b3d 100644 --- a/js/renovation/widget.tsx +++ b/js/renovation/widget.tsx @@ -174,7 +174,7 @@ export default class Widget extends JSXComponent { active.on(this.widgetRef, ({ event }) => { this._active = true; - onActive!(event); + onActive?.(event); }, ({ event }) => { this._active = false; From 4faed3fef2abf4e4de81c6d42f59b61750eff7c3 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 18:25:45 +0300 Subject: [PATCH 08/12] rename parameter --- build/gulp/generator/gulpfile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/gulp/generator/gulpfile.js b/build/gulp/generator/gulpfile.js index bd339fe4e1ea..ff523bd2d88b 100644 --- a/build/gulp/generator/gulpfile.js +++ b/build/gulp/generator/gulpfile.js @@ -45,10 +45,10 @@ gulp.task('generate-components', function() { .pipe(gulp.dest(DEST)); }); -function addGenerationTask(approach, knownErrors = []) { - const generator = require(`devextreme-generator/${approach}-generator`).default; - gulp.task(`generate-${approach}`, function() { - const tsProject = ts.createProject(`build/gulp/generator/ts-configs/${approach}.tsconfig.json`); +function addGenerationTask(frameworkName, knownErrors = []) { + const generator = require(`devextreme-generator/${frameworkName}-generator`).default; + gulp.task(`generate-${frameworkName}`, function() { + const tsProject = ts.createProject(`build/gulp/generator/ts-configs/${frameworkName}.tsconfig.json`); generator.defaultOptionsModule = 'js/core/options/utils'; return merge( @@ -65,7 +65,7 @@ function addGenerationTask(approach, knownErrors = []) { finish() { } })) ).pipe(babel()) - .pipe(gulp.dest(`artifacts/${approach}`)); + .pipe(gulp.dest(`artifacts/${frameworkName}`)); }); } From 36db9841e0325f5c1169cd4a4be262bc7ac9faa9 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 18:26:54 +0300 Subject: [PATCH 09/12] extract base tsconfig --- .../generator/ts-configs/angular.tsconfig.json | 13 ++----------- .../generator/ts-configs/preact.tsconfig.json | 16 +++------------- .../generator/ts-configs/react.tsconfig.json | 16 +++------------- build/gulp/generator/ts-configs/tsconfig.json | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 37 deletions(-) create mode 100644 build/gulp/generator/ts-configs/tsconfig.json diff --git a/build/gulp/generator/ts-configs/angular.tsconfig.json b/build/gulp/generator/ts-configs/angular.tsconfig.json index a30645532a74..2dedc812db31 100644 --- a/build/gulp/generator/ts-configs/angular.tsconfig.json +++ b/build/gulp/generator/ts-configs/angular.tsconfig.json @@ -1,15 +1,6 @@ { + "extends": "./tsconfig.json", "compilerOptions": { - "target": "ES2016", - "module": "ESNext", - "strict": false, - "jsx": "react", - "esModuleInterop": false, - "typeRoots": ["node_modules/@types"], - "forceConsistentCasingInFileNames": true, "experimentalDecorators": true - }, - "exclude": [ - "node_modules" - ] + } } diff --git a/build/gulp/generator/ts-configs/preact.tsconfig.json b/build/gulp/generator/ts-configs/preact.tsconfig.json index 6653dc32277d..b21bba7e312f 100644 --- a/build/gulp/generator/ts-configs/preact.tsconfig.json +++ b/build/gulp/generator/ts-configs/preact.tsconfig.json @@ -1,16 +1,6 @@ { + "extends": "./tsconfig.json", "compilerOptions": { - "target": "ES2016", - "module": "ESNext", - "strict": false, - "esModuleInterop": false, - "typeRoots": ["node_modules/@types"], - "forceConsistentCasingInFileNames": true, - "jsx": "react", - "jsxFactory": "Preact.h", - "declaration": true - }, - "exclude": [ - "node_modules" - ] + "jsxFactory": "Preact.h" + } } diff --git a/build/gulp/generator/ts-configs/react.tsconfig.json b/build/gulp/generator/ts-configs/react.tsconfig.json index 4def24ba58c7..08be024c5d52 100644 --- a/build/gulp/generator/ts-configs/react.tsconfig.json +++ b/build/gulp/generator/ts-configs/react.tsconfig.json @@ -1,16 +1,6 @@ { + "extends": "./tsconfig.json", "compilerOptions": { - "target": "ES2016", - "module": "ESNext", - "strict": false, - "esModuleInterop": false, - "typeRoots": ["node_modules/@types"], - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "jsx": "react", - "declaration": true - }, - "exclude": [ - "node_modules" - ] + "allowSyntheticDefaultImports": true + } } diff --git a/build/gulp/generator/ts-configs/tsconfig.json b/build/gulp/generator/ts-configs/tsconfig.json new file mode 100644 index 000000000000..3756fc0f3e89 --- /dev/null +++ b/build/gulp/generator/ts-configs/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2016", + "module": "ESNext", + "strict": false, + "esModuleInterop": false, + "typeRoots": ["node_modules/@types"], + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "declaration": true + }, + "exclude": [ + "node_modules" + ] +} From 3418be5ac45893a3850a38871f5212edf1abf0ca Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 18:44:18 +0300 Subject: [PATCH 10/12] fix remark --- playground/react/App.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playground/react/App.js b/playground/react/App.js index 3f94f2bb8d2f..ffaef5a41ab4 100644 --- a/playground/react/App.js +++ b/playground/react/App.js @@ -3,11 +3,11 @@ import Button from 'devextreme/renovation/button'; const App = () => { return ; + icon="download" + iconPosition="right" + />; }; export default App; From 1d3dddbea6f808596da587b5baffda1246cd9750 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 18:48:09 +0300 Subject: [PATCH 11/12] add eslintignore for react and angular --- playground/.eslintignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 playground/.eslintignore diff --git a/playground/.eslintignore b/playground/.eslintignore new file mode 100644 index 000000000000..fd379999d5ad --- /dev/null +++ b/playground/.eslintignore @@ -0,0 +1,2 @@ +./angular +./react From 16f4e1a2d6470464936c8c58da2c2a2f56f22170 Mon Sep 17 00:00:00 2001 From: roman-simionov Date: Wed, 18 Mar 2020 19:04:47 +0300 Subject: [PATCH 12/12] rework ignoring eslint rules for playground --- playground/.eslintignore | 2 -- playground/angular/config.js | 2 ++ playground/react/App.js | 2 ++ playground/react/config.js | 2 ++ playground/react/index.js | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 playground/.eslintignore diff --git a/playground/.eslintignore b/playground/.eslintignore deleted file mode 100644 index fd379999d5ad..000000000000 --- a/playground/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -./angular -./react diff --git a/playground/angular/config.js b/playground/angular/config.js index 1389a22cc5fe..e83fa630bddc 100644 --- a/playground/angular/config.js +++ b/playground/angular/config.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + System.config({ transpiler: 'ts', typescriptOptions: { diff --git a/playground/react/App.js b/playground/react/App.js index ffaef5a41ab4..aca27defcb34 100644 --- a/playground/react/App.js +++ b/playground/react/App.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + import React from 'react'; import Button from 'devextreme/renovation/button'; diff --git a/playground/react/config.js b/playground/react/config.js index 7e22edd015cb..c5484e502dfe 100644 --- a/playground/react/config.js +++ b/playground/react/config.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + System.config({ transpiler: 'plugin-babel', paths: { diff --git a/playground/react/index.js b/playground/react/index.js index b107ab858276..a340dace3ed7 100644 --- a/playground/react/index.js +++ b/playground/react/index.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + import React from 'react'; import ReactDOM from 'react-dom';