Skip to content

Commit

Permalink
Merge branch 'master' of ~/WebstormProjects/tmp/devextreme-react into…
Browse files Browse the repository at this point in the history
… 23_2
  • Loading branch information
Alexander Bulychev committed Aug 15, 2023
2 parents e9be45c + 0a36d0f commit dc5ca1f
Show file tree
Hide file tree
Showing 77 changed files with 38,441 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/devextreme-react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
npm/
src/*
!src/core
src/index.ts
18 changes: 18 additions & 0 deletions packages/devextreme-react/build.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

module.exports = {
src: './src/**/*.{ts,tsx}',
testSrc: './src/**/__tests__/*.*',
npm: {
dist: './npm/',
package: 'package.json',
license: '../../LICENSE',
readme: '../../README.md'
},
metadataPath: './metadata/integration-data.json',
generatedComponentsDir: './src',
coreComponentsDir: './src/core',
indexFileName: './src/index.ts',
baseComponent: './core/component',
extensionComponent: './core/extension-component',
configComponent: './core/nested-option'
}
122 changes: 122 additions & 0 deletions packages/devextreme-react/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
const mkdir = require('mkdirp');
const fs = require('fs');
const del = require('del');

const gulp = require('gulp');
const shell = require('gulp-shell');
const header = require('gulp-header');
const ts = require('gulp-typescript');

const config = require('./build.config');

const generateSync = require('devextreme-react-generator').default;

const GENERATE = 'generate';
const CLEAN = 'clean';

const GEN_RUN = 'generator.run';

const NPM_CLEAN = 'npm.clean';
const NPM_PACKAGE = 'npm.package';
const NPM_LICENSE = 'npm.license';
const NPM_BUILD_WITH_HEADERS = 'npm.license-headers';
const NPM_README = 'npm.readme';
const NPM_BUILD = 'npm.build';
const NPM_PACK = 'npm.pack';

gulp.task(CLEAN, (c) =>
del([`${config.generatedComponentsDir}\\*`, `!${config.coreComponentsDir}`], c)
);

gulp.task(GEN_RUN, (done) => {
generateSync({
metaData: JSON.parse(fs.readFileSync(config.metadataPath).toString()),
components: {
baseComponent: config.baseComponent,
extensionComponent: config.extensionComponent,
configComponent: config.configComponent
},
out: {
componentsDir: config.generatedComponentsDir,
indexFileName: config.indexFileName
},
widgetsPackage: 'devextreme',
typeGenerationOptions: {
generateReexports: true,
generateCustomTypes: true,
},
});

done();
});

gulp.task(GENERATE, gulp.series(
CLEAN,
GEN_RUN
));

gulp.task(NPM_CLEAN, (c) =>
del(config.npm.dist, c)
);

gulp.task(NPM_PACKAGE, gulp.series(
() => gulp.src(config.npm.package).pipe(gulp.dest(config.npm.dist))
));

gulp.task(NPM_LICENSE, gulp.series(
() => gulp.src(config.npm.license).pipe(gulp.dest(config.npm.dist))
));

gulp.task(NPM_README, gulp.series(
() => gulp.src(config.npm.readme).pipe(gulp.dest(config.npm.dist))
));

gulp.task(NPM_BUILD, gulp.series(
NPM_CLEAN,
gulp.parallel(NPM_LICENSE, NPM_PACKAGE, NPM_README),
GENERATE,
() => gulp.src([
config.src,
`!${config.testSrc}`
])
.pipe(ts('tsconfig.json'))
.pipe(gulp.dest(config.npm.dist))
));

gulp.task(NPM_BUILD_WITH_HEADERS, gulp.series(
NPM_BUILD,
() => {
const pkg = require('./package.json');
const now = new Date();
const data = {
pkg,
date: now.toDateString(),
year: now.getFullYear()
};

const banner = [
'/*!',
' * <%= pkg.name %>',
' * Version: <%= pkg.version %>',
' * Build date: <%= date %>',
' *',
' * Copyright (c) 2012 - <%= year %> Developer Express Inc. ALL RIGHTS RESERVED',
' *',
' * This software may be modified and distributed under the terms',
' * of the MIT license. See the LICENSE file in the root of the project for details.',
' *',
' * https://github.com/DevExpress/devextreme-react',
' */',
'\n'
].join('\n');

return gulp.src(`${config.npm.dist}**/*.{ts,js}`)
.pipe(header(banner, data))
.pipe(gulp.dest(config.npm.dist));
}
));

gulp.task(NPM_PACK, gulp.series(
NPM_BUILD_WITH_HEADERS,
shell.task(['npm pack'], { cwd: config.npm.dist })
));
10 changes: 10 additions & 0 deletions packages/devextreme-react/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const base = require('../../jest.config.base.js');
const pack = require('./package');

const packageName = pack.name;

module.exports = {
...base,
name: packageName,
displayName: packageName,
};
50 changes: 50 additions & 0 deletions packages/devextreme-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"author": "Developer Express Inc.",
"name": "devextreme-react",
"version": "23.2.0",
"description": "DevExtreme React UI and Visualization Components",
"repository": {
"type": "git",
"url": "https://github.com/DevExpress/devextreme-react.git"
},
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"clean": "gulp clean",
"build": "npm run clean && gulp generate",
"pack": "npm run clean && gulp npm.pack",
"test": "npm run build && jest"
},
"keywords": [
"react",
"devextreme",
"devexpress"
],
"license": "MIT",
"peerDependencies": {
"devextreme": "23.2-next",
"react": "^16.2.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.2.0 || ^17.0.0 || ^18.0.0"
},
"dependencies": {
"prop-types": "^15.8.1"
},
"devDependencies": {
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.0.1",
"@types/jest": "^22.2.3",
"@types/react": "^16.14.28",
"@types/react-dom": "^16.9.16",
"del": "^3.0.0",
"devextreme-react-generator": "^4.1.3",
"gulp": "^4.0.2",
"gulp-header": "^2.0.9",
"gulp-shell": "^0.8.0",
"gulp-typescript": "^5.0.1",
"jest": "^25.0.0",
"react": "~18.0.0",
"react-dom": "~18.0.0",
"ts-jest": "^25.5.1",
"typescript": "~4.2"
}
}
Loading

0 comments on commit dc5ca1f

Please sign in to comment.