diff --git a/build/gulp/bundler-config.js b/build/gulp/bundler-config.js index 7477b84f19b7..cdb50521a756 100644 --- a/build/gulp/bundler-config.js +++ b/build/gulp/bundler-config.js @@ -31,7 +31,7 @@ gulp.task('bundler-config', function() { .pipe(gulp.dest('js/bundles')) .pipe(rename('dx.custom.config.js')) .pipe(replace(/require *\( *["']..\//g, 'require("devextreme/')) - .pipe(gulp.dest(context.RESULT_NPM_PATH + '/bundles')); + .pipe(gulp.dest(context.RESULT_NPM_PATH + '/devextreme/bundles')); }); gulp.task('bundler-config-dev', function() { diff --git a/build/gulp/context.js b/build/gulp/context.js index c2794ff470a9..d7dd7c087e08 100644 --- a/build/gulp/context.js +++ b/build/gulp/context.js @@ -58,7 +58,6 @@ module.exports = { uglify: argv.uglify, RESULT_JS_PATH: 'artifacts/js', RESULT_NPM_PATH: 'artifacts/npm', - RESULT_THEMEBUILDER_NPM_PATH: 'artifacts/themebuilder-npm', TRANSPILED_PATH: 'artifacts/transpiled', EULA_URL: 'https://js.devexpress.com/Licensing/' }; diff --git a/build/gulp/npm.js b/build/gulp/npm.js index 7f25c4751861..8276b505986b 100644 --- a/build/gulp/npm.js +++ b/build/gulp/npm.js @@ -14,6 +14,7 @@ var context = require('./context.js'); var headerPipes = require('./header-pipes.js'); var compressionPipes = require('./compression-pipes.js'); var version = require('../../package.json').version; +var packagePath = context.RESULT_NPM_PATH + '/devextreme'; var TRANSPILED_GLOBS = [ context.TRANSPILED_PATH + '/**/*.js', @@ -76,27 +77,27 @@ gulp.task('npm-sources', ['npm-dts-generator'], function() { .pipe(addDefaultExport()) .pipe(headerPipes.starLicense()) .pipe(compressionPipes.beautify()) - .pipe(gulp.dest(context.RESULT_NPM_PATH)), + .pipe(gulp.dest(packagePath)), gulp.src(JSON_GLOBS) - .pipe(gulp.dest(context.RESULT_NPM_PATH)), + .pipe(gulp.dest(packagePath)), gulp.src('build/npm-bin/*.js') .pipe(eol('\n')) - .pipe(gulp.dest(context.RESULT_NPM_PATH + '/bin')), + .pipe(gulp.dest(packagePath + '/bin')), gulp.src('webpack.config.js') - .pipe(gulp.dest(context.RESULT_NPM_PATH + '/bin')), + .pipe(gulp.dest(packagePath + '/bin')), gulp.src('package.json') .pipe(replace(version, context.version.package)) - .pipe(gulp.dest(context.RESULT_NPM_PATH)), + .pipe(gulp.dest(packagePath)), gulp.src(DIST_GLOBS) - .pipe(gulp.dest(context.RESULT_NPM_PATH + '/dist')), + .pipe(gulp.dest(packagePath + '/dist')), gulp.src('README.md') - .pipe(gulp.dest(context.RESULT_NPM_PATH)) + .pipe(gulp.dest(packagePath)) ); }); @@ -165,11 +166,11 @@ gulp.task('npm-dts-generator', function() { .pipe(replace(/\/\*\s*#EndGlobalDeclaration\s*\*\//g, '}')) .pipe(replace(/\/\*\s*#StartJQueryAugmentation\s*\*\/[\s\S]*\/\*\s*#EndJQueryAugmentation\s*\*\//g, '')) .pipe(footer('\nexport default DevExpress;')) - .pipe(gulp.dest(path.join(context.RESULT_NPM_PATH, 'bundles'))), + .pipe(gulp.dest(path.join(packagePath, 'bundles'))), merge.apply(merge, tsModules) .pipe(headerPipes.starLicense()) - .pipe(gulp.dest(context.RESULT_NPM_PATH)) + .pipe(gulp.dest(packagePath)) ); }); @@ -177,7 +178,7 @@ gulp.task('npm-dts-check', ['npm-dts-generator'], function() { var content = 'import $ from \'jquery\';\n'; content += MODULES.map(function(moduleMeta) { - var modulePath = '\'./npm/' + moduleMeta.name + '\''; + var modulePath = '\'./npm/devextreme/' + moduleMeta.name + '\''; if(!moduleMeta.exports) { return 'import ' + modulePath + ';'; } diff --git a/build/gulp/themebuilder-npm.js b/build/gulp/themebuilder-npm.js index a02265d1acf3..f9d351e5dade 100644 --- a/build/gulp/themebuilder-npm.js +++ b/build/gulp/themebuilder-npm.js @@ -1,25 +1,37 @@ const gulp = require('gulp'); +const babel = require('gulp-babel'); const replace = require('gulp-replace'); const merge = require('merge-stream'); const context = require('./context.js'); const version = require('../../themebuilder/package.json').version; +const packagePath = context.RESULT_NPM_PATH + '/devextreme-themebuilder'; -const SCRIPTS = [ +const ASSETS = [ 'themebuilder/**/*.*', + '!themebuilder/modules/*.js', '!themebuilder/tests/**/*.*', '!themebuilder/node_modules/**/*', '!themebuilder/.npmignore', '!themebuilder/cli/.eslintrc', - '!themebuilder/package.json' + '!themebuilder/package.json', + '!themebuilder/package-lock.json' +]; + +const SCRIPTS = [ + 'themebuilder/modules/*.js' ]; gulp.task('themebuilder-npm', () => { return merge( + gulp.src(ASSETS) + .pipe(gulp.dest(packagePath)), + gulp.src(SCRIPTS) - .pipe(gulp.dest(context.RESULT_THEMEBUILDER_NPM_PATH)), + .pipe(babel()) + .pipe(gulp.dest(packagePath + '/modules')), gulp.src('themebuilder/package.json') .pipe(replace(version, context.version.package)) - .pipe(gulp.dest(context.RESULT_THEMEBUILDER_NPM_PATH)) + .pipe(gulp.dest(packagePath)) ); });