Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-Krahn committed Aug 27, 2024
1 parent e0960cd commit 5ea833e
Show file tree
Hide file tree
Showing 210 changed files with 23,941 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-typescript",
{
"isTSX": true,
"allExtensions": true
}
]
],
"plugins": [
"inline-react-svg",
"@babel/plugin-proposal-class-properties"
],
"ignore": [
"src/**/*.d.ts"
]
}
36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended"
],
"plugins": [
"react",
"@typescript-eslint",
"react-hooks"
],
"rules": {
"react-hooks/exhaustive-deps": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-non-null-assertion": "off",
"@typescript-eslint/no-unused-expressions": "off",
"no-undef": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"react/prop-types": "off",
"react/display-name": "off",
"@typescript-eslint/no-unused-vars": "warn",
"no-prototype-builtins": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/lib

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea/

# example project
/example/dist
93 changes: 93 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Allow execution of scripts.
default:
image: node:latest
before_script:
- chmod -R +x ./scripts/ci_cd/

cache:
key: $CI_COMMIT_REF_SLUG
paths:
- ./node_modules

stages:
- prepare
- validate
- build
- publish
- release

# Generate environment variables for package.
generate_env_variables:
stage: prepare
script:
- ./scripts/ci_cd/generate_package_env_variables.sh
artifacts:
reports:
dotenv: build.env
except:
- tags

# If no release notes for the current version exist and this pipeline was triggered on the main branch the pipeline will be terminated.
validate_release_notes:
stage: validate
script:
- >
if [[ ! -f ./scripts/ci_cd/release_notes/${NPM_PACKAGE_VERSION}.md ]]; then
echo "You have to create release notes for version ${NPM_PACKAGE_VERSION}. Otherwise the package won't be published."
fi
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
- if: '$FORCE_PUBLISH == "true"'

# Validates typescript files
validate_typescript:
stage: validate
variables:
NODE_EXTRA_CA_CERTS: ${IAV_CA_BUNDLE}
script:
- npm ci
- npx tsc --noEmit --emitDeclarationOnly false
except:
- tags

# Builds the framework
build_package:
stage: build
script:
- npm install -D
- npm run build-linux
artifacts:
paths:
- ./build
except:
- tags

# Publish the package. If the version in package.json has not yet been published, it will be
# published to GitLab's NPM registry. If the version already exists, the publish command
# will fail. The existing package will not be updated.
publish_package:
stage: publish
variables:
NODE_EXTRA_CA_CERTS: ${IAV_CA_BUNDLE}
script:
- npm install -D
- sh ./scripts/ci_cd/configure_npmrc_for_publish.sh
- npm publish
rules:
- if: '$CI_SERVER_HOST == "*.local"'
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
- if: '$FORCE_PUBLISH == "true"'

# Create release so observer of this project will get a notification e-mail.
create_release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
variables:
SSL_CERT_FILE: ${IAV_CA_BUNDLE}
script:
- >
release-cli create --description ./scripts/ci_cd/release_notes/${NPM_PACKAGE_VERSION}.md
--tag-name v${NPM_PACKAGE_VERSION}
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
- if: '$FORCE_PUBLISH == "true"'
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
IAV Frontend Framework
Copyright 2024 IAV GmbH

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Binary file added SBOM.json
Binary file not shown.
27 changes: 27 additions & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright © 2024 IAV GmbH Ingenieurgesellschaft Auto und Verkehr, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

declare module "*.svg" {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
export default content;
}

declare module "*.png" {
const value: any;
export = value;
}
18 changes: 18 additions & 0 deletions example/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-typescript",
{
"isTSX": true,
"allExtensions": true
}
]
],
"plugins": [
["@babel/plugin-transform-typescript", {}],

"@babel/plugin-proposal-class-properties"
],
"ignore": ["src/**/*.d.ts"]
}
23 changes: 23 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
88 changes: 88 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!--
Copyright © 2024 IAV GmbH Ingenieurgesellschaft Auto und Verkehr, All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
-->

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is mi[text](src/components/exampleComponent2.tsx)nified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

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.

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.

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.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
48 changes: 48 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
Copyright © 2024 IAV GmbH Ingenieurgesellschaft Auto und Verkehr, All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
-->

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Entry point for vite -->
<script type="module" src="/src/index.tsx"></script>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<title>IAV Frontend Framework Example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Loading

0 comments on commit 5ea833e

Please sign in to comment.