-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from equinor/initial-setup
✨ Initial setup
- Loading branch information
Showing
155 changed files
with
34,520 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_NAME="Amplify SAM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
vite.config.ts | ||
vitest.config.ts | ||
playwright.config.ts | ||
|
||
src/api | ||
src/config | ||
|
||
**/*.json | ||
**/*.md | ||
**/*.cjs | ||
**/*.yaml | ||
**/*.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended-type-checked', | ||
'plugin:@typescript-eslint/stylistic-type-checked', | ||
'plugin:react-hooks/recommended', | ||
'plugin:react/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 12, | ||
sourceType: 'module', | ||
project: './tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
plugins: ['react', 'react-hooks', '@typescript-eslint', 'simple-import-sort'], | ||
rules: { | ||
'react/react-in-jsx-scope': 'off', | ||
'@typescript-eslint/no-redundant-type-constituents': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-floating-promises': 'off', // we don't always care about unhandled promises | ||
'@typescript-eslint/prefer-nullish-coalescing': 'off', // we sometimes want to use || instead of ?? | ||
'@typescript-eslint/no-misused-promises': [ | ||
'error', | ||
{ checksVoidReturn: false }, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.js', '**/*.ts', '**/*.tsx'], | ||
rules: { | ||
'simple-import-sort/imports': [ | ||
'error', | ||
{ | ||
groups: [ | ||
// `react` first | ||
['^react?(.+)'], | ||
// Packages starting with `@` | ||
['^@'], | ||
// Packages starting with `~` | ||
['^~'], | ||
// Imports starting with `./`, `../` `src` | ||
[ | ||
'^\\.\\.(?!/?$)', | ||
'^\\.\\./?$', | ||
'^\\./(?=.*/)(?!/?$)', | ||
'^\\.(?!/?$)', | ||
'^\\./?$', | ||
'src', | ||
], | ||
// Imports starting with a character | ||
['^[a-z]'], | ||
// Style imports | ||
['^.+\\.s?css$'], | ||
// Side effect imports | ||
['^\\u0000'], | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js', '**/*.ts', '**/*.tsx'], | ||
excludedFiles: ['*.test.*', '*.stories.*', './src/providers/AuthProvider/**', './src/utils/auth_environment.ts'], | ||
rules: { | ||
'no-console': ['warn', { allow: ['warn', 'error'] }], | ||
} | ||
}, | ||
], | ||
settings: { | ||
react: { | ||
pragma: 'React', | ||
version: 'detect', | ||
}, | ||
}, | ||
}; |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @equinor/amplify-frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Build | ||
on: | ||
workflow_call: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [21.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Build storybook | ||
on: | ||
workflow_call: | ||
jobs: | ||
build-storybook: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [21.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build-storybook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test | ||
on: | ||
workflow_call: | ||
jobs: | ||
code-coverage: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [21.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Unit tests | ||
run: npm run test:coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Lint | ||
on: | ||
workflow_call: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [21.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Linting | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: NPM Publish | ||
on: | ||
workflow_call: | ||
secrets: | ||
npm-token: | ||
required: true | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21.x | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run Tests | ||
run: npm run test:ci | ||
|
||
- name: Build Components | ||
run: npm run build-components:ci | ||
|
||
- uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.npm-token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Pull request | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "**" | ||
- ".github/workflows/**" | ||
workflow_dispatch: | ||
jobs: | ||
lint: | ||
name: Lint | ||
uses: ./.github/workflows/lint.yaml | ||
|
||
test: | ||
name: Test | ||
uses: ./.github/workflows/test.yaml | ||
|
||
code-coverage: | ||
name: Code coverage | ||
uses: ./.github/workflows/code_coverage.yaml | ||
|
||
build: | ||
name: Build | ||
uses: ./.github/workflows/build.yaml | ||
|
||
build-storybook: | ||
name: Build storybook | ||
uses: ./.github/workflows/build_storybook.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: NPM Publish | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
publish: | ||
name: Publish to NPM | ||
uses: ./.github/workflows/npm_publish.yaml | ||
secrets: | ||
npm-token: ${{ secrets.NPM_TOKEN }} | ||
release: | ||
name: Create release notes | ||
needs: [publish] | ||
uses: ./.github/workflows/release.yaml | ||
secrets: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Create release | ||
on: | ||
workflow_call: | ||
secrets: | ||
github-token: | ||
required: true | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.github-token }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test | ||
on: | ||
workflow_call: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [21.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Unit tests | ||
run: npm run test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
/dist | ||
/lib | ||
|
||
# testing | ||
/coverage | ||
|
||
# Webstorm user specific settings | ||
.idea/workspace.xml | ||
|
||
# production | ||
/build | ||
/storybook-static | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# yarn modern | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.pnp.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.