Skip to content

Commit

Permalink
Monorepo - move out bundlers e2e (#27104)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomahtri authored Jun 17, 2024
1 parent 935aa33 commit 2cbd805
Show file tree
Hide file tree
Showing 17 changed files with 4,527 additions and 12,941 deletions.
135 changes: 0 additions & 135 deletions .github/workflows/devextreme_npm_tests.yml

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions e2e/bundlers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist
/entry
/devextreme*
/.parcel-cache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');

const modulesMetadataFilePath = path.join(__dirname, '../../build/gulp/modules_metadata.json');
const modulesMetadataFilePath = path.join(__dirname, '../../packages/devextreme/build/gulp/modules_metadata.json');

const filePaths = {
cjs: path.join(__dirname, './entry/modules_cjs.js'),
Expand Down
28 changes: 28 additions & 0 deletions e2e/bundlers/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "devextreme-modules-test",
"version": "1.0.0",
"devDependencies": {
"@rollup/plugin-alias": "3.1.9",
"@rollup/plugin-commonjs": "19.0.2",
"@rollup/plugin-node-resolve": "13.3.0",
"browserify": "17.0.0",
"cross-env": "7.0.3",
"devextreme-cldr-data": "1.0.3",
"globalize": "1.7.0",
"jquery": "3.7.1",
"minimist": "1.2.8",
"parcel": "2.11.0",
"rimraf": "3.0.2",
"rollup": "2.79.1",
"vite": "2.9.18",
"webpack": "5.76.0",
"webpack-cli": "4.10.0",
"devextreme-main": "*"
},
"alias": {
"globalize$": "../../node_modules/globalize/dist/globalize.js",
"globalize": "../../node_modules/globalize/dist/globalize",
"cldr$": "../../node_modules/cldrjs/dist/cldr.js",
"cldr": "../../node_modules/cldrjs/dist/cldr"
}
}
75 changes: 75 additions & 0 deletions e2e/bundlers/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "devextreme-modules-test",
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "rimraf entry && mkdir entry && node ./generate_entry_files.js"
},
"outputs": [
"{projectRoot}/entry"
]
},
"test": {
"executor": "nx:noop",
"dependsOn": [
"build",
"test--webpack-cjs",
"test--webpack",
"test--rollup",
"test--parcel",
"test--browserify-cjs",
"test--vite"
]
},
"test--webpack-cjs": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "webpack --config ./webpack.config.cjs.js"
},
"dependsOn": ["build"]
},
"test--webpack": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "webpack --config ./webpack.config.js"
},
"dependsOn": ["build"]
},
"test--rollup": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "rollup -c"
},
"dependsOn": ["build"]
},
"test--parcel": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "parcel build ./entry/modules_esm.js --no-cache --dist-dir ./dist/dist_parsel"
},
"dependsOn": ["build"]
},
"test--browserify-cjs": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "cross-env NODE_PATH=./node_modules:./node_modules/globalize/dist browserify ./entry/modules_cjs.js -o ./dist/dist_browserify/bundle_cjs.js"
},
"dependsOn": ["build"]
},
"test--vite": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "vite build"
},
"dependsOn": ["build"]
}
}
}
37 changes: 37 additions & 0 deletions e2e/bundlers/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import path from 'path';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonJs from '@rollup/plugin-commonjs';
import alias from '@rollup/plugin-alias';

export default {
input: './entry/modules_esm.js',
output: {
file: './dist/dist_rollup/bundle_esm.js',
format: 'es'
},
external: [ 'rrule'],
plugins: [
alias({
globalize$: path.join(__dirname, '../../node_modules/globalize/dist/globalize.js'),
globalize: path.join(__dirname, '../../node_modules/globalize/dist/globalize'),
cldr$: path.join(__dirname, '../../node_modules/cldrjs/dist/cldr.js'),
cldr: path.join(__dirname, '../../node_modules/cldrjs/dist/cldr')
}),
nodeResolve(),
commonJs({
include: [
'../../node_modules/devexpress-gantt/**',
'../../node_modules/devexpress-diagram/**',
'../../node_modules/devextreme-quill/**',
'../../node_modules/globalize/**',
'../../node_modules/luxon/**',
'../../node_modules/jquery/dist/jquery.js',
'../../node_modules/jszip/**',
'../../node_modules/rxjs/**'
],
dynamicRequireTargets: [
'../../node_modules/jszip/lib/utils.js'
]
})
]
};
File renamed without changes.
21 changes: 21 additions & 0 deletions e2e/bundlers/webpack.config.cjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');

module.exports = {
mode: 'development',
entry: path.resolve(__dirname, './entry/modules_cjs.js'),
output: {
filename: 'bundle_cjs.js',
path: path.resolve(__dirname, './dist/dist_webpack/'),
},
resolve: {
alias: {
globalize$: path.resolve(__dirname, '../../node_modules/globalize/dist/globalize.js'),
globalize: path.resolve(__dirname, '../../node_modules/globalize/dist/globalize'),
cldr$: path.resolve(__dirname, '../../node_modules/cldrjs/dist/cldr.js'),
cldr: path.resolve(__dirname, '../../node_modules/cldrjs/dist/cldr')
},
},
stats: {
errorDetails: true
}
};
21 changes: 21 additions & 0 deletions e2e/bundlers/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');

module.exports = {
mode: 'development',
entry: path.resolve(__dirname, './entry/modules_esm.js'),
output: {
filename: 'bundle_esm.js',
path: path.resolve(__dirname, './dist/dist_webpack/'),
},
resolve: {
alias: {
globalize$: path.resolve(__dirname, '../../node_modules/globalize/dist/globalize.js'),
globalize: path.resolve(__dirname, '../../node_modules/globalize/dist/globalize'),
cldr$: path.resolve(__dirname, '../../node_modules/cldrjs/dist/cldr.js'),
cldr: path.resolve(__dirname, '../../node_modules/cldrjs/dist/cldr')
},
},
stats: {
errorDetails: true
}
};
Loading

0 comments on commit 2cbd805

Please sign in to comment.