Skip to content

Commit

Permalink
Add configuration files and setup for project environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Dec 12, 2024
1 parent b05b47e commit e2af981
Show file tree
Hide file tree
Showing 264 changed files with 56,277 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "entry",
"targets": {
"esmodules": true
}
}
],
["@babel/preset-react", {
"runtime": "automatic"
}],
"@babel/preset-typescript"
]
}
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"react-app",
"plugin:storybook/recommended"
],
"ignorePatterns": "stories"
}
21 changes: 21 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[include]
src/.*
stories/.*

[lints]
all=error
untyped-import=off
unclear-type=off
sketchy-null=off
unsafe-getters-setters=warn
dynamic-export=off
inexact-spread =off

[options]
include_warnings=false
module.ignore_non_literal_requires=true

[strict]

[untyped]
.*/node_modules/**/.*
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Bug Report
about: Report a bug encountered while operating core-ui
labels: bug,core-ui

---

**Component**:

<!-- E.g. 'Layout', 'Table', 'build', 'tests'... -->

**What happened**:

**What was expected**:

**Steps to reproduce**

**Resolution proposal** (optional):
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Improvement
about: Suggest an improvement to the core-ui project
labels: core-ui

---

**Component**:

<!-- E.g. 'Layout', 'Table', 'build', 'tests'... -->

**Why this is needed**:

**What should be done**:

**Implementation proposal** (strongly recommended):

**Test plan**:
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Component**:

<!-- E.g. 'Layout', 'Table', 'build', 'tests'... -->

**Description**:

**Design**:

**Breaking Changes**:

- [] Breaking Changes


---

<!-- Declare one or more issues to close once this PR gets merged -->

Closes: #ISSUE_NUMBER

<!-- If you want to refer to an issue while not closing it, use:
See: #ISSUE_NUMBER
-->
25 changes: 25 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: codeQL

on:
push:
branches: [development/*, stabilization/*, hotfix/*]
pull_request:
branches: [development/*, stabilization/*, hotfix/*]
workflow_dispatch:

jobs:
analyze:
name: Static analysis with CodeQL
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: typescript, javascript

- name: Build and analyze
uses: github/codeql-action/analyze@v2
18 changes: 18 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: dependency review

on:
pull_request:
branches: [development/*, stabilization/*, hotfix/*]

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
fail-on-severity: high
17 changes: 17 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy Storybook

on:
push:
branches: [development/1.0]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run storybook:deploy -- --ci
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
release:
types:
- published
workflow_dispatch:

jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '16'
- run: echo "nextVersion=$(npm version --no-git-tag minor)" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
id: cpr
with:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
branch: feature/bump-core-ui-version-to-${{ env.nextVersion }}
commit-message: Bump core-ui version to ${{ env.nextVersion }}
title: Bump core-ui version to ${{ env.nextVersion }}
body: ''
base: ${{ github.event.repository.default_branch }}
- uses: actions/github-script@v5
if: ${{ steps.cpr.outputs.pull-request-number }}
with:
github-token: ${{secrets.GIT_ACCESS_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: '${{ steps.cpr.outputs.pull-request-number }}',
owner: context.repo.owner,
repo: context.repo.repo,
body: '/approve'
})
publish-npm:
runs-on: ubuntu-latest
environment: npmjs
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npmjs.org
- uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: basic tests

on:
push:
branches:
- 'user/**'
- 'feature/**'
- 'improvement/**'
- 'bugfix/**'
- 'w/**'
- 'q/**'
- 'hotfix/**'
- 'dependabot/**'
pull_request:
types:
- opened
branches:
- 'feature/bump-core-ui-version-to-**'

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run test
- run: npm run lint
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/
dist/
coverage/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tabWidth": 2,
"trailingComma": "all",
"singleQuote": true
}
55 changes: 55 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.@(mdx|stories.@(ts|tsx))'],
staticDirs: ['./public'],

addons: [
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'@storybook/addon-mdx-gfm',
'@storybook/addon-webpack5-compiler-swc',
'@chromatic-com/storybook',
],
swc: (config, options) => ({
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
}),

webpackFinal: async (config, { configType }) => {
// Resolve error when webpack-ing storybook:
// Can't import the named export 'Children' from non EcmaScript module (only
// default export is available)
config.module?.rules?.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});

return config;
},

framework: {
name: '@storybook/react-webpack5',
options: {},
},

docs: {
defaultName: 'Stories',
},

managerHead: (head) => `
${head}
<link rel="icon" href="/favicon.ico" />
`,

typescript: {
reactDocgen: 'react-docgen-typescript',
},
};

export default config;
6 changes: 6 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api';
import Theme from './theme.storybook';

addons.setConfig({
theme: Theme,
});
Loading

0 comments on commit e2af981

Please sign in to comment.