Skip to content

Commit

Permalink
bug with react app generator for pascalCaseFiles
Browse files Browse the repository at this point in the history
`yarn nx generate @nrwl/react:application --name=react-pascal --style=none --e2eTestRunner=none --pascalCaseFiles
--no-interactive`
  • Loading branch information
kaltepeter committed Apr 1, 2022
1 parent 4ce39df commit a49b47d
Show file tree
Hide file tree
Showing 22 changed files with 1,318 additions and 8 deletions.
11 changes: 11 additions & 0 deletions apps/react-pascal/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic"
}
]
],
"plugins": []
}
16 changes: 16 additions & 0 deletions apps/react-pascal/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is used by:
# 1. autoprefixer to adjust CSS to support the below specified browsers
# 2. babel preset-env to adjust included polyfills
#
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# If you need to support different browsers in production, you may tweak the list below.

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
18 changes: 18 additions & 0 deletions apps/react-pascal/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
10 changes: 10 additions & 0 deletions apps/react-pascal/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
displayName: 'react-pascal',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/react-pascal',
};
73 changes: 73 additions & 0 deletions apps/react-pascal/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"root": "apps/react-pascal",
"sourceRoot": "apps/react-pascal/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/react-pascal",
"index": "apps/react-pascal/src/index.html",
"baseHref": "/",
"main": "apps/react-pascal/src/main.tsx",
"polyfills": "apps/react-pascal/src/polyfills.ts",
"tsConfig": "apps/react-pascal/tsconfig.app.json",
"assets": [
"apps/react-pascal/src/favicon.ico",
"apps/react-pascal/src/assets"
],
"styles": [],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/react-pascal/src/environments/environment.ts",
"with": "apps/react-pascal/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false
}
}
},
"serve": {
"executor": "@nrwl/web:dev-server",
"options": {
"buildTarget": "react-pascal:build",
"hmr": true
},
"configurations": {
"production": {
"buildTarget": "react-pascal:build:production",
"hmr": false
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/react-pascal/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/react-pascal"],
"options": {
"jestConfig": "apps/react-pascal/jest.config.js",
"passWithNoTests": true
}
}
},
"tags": []
}
17 changes: 17 additions & 0 deletions apps/react-pascal/src/app/App.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { render } from '@testing-library/react';

import App from './app';

describe('App', () => {
it('should render successfully', () => {
const { baseElement } = render(<App />);

expect(baseElement).toBeTruthy();
});

it('should have a greeting as the title', () => {
const { getByText } = render(<App />);

expect(getByText(/Welcome react-pascal/gi)).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions apps/react-pascal/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import NxWelcome from './nx-welcome';

export function App() {
return (
<>
<NxWelcome title="react-pascal" />
<div />
</>
);
}

export default App;

0 comments on commit a49b47d

Please sign in to comment.