Skip to content

Commit e166226

Browse files
committed
Add react-props on examples-react
1 parent c517031 commit e166226

File tree

25 files changed

+334
-21620
lines changed

25 files changed

+334
-21620
lines changed

application-angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "17.0.7",
44
"scripts": {
55
"ng": "ng",
6+
"dev": "ng serve --port 4200",
67
"start": "ng serve --port 4200",
78
"build": "ng build",
89
"watch": "ng build --watch --configuration development",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"dbaeumer.vscode-eslint",
6+
"firsttris.vscode-jest-runner"
7+
]
8+
}

examples-react/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,19 @@
3131

3232
### Compilation
3333
* `npm run build-starter`
34+
35+
36+
37+
## Props
38+
## Development
39+
* `npm run start-props`
40+
* in your browser [http://localhost:4200](http://localhost:4200)
41+
42+
## Linter
43+
* `npm run lint-props`
44+
45+
## Tests
46+
* `npm run test-props`
47+
48+
### Compilation
49+
* `npm run build-props`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
[
4+
"@nx/react/babel",
5+
{
6+
"runtime": "automatic"
7+
}
8+
]
9+
],
10+
"plugins": []
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* eslint-disable */
2+
module.exports = {
3+
displayName: 'react-props',
4+
preset: '../../jest.preset.js',
5+
transform: {
6+
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
7+
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
8+
},
9+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
10+
coverageDirectory: '../../coverage/apps/react-props',
11+
};
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"name": "react-props",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/react-props/src",
5+
"projectType": "application",
6+
"targets": {
7+
"build": {
8+
"executor": "@nx/webpack:webpack",
9+
"outputs": ["{options.outputPath}"],
10+
"defaultConfiguration": "production",
11+
"options": {
12+
"compiler": "babel",
13+
"outputPath": "dist/apps/react-props",
14+
"index": "apps/react-props/src/index.html",
15+
"baseHref": "/",
16+
"main": "apps/react-props/src/main.js",
17+
"tsConfig": "apps/react-props/tsconfig.app.json",
18+
"assets": [
19+
"apps/react-props/src/favicon.ico",
20+
"apps/react-props/src/assets"
21+
],
22+
"styles": ["apps/react-props/src/styles.css"],
23+
"scripts": [],
24+
"webpackConfig": "apps/react-props/webpack.config.js"
25+
},
26+
"configurations": {
27+
"development": {
28+
"extractLicenses": false,
29+
"optimization": false,
30+
"sourceMap": true,
31+
"vendorChunk": true
32+
},
33+
"production": {
34+
"fileReplacements": [
35+
{
36+
"replace": "apps/react-props/src/environments/environment.js",
37+
"with": "apps/react-props/src/environments/environment.prod.js"
38+
}
39+
],
40+
"optimization": true,
41+
"outputHashing": "all",
42+
"sourceMap": false,
43+
"namedChunks": false,
44+
"extractLicenses": true,
45+
"vendorChunk": false
46+
}
47+
}
48+
},
49+
"serve": {
50+
"executor": "@nx/webpack:dev-server",
51+
"defaultConfiguration": "development",
52+
"options": {
53+
"buildTarget": "react-props:build",
54+
"hmr": true
55+
},
56+
"configurations": {
57+
"development": {
58+
"buildTarget": "react-props:build:development"
59+
},
60+
"production": {
61+
"buildTarget": "react-props:build:production",
62+
"hmr": false
63+
}
64+
}
65+
},
66+
"lint": {
67+
"executor": "@nx/eslint:lint",
68+
"outputs": ["{options.outputFile}"]
69+
},
70+
"serve-static": {
71+
"executor": "@nx/web:file-server",
72+
"options": {
73+
"buildTarget": "react-props:build"
74+
}
75+
},
76+
"test": {
77+
"executor": "@nx/jest:jest",
78+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
79+
"options": {
80+
"jestConfig": "apps/react-props/jest.config.js"
81+
}
82+
}
83+
},
84+
"tags": []
85+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import MovieAction from './movie-action';
2+
import Movie from './movie';
3+
4+
export function App() {
5+
return (
6+
<div>
7+
<Movie name="Exodus"></Movie>
8+
<MovieAction name="Kigndom of Heaven"></MovieAction>
9+
</div>
10+
);
11+
}
12+
export default App;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Your styles goes here. */
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { render } from '@testing-library/react';
2+
import App from './app';
3+
describe('App', () => {
4+
it('should render successfully', () => {
5+
const { baseElement } = render(<App />);
6+
expect(baseElement).toBeTruthy();
7+
});
8+
});

0 commit comments

Comments
 (0)