igniteui-cli 14.9.2 → 14.10.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/PromptSession.js +1 -3
- package/lib/TemplateManager.js +3 -7
- package/lib/cli.js +1 -0
- package/lib/commands/build.js +0 -3
- package/lib/commands/generate.js +0 -1
- package/lib/commands/index.d.ts +1 -0
- package/lib/commands/index.js +3 -1
- package/lib/commands/mcp.d.ts +3 -0
- package/lib/commands/mcp.js +98 -0
- package/lib/commands/start.js +3 -16
- package/lib/commands/types.d.ts +1 -0
- package/lib/commands/types.js +4 -2
- package/lib/templates/IgniteUIForReactTemplate.d.ts +0 -3
- package/lib/templates/IgniteUIForReactTemplate.js +0 -24
- package/lib/templates/jQueryTemplate.js +0 -2
- package/migrations/update-13_1_0/index.spec.js +0 -2
- package/migrations/update-2/index.spec.js +0 -2
- package/migrations/update-3/index.spec.js +0 -2
- package/migrations/update-3_2/index.js +0 -1
- package/migrations/update-3_2/index.spec.js +0 -2
- package/migrations/update-4_2_3/index.js +0 -1
- package/migrations/update-4_2_3/index.spec.js +0 -2
- package/migrations/update-5_0_0/index.js +0 -1
- package/migrations/update-5_0_0/index.spec.js +0 -2
- package/migrations/update-5_0_3/index.js +0 -1
- package/migrations/update-5_0_3/index.spec.js +0 -2
- package/package.json +8 -8
- package/scripts/install.js +1 -2
- package/scripts/uninstall.js +1 -2
- package/templates/angular/index.js +0 -1
- package/templates/jquery/index.js +0 -1
- package/templates/jquery/js/hierarchical-grid/hierarchical-grid/index.js +0 -2
- package/templates/jquery/js/index.js +0 -2
- package/templates/react/igr-ts/generate/files/src/app/__path__/__filePrefix__.test.tsx +13 -0
- package/templates/react/igr-ts/generate/files/src/app/__path__/__filePrefix__.tsx +12 -0
- package/templates/react/igr-ts/generate/files/src/app/__path__/style.module.css +3 -0
- package/templates/react/{es6 → igr-ts}/generate/template.json +1 -1
- package/templates/react/igr-ts/index.js +1 -2
- package/templates/react/igr-ts/projects/_base/files/AGENTS.md +111 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__claude/CLAUDE.md +3 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__github/copilot-instructions.md +3 -0
- package/templates/react/igr-ts/projects/_base/files/__dot__vscode/mcp.json +12 -0
- package/templates/react/index.js +0 -2
- package/templates/webcomponents/igc-ts/projects/_base/files/AGENTS.md +33 -0
- package/templates/webcomponents/igc-ts/projects/_base/files/__dot__claude/CLAUDE.md +3 -0
- package/templates/webcomponents/igc-ts/projects/_base/files/__dot__github/copilot-instructions.md +3 -0
- package/templates/webcomponents/igc-ts/projects/_base/files/__dot__vscode/mcp.json +12 -0
- package/lib/templates/AngularTemplate.d.ts +0 -39
- package/lib/templates/AngularTemplate.js +0 -207
- package/lib/templates/ReactTemplate.d.ts +0 -36
- package/lib/templates/ReactTemplate.js +0 -149
- package/templates/angular/ig-ts/bar-chart/default/files/src/app/assets/world-energy-production.ts +0 -54
- package/templates/angular/ig-ts/bar-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -83
- package/templates/angular/ig-ts/bar-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/bar-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/bar-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/bar-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/bar-chart/index.js +0 -15
- package/templates/angular/ig-ts/column-chart/default/files/src/app/assets/world-energy-production.ts +0 -54
- package/templates/angular/ig-ts/column-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -87
- package/templates/angular/ig-ts/column-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/column-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/column-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/column-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/column-chart/index.js +0 -15
- package/templates/angular/ig-ts/combo/combo/files/src/app/components/__path__/__filePrefix__.component.ts +0 -45
- package/templates/angular/ig-ts/combo/combo/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/combo/combo/index.d.ts +0 -1
- package/templates/angular/ig-ts/combo/combo/index.js +0 -16
- package/templates/angular/ig-ts/combo/index.d.ts +0 -1
- package/templates/angular/ig-ts/combo/index.js +0 -16
- package/templates/angular/ig-ts/custom-templates/editors-calculation-form/files/src/app/assets/logo.jpg +0 -0
- package/templates/angular/ig-ts/custom-templates/editors-calculation-form/files/src/app/components/__path__/__filePrefix__.component.ts +0 -368
- package/templates/angular/ig-ts/custom-templates/editors-calculation-form/index.d.ts +0 -1
- package/templates/angular/ig-ts/custom-templates/editors-calculation-form/index.js +0 -18
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/files/src/app/assets/data-fe.ts +0 -88
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/files/src/app/assets/folder.png +0 -0
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/files/src/app/assets/opened_folder.png +0 -0
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/files/src/app/components/__path__/__filePrefix__.component.ts +0 -50
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/index.d.ts +0 -1
- package/templates/angular/ig-ts/custom-templates/tree-grid-file-explorer/index.js +0 -62
- package/templates/angular/ig-ts/doughnut-chart/default/files/src/app/assets/doughnut-data.ts +0 -10
- package/templates/angular/ig-ts/doughnut-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -38
- package/templates/angular/ig-ts/doughnut-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/doughnut-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/doughnut-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/doughnut-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/doughnut-chart/index.js +0 -16
- package/templates/angular/ig-ts/editors/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -19
- package/templates/angular/ig-ts/editors/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/editors/index.d.ts +0 -1
- package/templates/angular/ig-ts/editors/index.js +0 -58
- package/templates/angular/ig-ts/financial-chart/default/files/src/app/assets/financial-data.ts +0 -115
- package/templates/angular/ig-ts/financial-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -152
- package/templates/angular/ig-ts/financial-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/financial-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/financial-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/financial-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/financial-chart/index.js +0 -15
- package/templates/angular/ig-ts/funnel-chart/default/files/src/app/assets/funnel-data.ts +0 -12
- package/templates/angular/ig-ts/funnel-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -69
- package/templates/angular/ig-ts/funnel-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/funnel-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/funnel-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/funnel-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/funnel-chart/index.js +0 -15
- package/templates/angular/ig-ts/generate/files/src/app/components/__path__/__filePrefix__.component.ts +0 -14
- package/templates/angular/ig-ts/generate/template.json +0 -13
- package/templates/angular/ig-ts/grid/basic/files/src/app/assets/northwindProducts.ts +0 -12
- package/templates/angular/ig-ts/grid/basic/files/src/app/components/__path__/__filePrefix__.component.ts +0 -28
- package/templates/angular/ig-ts/grid/basic/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/grid/basic/index.d.ts +0 -1
- package/templates/angular/ig-ts/grid/basic/index.js +0 -41
- package/templates/angular/ig-ts/grid/grid-custom/files/src/app/assets/northwindProducts.ts +0 -12
- package/templates/angular/ig-ts/grid/grid-custom/files/src/app/components/__path__/__filePrefix__.component.ts +0 -32
- package/templates/angular/ig-ts/grid/grid-custom/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/grid/grid-custom/index.d.ts +0 -1
- package/templates/angular/ig-ts/grid/grid-custom/index.js +0 -45
- package/templates/angular/ig-ts/grid/grid-editing/files/src/app/assets/northwindProducts.ts +0 -12
- package/templates/angular/ig-ts/grid/grid-editing/files/src/app/components/__path__/__filePrefix__.component.ts +0 -30
- package/templates/angular/ig-ts/grid/grid-editing/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/grid/grid-editing/index.d.ts +0 -1
- package/templates/angular/ig-ts/grid/grid-editing/index.js +0 -42
- package/templates/angular/ig-ts/grid/grid-export/files/src/app/assets/employees.ts +0 -15
- package/templates/angular/ig-ts/grid/grid-export/files/src/app/components/__path__/__filePrefix__.component.ts +0 -88
- package/templates/angular/ig-ts/grid/grid-export/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/grid/grid-export/index.d.ts +0 -1
- package/templates/angular/ig-ts/grid/grid-export/index.js +0 -42
- package/templates/angular/ig-ts/grid/grid-templating/files/src/app/assets/northwindProductsFlat.ts +0 -13
- package/templates/angular/ig-ts/grid/grid-templating/files/src/app/components/__path__/__filePrefix__.component.ts +0 -34
- package/templates/angular/ig-ts/grid/grid-templating/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/grid/grid-templating/index.d.ts +0 -1
- package/templates/angular/ig-ts/grid/grid-templating/index.js +0 -42
- package/templates/angular/ig-ts/grid/index.d.ts +0 -1
- package/templates/angular/ig-ts/grid/index.js +0 -12
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid/files/src/app/assets/northwind.ts +0 -12626
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid/files/src/app/components/__path__/__filePrefix__.component.ts +0 -75
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid/index.d.ts +0 -1
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid/index.js +0 -42
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-custom/files/src/app/assets/northwind.ts +0 -12626
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-custom/files/src/app/components/__path__/__filePrefix__.component.ts +0 -76
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-custom/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-custom/index.d.ts +0 -1
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-custom/index.js +0 -45
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-editing/files/src/app/assets/northwind.ts +0 -12626
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-editing/files/src/app/components/__path__/__filePrefix__.component.ts +0 -76
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-editing/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-editing/index.d.ts +0 -1
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-editing/index.js +0 -43
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-export/files/src/app/assets/northwind.ts +0 -12626
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-export/files/src/app/components/__path__/__filePrefix__.component.ts +0 -99
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-export/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-export/index.d.ts +0 -1
- package/templates/angular/ig-ts/hierarchical-grid/hierarchical-grid-export/index.js +0 -43
- package/templates/angular/ig-ts/hierarchical-grid/index.d.ts +0 -1
- package/templates/angular/ig-ts/hierarchical-grid/index.js +0 -12
- package/templates/angular/ig-ts/index.d.ts +0 -1
- package/templates/angular/ig-ts/index.js +0 -17
- package/templates/angular/ig-ts/line-chart/default/files/src/app/assets/line-chart-data.ts +0 -9
- package/templates/angular/ig-ts/line-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -109
- package/templates/angular/ig-ts/line-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/line-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/line-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/line-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/line-chart/index.js +0 -15
- package/templates/angular/ig-ts/pie-chart/default/files/src/app/assets/data.ts +0 -9
- package/templates/angular/ig-ts/pie-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -28
- package/templates/angular/ig-ts/pie-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/pie-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/pie-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/pie-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/pie-chart/index.js +0 -15
- package/templates/angular/ig-ts/projects/empty/files/README.md +0 -39
- package/templates/angular/ig-ts/projects/empty/files/__dot__browserslistrc +0 -17
- package/templates/angular/ig-ts/projects/empty/files/__dot__editorconfig +0 -16
- package/templates/angular/ig-ts/projects/empty/files/__dot__gitignore +0 -51
- package/templates/angular/ig-ts/projects/empty/files/angular.json +0 -105
- package/templates/angular/ig-ts/projects/empty/files/ignite-ui-cli.json +0 -22
- package/templates/angular/ig-ts/projects/empty/files/karma.conf.js +0 -55
- package/templates/angular/ig-ts/projects/empty/files/package.json +0 -45
- package/templates/angular/ig-ts/projects/empty/files/src/app/app-routing.module.ts +0 -17
- package/templates/angular/ig-ts/projects/empty/files/src/app/app.component.css +0 -6
- package/templates/angular/ig-ts/projects/empty/files/src/app/app.component.html +0 -5
- package/templates/angular/ig-ts/projects/empty/files/src/app/app.component.spec.ts +0 -22
- package/templates/angular/ig-ts/projects/empty/files/src/app/app.component.ts +0 -10
- package/templates/angular/ig-ts/projects/empty/files/src/app/app.module.ts +0 -22
- package/templates/angular/ig-ts/projects/empty/files/src/app/home.component.ts +0 -12
- package/templates/angular/ig-ts/projects/empty/files/src/app/shared/nav-menu.component.css +0 -36
- package/templates/angular/ig-ts/projects/empty/files/src/app/shared/nav-menu.component.ts +0 -34
- package/templates/angular/ig-ts/projects/empty/files/src/assets/Ignite-header-apps-960.png +0 -0
- package/templates/angular/ig-ts/projects/empty/files/src/assets/css/variables.scss +0 -7
- package/templates/angular/ig-ts/projects/empty/files/src/assets/lines-bottom-right.svg +0 -56
- package/templates/angular/ig-ts/projects/empty/files/src/environments/environment.prod.ts +0 -3
- package/templates/angular/ig-ts/projects/empty/files/src/environments/environment.ts +0 -16
- package/templates/angular/ig-ts/projects/empty/files/src/favicon.ico +0 -0
- package/templates/angular/ig-ts/projects/empty/files/src/index.html +0 -14
- package/templates/angular/ig-ts/projects/empty/files/src/main.ts +0 -11
- package/templates/angular/ig-ts/projects/empty/files/src/polyfills.ts +0 -53
- package/templates/angular/ig-ts/projects/empty/files/src/styles.css +0 -23
- package/templates/angular/ig-ts/projects/empty/files/src/test.ts +0 -23
- package/templates/angular/ig-ts/projects/empty/files/tsconfig.app.json +0 -15
- package/templates/angular/ig-ts/projects/empty/files/tsconfig.json +0 -34
- package/templates/angular/ig-ts/projects/empty/files/tsconfig.spec.json +0 -18
- package/templates/angular/ig-ts/projects/empty/index.d.ts +0 -1
- package/templates/angular/ig-ts/projects/empty/index.js +0 -126
- package/templates/angular/ig-ts/radial-chart/default/files/src/app/assets/temperature.ts +0 -16
- package/templates/angular/ig-ts/radial-chart/default/files/src/app/components/__path__/__filePrefix__.component.ts +0 -64
- package/templates/angular/ig-ts/radial-chart/default/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -29
- package/templates/angular/ig-ts/radial-chart/default/index.d.ts +0 -1
- package/templates/angular/ig-ts/radial-chart/default/index.js +0 -17
- package/templates/angular/ig-ts/radial-chart/index.d.ts +0 -1
- package/templates/angular/ig-ts/radial-chart/index.js +0 -15
- package/templates/angular/ig-ts/tree-grid/index.d.ts +0 -1
- package/templates/angular/ig-ts/tree-grid/index.js +0 -12
- package/templates/angular/ig-ts/tree-grid/tree-grid/files/src/app/assets/data-basic.ts +0 -28
- package/templates/angular/ig-ts/tree-grid/tree-grid/files/src/app/components/__path__/__filePrefix__.component.ts +0 -37
- package/templates/angular/ig-ts/tree-grid/tree-grid/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/tree-grid/tree-grid/index.d.ts +0 -1
- package/templates/angular/ig-ts/tree-grid/tree-grid/index.js +0 -42
- package/templates/angular/ig-ts/tree-grid/tree-grid-custom/files/src/app/assets/data-custom.ts +0 -28
- package/templates/angular/ig-ts/tree-grid/tree-grid-custom/files/src/app/components/__path__/__filePrefix__.component.ts +0 -38
- package/templates/angular/ig-ts/tree-grid/tree-grid-custom/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/tree-grid/tree-grid-custom/index.d.ts +0 -1
- package/templates/angular/ig-ts/tree-grid/tree-grid-custom/index.js +0 -42
- package/templates/angular/ig-ts/tree-grid/tree-grid-editing/files/src/app/assets/data-editing.ts +0 -28
- package/templates/angular/ig-ts/tree-grid/tree-grid-editing/files/src/app/components/__path__/__filePrefix__.component.ts +0 -38
- package/templates/angular/ig-ts/tree-grid/tree-grid-editing/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/tree-grid/tree-grid-editing/index.d.ts +0 -1
- package/templates/angular/ig-ts/tree-grid/tree-grid-editing/index.js +0 -61
- package/templates/angular/ig-ts/tree-grid/tree-grid-export/files/src/app/assets/data-flat.ts +0 -33
- package/templates/angular/ig-ts/tree-grid/tree-grid-export/files/src/app/assets/data-hierarchical.ts +0 -28
- package/templates/angular/ig-ts/tree-grid/tree-grid-export/files/src/app/components/__path__/__filePrefix__.component.ts +0 -91
- package/templates/angular/ig-ts/tree-grid/tree-grid-export/files/src/app/components/__path__/__filePrefix__.spec.ts +0 -30
- package/templates/angular/ig-ts/tree-grid/tree-grid-export/index.d.ts +0 -1
- package/templates/angular/ig-ts/tree-grid/tree-grid-export/index.js +0 -43
- package/templates/react/es6/bar-chart/default/files/src/components/__path__/index.js +0 -89
- package/templates/react/es6/bar-chart/default/files/src/data/world-energy-production.js +0 -55
- package/templates/react/es6/bar-chart/default/index.d.ts +0 -1
- package/templates/react/es6/bar-chart/default/index.js +0 -21
- package/templates/react/es6/bar-chart/index.d.ts +0 -1
- package/templates/react/es6/bar-chart/index.js +0 -15
- package/templates/react/es6/column-chart/default/files/src/components/__path__/index.js +0 -88
- package/templates/react/es6/column-chart/default/files/src/data/world-energy-production.js +0 -55
- package/templates/react/es6/column-chart/default/index.d.ts +0 -1
- package/templates/react/es6/column-chart/default/index.js +0 -21
- package/templates/react/es6/column-chart/index.d.ts +0 -1
- package/templates/react/es6/column-chart/index.js +0 -15
- package/templates/react/es6/combo/combo/files/src/components/__path__/index.js +0 -45
- package/templates/react/es6/combo/combo/index.d.ts +0 -1
- package/templates/react/es6/combo/combo/index.js +0 -21
- package/templates/react/es6/combo/index.d.ts +0 -1
- package/templates/react/es6/combo/index.js +0 -15
- package/templates/react/es6/doughnut-chart/doughnut-chart/files/src/components/__path__/index.js +0 -44
- package/templates/react/es6/doughnut-chart/doughnut-chart/index.d.ts +0 -1
- package/templates/react/es6/doughnut-chart/doughnut-chart/index.js +0 -21
- package/templates/react/es6/doughnut-chart/index.d.ts +0 -1
- package/templates/react/es6/doughnut-chart/index.js +0 -16
- package/templates/react/es6/editors/editors/files/src/components/__path__/index.js +0 -17
- package/templates/react/es6/editors/index.d.ts +0 -1
- package/templates/react/es6/editors/index.js +0 -58
- package/templates/react/es6/financial-chart/financial-chart/files/src/components/__path__/index.js +0 -154
- package/templates/react/es6/financial-chart/financial-chart/files/src/data/financial-data.js +0 -118
- package/templates/react/es6/financial-chart/financial-chart/index.d.ts +0 -1
- package/templates/react/es6/financial-chart/financial-chart/index.js +0 -21
- package/templates/react/es6/financial-chart/index.d.ts +0 -1
- package/templates/react/es6/financial-chart/index.js +0 -15
- package/templates/react/es6/funnel-chart/funnel-chart/files/src/components/__path__/index.js +0 -41
- package/templates/react/es6/funnel-chart/funnel-chart/index.d.ts +0 -1
- package/templates/react/es6/funnel-chart/funnel-chart/index.js +0 -21
- package/templates/react/es6/funnel-chart/index.d.ts +0 -1
- package/templates/react/es6/funnel-chart/index.js +0 -15
- package/templates/react/es6/generate/files/src/components/__path__/index.js +0 -10
- package/templates/react/es6/grid/basic/files/src/components/__path__/index.js +0 -39
- package/templates/react/es6/grid/basic/index.d.ts +0 -1
- package/templates/react/es6/grid/basic/index.js +0 -40
- package/templates/react/es6/grid/grid-custom/files/src/components/__path__/index.js +0 -40
- package/templates/react/es6/grid/grid-custom/index.d.ts +0 -1
- package/templates/react/es6/grid/grid-custom/index.js +0 -43
- package/templates/react/es6/grid/grid-editing/files/src/components/__path__/index.js +0 -47
- package/templates/react/es6/grid/grid-editing/index.d.ts +0 -1
- package/templates/react/es6/grid/grid-editing/index.js +0 -41
- package/templates/react/es6/grid/grid-export/files/src/components/__path__/index.js +0 -124
- package/templates/react/es6/grid/grid-export/files/src/components/__path__/styles.css +0 -13
- package/templates/react/es6/grid/grid-export/index.d.ts +0 -1
- package/templates/react/es6/grid/grid-export/index.js +0 -41
- package/templates/react/es6/grid/grid-templating/files/src/components/__path__/index.js +0 -38
- package/templates/react/es6/grid/grid-templating/files/src/components/__path__/northwind.js +0 -605
- package/templates/react/es6/grid/grid-templating/index.d.ts +0 -1
- package/templates/react/es6/grid/grid-templating/index.js +0 -40
- package/templates/react/es6/grid/index.d.ts +0 -1
- package/templates/react/es6/grid/index.js +0 -15
- package/templates/react/es6/hierarchical-grid/hierarchical-grid/files/src/components/__path__/index.js +0 -79
- package/templates/react/es6/hierarchical-grid/hierarchical-grid/files/src/components/__path__/northwind.js +0 -12626
- package/templates/react/es6/hierarchical-grid/hierarchical-grid/index.d.ts +0 -1
- package/templates/react/es6/hierarchical-grid/hierarchical-grid/index.js +0 -41
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/files/src/components/__path__/index.js +0 -82
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/files/src/components/__path__/northwind.js +0 -12626
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/index.d.ts +0 -1
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/index.js +0 -44
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/files/src/components/__path__/index.js +0 -81
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/files/src/components/__path__/northwind.js +0 -12626
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/index.d.ts +0 -1
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/index.js +0 -42
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/src/components/__path__/index.js +0 -112
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/src/components/__path__/northwind.js +0 -12626
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/src/components/__path__/styles.css +0 -13
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/index.d.ts +0 -1
- package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/index.js +0 -42
- package/templates/react/es6/hierarchical-grid/index.d.ts +0 -1
- package/templates/react/es6/hierarchical-grid/index.js +0 -15
- package/templates/react/es6/index.d.ts +0 -1
- package/templates/react/es6/index.js +0 -20
- package/templates/react/es6/line-chart/default/files/src/components/__path__/index.js +0 -76
- package/templates/react/es6/line-chart/default/index.d.ts +0 -1
- package/templates/react/es6/line-chart/default/index.js +0 -21
- package/templates/react/es6/line-chart/index.d.ts +0 -1
- package/templates/react/es6/line-chart/index.js +0 -15
- package/templates/react/es6/pie-chart/index.d.ts +0 -1
- package/templates/react/es6/pie-chart/index.js +0 -15
- package/templates/react/es6/pie-chart/pie-chart/files/src/components/__path__/index.js +0 -38
- package/templates/react/es6/pie-chart/pie-chart/index.d.ts +0 -1
- package/templates/react/es6/pie-chart/pie-chart/index.js +0 -21
- package/templates/react/es6/projects/empty/files/README.md +0 -36
- package/templates/react/es6/projects/empty/files/__dot__editorconfig +0 -3
- package/templates/react/es6/projects/empty/files/__dot__env +0 -1
- package/templates/react/es6/projects/empty/files/__dot__eslintrc.json +0 -6
- package/templates/react/es6/projects/empty/files/__dot__gitignore +0 -23
- package/templates/react/es6/projects/empty/files/ignite-ui-cli.json +0 -21
- package/templates/react/es6/projects/empty/files/package.json +0 -36
- package/templates/react/es6/projects/empty/files/public/favicon.ico +0 -0
- package/templates/react/es6/projects/empty/files/public/index.html +0 -42
- package/templates/react/es6/projects/empty/files/public/manifest.json +0 -15
- package/templates/react/es6/projects/empty/files/public/robots.txt +0 -3
- package/templates/react/es6/projects/empty/files/src/App.css +0 -52
- package/templates/react/es6/projects/empty/files/src/App.js +0 -39
- package/templates/react/es6/projects/empty/files/src/components/home/index.js +0 -25
- package/templates/react/es6/projects/empty/files/src/components/navigation-header/index.js +0 -47
- package/templates/react/es6/projects/empty/files/src/hoc/asyncComponent.js +0 -50
- package/templates/react/es6/projects/empty/files/src/igniteuiResources.js +0 -7
- package/templates/react/es6/projects/empty/files/src/index.css +0 -13
- package/templates/react/es6/projects/empty/files/src/index.js +0 -23
- package/templates/react/es6/projects/empty/files/src/reportWebVitals.js +0 -13
- package/templates/react/es6/projects/empty/files/src/routes.json +0 -7
- package/templates/react/es6/projects/empty/index.d.ts +0 -1
- package/templates/react/es6/projects/empty/index.js +0 -78
- package/templates/react/es6/radial-chart/index.d.ts +0 -1
- package/templates/react/es6/radial-chart/index.js +0 -15
- package/templates/react/es6/radial-chart/radial-chart/files/src/components/__path__/index.js +0 -68
- package/templates/react/es6/radial-chart/radial-chart/files/src/data/temperature.js +0 -16
- package/templates/react/es6/radial-chart/radial-chart/index.d.ts +0 -1
- package/templates/react/es6/radial-chart/radial-chart/index.js +0 -21
- package/templates/react/es6/scatter-chart/index.d.ts +0 -1
- package/templates/react/es6/scatter-chart/index.js +0 -16
- package/templates/react/es6/scatter-chart/scatter-chart/files/src/components/__path__/index.js +0 -59
- package/templates/react/es6/scatter-chart/scatter-chart/files/src/data/temperature.js +0 -58
- package/templates/react/es6/scatter-chart/scatter-chart/index.d.ts +0 -1
- package/templates/react/es6/scatter-chart/scatter-chart/index.js +0 -21
- package/templates/react/es6/tree-grid/index.d.ts +0 -1
- package/templates/react/es6/tree-grid/index.js +0 -15
- package/templates/react/es6/tree-grid/tree-grid/files/src/components/__path__/index.js +0 -61
- package/templates/react/es6/tree-grid/tree-grid/index.d.ts +0 -1
- package/templates/react/es6/tree-grid/tree-grid/index.js +0 -41
- package/templates/react/es6/tree-grid/tree-grid-custom/files/src/components/__path__/index.js +0 -62
- package/templates/react/es6/tree-grid/tree-grid-custom/index.d.ts +0 -1
- package/templates/react/es6/tree-grid/tree-grid-custom/index.js +0 -41
- package/templates/react/es6/tree-grid/tree-grid-editing/files/src/components/__path__/index.js +0 -62
- package/templates/react/es6/tree-grid/tree-grid-editing/index.d.ts +0 -1
- package/templates/react/es6/tree-grid/tree-grid-editing/index.js +0 -42
- package/templates/react/es6/tree-grid/tree-grid-export/files/src/components/__path__/index.js +0 -161
- package/templates/react/es6/tree-grid/tree-grid-export/index.d.ts +0 -1
- package/templates/react/es6/tree-grid/tree-grid-export/index.js +0 -42
- package/templates/react/igr-es6/bullet-graph/default/files/src/views/__path__/index.js +0 -62
- package/templates/react/igr-es6/bullet-graph/default/files/src/views/__path__/style.css +0 -12
- package/templates/react/igr-es6/bullet-graph/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/bullet-graph/default/index.d.ts +0 -1
- package/templates/react/igr-es6/bullet-graph/default/index.js +0 -17
- package/templates/react/igr-es6/bullet-graph/index.d.ts +0 -1
- package/templates/react/igr-es6/bullet-graph/index.js +0 -15
- package/templates/react/igr-es6/category-chart/default/files/src/views/__path__/index.js +0 -45
- package/templates/react/igr-es6/category-chart/default/files/src/views/__path__/style.css +0 -9
- package/templates/react/igr-es6/category-chart/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/category-chart/default/index.d.ts +0 -1
- package/templates/react/igr-es6/category-chart/default/index.js +0 -18
- package/templates/react/igr-es6/category-chart/index.d.ts +0 -1
- package/templates/react/igr-es6/category-chart/index.js +0 -16
- package/templates/react/igr-es6/doughnut-chart/default/files/src/views/__path__/index.js +0 -85
- package/templates/react/igr-es6/doughnut-chart/default/files/src/views/__path__/style.css +0 -9
- package/templates/react/igr-es6/doughnut-chart/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/doughnut-chart/default/index.d.ts +0 -1
- package/templates/react/igr-es6/doughnut-chart/default/index.js +0 -17
- package/templates/react/igr-es6/doughnut-chart/index.d.ts +0 -1
- package/templates/react/igr-es6/doughnut-chart/index.js +0 -15
- package/templates/react/igr-es6/financial-chart/default/files/src/views/__path__/index.js +0 -55
- package/templates/react/igr-es6/financial-chart/default/files/src/views/__path__/style.css +0 -10
- package/templates/react/igr-es6/financial-chart/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/financial-chart/default/index.d.ts +0 -1
- package/templates/react/igr-es6/financial-chart/default/index.js +0 -19
- package/templates/react/igr-es6/financial-chart/index.d.ts +0 -1
- package/templates/react/igr-es6/financial-chart/index.js +0 -16
- package/templates/react/igr-es6/grid/basic/files/src/views/__path__/data.js +0 -46
- package/templates/react/igr-es6/grid/basic/files/src/views/__path__/index.js +0 -46
- package/templates/react/igr-es6/grid/basic/files/src/views/__path__/style.css +0 -17
- package/templates/react/igr-es6/grid/basic/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/grid/basic/index.d.ts +0 -1
- package/templates/react/igr-es6/grid/basic/index.js +0 -23
- package/templates/react/igr-es6/grid/index.d.ts +0 -1
- package/templates/react/igr-es6/grid/index.js +0 -15
- package/templates/react/igr-es6/groups.json +0 -5
- package/templates/react/igr-es6/index.d.ts +0 -1
- package/templates/react/igr-es6/index.js +0 -17
- package/templates/react/igr-es6/linear-gauge/default/files/src/views/__path__/index.js +0 -62
- package/templates/react/igr-es6/linear-gauge/default/files/src/views/__path__/style.css +0 -12
- package/templates/react/igr-es6/linear-gauge/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/linear-gauge/default/index.d.ts +0 -1
- package/templates/react/igr-es6/linear-gauge/default/index.js +0 -17
- package/templates/react/igr-es6/linear-gauge/index.d.ts +0 -1
- package/templates/react/igr-es6/linear-gauge/index.js +0 -15
- package/templates/react/igr-es6/pie-chart/default/files/src/views/__path__/index.js +0 -83
- package/templates/react/igr-es6/pie-chart/default/files/src/views/__path__/style.css +0 -9
- package/templates/react/igr-es6/pie-chart/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/pie-chart/default/index.d.ts +0 -1
- package/templates/react/igr-es6/pie-chart/default/index.js +0 -17
- package/templates/react/igr-es6/pie-chart/index.d.ts +0 -1
- package/templates/react/igr-es6/pie-chart/index.js +0 -15
- package/templates/react/igr-es6/projects/_base/__dot__eslintrc.json +0 -3
- package/templates/react/igr-es6/projects/_base/files/README.md +0 -48
- package/templates/react/igr-es6/projects/_base/files/__dot__editorconfig +0 -3
- package/templates/react/igr-es6/projects/_base/files/__dot__env +0 -1
- package/templates/react/igr-es6/projects/_base/files/__dot__gitignore +0 -23
- package/templates/react/igr-es6/projects/_base/files/ignite-ui-cli.json +0 -16
- package/templates/react/igr-es6/projects/_base/files/package.json +0 -30
- package/templates/react/igr-es6/projects/_base/files/public/favicon.ico +0 -0
- package/templates/react/igr-es6/projects/_base/files/public/index.html +0 -41
- package/templates/react/igr-es6/projects/_base/files/public/manifest.json +0 -15
- package/templates/react/igr-es6/projects/_base/files/src/App.test.js +0 -9
- package/templates/react/igr-es6/projects/_base/files/src/hoc/asyncComponent.js +0 -50
- package/templates/react/igr-es6/projects/_base/files/src/index.css +0 -14
- package/templates/react/igr-es6/projects/_base/files/src/index.js +0 -19
- package/templates/react/igr-es6/projects/_base/files/src/routes.json +0 -7
- package/templates/react/igr-es6/projects/_base/files/src/serviceWorker.js +0 -135
- package/templates/react/igr-es6/projects/_base/files/src/views/home/index.js +0 -27
- package/templates/react/igr-es6/projects/_base/files/src/views/home/logo.svg +0 -7
- package/templates/react/igr-es6/projects/_base/files/src/views/home/style.css +0 -28
- package/templates/react/igr-es6/projects/_base/index.d.ts +0 -29
- package/templates/react/igr-es6/projects/_base/index.js +0 -81
- package/templates/react/igr-es6/projects/top-nav/files/src/App.css +0 -59
- package/templates/react/igr-es6/projects/top-nav/files/src/App.js +0 -36
- package/templates/react/igr-es6/projects/top-nav/files/src/components/navigation-header/index.js +0 -37
- package/templates/react/igr-es6/projects/top-nav/files/src/setupTests.js +0 -4
- package/templates/react/igr-es6/projects/top-nav/index.d.ts +0 -14
- package/templates/react/igr-es6/projects/top-nav/index.js +0 -45
- package/templates/react/igr-es6/radial-gauge/default/files/src/views/__path__/index.js +0 -66
- package/templates/react/igr-es6/radial-gauge/default/files/src/views/__path__/style.css +0 -12
- package/templates/react/igr-es6/radial-gauge/default/files/src/views/__path__/test.js +0 -9
- package/templates/react/igr-es6/radial-gauge/default/index.d.ts +0 -1
- package/templates/react/igr-es6/radial-gauge/default/index.js +0 -18
- package/templates/react/igr-es6/radial-gauge/index.d.ts +0 -1
- package/templates/react/igr-es6/radial-gauge/index.js +0 -16
|
@@ -4,11 +4,10 @@ const cli_core_1 = require("@igniteui/cli-core");
|
|
|
4
4
|
class IgrTsReactProjectLibrary extends cli_core_1.BaseProjectLibrary {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(__dirname);
|
|
7
|
-
this.name = "Ignite UI for React
|
|
7
|
+
this.name = "Ignite UI for React";
|
|
8
8
|
this.projectType = "igr-ts";
|
|
9
9
|
this.themes = ["default"];
|
|
10
10
|
const groups = require("./groups.json");
|
|
11
|
-
// tslint:disable-next-line:forin
|
|
12
11
|
for (const key in groups) {
|
|
13
12
|
this.groupDescriptions.set(key, groups[key]);
|
|
14
13
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
You are an expert in building front-end web applications with React with deep knowledge of modern hooks, TypeScript, and cutting-edge frontend architecture. You are familiar with the igniteui-react library. You prioritize performance optimizations and accessibility best practices in your work.
|
|
2
|
+
|
|
3
|
+
## Your Expertise
|
|
4
|
+
|
|
5
|
+
- **React 19.2 Features**: Expert in `<Activity>` component, `useEffectEvent()`, and React Performance Tracks
|
|
6
|
+
- **React 19 Core Features**: Mastery of `use()` hook, `useFormStatus`, `useOptimistic`, `useActionState`, and Actions API
|
|
7
|
+
- **Concurrent Rendering**: Expert knowledge of concurrent rendering patterns, transitions, and Suspense boundaries
|
|
8
|
+
- **Modern Hooks**: Deep knowledge of all React hooks including new ones and advanced composition patterns
|
|
9
|
+
- **TypeScript Integration**: Advanced TypeScript patterns with improved React 19 type inference and type safety
|
|
10
|
+
- **Form Handling**: Expert in modern form patterns with Actions API, validation, and optimistic updates
|
|
11
|
+
- **State Management**: Mastery of React Context, Zustand, Redux Toolkit, and choosing the right solution
|
|
12
|
+
- **Performance Optimization**: Expert in React.memo, useMemo, useCallback, code splitting, lazy loading, and Core Web Vitals
|
|
13
|
+
- **Testing Strategies**: Comprehensive testing with Vitest, React Testing Library, and Playwright/Cypress
|
|
14
|
+
- **Accessibility**: WCAG compliance, semantic HTML, ARIA attributes, and keyboard navigation
|
|
15
|
+
- **Vite**: Configuration, plugins, environment variables, and build optimization
|
|
16
|
+
- **Design Systems**: Material UI, Shadcn/ui, and custom design system architecture
|
|
17
|
+
|
|
18
|
+
## Your Approach
|
|
19
|
+
|
|
20
|
+
- **React 19.2 First**: Leverage the latest features including `<Activity>`, `useEffectEvent()`, and Performance Tracks
|
|
21
|
+
- **Modern Hooks**: Use `use()`, `useFormStatus`, `useOptimistic`, and `useActionState` for cutting-edge patterns
|
|
22
|
+
- **Actions for Forms**: Use Actions API for client-side form handling
|
|
23
|
+
- **Concurrent by Default**: Leverage concurrent rendering with `startTransition` and `useDeferredValue`
|
|
24
|
+
- **TypeScript Throughout**: Use comprehensive type safety with React 19's improved type inference
|
|
25
|
+
- **Performance-First**: Optimize rendering, bundle size, and runtime performance
|
|
26
|
+
- **Accessibility by Default**: Build inclusive interfaces following WCAG 2.1 AA standards
|
|
27
|
+
- **Test-Driven**: Write tests alongside components using Vitest and React Testing Library best practices
|
|
28
|
+
- **Modern Development**: Use Vite, ESLint, Prettier, and modern tooling for optimal DX
|
|
29
|
+
|
|
30
|
+
## Guidelines
|
|
31
|
+
|
|
32
|
+
- Always use functional components with hooks - class components are legacy
|
|
33
|
+
- Leverage React 19.2 features: `<Activity>`, `useEffectEvent()`, Performance Tracks
|
|
34
|
+
- Use the `use()` hook for promise handling and async data fetching
|
|
35
|
+
- Implement forms with Actions API and `useFormStatus` for loading states
|
|
36
|
+
- Use `useOptimistic` for optimistic UI updates during async operations
|
|
37
|
+
- Use `useActionState` for managing action state and form submissions
|
|
38
|
+
- Leverage `useEffectEvent()` to extract non-reactive logic from effects (React 19.2)
|
|
39
|
+
- Use `<Activity>` component to manage UI visibility and state preservation (React 19.2)
|
|
40
|
+
- **Ref as Prop** (React 19): Pass `ref` directly as prop - no need for `forwardRef` anymore
|
|
41
|
+
- **Context without Provider** (React 19): Render context directly instead of `Context.Provider`
|
|
42
|
+
- Use `startTransition` for non-urgent updates to keep the UI responsive
|
|
43
|
+
- Leverage Suspense boundaries for async data fetching and code splitting
|
|
44
|
+
- No need to import React in every file - new JSX transform handles it
|
|
45
|
+
- Use strict TypeScript with proper interface design and discriminated unions
|
|
46
|
+
- Implement proper error boundaries for graceful error handling
|
|
47
|
+
- Use semantic HTML elements (`<button>`, `<nav>`, `<main>`, etc.) for accessibility
|
|
48
|
+
- Ensure all interactive elements are keyboard accessible
|
|
49
|
+
- Optimize images with lazy loading and modern formats (WebP, AVIF)
|
|
50
|
+
- Use React DevTools Performance panel with React 19.2 Performance Tracks
|
|
51
|
+
- Implement code splitting with `React.lazy()` and dynamic imports
|
|
52
|
+
- Use proper dependency arrays in `useEffect`, `useMemo`, and `useCallback`
|
|
53
|
+
- Ref callbacks can now return cleanup functions for easier cleanup management
|
|
54
|
+
- Use Vite's `import.meta.env` for environment variables
|
|
55
|
+
|
|
56
|
+
## Common Scenarios You Excel At
|
|
57
|
+
|
|
58
|
+
- **Building Modern React Apps**: Setting up projects with Vite, TypeScript, React 19.2, and modern tooling
|
|
59
|
+
- **Implementing New Hooks**: Using `use()`, `useFormStatus`, `useOptimistic`, `useActionState`, `useEffectEvent()`
|
|
60
|
+
- **React 19 Quality-of-Life Features**: Ref as prop, context without provider, ref callback cleanup, document metadata
|
|
61
|
+
- **Form Handling**: Creating forms with Actions API, validation, and optimistic updates
|
|
62
|
+
- **State Management**: Choosing and implementing the right state solution (Context, Zustand, Redux Toolkit)
|
|
63
|
+
- **Async Data Fetching**: Using `use()` hook, Suspense, and error boundaries for data loading
|
|
64
|
+
- **Performance Optimization**: Analyzing bundle size, implementing code splitting, optimizing re-renders
|
|
65
|
+
- **Component Visibility**: Implementing `<Activity>` component for state preservation across navigation
|
|
66
|
+
- **Accessibility Implementation**: Building WCAG-compliant interfaces with proper ARIA and keyboard support
|
|
67
|
+
- **Complex UI Patterns**: Implementing modals, dropdowns, tabs, accordions, and data tables
|
|
68
|
+
- **Animation**: Using React Spring, Framer Motion, or CSS transitions for smooth animations
|
|
69
|
+
- **Testing**: Writing comprehensive unit, integration, and e2e tests
|
|
70
|
+
- **TypeScript Patterns**: Advanced typing for hooks, HOCs, render props, and generic components
|
|
71
|
+
- **Vite Configuration**: Configuring plugins, aliases, proxies, and build output
|
|
72
|
+
|
|
73
|
+
## Response Style
|
|
74
|
+
|
|
75
|
+
- Provide complete, working React 19.2 code following modern best practices
|
|
76
|
+
- Include all necessary imports (no React import needed thanks to new JSX transform)
|
|
77
|
+
- Add inline comments explaining React 19 patterns and why specific approaches are used
|
|
78
|
+
- Show proper TypeScript types for all props, state, and return values
|
|
79
|
+
- Demonstrate when to use new hooks like `use()`, `useFormStatus`, `useOptimistic`, `useEffectEvent()`
|
|
80
|
+
- Show proper error handling with error boundaries
|
|
81
|
+
- Include accessibility attributes (ARIA labels, roles, etc.)
|
|
82
|
+
- Provide testing examples when creating components
|
|
83
|
+
- Highlight performance implications and optimization opportunities
|
|
84
|
+
- Show both basic and production-ready implementations
|
|
85
|
+
- Mention React 19.2 features when they provide value
|
|
86
|
+
|
|
87
|
+
## Advanced Capabilities You Know
|
|
88
|
+
|
|
89
|
+
- **`use()` Hook Patterns**: Advanced promise handling, resource reading, and context consumption
|
|
90
|
+
- **`<Activity>` Component**: UI visibility and state preservation patterns (React 19.2)
|
|
91
|
+
- **`useEffectEvent()` Hook**: Extracting non-reactive logic for cleaner effects (React 19.2)
|
|
92
|
+
- **Actions API**: Client-side form actions and progressive enhancement patterns
|
|
93
|
+
- **Optimistic Updates**: Complex optimistic UI patterns with `useOptimistic`
|
|
94
|
+
- **Concurrent Rendering**: Advanced `startTransition`, `useDeferredValue`, and priority patterns
|
|
95
|
+
- **Suspense Patterns**: Nested suspense boundaries, batched reveals, and error handling
|
|
96
|
+
- **Ref as Prop (React 19)**: Using refs without `forwardRef` for cleaner component APIs
|
|
97
|
+
- **Context Without Provider (React 19)**: Rendering context directly for simpler code
|
|
98
|
+
- **Ref Callbacks with Cleanup (React 19)**: Returning cleanup functions from ref callbacks
|
|
99
|
+
- **Document Metadata (React 19)**: Placing `<title>`, `<meta>`, `<link>` directly in components
|
|
100
|
+
- **useDeferredValue Initial Value (React 19)**: Providing initial values for better UX
|
|
101
|
+
- **Custom Hooks**: Advanced hook composition, generic hooks, and reusable logic extraction
|
|
102
|
+
- **Render Optimization**: Understanding React's rendering cycle and preventing unnecessary re-renders
|
|
103
|
+
- **Context Optimization**: Context splitting, selector patterns, and preventing context re-render issues
|
|
104
|
+
- **Portal Patterns**: Using portals for modals, tooltips, and z-index management
|
|
105
|
+
- **Error Boundaries**: Advanced error handling with fallback UIs and error recovery
|
|
106
|
+
- **Performance Profiling**: Using React DevTools Profiler and Performance Tracks (React 19.2)
|
|
107
|
+
- **Bundle Analysis**: Analyzing and optimizing bundle size with Vite's build output and rollup-plugin-visualizer
|
|
108
|
+
|
|
109
|
+
## UI Components
|
|
110
|
+
|
|
111
|
+
- Use `igniteui-react`.
|
package/templates/react/index.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
You are an expert in building front-end web applications. You have a strong understanding of modern web standards, including custom elements, Shadow DOM, and CSS custom properties. You are proficient in TypeScript and follow best practices for writing clean, maintainable code. You have experience with the Lit framework and are familiar with the igniteui-webcomponents library. You prioritize performance optimizations and accessibility best practices in your work.
|
|
2
|
+
|
|
3
|
+
## Coding Standards
|
|
4
|
+
|
|
5
|
+
- Use standard ESM imports.
|
|
6
|
+
- TypeScript imports end with `.js` extension.
|
|
7
|
+
- Focuses on native, modern browser features, including custom elements, Shadow DOM and CSS custom properties.
|
|
8
|
+
- Follows latest ECMAScript standards and best practices.
|
|
9
|
+
- Avoids heavy reliance on third-party libraries unless absolutely necessary.
|
|
10
|
+
- Prioritizes performance optimizations and accessibility best practices.
|
|
11
|
+
- Writes clean, maintainable, and well-documented code.
|
|
12
|
+
- Includes unit tests for components to ensure reliability and ease of maintenance.
|
|
13
|
+
|
|
14
|
+
## TypeScript Best Practices
|
|
15
|
+
|
|
16
|
+
- Use strict type checking.
|
|
17
|
+
- Avoid using `any` type; use `unknown` when type is uncertain.
|
|
18
|
+
- Decorators are used, but other non-standard TypeScript features are avoided.
|
|
19
|
+
|
|
20
|
+
## Styling Guidelines
|
|
21
|
+
|
|
22
|
+
- Component styles are written in external SCSS files, transpiled to TS files using Lit's `css` function and imported into the component.
|
|
23
|
+
- Internal parts of components are styled using part selectors.
|
|
24
|
+
- The project uses the igniteui-theming package for consistent theming across components.
|
|
25
|
+
|
|
26
|
+
## State Management
|
|
27
|
+
|
|
28
|
+
- Use Lit's reactive properties for state management within components.
|
|
29
|
+
- If state needs to be shared across multiple components, consider using the Lit context API.
|
|
30
|
+
|
|
31
|
+
## UI Components
|
|
32
|
+
|
|
33
|
+
- Use `igniteui-webcomponents`.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { AddTemplateArgs, Config, ControlExtraConfiguration, FsFileSystem, Template } from "@igniteui/cli-core";
|
|
2
|
-
export declare class AngularTemplate implements Template {
|
|
3
|
-
private rootPath;
|
|
4
|
-
components: string[];
|
|
5
|
-
controlGroup: string;
|
|
6
|
-
listInComponentTemplates: boolean;
|
|
7
|
-
listInCustomTemplates: boolean;
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
dependencies: Array<string | object>;
|
|
12
|
-
framework: string;
|
|
13
|
-
projectType: string;
|
|
14
|
-
hasExtraConfiguration: boolean;
|
|
15
|
-
packages: any[];
|
|
16
|
-
delimiters: import("@igniteui/cli-core").TemplateDelimiters;
|
|
17
|
-
protected widget: string;
|
|
18
|
-
protected fileSystem: FsFileSystem;
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new AngularTemplate for a root path (pass in __dirname)
|
|
21
|
-
*/
|
|
22
|
-
constructor(rootPath: string);
|
|
23
|
-
get templatePaths(): string[];
|
|
24
|
-
generateConfig(name: string, options: {}): {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
};
|
|
27
|
-
registerInProject(projectPath: string, name: string, options?: AddTemplateArgs): void;
|
|
28
|
-
getExtraConfiguration(): ControlExtraConfiguration[];
|
|
29
|
-
setExtraConfiguration(extraConfigKeys: {}): void;
|
|
30
|
-
protected getBaseVariables(name: string): {};
|
|
31
|
-
protected ensureSourceFiles(projectPath: string): void;
|
|
32
|
-
/**
|
|
33
|
-
* Register igniteui-angular-wrappers(ig-ts) resources under the project"s angular.json scripts and styles collections,
|
|
34
|
-
* so these are picked by Angular"s internal webpack to build and serve
|
|
35
|
-
*/
|
|
36
|
-
protected registerSourceFiles(config: Config, projectPath: string): void;
|
|
37
|
-
protected folderName(pathName: string): string;
|
|
38
|
-
protected fileName(pathName: string): string;
|
|
39
|
-
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.AngularTemplate = void 0;
|
|
27
|
-
const cli_core_1 = require("@igniteui/cli-core");
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
class AngularTemplate {
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new AngularTemplate for a root path (pass in __dirname)
|
|
32
|
-
*/
|
|
33
|
-
constructor(rootPath) {
|
|
34
|
-
this.rootPath = rootPath;
|
|
35
|
-
this.listInComponentTemplates = true;
|
|
36
|
-
this.listInCustomTemplates = false;
|
|
37
|
-
this.dependencies = [];
|
|
38
|
-
this.framework = "angular";
|
|
39
|
-
this.hasExtraConfiguration = false;
|
|
40
|
-
this.packages = [];
|
|
41
|
-
this.delimiters = cli_core_1.defaultDelimiters;
|
|
42
|
-
this.fileSystem = new cli_core_1.FsFileSystem();
|
|
43
|
-
}
|
|
44
|
-
get templatePaths() {
|
|
45
|
-
return [path.join(this.rootPath, "files")];
|
|
46
|
-
}
|
|
47
|
-
generateConfig(name, options) {
|
|
48
|
-
if (options["modulePath"] && !cli_core_1.Util.fileExists(path.join(process.cwd(), `src\\app`, options["modulePath"]))) {
|
|
49
|
-
cli_core_1.Util.error(`Wrong module path provided: ${options["modulePath"]}. No components were added!`);
|
|
50
|
-
return Promise.resolve(false);
|
|
51
|
-
}
|
|
52
|
-
const config = Object.assign({}, options["extraConfig"], this.getBaseVariables(name));
|
|
53
|
-
return config;
|
|
54
|
-
}
|
|
55
|
-
registerInProject(projectPath, name, options) {
|
|
56
|
-
let modulePath = "app.module.ts";
|
|
57
|
-
if (options && options.modulePath) {
|
|
58
|
-
modulePath = options.modulePath;
|
|
59
|
-
}
|
|
60
|
-
// D.P. Don't use the top-level import as that chains import of typescript
|
|
61
|
-
// which slows down execution of the entire component noticeably (template loading)
|
|
62
|
-
// https://www.typescriptlang.org/docs/handbook/modules.html#dynamic-module-loading-in-nodejs
|
|
63
|
-
// tslint:disable-next-line:variable-name
|
|
64
|
-
const TsUpdate =
|
|
65
|
-
// tslint:disable-next-line:no-submodule-imports
|
|
66
|
-
require("@igniteui/angular-templates").AngularTypeScriptFileUpdate;
|
|
67
|
-
const componentPath = path.join(projectPath, `src/app/components/${this.folderName(name)}/${this.fileName(name)}.component.ts`);
|
|
68
|
-
const className = `${cli_core_1.Util.className(cli_core_1.Util.nameFromPath(name))}Component`;
|
|
69
|
-
if (!(options && options.skipRoute)) {
|
|
70
|
-
//1) import the component class name,
|
|
71
|
-
//2) and populate the Routes array with the path and component
|
|
72
|
-
//for example: { path: "combo", component: ComboComponent }
|
|
73
|
-
const routingModulePath = path.join(projectPath, "src/app/app-routing.module.ts");
|
|
74
|
-
const routingModule = new TsUpdate(routingModulePath, false, { singleQuotes: false });
|
|
75
|
-
routingModule.addRoute({
|
|
76
|
-
path: this.folderName(name),
|
|
77
|
-
identifierName: className,
|
|
78
|
-
modulePath: cli_core_1.Util.relativePath(routingModulePath, componentPath, true, true),
|
|
79
|
-
data: { text: cli_core_1.Util.nameFromPath(name) }
|
|
80
|
-
});
|
|
81
|
-
routingModule.finalize();
|
|
82
|
-
}
|
|
83
|
-
//3) add an import of the component class from its file location.
|
|
84
|
-
//4) populate the declarations portion of the @NgModule with the component class name.
|
|
85
|
-
const mainModulePath = path.join(projectPath, `src/app/${modulePath}`);
|
|
86
|
-
const relativePath = cli_core_1.Util.relativePath(mainModulePath, componentPath, true, true);
|
|
87
|
-
const mainModule = new TsUpdate(mainModulePath, false, { singleQuotes: false });
|
|
88
|
-
mainModule.addNgModuleMeta({
|
|
89
|
-
declare: [className],
|
|
90
|
-
from: relativePath,
|
|
91
|
-
export: modulePath !== "app.module.ts" ? [className] : []
|
|
92
|
-
});
|
|
93
|
-
mainModule.finalize();
|
|
94
|
-
this.ensureSourceFiles(projectPath);
|
|
95
|
-
}
|
|
96
|
-
getExtraConfiguration() {
|
|
97
|
-
return [];
|
|
98
|
-
}
|
|
99
|
-
setExtraConfiguration(extraConfigKeys) { }
|
|
100
|
-
getBaseVariables(name) {
|
|
101
|
-
const config = {};
|
|
102
|
-
config["name"] = cli_core_1.Util.nameFromPath(name);
|
|
103
|
-
config["ClassName"] = cli_core_1.Util.className(cli_core_1.Util.nameFromPath(name));
|
|
104
|
-
config["path"] = this.folderName(name);
|
|
105
|
-
config["filePrefix"] = this.fileName(name);
|
|
106
|
-
config["description"] = this.description;
|
|
107
|
-
config["cliVersion"] = cli_core_1.Util.version();
|
|
108
|
-
config["camelCaseName"] = cli_core_1.Util.camelCase(name);
|
|
109
|
-
if (this.widget) {
|
|
110
|
-
config["widget"] = this.widget;
|
|
111
|
-
}
|
|
112
|
-
if (this.name) {
|
|
113
|
-
config["nameMerged"] = this.name.replace(/ /g, "");
|
|
114
|
-
}
|
|
115
|
-
return config;
|
|
116
|
-
}
|
|
117
|
-
ensureSourceFiles(projectPath) {
|
|
118
|
-
// tslint:disable-next-line:no-submodule-imports
|
|
119
|
-
const components = require("@igniteui/cli-core/packages/components");
|
|
120
|
-
const config = cli_core_1.ProjectConfig.getConfig();
|
|
121
|
-
const files = config.project.sourceFiles;
|
|
122
|
-
const dvDependencies = this.dependencies.filter(x => components.dv.indexOf(x) !== -1);
|
|
123
|
-
if (dvDependencies.length && files.indexOf("infragistics.dv.js") === -1) {
|
|
124
|
-
files.push("infragistics.dv.js");
|
|
125
|
-
cli_core_1.ProjectConfig.setConfig(config);
|
|
126
|
-
}
|
|
127
|
-
if (this.dependencies.indexOf("igExcel") !== -1 && files.indexOf("infragistics.excel-bundled.js") === -1) {
|
|
128
|
-
files.push("infragistics.excel-bundled.js");
|
|
129
|
-
cli_core_1.ProjectConfig.setConfig(config);
|
|
130
|
-
}
|
|
131
|
-
if (this.dependencies.indexOf("igGridExcelExporter") !== -1
|
|
132
|
-
&& files.indexOf("modules/infragistics.gridexcelexporter.js") === -1) {
|
|
133
|
-
files.push("modules/infragistics.gridexcelexporter.js");
|
|
134
|
-
cli_core_1.ProjectConfig.setConfig(config);
|
|
135
|
-
}
|
|
136
|
-
// ensure ig-ts resource files registration
|
|
137
|
-
if (this.projectType === "ig-ts") {
|
|
138
|
-
this.registerSourceFiles(config, projectPath);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Register igniteui-angular-wrappers(ig-ts) resources under the project"s angular.json scripts and styles collections,
|
|
143
|
-
* so these are picked by Angular"s internal webpack to build and serve
|
|
144
|
-
*/
|
|
145
|
-
registerSourceFiles(config, projectPath) {
|
|
146
|
-
const fs = cli_core_1.App.container.get(cli_core_1.FS_TOKEN);
|
|
147
|
-
const sourceFiles = config.project.sourceFiles;
|
|
148
|
-
const igniteuiSource = config.project.igniteuiSource;
|
|
149
|
-
const themeCSS = "css/themes/infragistics/infragistics.theme.css";
|
|
150
|
-
const infragisticsCSS = "css/structure/infragistics.css";
|
|
151
|
-
let workspaceConfigObj;
|
|
152
|
-
let updateFile = false;
|
|
153
|
-
const workspacePath = path.join(projectPath, "angular.json");
|
|
154
|
-
if (this.fileSystem.fileExists(workspacePath)) {
|
|
155
|
-
workspaceConfigObj = JSON.parse(this.fileSystem.readFile(workspacePath));
|
|
156
|
-
const scripts = workspaceConfigObj.projects[Object.keys(workspaceConfigObj.projects)[0]].architect.build.options.scripts;
|
|
157
|
-
let styles = workspaceConfigObj.projects[Object.keys(workspaceConfigObj.projects)[0]].architect.build.options.styles;
|
|
158
|
-
if (!styles.find(x => { var _a; return (_a = x.input) === null || _a === void 0 ? void 0 : _a.includes(themeCSS); }) || !styles.find(x => { var _a; return (_a = x.input) === null || _a === void 0 ? void 0 : _a.includes(infragisticsCSS); })) {
|
|
159
|
-
styles = igniteuiSource === "@infragistics/ignite-ui-full/en/" ?
|
|
160
|
-
styles.push({ input: `${"@infragistics/ignite-ui-full/en/" + themeCSS}` }, { input: `${"@infragistics/ignite-ui-full/en/" + infragisticsCSS}` }) :
|
|
161
|
-
styles.push({ input: `${"ignite-ui/" + themeCSS}` }, { input: `${"ignite-ui/" + infragisticsCSS}` });
|
|
162
|
-
updateFile = true;
|
|
163
|
-
}
|
|
164
|
-
for (const fileName of sourceFiles) {
|
|
165
|
-
if (!scripts.find(x => x.bundleName === fileName)) {
|
|
166
|
-
scripts.push({
|
|
167
|
-
bundleName: fileName,
|
|
168
|
-
input: `${igniteuiSource + "/js/" + fileName}`
|
|
169
|
-
});
|
|
170
|
-
updateFile = true;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (updateFile) {
|
|
174
|
-
fs.writeFile(workspacePath, cli_core_1.Util.formatAngularJsonOptions(workspaceConfigObj));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
cli_core_1.Util.log(`No angular.json file found! May have to manually add igniteui-angular-wrappers styles and scripts
|
|
179
|
-
(infragistics.core.js, infragistics.lob.js, etc.) to the corresponding angular.json styles and scripts collections`);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
folderName(pathName) {
|
|
183
|
-
//TODO: should remove the spaces
|
|
184
|
-
const parts = path.parse(pathName);
|
|
185
|
-
let folderName = pathName;
|
|
186
|
-
if (parts.dir) {
|
|
187
|
-
folderName = path.join(parts.dir, parts.name);
|
|
188
|
-
folderName = folderName.replace(/\\/g, "/");
|
|
189
|
-
// TODO: config-based "src/app"?
|
|
190
|
-
const relative = path.join(process.cwd(), "src/app", folderName);
|
|
191
|
-
// path.join will also resolve any ".." segments
|
|
192
|
-
// so if relative result doesn't start with CWD it's out of project root
|
|
193
|
-
if (!relative.startsWith(process.cwd())) {
|
|
194
|
-
cli_core_1.Util.error(`Path ${"src/app/" + folderName} is not valid!`, "red");
|
|
195
|
-
process.exit(1);
|
|
196
|
-
}
|
|
197
|
-
//clean up potential leading spaces in folder names (`path/ name`):
|
|
198
|
-
folderName = folderName.replace(/\/\s+/g, "/");
|
|
199
|
-
}
|
|
200
|
-
return cli_core_1.Util.lowerDashed(folderName);
|
|
201
|
-
}
|
|
202
|
-
fileName(pathName) {
|
|
203
|
-
const name = cli_core_1.Util.nameFromPath(pathName);
|
|
204
|
-
return cli_core_1.Util.lowerDashed(name);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
exports.AngularTemplate = AngularTemplate;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AddTemplateArgs, ControlExtraConfiguration, Template } from "@igniteui/cli-core";
|
|
2
|
-
export declare class ReactTemplate implements Template {
|
|
3
|
-
private rootPath;
|
|
4
|
-
components: string[];
|
|
5
|
-
controlGroup: string;
|
|
6
|
-
listInComponentTemplates: boolean;
|
|
7
|
-
listInCustomTemplates: boolean;
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
dependencies: string[];
|
|
12
|
-
framework: string;
|
|
13
|
-
projectType: string;
|
|
14
|
-
hasExtraConfiguration: boolean;
|
|
15
|
-
packages: any[];
|
|
16
|
-
delimiters: import("@igniteui/cli-core").TemplateDelimiters;
|
|
17
|
-
protected widget: string;
|
|
18
|
-
private appRoutsPath;
|
|
19
|
-
private igniteResources;
|
|
20
|
-
/**
|
|
21
|
-
* Base ReactTemplate constructor
|
|
22
|
-
* @param rootPath The template folder path. Pass in `__dirname`
|
|
23
|
-
*/
|
|
24
|
-
constructor(rootPath: string);
|
|
25
|
-
get templatePaths(): string[];
|
|
26
|
-
generateConfig(name: string, options: {}): {
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
registerInProject(projectPath: string, name: string, options?: AddTemplateArgs): void;
|
|
30
|
-
getExtraConfiguration(): ControlExtraConfiguration[];
|
|
31
|
-
setExtraConfiguration(extraConfigKeys: {}): void;
|
|
32
|
-
protected folderName(pathName: string): string;
|
|
33
|
-
protected getViewLink(name: string): string;
|
|
34
|
-
protected registerSourceFiles(projectPath: string): void;
|
|
35
|
-
protected getNavText(name: string): string;
|
|
36
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ReactTemplate = void 0;
|
|
27
|
-
const cli_core_1 = require("@igniteui/cli-core");
|
|
28
|
-
const fs = __importStar(require("fs"));
|
|
29
|
-
const path = __importStar(require("path"));
|
|
30
|
-
class ReactTemplate {
|
|
31
|
-
/**
|
|
32
|
-
* Base ReactTemplate constructor
|
|
33
|
-
* @param rootPath The template folder path. Pass in `__dirname`
|
|
34
|
-
*/
|
|
35
|
-
constructor(rootPath) {
|
|
36
|
-
this.rootPath = rootPath;
|
|
37
|
-
this.listInComponentTemplates = true;
|
|
38
|
-
this.listInCustomTemplates = false;
|
|
39
|
-
this.dependencies = [];
|
|
40
|
-
this.framework = "react";
|
|
41
|
-
this.hasExtraConfiguration = false;
|
|
42
|
-
this.packages = [];
|
|
43
|
-
this.delimiters = cli_core_1.defaultDelimiters;
|
|
44
|
-
this.appRoutsPath = "./src/routes.json";
|
|
45
|
-
this.igniteResources = "src/igniteuiResources.js";
|
|
46
|
-
}
|
|
47
|
-
get templatePaths() {
|
|
48
|
-
return [path.join(this.rootPath, "files")];
|
|
49
|
-
}
|
|
50
|
-
generateConfig(name, options) {
|
|
51
|
-
let config = {};
|
|
52
|
-
if (options["extraConfig"]) {
|
|
53
|
-
config = options["extraConfig"];
|
|
54
|
-
}
|
|
55
|
-
config["path"] = this.folderName(name); //folder name allowed spaces, any casing
|
|
56
|
-
config["name"] = cli_core_1.Util.nameFromPath(name); // this name should not have restrictions
|
|
57
|
-
config["ClassName"] = cli_core_1.Util.className(cli_core_1.Util.nameFromPath(name)); //first letter capital, no spaces and no dashes,
|
|
58
|
-
config["cliVersion"] = cli_core_1.Util.version();
|
|
59
|
-
if (this.widget) {
|
|
60
|
-
config["widget"] = this.widget;
|
|
61
|
-
config["Control"] = cli_core_1.Util.className(this.widget);
|
|
62
|
-
}
|
|
63
|
-
if (this.description) {
|
|
64
|
-
config["description"] = this.description;
|
|
65
|
-
}
|
|
66
|
-
return config;
|
|
67
|
-
}
|
|
68
|
-
registerInProject(projectPath, name, options) {
|
|
69
|
-
if (options && options.skipRoute) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
// add Routing config for each added component
|
|
73
|
-
const appRoutsFile = fs.readFileSync(path.join(projectPath, this.appRoutsPath), "utf8");
|
|
74
|
-
const viewsArr = JSON.parse(appRoutsFile);
|
|
75
|
-
viewsArr.push({
|
|
76
|
-
// tslint:disable:object-literal-sort-keys
|
|
77
|
-
path: "/" + this.folderName(cli_core_1.Util.nameFromPath(name)),
|
|
78
|
-
componentPath: this.getViewLink(name),
|
|
79
|
-
text: this.getNavText(name)
|
|
80
|
-
});
|
|
81
|
-
fs.writeFileSync(path.join(projectPath, this.appRoutsPath), JSON.stringify(viewsArr, null, 4));
|
|
82
|
-
this.registerSourceFiles(projectPath);
|
|
83
|
-
}
|
|
84
|
-
getExtraConfiguration() {
|
|
85
|
-
throw new Error("Method not implemented.");
|
|
86
|
-
}
|
|
87
|
-
setExtraConfiguration(extraConfigKeys) {
|
|
88
|
-
throw new Error("Method not implemented.");
|
|
89
|
-
}
|
|
90
|
-
folderName(pathName) {
|
|
91
|
-
//TODO: should remove the spaces
|
|
92
|
-
const parts = path.parse(pathName);
|
|
93
|
-
let folderName = pathName;
|
|
94
|
-
if (parts.dir) {
|
|
95
|
-
folderName = path.join(parts.dir, parts.name);
|
|
96
|
-
folderName = folderName.replace(/\\/g, "/");
|
|
97
|
-
// TODO: config-based "src/app"?
|
|
98
|
-
const relative = path.join(process.cwd(), "components", folderName);
|
|
99
|
-
// path.join will also resolve any '..' segments
|
|
100
|
-
// so if relative result doesn't start with CWD it's out of project root
|
|
101
|
-
if (!relative.startsWith(process.cwd())) {
|
|
102
|
-
cli_core_1.Util.error(`Path ${"components/" + folderName} is not valid!`, "red");
|
|
103
|
-
process.exit(1);
|
|
104
|
-
}
|
|
105
|
-
//clean up potential leading spaces in folder names (`path/ name`):
|
|
106
|
-
folderName = folderName.replace(/\/\s+/g, "/");
|
|
107
|
-
}
|
|
108
|
-
return cli_core_1.Util.lowerDashed(folderName);
|
|
109
|
-
}
|
|
110
|
-
getViewLink(name) {
|
|
111
|
-
return "./components/" + this.folderName(name);
|
|
112
|
-
}
|
|
113
|
-
registerSourceFiles(projectPath) {
|
|
114
|
-
// tslint:disable:no-submodule-imports
|
|
115
|
-
const components = require("@igniteui/cli-core/packages/components");
|
|
116
|
-
const igResPath = path.join(projectPath, this.igniteResources);
|
|
117
|
-
try {
|
|
118
|
-
const fd = fs.openSync(igResPath, fs.constants.O_RDWR | fs.constants.O_CREAT);
|
|
119
|
-
let igniteuiResFile = fs.readFileSync(fd, "utf8");
|
|
120
|
-
const freeVersionPath = "ignite-ui/";
|
|
121
|
-
const fullVersionPath = "@infragistics/ignite-ui-full/en/";
|
|
122
|
-
const dvPath = "@infragistics/ignite-ui-full/en/js/infragistics.dv.js";
|
|
123
|
-
const dvDep = this.dependencies.filter(x => components.dv.indexOf(x) !== -1).length !== 0;
|
|
124
|
-
const fullDep = this.dependencies.filter(x => components.full.indexOf(x) !== -1).length !== 0;
|
|
125
|
-
if (fullDep) {
|
|
126
|
-
while (igniteuiResFile.includes(freeVersionPath)) {
|
|
127
|
-
igniteuiResFile = igniteuiResFile.replace(freeVersionPath, fullVersionPath);
|
|
128
|
-
igniteuiResFile = igniteuiResFile.replace("-lite", "");
|
|
129
|
-
}
|
|
130
|
-
fs.ftruncateSync(fd, 0);
|
|
131
|
-
fs.writeSync(fd, igniteuiResFile, 0);
|
|
132
|
-
}
|
|
133
|
-
if (dvDep && !igniteuiResFile.includes(dvPath)) {
|
|
134
|
-
const endPos = fs.fstatSync(fd).size;
|
|
135
|
-
fs.writeSync(fd, `\r\n// Ignite UI Charts Required JavaScript File\r\nimport "${dvPath}";\r\n`, endPos);
|
|
136
|
-
}
|
|
137
|
-
fs.closeSync(fd);
|
|
138
|
-
}
|
|
139
|
-
catch (err) {
|
|
140
|
-
cli_core_1.Util.error(`Error while updating igniteuiResources.js: ${err.message}`);
|
|
141
|
-
throw err;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
getNavText(name) {
|
|
145
|
-
name = cli_core_1.Util.nameFromPath(name);
|
|
146
|
-
return name.replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
exports.ReactTemplate = ReactTemplate;
|