From 6fd18b61c3f7cb69902776a25019f480a62e5067 Mon Sep 17 00:00:00 2001 From: volvl Date: Thu, 13 Jun 2024 14:30:48 +0400 Subject: [PATCH 1/6] Disable ssr prompt (#891) * Disable ssr prompt * Small refactoring --- packages/devextreme-cli/src/applications/application.angular.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devextreme-cli/src/applications/application.angular.js b/packages/devextreme-cli/src/applications/application.angular.js index 48d762f70..59dd0fc7e 100644 --- a/packages/devextreme-cli/src/applications/application.angular.js +++ b/packages/devextreme-cli/src/applications/application.angular.js @@ -88,7 +88,7 @@ const create = async(appName, options) => { ]; if(ngCliWithStandalone.compare(currentNgVersion) <= 0) { - commandArguments.push('--standalone=false'); + commandArguments.push('--standalone=false', '--ssr=false'); } await runNgCommand(commandArguments, options); From 017bebb92fc039ff6a327601fa929cfeb18e59fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 01:07:28 +0000 Subject: [PATCH 2/6] fix(deps): update dependency sass to ^1.77.6 (#883) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/devextreme-cli/package-lock.json | 15 ++++++++------- packages/devextreme-cli/package.json | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/devextreme-cli/package-lock.json b/packages/devextreme-cli/package-lock.json index 64e6e790c..59ecf790f 100644 --- a/packages/devextreme-cli/package-lock.json +++ b/packages/devextreme-cli/package-lock.json @@ -15,7 +15,7 @@ "minimist": "^1.2.8", "mustache": "^3.2.1", "prompts": "^2.4.2", - "sass": "^1.71.0", + "sass": "^1.77.6", "semver": "^5.7.2", "strip-bom": "^4.0.0" }, @@ -7573,9 +7573,10 @@ } }, "node_modules/sass": { - "version": "1.71.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.0.tgz", - "integrity": "sha512-HKKIKf49Vkxlrav3F/w6qRuPcmImGVbIXJ2I3Kg0VMA+3Bav+8yE9G5XmP5lMj6nl4OlqbPftGAscNaNu28b8w==", + "version": "1.77.6", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.6.tgz", + "integrity": "sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==", + "license": "MIT", "dependencies": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -14104,9 +14105,9 @@ } }, "sass": { - "version": "1.71.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.0.tgz", - "integrity": "sha512-HKKIKf49Vkxlrav3F/w6qRuPcmImGVbIXJ2I3Kg0VMA+3Bav+8yE9G5XmP5lMj6nl4OlqbPftGAscNaNu28b8w==", + "version": "1.77.6", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.6.tgz", + "integrity": "sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==", "requires": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", diff --git a/packages/devextreme-cli/package.json b/packages/devextreme-cli/package.json index 7bd1b0844..e23c55548 100644 --- a/packages/devextreme-cli/package.json +++ b/packages/devextreme-cli/package.json @@ -43,7 +43,7 @@ "minimist": "^1.2.8", "mustache": "^3.2.1", "prompts": "^2.4.2", - "sass": "^1.71.0", + "sass": "^1.77.6", "semver": "^5.7.2", "strip-bom": "^4.0.0" }, From 3469829e32c7aaf4c077536b040705822cec77a3 Mon Sep 17 00:00:00 2001 From: Vasily Strelyaev Date: Wed, 19 Jun 2024 10:18:31 +0300 Subject: [PATCH 3/6] use internal DevExtreme module for screenshot tests (#885) --- .github/workflows/applications.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/applications.yml b/.github/workflows/applications.yml index 14e161cba..b62bb2d2e 100644 --- a/.github/workflows/applications.yml +++ b/.github/workflows/applications.yml @@ -53,6 +53,11 @@ jobs: run: npm run create-template -- -- -e ${{ matrix.APPROACH }} ${{ env.TOOLING_VERSION_PARAM }} timeout-minutes: 30 + - name: Install Internal Packages + uses: DevExpress/github-actions/install-internal-package@main + with: + working-directory: packages/devextreme-cli/testing/sandbox/${{ matrix.APPROACH }}/my-app + - name: Lint created application if: ${{ matrix.OS != 'windows-latest' }} run: npm run lint-template -- -- -e ${{ matrix.APPROACH }} ${{ env.TOOLING_VERSION_PARAM }} From ede33a6c95aaa891392146aea2b8bde0d049c72e Mon Sep 17 00:00:00 2001 From: Roch Nicolas <89575880+tomodasheesh@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:24:30 +0800 Subject: [PATCH 4/6] Update CLI to use version 24.1 (#893) --- .../src/applications/application.angular.js | 3 ++- .../side-navigation-menu/SideNavigationMenu.tsx | 6 +++--- .../templates/react/application/src/index.tsx | 16 ++++++++++++++++ .../side-nav-inner-toolbar.tsx | 6 +++--- .../side-nav-outer-toolbar.tsx | 6 +++--- .../src/utility/latest-versions.js | 6 +++--- .../devextreme-cli/src/utility/ng-version.js | 2 +- .../src/add-app-template/schema.json | 2 +- .../src/install/schema.json | 2 +- .../src/utility/latest-versions.ts | 4 ++-- 10 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 packages/devextreme-cli/src/templates/react/application/src/index.tsx diff --git a/packages/devextreme-cli/src/applications/application.angular.js b/packages/devextreme-cli/src/applications/application.angular.js index 59dd0fc7e..847e9350a 100644 --- a/packages/devextreme-cli/src/applications/application.angular.js +++ b/packages/devextreme-cli/src/applications/application.angular.js @@ -40,9 +40,10 @@ async function runNgCommand(commandArguments, commandOptions, commandConfig) { const hasNg = await hasSutableNgCli(); const toolingVersion = extractToolingVersion(commandOptions); const npmCommandName = hasNg && !toolingVersion ? 'ng' : 'npx'; + const [minCliLtsVersion] = minNgCliVersion.version.split('.'); const ngCommandArguments = hasNg && !toolingVersion ? [] - : ['-p', '@angular/cli@v15-lts', 'ng']; + : ['-p', `@angular/cli@v${minCliLtsVersion}-lts`, 'ng']; ngCommandArguments.push(...commandArguments); return runCommand(npmCommandName, ngCommandArguments, commandConfig); diff --git a/packages/devextreme-cli/src/templates/react/application/src/components/side-navigation-menu/SideNavigationMenu.tsx b/packages/devextreme-cli/src/templates/react/application/src/components/side-navigation-menu/SideNavigationMenu.tsx index 9eb873839..646c1a6ab 100644 --- a/packages/devextreme-cli/src/templates/react/application/src/components/side-navigation-menu/SideNavigationMenu.tsx +++ b/packages/devextreme-cli/src/templates/react/application/src/components/side-navigation-menu/SideNavigationMenu.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useRef, useCallback, useMemo } from 'react'; -import TreeView from 'devextreme-react/tree-view'; +import { TreeView<%=#isTypeScript%>, TreeViewRef<%=/isTypeScript%> } from 'devextreme-react/tree-view'; import { navigation } from '../../app-navigation'; import { useNavigation } from '../../contexts/navigation'; import { useScreenSize } from '../../utils/media-query'; @@ -32,7 +32,7 @@ export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsW const { navigationData: { currentPath } } = useNavigation(); - const treeViewRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(null); + const treeViewRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(null); const wrapperRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(); const getWrapperRef = useCallback((element<%=#isTypeScript%>: HTMLDivElement<%=/isTypeScript%>) => { const prevElement = wrapperRef.current; @@ -47,7 +47,7 @@ export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsW }, [openMenu]); useEffect(() => { - const treeView = treeViewRef.current && treeViewRef.current.instance; + const treeView = treeViewRef.current && treeViewRef.current.instance(); if (!treeView) { return; } diff --git a/packages/devextreme-cli/src/templates/react/application/src/index.tsx b/packages/devextreme-cli/src/templates/react/application/src/index.tsx new file mode 100644 index 000000000..a42189c0b --- /dev/null +++ b/packages/devextreme-cli/src/templates/react/application/src/index.tsx @@ -0,0 +1,16 @@ +import './polyfills'; +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import './index.css'; +import App from './App'; +import reportWebVitals from './reportWebVitals'; + +const root = ReactDOM.createRoot( + document.getElementById('root')<%=#isTypeScript%> as HTMLElement<%=/isTypeScript%> +); +root.render(); + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals(); diff --git a/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.tsx b/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.tsx index 849e9d7a7..e6335b526 100644 --- a/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.tsx +++ b/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.tsx @@ -1,6 +1,6 @@ import Button from 'devextreme-react/button'; import Drawer from 'devextreme-react/drawer'; -import ScrollView from 'devextreme-react/scroll-view'; +import { ScrollView<%=#isTypeScript%>, ScrollViewRef<%=/isTypeScript%> } from 'devextreme-react/scroll-view'; import Toolbar, { Item } from 'devextreme-react/toolbar'; import React, { useState, useCallback, useRef } from 'react'; import { useNavigate } from 'react-router'; @@ -14,7 +14,7 @@ import { useMenuPatch } from '../../utils/patches'; <%=#isTypeScript%>import { ButtonTypes } from 'devextreme-react/button';<%=/isTypeScript%> export default function SideNavInnerToolbar({ title, children }<%=#isTypeScript%>: React.PropsWithChildren<%=/isTypeScript%>) { - const scrollViewRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(null); + const scrollViewRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(null); const navigate = useNavigate(); const { isXSmall, isLarge } = useScreenSize(); const [patchCssClass, onMenuReady] = useMenuPatch(); @@ -55,7 +55,7 @@ export default function SideNavInnerToolbar({ title, children }<%=#isTypeScript% } navigate(itemData.path); - scrollViewRef.current<%=#isTypeScript%>?<%=/isTypeScript%>.instance.scrollTo(0); + scrollViewRef.current<%=#isTypeScript%>?<%=/isTypeScript%>.instance().scrollTo(0); if (!isLarge || menuStatus === MenuStatus.TemporaryOpened) { setMenuStatus(MenuStatus.Closed); diff --git a/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.tsx b/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.tsx index ca859cb36..9d618079e 100644 --- a/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.tsx +++ b/packages/devextreme-cli/src/templates/react/application/src/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.tsx @@ -1,5 +1,5 @@ import Drawer from 'devextreme-react/drawer'; -import ScrollView from 'devextreme-react/scroll-view'; +import { ScrollView<%=#isTypeScript%>, ScrollViewRef<%=/isTypeScript%> } from 'devextreme-react/scroll-view'; import React, { useState, useCallback, useRef } from 'react'; import { useNavigate } from 'react-router'; import { Header, SideNavigationMenu, Footer } from '../../components'; @@ -12,7 +12,7 @@ import { useMenuPatch } from '../../utils/patches'; <%=#isTypeScript%>import type { SideNavToolbarProps } from '../../types';<%=/isTypeScript%> export default function SideNavOuterToolbar({ title, children }<%=#isTypeScript%>: React.PropsWithChildren<%=/isTypeScript%>) { - const scrollViewRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(null); + const scrollViewRef = useRef<%=#isTypeScript%><%=/isTypeScript%>(null); const navigate = useNavigate(); const { isXSmall, isLarge } = useScreenSize(); const [patchCssClass, onMenuReady] = useMenuPatch(); @@ -53,7 +53,7 @@ export default function SideNavOuterToolbar({ title, children }<%=#isTypeScript% } navigate(itemData.path); - scrollViewRef.current<%=#isTypeScript%>?<%=/isTypeScript%>.instance.scrollTo(0); + scrollViewRef.current<%=#isTypeScript%>?<%=/isTypeScript%>.instance().scrollTo(0); if (!isLarge || menuStatus === MenuStatus.TemporaryOpened) { setMenuStatus(MenuStatus.Closed); diff --git a/packages/devextreme-cli/src/utility/latest-versions.js b/packages/devextreme-cli/src/utility/latest-versions.js index 8ae312e46..a5dd11dcb 100644 --- a/packages/devextreme-cli/src/utility/latest-versions.js +++ b/packages/devextreme-cli/src/utility/latest-versions.js @@ -1,8 +1,8 @@ const packageJson = require('../../package.json'); module.exports = { - 'devextreme': '23.2.6', - 'devextreme-react': '23.2.6', - 'devextreme-vue': '23.2.6', + 'devextreme': '24.1.3', + 'devextreme-react': '24.1.3', + 'devextreme-vue': '24.1.3', 'devextreme-cli': packageJson.version, 'devextreme-schematics': 'latest' }; diff --git a/packages/devextreme-cli/src/utility/ng-version.js b/packages/devextreme-cli/src/utility/ng-version.js index 07f30a1fa..5ad037250 100644 --- a/packages/devextreme-cli/src/utility/ng-version.js +++ b/packages/devextreme-cli/src/utility/ng-version.js @@ -15,7 +15,7 @@ const getLocalNgVersion = () => { }; const getPublicNgVersion = () => { - const version = execSync('npm view @angular/cli@v15-lts version').toString(); + const version = execSync('npm view @angular/cli@v16-lts version').toString(); return new semver(version); }; diff --git a/packages/devextreme-schematics/src/add-app-template/schema.json b/packages/devextreme-schematics/src/add-app-template/schema.json index e337dd1f0..b463ce2c2 100644 --- a/packages/devextreme-schematics/src/add-app-template/schema.json +++ b/packages/devextreme-schematics/src/add-app-template/schema.json @@ -39,7 +39,7 @@ "dxversion": { "type": "string", "description": "The DevExtreme version", - "default": "23.2.6" + "default": "24.1.3" }, "globalNgCliVersion": { "type":"string", diff --git a/packages/devextreme-schematics/src/install/schema.json b/packages/devextreme-schematics/src/install/schema.json index 427a67daa..9d0c8cec6 100644 --- a/packages/devextreme-schematics/src/install/schema.json +++ b/packages/devextreme-schematics/src/install/schema.json @@ -7,7 +7,7 @@ "dxversion": { "type": "string", "description": "The DevExtreme version", - "default": "23.2.6" + "default": "24.1.3" }, "project": { "type": "string", diff --git a/packages/devextreme-schematics/src/utility/latest-versions.ts b/packages/devextreme-schematics/src/utility/latest-versions.ts index f7a91d216..1d829c09f 100644 --- a/packages/devextreme-schematics/src/utility/latest-versions.ts +++ b/packages/devextreme-schematics/src/utility/latest-versions.ts @@ -1,6 +1,6 @@ // TODO: implement export const latestVersions = { - 'devextreme': '23.2.6', - 'devextreme-angular': '23.2.6', + 'devextreme': '24.1.3', + 'devextreme-angular': '24.1.3', 'devextreme-cli': 'latest' }; From 5289a6c9aa525ea566b22a1e21a9782e434395f8 Mon Sep 17 00:00:00 2001 From: alexlavrov Date: Thu, 20 Jun 2024 20:35:40 +0400 Subject: [PATCH 5/6] v1.7.0 --- lerna.json | 2 +- packages/devextreme-cli/package-lock.json | 4 ++-- packages/devextreme-cli/package.json | 2 +- packages/devextreme-schematics/package-lock.json | 4 ++-- packages/devextreme-schematics/package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lerna.json b/lerna.json index 079638650..bf59ac905 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "1.6.8" + "version": "1.7.0" } diff --git a/packages/devextreme-cli/package-lock.json b/packages/devextreme-cli/package-lock.json index 59ecf790f..0d47c975f 100644 --- a/packages/devextreme-cli/package-lock.json +++ b/packages/devextreme-cli/package-lock.json @@ -1,12 +1,12 @@ { "name": "devextreme-cli", - "version": "1.6.8", + "version": "1.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "devextreme-cli", - "version": "1.6.8", + "version": "1.7.0", "license": "MIT", "dependencies": { "@yarnpkg/lockfile": "^1.1.0", diff --git a/packages/devextreme-cli/package.json b/packages/devextreme-cli/package.json index e23c55548..445ad4569 100644 --- a/packages/devextreme-cli/package.json +++ b/packages/devextreme-cli/package.json @@ -1,6 +1,6 @@ { "name": "devextreme-cli", - "version": "1.6.8", + "version": "1.7.0", "description": "DevExtreme CLI", "keywords": [ "devexpress", diff --git a/packages/devextreme-schematics/package-lock.json b/packages/devextreme-schematics/package-lock.json index 5c92b3813..57be37253 100644 --- a/packages/devextreme-schematics/package-lock.json +++ b/packages/devextreme-schematics/package-lock.json @@ -1,12 +1,12 @@ { "name": "devextreme-schematics", - "version": "1.6.8", + "version": "1.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "devextreme-schematics", - "version": "1.6.8", + "version": "1.7.0", "license": "MIT", "dependencies": { "@angular-devkit/core": "^16.2.10", diff --git a/packages/devextreme-schematics/package.json b/packages/devextreme-schematics/package.json index 82f92dcc1..dc2102795 100644 --- a/packages/devextreme-schematics/package.json +++ b/packages/devextreme-schematics/package.json @@ -1,6 +1,6 @@ { "name": "devextreme-schematics", - "version": "1.6.8", + "version": "1.7.0", "description": "DevExtreme schematics", "scripts": { "build": "tsc -p tsconfig.json", From 755ad92a960cf4b0bbda6cb743b433d1af0609be Mon Sep 17 00:00:00 2001 From: Roch Nicolas <89575880+tomodasheesh@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:43:54 +0800 Subject: [PATCH 6/6] Add DxHttpModule to Angular app template (#894) * Import DxHttpModule * Add http module test --------- Co-authored-by: Rochmar Nicolas (DevExpress) --- packages/devextreme-schematics/src/add-layout/index.ts | 1 + packages/devextreme-schematics/src/add-layout/index_spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/devextreme-schematics/src/add-layout/index.ts b/packages/devextreme-schematics/src/add-layout/index.ts index a16c63e9d..316f22237 100644 --- a/packages/devextreme-schematics/src/add-layout/index.ts +++ b/packages/devextreme-schematics/src/add-layout/index.ts @@ -181,6 +181,7 @@ function updateAppModule(host: Tree, sourcePath: string) { }; const rules = [ + modifyFileRule(appModulePath, importSetter('DxHttpModule', 'devextreme-angular/http')), modifyFileRule(appModulePath, importSetter('SideNavOuterToolbarModule', './layouts')), modifyFileRule(appModulePath, importSetter('SideNavInnerToolbarModule', './layouts')), modifyFileRule(appModulePath, importSetter('SingleCardModule', './layouts')), diff --git a/packages/devextreme-schematics/src/add-layout/index_spec.ts b/packages/devextreme-schematics/src/add-layout/index_spec.ts index 2bc6d2a33..b0a31ef7f 100644 --- a/packages/devextreme-schematics/src/add-layout/index_spec.ts +++ b/packages/devextreme-schematics/src/add-layout/index_spec.ts @@ -99,6 +99,7 @@ describe('layout', () => { expect(styles[2]).toBe('src/themes/generated/theme.additional.css'); const moduleContent = tree.readContent('/src/app/app.module.ts'); + expect(moduleContent).toContain('import { DxHttpModule }'); expect(moduleContent) .toContain('import { SideNavOuterToolbarModule, SideNavInnerToolbarModule, SingleCardModule }'); expect(moduleContent)