Skip to content

Commit 5c5a035

Browse files
committed
chore: Project setup
1 parent fdeac39 commit 5c5a035

File tree

84 files changed

+29188
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+29188
-44
lines changed

.eslintrc

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:react/recommended",
7+
"plugin:react/jsx-runtime",
8+
"plugin:prettier/recommended",
9+
"plugin:no-unsanitized/DOM",
10+
"plugin:@vitest/legacy-recommended"
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module",
15+
"ecmaFeatures": {
16+
"jsx": true
17+
}
18+
},
19+
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import", "simple-import-sort", "@vitest"],
20+
"rules": {
21+
"@typescript-eslint/no-unused-vars": "error",
22+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
23+
"@typescript-eslint/no-empty-function": "off",
24+
"@typescript-eslint/no-namespace": "off",
25+
"@typescript-eslint/no-non-null-assertion": "off",
26+
"@typescript-eslint/no-explicit-any": "warn",
27+
"react/display-name": "off",
28+
"react/no-danger": "error",
29+
"react/no-unstable-nested-components": [
30+
"error",
31+
{
32+
"allowAsProps": true
33+
}
34+
],
35+
"react/forbid-component-props": [
36+
"warn",
37+
{
38+
"forbid": ["className", "id"]
39+
}
40+
],
41+
"react/jsx-boolean-value": ["error", "always"],
42+
"@typescript-eslint/naming-convention": [
43+
"error",
44+
{
45+
"selector": "typeLike",
46+
"format": ["PascalCase"]
47+
}
48+
],
49+
"react-hooks/rules-of-hooks": "error",
50+
"react-hooks/exhaustive-deps": ["error"],
51+
"unicorn/filename-case": "error",
52+
"curly": "error",
53+
"dot-notation": "error",
54+
"eqeqeq": "error",
55+
"no-return-await": "error",
56+
"require-await": "error",
57+
"header/header": [
58+
"error",
59+
"line",
60+
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"]
61+
],
62+
"no-restricted-imports": [
63+
"error",
64+
{
65+
"paths": [
66+
{
67+
"name": "react",
68+
"importNames": ["default"],
69+
"message": "Prefer named imports."
70+
},
71+
{
72+
"name": "@cloudscape-design/components",
73+
"message": "Prefer subpath imports."
74+
}
75+
]
76+
}
77+
],
78+
"import/no-useless-path-segments": [
79+
"warn",
80+
{
81+
"noUselessIndex": true
82+
}
83+
],
84+
"simple-import-sort/imports": "warn",
85+
"@vitest/no-focused-tests": "error"
86+
},
87+
"settings": {
88+
"react": {
89+
"version": "detect"
90+
}
91+
},
92+
"env": {
93+
"browser": true,
94+
"es6": true
95+
},
96+
"overrides": [
97+
{
98+
"files": ["**/__integ__/**", "./test/**"],
99+
"rules": {
100+
// useBrowser is not a React hook
101+
"react-hooks/rules-of-hooks": "off",
102+
"react-hooks/exhaustive-deps": "off"
103+
},
104+
"env": {
105+
"jest": true
106+
}
107+
},
108+
{
109+
"files": ["src/**", "pages/**", "test/**", "scripts/**"],
110+
"rules": {
111+
"simple-import-sort/imports": [
112+
"warn",
113+
{
114+
"groups": [
115+
// External packages come first.
116+
["^react", "^(?!@cloudscape)@?\\w"],
117+
// Cloudscape packages.
118+
["^@cloudscape"],
119+
// Things that start with a letter (or digit or underscore), or `~` followed by a letter.
120+
["^~?\\w"],
121+
// Anything not matched in another group.
122+
["^"],
123+
// Styles come last.
124+
[
125+
"^.+\\.?(css)$","^.+\\.?(css.js)$", "^.+\\.?(scss)$", "^.+\\.?(selectors.js)$"
126+
]
127+
]
128+
}
129+
]
130+
}
131+
}
132+
]
133+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @cloudscape-design/cloudscape-dev
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Bug Report
2+
description: Report a bug
3+
title: '[Bug]: '
4+
labels: bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Provide as much information as possible to help us investigate the bug.
9+
- type: dropdown
10+
id: browser
11+
attributes:
12+
label: Browser
13+
description: In which browser(s) are you experiencing the issue?
14+
multiple: true
15+
options:
16+
- Chrome
17+
- Safari
18+
- Firefox
19+
- Edge
20+
- type: input
21+
id: version
22+
attributes:
23+
label: Package version
24+
description: Which version(s) are you using?
25+
placeholder: e.g. v3.0.122
26+
validations:
27+
required: true
28+
- type: input
29+
id: react-version
30+
attributes:
31+
label: React version
32+
description: Which version of React are you using?
33+
placeholder: e.g. v18.0.1
34+
- type: textarea
35+
id: description
36+
attributes:
37+
label: Description
38+
description: Tell us more about the issue you are experiencing
39+
placeholder: What is the actual and expected behavior?
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: source-code
44+
attributes:
45+
label: Source code
46+
description: Share links to your source code
47+
- type: textarea
48+
id: reproduction
49+
attributes:
50+
label: Reproduction
51+
description: Recreate the issue using [CodeSandbox](https://codesandbox.io/). Use this [template](https://codesandbox.io/s/cloudscape-design-system-react-javascript-ljs1t7) as a starting point
52+
- type: checkboxes
53+
id: terms
54+
attributes:
55+
label: Code of Conduct
56+
description: Please confirm the following
57+
options:
58+
- label:
59+
I agree to follow this project's [Code of
60+
Conduct](https://github.com/cloudscape-design/components/blob/main/CODE_OF_CONDUCT.md)
61+
required: true
62+
- label:
63+
I checked the [current
64+
issues](https://github.com/cloudscape-design/components/issues) for duplicate problems
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature request
2+
description: Request a feature
3+
title: '[Feature Request]: '
4+
labels: enhancement
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Use this template to request a new feature.
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: Description
13+
description: Describe the feature you request. Provide details on your use case, and how it would benefit your customers
14+
validations:
15+
required: true
16+
- type: checkboxes
17+
id: terms
18+
attributes:
19+
label: Code of Conduct
20+
description: Please confirm the following
21+
options:
22+
- label:
23+
I agree to follow this project's [Code of
24+
Conduct](https://github.com/cloudscape-design/components/blob/main/CODE_OF_CONDUCT.md)
25+
required: true
26+
- label:
27+
I checked the [current
28+
issues](https://github.com/cloudscape-design/components/issues) for duplicate requests

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/cloudscape-design/components/discussions
5+
about: Ask a question about Cloudscape Design System

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### Description
2+
3+
<!-- Include a summary of the changes and the related issue. -->
4+
5+
<!-- Also include relevant motivation and context. -->
6+
7+
Related links, issue #, if available: n/a
8+
9+
### How has this been tested?
10+
11+
<!-- How did you test to verify your changes? -->
12+
13+
<!-- How can reviewers test these changes efficiently? -->
14+
15+
<details>
16+
<summary>Review checklist</summary>
17+
18+
_The following items are to be evaluated by the author(s) and the reviewer(s)._
19+
20+
#### Correctness
21+
22+
- _Changes include appropriate documentation updates._
23+
- _Changes are backward-compatible if not indicated, see [`CONTRIBUTING.md`](CONTRIBUTING.md#public-apis)._
24+
- _Changes do not include unsupported browser features, see [`CONTRIBUTING.md`](CONTRIBUTING.md#browsers-support)._
25+
- _Changes were manually tested for accessibility, see [accessibility guidelines](https://cloudscape.design/foundation/core-principles/accessibility/)._
26+
27+
#### Security
28+
29+
- _If the code handles URLs: all URLs are validated through [the `checkSafeUrl` function](https://github.com/cloudscape-design/components/blob/main/src/internal/utils/check-safe-url.ts)._
30+
31+
#### Testing
32+
33+
- _Changes are covered with new/existing unit tests?_
34+
- _Changes are covered with new/existing integration tests?_
35+
</details>
36+
37+
---
38+
39+
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build, lint and test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
merge_group:
11+
12+
13+
permissions:
14+
id-token: write
15+
actions: read
16+
contents: read
17+
security-events: write
18+
deployments: write
19+
20+
jobs:
21+
build:
22+
uses: cloudscape-design/actions/.github/workflows/build-lint-test.yml@main
23+
secrets: inherit
24+
with:
25+
artifact-path: dist
26+
artifact-name: dev-pages
27+
deploy:
28+
needs: build
29+
uses: cloudscape-design/actions/.github/workflows/deploy.yml@main
30+
secrets: inherit
31+
with:
32+
artifact-name: dev-pages
33+
deployment-path: dist

.github/workflows/dry-run.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This workflow executes a full dry-run test, which means that all we build and test all @cloudscape-design packages in GitHub.
2+
# This ensures that the changes in the current package do not cause any regressions for its consumers.
3+
name: Dry-run
4+
on:
5+
workflow_dispatch:
6+
pull_request:
7+
branches:
8+
- main
9+
merge_group:
10+
11+
jobs:
12+
dry-run:
13+
uses: cloudscape-design/actions/.github/workflows/dry-run.yml@main

.github/workflows/lint-pr.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
merge_group:
10+
11+
jobs:
12+
dry-run:
13+
uses: cloudscape-design/actions/.github/workflows/lint-pr.yml@main
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Github notes
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
required: true
8+
description: 'Specify the version for this release'
9+
type: string
10+
commit:
11+
required: true
12+
description: 'commit to generate release notes'
13+
type: string
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
release:
20+
uses: cloudscape-design/actions/.github/workflows/release-gh-notes.yml@main
21+
secrets: inherit
22+
with:
23+
version: ${{ github.event.inputs.version }}
24+
commit: ${{ github.event.inputs.commit }}

0 commit comments

Comments
 (0)