From 239cfd95155bfcc540d2293bca7225f56808e6bf Mon Sep 17 00:00:00 2001 From: Roman Semenov Date: Thu, 18 Jul 2024 19:25:50 +0400 Subject: [PATCH] CI - remove devextreme-main (#27773) --- .github/workflows/default_workflow.yml | 1 - .github/workflows/demos_visual_tests.yml | 4 +- .github/workflows/renovation.yml | 2 +- .github/workflows/testcafe_tests.yml | 2 +- apps/README.md | 18 +++---- apps/demos/project.json | 2 +- e2e/bundlers/package.json | 1 - e2e/compilation-cases/package.json | 1 - e2e/testcafe-devextreme/project.json | 3 -- packages/devextreme-angular/project.json | 3 -- packages/devextreme-react/project.json | 3 -- packages/devextreme-vue/project.json | 3 -- packages/devextreme/.gitignore | 2 - .../artifacts/npm/devextreme/package.json | 53 ------------------- .../artifacts/npm/devextreme/project.json | 17 ------ packages/devextreme/build/gulp/npm.js | 21 ++++++-- packages/devextreme/build/preinstall.js | 23 -------- packages/devextreme/package.json | 9 ++-- packages/devextreme/project.json | 2 +- pnpm-lock.yaml | 43 +-------------- pnpm-workspace.yaml | 2 +- tools/scripts/build-all.ts | 6 +-- 22 files changed, 42 insertions(+), 179 deletions(-) delete mode 100644 packages/devextreme/artifacts/npm/devextreme/package.json delete mode 100644 packages/devextreme/artifacts/npm/devextreme/project.json delete mode 100644 packages/devextreme/build/preinstall.js diff --git a/.github/workflows/default_workflow.yml b/.github/workflows/default_workflow.yml index 6b09f30ec706..0321921f64dd 100644 --- a/.github/workflows/default_workflow.yml +++ b/.github/workflows/default_workflow.yml @@ -64,7 +64,6 @@ jobs: devextreme-react devextreme-vue devextreme-react-storybook - devextreme-main devextreme-angular-playground devextreme-testcafe-tests devextreme-demos diff --git a/.github/workflows/demos_visual_tests.yml b/.github/workflows/demos_visual_tests.yml index 67b334c4dd90..438f48af565f 100644 --- a/.github/workflows/demos_visual_tests.yml +++ b/.github/workflows/demos_visual_tests.yml @@ -57,7 +57,7 @@ jobs: pnpm install - name: DevExtreme - Build - run: pnpx nx build devextreme-main + run: pnpx nx build devextreme testcafe: needs: @@ -115,7 +115,7 @@ jobs: pnpm install - name: DevExtreme - Build - run: pnpx nx build devextreme-main + run: pnpx nx build devextreme - name: Run Web Server run: | diff --git a/.github/workflows/renovation.yml b/.github/workflows/renovation.yml index 602123b25ad5..f2540753a674 100644 --- a/.github/workflows/renovation.yml +++ b/.github/workflows/renovation.yml @@ -56,7 +56,7 @@ jobs: run: pnpx gulp localization - name: Jest tests - run: pnpx nx test-jest devextreme-main + run: pnpx nx test-jest devextreme notify: runs-on: devextreme-shr2 diff --git a/.github/workflows/testcafe_tests.yml b/.github/workflows/testcafe_tests.yml index 4bad9293045d..4511c466443d 100644 --- a/.github/workflows/testcafe_tests.yml +++ b/.github/workflows/testcafe_tests.yml @@ -58,7 +58,7 @@ jobs: pnpm install - name: Build - run: pnpx nx build devextreme-main + run: pnpx nx build devextreme - name: Zip artifacts working-directory: ./packages/devextreme diff --git a/apps/README.md b/apps/README.md index 1ee3a50ef6b0..9646d06d57dc 100644 --- a/apps/README.md +++ b/apps/README.md @@ -8,49 +8,49 @@ To run a playground, clone this repository and follow the instructions below. Before you run a playground, install modules and build the devextreme package. Run the following scripts from the root directory of this repository: ``` -npm install -npm run build -w=devextreme-main +pnpm install +pnpm run build -w=devextreme ``` ## Angular playground > **_NOTE:_** Requires Node v17+ 1. Prepare the devextreme-angular package: ``` -npm run pack -w=devextreme-angular +pnpm run pack -w=devextreme-angular ``` 2. Run the launch script: ``` cd apps/angular -npm run start +pnpm run start ``` ## React playground 1. Prepare the devextreme-react package: ``` -npm run pack -w=devextreme-react +pnpm run pack -w=devextreme-react ``` 2. Run the launch script: ``` cd apps/react -npm run start +pnpm run start ``` ## Vue playground 1. Prepare the devextreme-vue package: ``` -npm run pack -w=devextreme-vue +pnpm run pack -w=devextreme-vue ``` 2. Run the launch script: ``` cd apps/vue -npm run start +pnpm run start ``` ## Update DevExtreme code To observe the changes made to the DevExtreme code within playgrounds, rebuild the `devextreme` package. ``` -npm run build -w=devextreme-main +pnpm run build -w=devextreme ``` If you need your changes to apply dynamically without reloading the playground, save them in the following directory: ``` diff --git a/apps/demos/project.json b/apps/demos/project.json index 8959af6559b6..2b344b37044a 100644 --- a/apps/demos/project.json +++ b/apps/demos/project.json @@ -28,7 +28,7 @@ }, "dependsOn": [ // NOTE: uncomment me when the NX cache is fixed to work in GHA - // "devextreme-main:build" + // "devextreme:build" ], "inputs": [ { "env": "STRATEGY" }, diff --git a/e2e/bundlers/package.json b/e2e/bundlers/package.json index 6f77b1e66fe2..ce27b8cce72f 100644 --- a/e2e/bundlers/package.json +++ b/e2e/bundlers/package.json @@ -18,7 +18,6 @@ "vite": "2.9.18", "webpack": "5.76.0", "webpack-cli": "4.10.0", - "devextreme-main": "*", "devextreme": "*" }, "alias": { diff --git a/e2e/compilation-cases/package.json b/e2e/compilation-cases/package.json index 56ed5d8097e0..22a0c72458a9 100644 --- a/e2e/compilation-cases/package.json +++ b/e2e/compilation-cases/package.json @@ -9,7 +9,6 @@ "devDependencies": { "@angular/common": "^11.2.14", "@types/jquery": "3.5.29", - "devextreme-main": "*", "devextreme": "*", "jquery": "3.7.1", "typescript": "4.9.5" diff --git a/e2e/testcafe-devextreme/project.json b/e2e/testcafe-devextreme/project.json index 67cf3c1e5923..2ab85bebd929 100644 --- a/e2e/testcafe-devextreme/project.json +++ b/e2e/testcafe-devextreme/project.json @@ -3,9 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "e2e/testcafe-devextreme", "projectType": "application", - "implicitDependencies": [ - "devextreme-main" - ], "targets": { "lint": { "executor": "nx:run-script", diff --git a/packages/devextreme-angular/project.json b/packages/devextreme-angular/project.json index 55768d10b40b..7922be2b0707 100644 --- a/packages/devextreme-angular/project.json +++ b/packages/devextreme-angular/project.json @@ -3,9 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/devextreme-angular", "projectType": "library", - "implicitDependencies": [ - "devextreme-main" - ], "targets": { "build": { "executor": "nx:run-script", diff --git a/packages/devextreme-react/project.json b/packages/devextreme-react/project.json index 5db51b4b1c92..630ee7b22b8c 100644 --- a/packages/devextreme-react/project.json +++ b/packages/devextreme-react/project.json @@ -3,9 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/devextreme-react", "projectType": "library", - "implicitDependencies": [ - "devextreme-main" - ], "targets": { "pack": { "executor": "nx:run-script", diff --git a/packages/devextreme-vue/project.json b/packages/devextreme-vue/project.json index 04e86a7f6cfe..beb14247352a 100644 --- a/packages/devextreme-vue/project.json +++ b/packages/devextreme-vue/project.json @@ -3,9 +3,6 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/devextreme-vue", "projectType": "library", - "implicitDependencies": [ - "devextreme-main" - ], "targets": { "pack": { "executor": "nx:run-script", diff --git a/packages/devextreme/.gitignore b/packages/devextreme/.gitignore index 1eca05a9422f..c5b940a2af46 100644 --- a/packages/devextreme/.gitignore +++ b/packages/devextreme/.gitignore @@ -1,7 +1,5 @@ node_modules /artifacts -!/artifacts/npm/devextreme/package.json -!/artifacts/npm/devextreme/project.json !/artifacts/npm/devextreme-dist/package.json /testing/testcafe/artifacts /testing/LastSuiteTime.txt diff --git a/packages/devextreme/artifacts/npm/devextreme/package.json b/packages/devextreme/artifacts/npm/devextreme/package.json deleted file mode 100644 index ed2095c32406..000000000000 --- a/packages/devextreme/artifacts/npm/devextreme/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "devextreme", - "version": "24.2.0", - "description": "HTML5 JavaScript Component Suite for Responsive Web Development", - "keywords": [ - "html5", - "controls", - "widgets", - "components", - "jquery", - "knockout", - "angular", - "web", - "ui", - "datagrid", - "pivotgrid", - "scheduler", - "treelist", - "chart" - ], - "homepage": "https://js.devexpress.com/", - "bugs": "https://www.devexpress.com/support/", - "author": "Developer Express Inc.", - "repository": { - "type": "git", - "url": "https://github.com/DevExpress/DevExtreme.git" - }, - "types": "./bundles/dx.all.d.ts", - "license": "SEE LICENSE IN README.md", - "dependencies": { - "@babel/runtime": "^7.12.1", - "@devextreme/runtime": "3.0.13", - "devexpress-diagram": "2.2.10", - "devexpress-gantt": "4.1.56", - "devextreme-quill": "1.7.1", - "inferno": "^7.4.9", - "inferno-hydrate": "^7.4.9", - "jszip": "^3.10.1", - "rrule": "^2.7.1", - "showdown": "^2.1.0", - "turndown": "~7.1.0" - }, - "browserslist": [ - "last 2 versions", - "ios > 9", - "> 1%", - "not dead" - ], - "bin": { - "devextreme-bundler-init": "bin/bundler-init.js", - "devextreme-bundler": "bin/bundler.js" - } -} \ No newline at end of file diff --git a/packages/devextreme/artifacts/npm/devextreme/project.json b/packages/devextreme/artifacts/npm/devextreme/project.json deleted file mode 100644 index e7560e3017f1..000000000000 --- a/packages/devextreme/artifacts/npm/devextreme/project.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "devextreme", - "sourceRoot": "packages/devextreme/artifacts/npm/devextreme", - "projectType": "library", - "implicitDependencies": [ - "devextreme-main" - ], - "targets": { - "build": { - "executor": "nx:run-commands", - "options": { - "command": "echo START BUILDING" - } - } - }, - "tags": [] -} diff --git a/packages/devextreme/build/gulp/npm.js b/packages/devextreme/build/gulp/npm.js index 6be663a76023..0920280aeeac 100644 --- a/packages/devextreme/build/gulp/npm.js +++ b/packages/devextreme/build/gulp/npm.js @@ -6,6 +6,7 @@ const eol = require('gulp-eol'); const gulp = require('gulp'); const gulpIf = require('gulp-if'); const merge = require('merge-stream'); +const through = require('through2'); const replace = require('gulp-replace'); const lazyPipe = require('lazypipe'); const gulpFilter = require('gulp-filter'); @@ -16,7 +17,7 @@ const ctx = require('./context.js'); const env = require('./env-variables.js'); const dataUri = require('./gulp-data-uri').gulpPipe; const headerPipes = require('./header-pipes.js'); -const { packageDir, packageDistDir, isEsmPackage, stringSrc, devextremeDir, devextremeDistDir } = require('./utils'); +const { packageDir, packageDistDir, isEsmPackage, stringSrc, devextremeDistDir } = require('./utils'); const resultPath = ctx.RESULT_NPM_PATH; @@ -115,7 +116,20 @@ const sources = (src, dist, distGlob) => (() => merge( .pipe(gulp.dest(`${dist}/bin`)), gulp - .src(`${dist}/package.json`) + .src('package.json') + .pipe( + through.obj((file, enc, callback) => { + const pkg = JSON.parse(file.contents.toString(enc)); + + pkg.name = 'devextreme'; + pkg.version = ctx.version; + delete pkg.devDependencies; + delete pkg.publishConfig; + + file.contents = Buffer.from(JSON.stringify(pkg, null, 2)); + callback(null, file); + }) + ) .pipe(gulpIf(env.BUILD_INTERNAL_PACKAGE, overwriteInternalPackageName())) .pipe(gulp.dest(dist)), @@ -136,9 +150,6 @@ const distPath = `${resultPath}/${packageDistDir}`; gulp.task('npm-sources', gulp.series( 'ts-sources', - () => gulp - .src(`${resultPath}/${devextremeDir}/package.json`) - .pipe(gulpIf(env.BUILD_INTERNAL_PACKAGE, gulp.dest(packagePath))), () => gulp .src(`${resultPath}/${devextremeDistDir}/package.json`) .pipe(overwriteInternalPackageName()) diff --git a/packages/devextreme/build/preinstall.js b/packages/devextreme/build/preinstall.js deleted file mode 100644 index 0e1d40469ae0..000000000000 --- a/packages/devextreme/build/preinstall.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); - -const pkg = require('../package.json'); - -const generateProdPackageFile = (sourcePkg) => { - const packagePath = path.resolve('./artifacts/npm/devextreme/package.json'); - - sourcePkg.name = 'devextreme'; - sourcePkg.bin = { - 'devextreme-bundler-init': 'bin/bundler-init.js', - 'devextreme-bundler': 'bin/bundler.js' - }; - - delete sourcePkg.devDependencies; - delete sourcePkg.scripts; - - fs.writeFileSync(packagePath, Buffer.from(JSON.stringify(sourcePkg, null, 2))); -}; - -generateProdPackageFile(pkg); diff --git a/packages/devextreme/package.json b/packages/devextreme/package.json index 0d7295c44aab..c1f368150e32 100644 --- a/packages/devextreme/package.json +++ b/packages/devextreme/package.json @@ -1,5 +1,5 @@ { - "name": "devextreme-main", + "name": "devextreme", "version": "24.2.0", "description": "HTML5 JavaScript Component Suite for Responsive Web Development", "keywords": [ @@ -184,7 +184,6 @@ "yargs": "17.7.2" }, "scripts": { - "preinstall": "node build/preinstall.js", "clean": "gulp clean", "lint": "npm-run-all -p -c lint-js lint-ts lint-renovation lint-dts lint-texts", "lint-js": "eslint --quiet --ext .js .", @@ -228,5 +227,9 @@ "ios > 9", "> 1%", "not dead" - ] + ], + "publishConfig": { + "directory": "artifacts/npm/devextreme", + "linkDirectory": true + } } diff --git a/packages/devextreme/project.json b/packages/devextreme/project.json index 8c5a51aa5ad7..4b91a30e1b6a 100644 --- a/packages/devextreme/project.json +++ b/packages/devextreme/project.json @@ -1,5 +1,5 @@ { - "name": "devextreme-main", + "name": "devextreme", "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/devextreme", "projectType": "library", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf670c03a446..a10451d7534b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -697,9 +697,6 @@ importers: devextreme-cldr-data: specifier: 1.0.3 version: 1.0.3 - devextreme-main: - specifier: '*' - version: link:../../packages/devextreme globalize: specifier: 1.7.0 version: 1.7.0 @@ -739,9 +736,6 @@ importers: devextreme: specifier: '*' version: link:../../packages/devextreme/artifacts/npm/devextreme - devextreme-main: - specifier: '*' - version: link:../../packages/devextreme jquery: specifier: 3.7.1 version: 3.7.1 @@ -1241,6 +1235,7 @@ importers: yargs: specifier: 17.7.2 version: 17.7.2 + publishDirectory: artifacts/npm/devextreme packages/devextreme-angular: dependencies: @@ -1648,42 +1643,6 @@ importers: version: 4.2.5(vue@3.2.47) publishDirectory: npm - packages/devextreme/artifacts/npm/devextreme: - dependencies: - '@babel/runtime': - specifier: ^7.12.1 - version: 7.24.5 - '@devextreme/runtime': - specifier: 3.0.13 - version: 3.0.13 - devexpress-diagram: - specifier: 2.2.10 - version: 2.2.10 - devexpress-gantt: - specifier: 4.1.56 - version: 4.1.56 - devextreme-quill: - specifier: 1.7.1 - version: 1.7.1 - inferno: - specifier: ^7.4.9 - version: 7.4.11 - inferno-hydrate: - specifier: ^7.4.9 - version: 7.4.11 - jszip: - specifier: ^3.10.1 - version: 3.10.1 - rrule: - specifier: ^2.7.1 - version: 2.8.1 - showdown: - specifier: ^2.1.0 - version: 2.1.0 - turndown: - specifier: ~7.1.0 - version: 7.1.3 - packages/devextreme/artifacts/npm/devextreme-dist: {} packages/testcafe-models: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a6abacd630f1..f8f60f472e33 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,4 +2,4 @@ packages: - 'apps/*' - 'e2e/*' - 'packages/*' - - 'packages/devextreme/artifacts/npm/*' + - 'packages/devextreme/artifacts/npm/devextreme-dist' diff --git a/tools/scripts/build-all.ts b/tools/scripts/build-all.ts index 82ed26e0627a..fd8e5b4261ac 100644 --- a/tools/scripts/build-all.ts +++ b/tools/scripts/build-all.ts @@ -53,10 +53,10 @@ if (!devMode) { } if (devMode) { - sh.exec('pnpx nx build devextreme-main'); + sh.exec('pnpx nx build devextreme'); } else { sh.exec('npm run build -w devextreme-scss', sh); - sh.exec('pnpx nx build-dist devextreme-main --skipNxCache', { + sh.exec('pnpx nx build-dist devextreme --skipNxCache', { env: { ...sh.env, BUILD_INTERNAL_PACKAGE: 'false' @@ -100,7 +100,7 @@ sh.cp(path.join(ROOT_DIR, 'packages', 'devextreme-react', 'npm', '*.tgz'), NPM_D sh.cp(path.join(ROOT_DIR, 'packages', 'devextreme-vue', 'npm', '*.tgz'), NPM_DIR); if (sh.env.BUILD_INTERNAL_PACKAGE === 'true') { - sh.exec('pnpx nx build-dist devextreme-main'); + sh.exec('pnpx nx build-dist devextreme'); sh.pushd(path.join(DEVEXTREME_NPM_DIR, 'devextreme-internal')); sh.exec(`pnpm pkg set version="${devextremeNpmVersion}"`);