From e54d022abaf3217765c3873f2fe2081efaed048f Mon Sep 17 00:00:00 2001 From: Milko Venkov Date: Tue, 12 Mar 2024 15:35:55 +0200 Subject: [PATCH 1/4] chore(react): fix indentations in base project template --- .../projects/_base/files/ignite-ui-cli.json | 28 +++++++-------- .../projects/_base/files/src/app/app.test.tsx | 4 +-- .../projects/_base/files/src/app/app.tsx | 14 ++++---- .../_base/files/src/app/style-utils.ts | 12 +++---- .../igr-ts/projects/_base/files/src/main.tsx | 16 ++++----- .../igr-ts/projects/_base/files/tsconfig.json | 2 +- .../projects/_base/files/vite.config.ts | 34 +++++++++---------- 7 files changed, 55 insertions(+), 55 deletions(-) diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/ignite-ui-cli.json b/packages/cli/templates/react/igr-ts/projects/_base/files/ignite-ui-cli.json index 5a3f94d1b..1701244cf 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/ignite-ui-cli.json +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/ignite-ui-cli.json @@ -1,16 +1,16 @@ { - "version": "$(cliVersion)", - "project": { - "defaultPort": 3003, - "framework": "react", - "projectType": "igr-ts", - "projectTemplate": "$(projectTemplate)", - "theme": "$(theme)", - "isBundle": false, - "components": [], - "sourceFiles": [], - "isShowcase": false, - "version": "" - }, - "build": {} + "version": "$(cliVersion)", + "project": { + "defaultPort": 3003, + "framework": "react", + "projectType": "igr-ts", + "projectTemplate": "$(projectTemplate)", + "theme": "$(theme)", + "isBundle": false, + "components": [], + "sourceFiles": [], + "isShowcase": false, + "version": "" + }, + "build": {} } diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.test.tsx b/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.test.tsx index 8cf8a9469..3ef4325e2 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.test.tsx +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.test.tsx @@ -3,6 +3,6 @@ import { render } from '@testing-library/react'; import App from './app'; test('renders without crashing', () => { - const wrapper = render(); - expect(wrapper).toBeTruthy(); + const wrapper = render(); + expect(wrapper).toBeTruthy(); }); diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.tsx b/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.tsx index 4514300d8..200ca26f5 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.tsx +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/app.tsx @@ -2,11 +2,11 @@ import { Outlet } from "react-router-dom"; export default function App() { - return ( -
-
- -
-
- ) + return ( +
+
+ +
+
+ ) } diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/style-utils.ts b/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/style-utils.ts index a591f592c..418a87831 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/style-utils.ts +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/src/app/style-utils.ts @@ -3,10 +3,10 @@ * @param styles Object map of classes and their scoped name, normally from a CSS Module import */ export default function createClassTransformer(styles: any) { - return (classes: string) => { - return classes - .split(' ') - .map(className => styles[className] || className) - .join(' '); - } + return (classes: string) => { + return classes + .split(' ') + .map(className => styles[className] || className) + .join(' '); + } } diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/src/main.tsx b/packages/cli/templates/react/igr-ts/projects/_base/files/src/main.tsx index b2ef36d75..837881b2f 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/src/main.tsx +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/src/main.tsx @@ -1,8 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import { createBrowserRouter, RouterProvider } from "react-router-dom"; -import { routes } from "./app/app-routes"; import App from './app/app'; +import { routes } from "./app/app-routes"; import 'react-app-polyfill/ie11'; /** Required in IE11 for Charts */ @@ -11,14 +11,14 @@ Number.isNaN = Number.isNaN || function(value) { } const router = createBrowserRouter([ - { - element: , - children: [...routes] - } + { + element: , + children: [...routes] + } ]); ReactDOM.createRoot(document.getElementById('root')).render( - - - + + + ) diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/tsconfig.json b/packages/cli/templates/react/igr-ts/projects/_base/files/tsconfig.json index a39d6f990..8ed26f7ac 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/tsconfig.json +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/tsconfig.json @@ -5,7 +5,7 @@ "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, - "composite": true, + "composite": true, "allowSyntheticDefaultImports": true, /* Bundler mode */ diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/vite.config.ts b/packages/cli/templates/react/igr-ts/projects/_base/files/vite.config.ts index 95ca2ae68..50d3503cb 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/vite.config.ts +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/vite.config.ts @@ -4,21 +4,21 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ - define: process.env.VITEST ? {} : { global: 'window' }, - plugins: [react()], - test: { - globals: true, - environment: 'jsdom', - setupFiles: ['./src/setupTests.ts'], - deps: { - inline: ['vitest-canvas-mock'], - }, - }, - resolve: { - mainFields: ['module'], - }, - server: { - open: true, - port: 3003 - } + define: process.env.VITEST ? {} : { global: 'window' }, + plugins: [react()], + test: { + globals: true, + environment: 'jsdom', + setupFiles: ['./src/setupTests.ts'], + deps: { + inline: ['vitest-canvas-mock'], + }, + }, + resolve: { + mainFields: ['module'], + }, + server: { + open: true, + port: 3003 + } }) From b1e913f460be0f331cd572e817f5ed5bc9d345c0 Mon Sep 17 00:00:00 2001 From: Milko Venkov Date: Tue, 12 Mar 2024 15:36:34 +0200 Subject: [PATCH 2/4] chore(react): fix dependencies order in base project template --- .../templates/react/igr-ts/projects/_base/files/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/package.json b/packages/cli/templates/react/igr-ts/projects/_base/files/package.json index 89383b873..68810acb6 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/package.json +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/package.json @@ -20,9 +20,9 @@ "devDependencies": { "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", - "@vitejs/plugin-react": "^4.0.3", "@typescript-eslint/eslint-plugin": "^6.2.1", "@typescript-eslint/parser": "^6.2.1", + "@vitejs/plugin-react": "^4.0.3", "eslint": "^8.46.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.3", From 555300c38df56246cb7cc08f6b25e8ae5fd316f0 Mon Sep 17 00:00:00 2001 From: Milko Venkov Date: Tue, 12 Mar 2024 15:37:10 +0200 Subject: [PATCH 3/4] fix(react): add editorconfig and vite-env.d.ts --- packages/cli/bin/ddd | 1 + .../projects/_base/files/__dot__editorconfig | 16 ++++++++++++++++ .../projects/_base/files/src/vite-env.d.ts | 1 + 3 files changed, 18 insertions(+) create mode 160000 packages/cli/bin/ddd create mode 100644 packages/cli/templates/react/igr-ts/projects/_base/files/__dot__editorconfig create mode 100644 packages/cli/templates/react/igr-ts/projects/_base/files/src/vite-env.d.ts diff --git a/packages/cli/bin/ddd b/packages/cli/bin/ddd new file mode 160000 index 000000000..0ab9fe094 --- /dev/null +++ b/packages/cli/bin/ddd @@ -0,0 +1 @@ +Subproject commit 0ab9fe09418215ed35fa8783812d1d4a1410f739 diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__editorconfig b/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__editorconfig new file mode 100644 index 000000000..59d9a3a3e --- /dev/null +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/src/vite-env.d.ts b/packages/cli/templates/react/igr-ts/projects/_base/files/src/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/src/vite-env.d.ts @@ -0,0 +1 @@ +/// From f355c7a29e9a9dacacf2fa317e294b019bd6dc99 Mon Sep 17 00:00:00 2001 From: Milko Venkov Date: Tue, 12 Mar 2024 16:05:57 +0200 Subject: [PATCH 4/4] chore(*): remove wrongly committed folder --- packages/cli/bin/ddd | 1 - 1 file changed, 1 deletion(-) delete mode 160000 packages/cli/bin/ddd diff --git a/packages/cli/bin/ddd b/packages/cli/bin/ddd deleted file mode 160000 index 0ab9fe094..000000000 --- a/packages/cli/bin/ddd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ab9fe09418215ed35fa8783812d1d4a1410f739