Skip to content

Commit 7d60d4e

Browse files
authored
Merge branch 'master' into fix/object-page
2 parents 46e43e6 + fcb176c commit 7d60d4e

21 files changed

+471
-7
lines changed

.github/workflows/nodejs.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ jobs:
1111
matrix:
1212
node-version: [12.x]
1313

14+
env:
15+
CI: true
16+
1417
steps:
1518
- uses: actions/checkout@v1
1619
- name: Use Node.js ${{ matrix.node-version }}
1720
uses: actions/setup-node@v1
1821
with:
1922
node-version: ${{ matrix.node-version }}
20-
- name: npm install, test and build
21-
run: |
22-
yarn install
23-
yarn test
24-
yarn build
25-
env:
26-
CI: true
23+
- name: install dependencies
24+
run: yarn install
25+
- name: run tests
26+
run: yarn test
27+
- name: build project
28+
run: yarn build

config/jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ module.exports = {
1616
'!packages/*/src/index.ts',
1717
'!packages/*/index.ts',
1818
'!packages/docs/**/*',
19+
'!packages/cra-template/**/*',
1920
'!packages/**/demo/*',
21+
'!packages/base/src/polyfill/*', // no polyfills
22+
'!packages/main/src/components/AnalyticalTable/types/*', // no table enums
2023
'!**/npm/**/*'
2124
],
2225
setupFiles: [
@@ -27,6 +30,7 @@ module.exports = {
2730
setupFilesAfterEnv: ['./config/jestsetup.ts'],
2831
testEnvironment: 'jsdom-fifteen',
2932
testMatch: ['<rootDir>/packages/**/?(*.)(spec|test).{js,jsx,ts,tsx}'],
33+
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/packages/cra-template/'],
3034
transformIgnorePatterns: ['node_modules/(?!(@ui5|lit-html))'],
3135
moduleNameMapper: {
3236
'^@shared/(.*)$': '<rootDir>/shared/$1',

packages/cra-template/ package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@ui5/cra-template-webcomponents-react",
3+
"version": "0.1.0",
4+
"keywords": [
5+
"react",
6+
"create-react-app",
7+
"template"
8+
],
9+
"description": "A template for Create React App using UI5 Web Components for React.",
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/SAP/ui5-webcomponents-react.git",
13+
"directory": "packages/cra-template"
14+
},
15+
"author": "SAP SE (https://www.sap.com)",
16+
"license": "Apache-2.0",
17+
"main": "template.json",
18+
"engines": {
19+
"node": ">=8"
20+
},
21+
"bugs": {
22+
"url": "https://github.com/SAP/ui5-webcomponents-react/issues"
23+
},
24+
"files": [
25+
"template",
26+
"template.json"
27+
]
28+
}

packages/cra-template/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# cra-template for UI5 Web Components for React
2+
3+
### Usage
4+
```shell script
5+
npx create-react-app my-app --template @ui5/cra-template-webcomponents-react
6+
7+
# or if you prefer to use yarn
8+
9+
yarn create react-app my-app --template @ui5/cra-template-webcomponents-react
10+
```
11+
12+
For more information, please refer to:
13+
14+
- [Getting Started](https://create-react-app.dev/docs/getting-started) – How to create a new app.
15+
- [User Guide](https://create-react-app.dev) – How to develop apps bootstrapped with Create React App.
16+
- [UI5 Web Components for React Github Project](https://github.com/SAP/ui5-webcomponents-react)
17+
- [UI5 Web Components for React Documentation](https://sap.github.io/ui5-webcomponents-react/)

packages/cra-template/template.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"dependencies": {
3+
"@ui5/webcomponents-react": "^0.7.0-rc.0",
4+
"@testing-library/react": "^9.3.2",
5+
"@testing-library/jest-dom": "^4.2.4",
6+
"@testing-library/user-event": "^7.1.2"
7+
}
8+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `npm start`
8+
9+
Runs the app in the development mode.<br />
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br />
13+
You will also see any lint errors in the console.
14+
15+
### `npm test`
16+
17+
Launches the test runner in the interactive watch mode.<br />
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `npm run build`
21+
22+
Builds the app for production to the `build` folder.<br />
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br />
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `npm run eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35+
36+
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37+
38+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
45+
46+
### Code Splitting
47+
48+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49+
50+
### Analyzing the Bundle Size
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53+
54+
### Making a Progressive Web App
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57+
58+
### Advanced Configuration
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61+
62+
### Deployment
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65+
66+
### `npm run build` fails to minify
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Binary file not shown.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>React App</title>
28+
29+
<script data-ui5-config type="application/json">
30+
{
31+
"compactSize": false
32+
}
33+
</script>
34+
</head>
35+
<body>
36+
<noscript>You need to enable JavaScript to run this app.</noscript>
37+
<div id="root"></div>
38+
<!--
39+
This HTML file is a template.
40+
If you open it directly in the browser, you will see an empty page.
41+
42+
You can add webfonts, meta tags, or analytics to this file.
43+
The build step will place the bundled scripts into the <body> tag.
44+
45+
To begin the development, run `npm start` or `yarn start`.
46+
To create a production bundle, use `npm run build` or `yarn build`.
47+
-->
48+
</body>
49+
</html>
Loading
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
height: 40vmin;
7+
pointer-events: none;
8+
}
9+
10+
@media (prefers-reduced-motion: no-preference) {
11+
.App-logo {
12+
animation: App-logo-spin infinite 20s linear;
13+
}
14+
}
15+
16+
.App-header {
17+
background-color: #282c34;
18+
min-height: 100vh;
19+
display: flex;
20+
flex-direction: column;
21+
align-items: center;
22+
justify-content: center;
23+
font-size: calc(10px + 2vmin);
24+
color: white;
25+
}
26+
27+
.App-link {
28+
color: #61dafb;
29+
}
30+
31+
@keyframes App-logo-spin {
32+
from {
33+
transform: rotate(0deg);
34+
}
35+
to {
36+
transform: rotate(360deg);
37+
}
38+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { ThemeProvider } from '@ui5/webcomponents-react/lib/ThemeProvider';
2+
import React from 'react';
3+
import './App.css';
4+
import logo from './logo.svg';
5+
6+
function App() {
7+
return (
8+
<ThemeProvider withToastContainer>
9+
<div className="App">
10+
<header className="App-header">
11+
<img src={logo} className="App-logo" alt="logo" />
12+
<p>
13+
Edit <code>src/App.js</code> and save to reload.
14+
</p>
15+
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
16+
Learn React
17+
</a>
18+
</header>
19+
</div>
20+
</ThemeProvider>
21+
);
22+
}
23+
24+
export default App;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import { render } from '@testing-library/react';
3+
import App from './App';
4+
5+
test('renders learn react link', () => {
6+
const { getByText } = render(<App />);
7+
const linkElement = getByText(/learn react/i);
8+
expect(linkElement).toBeInTheDocument();
9+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
body {
2+
margin: 0;
3+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5+
sans-serif;
6+
-webkit-font-smoothing: antialiased;
7+
-moz-osx-font-smoothing: grayscale;
8+
}
9+
10+
code {
11+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12+
monospace;
13+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import './index.css';
4+
import App from './App';
5+
import * as serviceWorker from './serviceWorker';
6+
7+
ReactDOM.render(<App />, document.getElementById('root'));
8+
9+
// If you want your app to work offline and load faster, you can change
10+
// unregister() to register() below. Note this comes with some pitfalls.
11+
// Learn more about service workers: https://bit.ly/CRA-PWA
12+
serviceWorker.unregister();
Lines changed: 7 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)