Skip to content

React app generator#374

Open
qnowak wants to merge 19 commits into
onecx:mainfrom
qnowak:feat/react-app-generator
Open

React app generator#374
qnowak wants to merge 19 commits into
onecx:mainfrom
qnowak:feat/react-app-generator

Conversation

@qnowak

@qnowak qnowak commented May 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

qnowak and others added 19 commits May 15, 2026 15:13
…upport

- Add `@onecx/nx-plugin-react` package with React preset generator
- Implement plugin resolution system in create-workspace with flavor-based mapping
- Add validation for supported flavors (angular, react, ngrx, standalone-ngrx)
- Include AI agent rules for React, PrimeReact, PrimeFlex, React Router, and Vitest
- Add coding standards rules for DDD, ESLint, Prettier, and expert support level
- Improve error handling in create-workspace with proper exit codes
- Configure build,
- Add Apache-2.0 license file
- Update package.json with repository information and publish configuration
- Add required dependencies: @nx/react, enquirer, ora, picocolors, yaml, yargs
- Configure package as public with proper types and main entry points
- Update tsconfig to include ES2021 lib
…al steps

- Move AI agent configuration files from `files` to `files-ai` directory
- Split styles into separate directories: `files-styles-primeflex` and `files-styles-tailwind`
- Add new `styles` parameter to select between PrimeFlex and Tailwind CSS frameworks
- Add new `ai` parameter to optionally include AI agent configuration files
- Implement `StylesStep` and `AIStep` generator steps with conditional execution
- Add `isApplicable` method to `Gener
- Add @nx/eslint-plugin dependency to package.json
- Remove unused options parameter from addScriptsToPackageJson function
- Remove unnecessary isApplicable method from StylesStep class
- Fix indentation in OpenAPIUtil class
- Improve type safety in OpenAPIArraySectionUtil by using proper type assertion for item access
- Change @nx/devkit, @nx/eslint-plugin, and @nx/react from fixed versions to caret ranges (^19.8.14)
- Change directory paths from `${options.name}/` to `.` in React generator and steps
- Update react-i18next dependency from ^16.5.4 to ^17.0.8
- Fix react-router dependency version string formatting
- Bump nx-plugin-react version from 0.0.1 to 7.1.0
- Add error log file reading in create-workspace error handler
- Add publish-local script to package.json
- Remove unused options parameter from adaptTsConfig function
…ries

- Remove .tsx extension from App import in bootstrap.ts template
- Fix react-router dependency version string (remove extra quote)
- Update cleanup command to remove apps and libs directories along with .vscode
- Change generated API files location from `src/app/shared/generated` to `src/api/generated`
- Update .prettierignore and eslint.config.js to ignore new API path
- Remove unused imports from vite.config.ts (loadEnv, writeFileSync)
- Consolidate @module-federation/vite imports into single statement
- Fix ESLint rule formatting for @typescript-eslint/no-unused-vars (use single quotes)
…n in test mode

- Remove .tsx extensions from bootstrap.test.ts imports (bootstrap and App)
- Update setupFiles path from setupTests.tsx to setupTests.ts in vite.config.ts
- Conditionally exclude federation plugin when running in test mode to prevent module federation conflicts during testing
…ettings

- Add comprehensive README.md with development commands, project structure, and environment variables documentation
- Create environment.ts and environment.prod.ts configuration files
- Update Helm values to use correct exposed module name (OneCX<%= className %>RemoteModule) and tag name (onecx-<%= fileName %>-ui-entrypoint)
…ation

- Replace deprecated @tailwind directives with @import 'tailwindcss' in styles.css
- Add tailwindcss-primeui import for PrimeReact component styling
- Conditionally include @tailwindcss/vite plugin in vite.config.ts based on styles option
- Add tailwindcss-primeui dependency (^0.3.0) when Tailwind is selected
- Remove unused ModuleFederationOptions reference comment
- Update README.md to reflect API directory structure change (api/generated instead of app/shared/generated)
- Add tests for documentation links in Welcome component (OneCX GitHub link validation and link count verification)
- Fix tsconfig.app.json to reference bootstrap.ts instead of bootstrap.tsx
- Add @onecx/react-webcomponents mock with useAppHref to App.test.tsx
- Add withApp mock to bootstrap.test.ts
- Fix type assertion for App component call in App.test.tsx
- Update router.test.tsx to properly render AppRoutes component
- Remove trailing commas from mock objects for consistency
- Add main.tsx template for standalone development mode
- Update vite.config.ts to exclude environments and __mocks__ from coverage
- Add resolveJsonModule compiler option to tsconfig.app.json
- Bump On
@qnowak qnowak requested a review from BenjaminPabst June 2, 2026 07:20
Comment on lines +1 to +2
removeOperationIdPrefix: true
removeOperationIdPrefixCount: 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this apigen configuration?

Comment on lines +10 to +69
const mfConfig: ModuleFederationOptions = {
name: "onecx-<%= fileName %>-ui",
filename: "remoteEntry.js",
exposes: {
"./OneCX<%= className %>RemoteModule": "./src/bootstrap.ts",
},
shared: {
react: {
requiredVersion: dependencies.react,
singleton: true,
},
"react-dom": {
requiredVersion: dependencies["react-dom"],
singleton: true,
},
"react-router": {
requiredVersion: dependencies["react-router"],
singleton: true,
},
i18next: {
requiredVersion: dependencies.i18next,
singleton: true,
},
"react-i18next": {
requiredVersion: dependencies["react-i18next"],
singleton: true,
},
primereact: {
requiredVersion: dependencies.primereact,
singleton: true,
},
"@onecx/accelerator": {
requiredVersion: dependencies["@onecx/accelerator"],
singleton: true,
},
"@onecx/integration-interface": {
requiredVersion: dependencies["@onecx/integration-interface"],
singleton: true,
},
"@onecx/react-utils": {
requiredVersion: dependencies["@onecx/react-utils"],
singleton: true,
},
"@onecx/react-remote-components": {
requiredVersion: dependencies["@onecx/react-remote-components"],
singleton: true,
},
"@onecx/react-integration-interface": {
requiredVersion: dependencies["@onecx/react-integration-interface"],
singleton: true,
},
"@onecx/react-webcomponents": {
requiredVersion: dependencies["@onecx/react-webcomponents"],
singleton: true,
},
"@onecx/react-auth": {
requiredVersion: dependencies["@onecx/react-auth"],
singleton: true,
},
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also cover this via the shared function that is used in angular+libs now?
@markuczy @bastianjakobi

Comment on lines +30 to +46
"aiTool": {
"type": "string",
"description": "Which AI tool to configure (none to skip)",
"enum": ["none", "agents", "copilot", "both"],
"default": "none",
"x-prompt": {
"message": "Would you like to add AI agent configuration files?",
"type": "list",
"items": [
{ "value": "none", "label": "No" },
{ "value": "agents", "label": ".agents (Cursor / Windsurf)" },
{ "value": "copilot", "label": "GitHub Copilot" },
{ "value": "both", "label": "Both" }
]
}
}
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have it here and in the parameter section it can be input via nx cli and via enquirer/the custom interactive system, is this intentional?

@@ -0,0 +1,29 @@
{
"name": "@onecx/nx-plugin-react",
"version": "7.1.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 8.0.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants