Skip to content

Commit 0d9c443

Browse files
JEAxerovrseraphinseravniallriddellNiall Riddell
authored
Make "main" use new packaging (#320)
* Updates e2e tests to match latest * Add default self-signed keys to ease using https for npm run authenticate (#313) Co-authored-by: serav <[email protected]> * Add initial node version check (#319) * Use release packages: ~8.23.10 (#314) * Updates to README.md fore release 8.23.10 (#317) * Updates to README.md fore release 8.23.10 * Updated after review comments from JA --------- Co-authored-by: Niall Riddell <[email protected]> --------- Co-authored-by: Vinod Seraphin <[email protected]> Co-authored-by: serav <[email protected]> Co-authored-by: Niall Riddell <[email protected]> Co-authored-by: Niall Riddell <[email protected]>
1 parent 335c9e0 commit 0d9c443

File tree

138 files changed

+41208
-389
lines changed

Some content is hidden

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

138 files changed

+41208
-389
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
webpack.config.js
2+
src/helpers/config_access.js
3+
scripts/*.*
4+
*.html
5+
*.css
6+
*.json
7+
*.md
8+
*.svg
9+
*.zip

.eslintrc.json

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
{
2+
"root": true,
3+
"extends": ["@pega"],
4+
"parserOptions": {
5+
"project": "tsconfig.json",
6+
"ecmaVersion": 13
7+
},
8+
"settings": {
9+
"import/resolver": {
10+
"typescript": {},
11+
"node": {
12+
"extensions": [".js", ".jsx"]
13+
}
14+
},
15+
"react": {
16+
"version": "detect"
17+
}
18+
},
19+
"ignorePatterns": ["node_modules", "packages/*/lib", "!.storybook", ".storybook/public"],
20+
"rules": {
21+
22+
// Prettier recommends running separately from a linter.
23+
// https://prettier.io/docs/en/integrating-with-linters.html#notes
24+
"prettier/prettier": "off",
25+
26+
// Disable rules from shared configs we're not ready for yet.
27+
"sonarjs/cognitive-complexity": "off",
28+
"sonarjs/no-identical-functions": "off",
29+
"sonarjs/no-duplicate-string": "off",
30+
"sonarjs/no-nested-template-literals": "off",
31+
32+
//
33+
// JA - Override some default lint handling here
34+
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
35+
// "import/extensions": ["warn", "never"], // Turning off for now (see below)
36+
37+
// Note: the "0" means to allow it. 1 = warning, 2 = error
38+
// allowing this lets index.tsx files pass linting even though they only have an export (and no JSX)
39+
"react/jsx-filename-extension": [0, { "extensions": [".js", ".jsx", "*.ts", "*.tsx"] }],
40+
41+
//
42+
// Initial release: turning these off; phase in to "warn" or "error" over time
43+
// For "quotes" and "@typescript-eslint/quotes", see override below for .ts/.tsx files
44+
"import/extensions": ["off", "never"],
45+
"import/named": "off",
46+
"import/no-cycle": "off",
47+
"import/no-duplicates": "off",
48+
"import/no-extraneous-dependencies": "off",
49+
"import/no-named-as-default": "off",
50+
"import/no-named-as-default-member": "off",
51+
"import/no-self-import": "off",
52+
"import/no-unresolved": "off",
53+
"import/no-useless-path-segments": "off",
54+
"import/order": "off",
55+
56+
"no-else-return": "off",
57+
"no-restricted-syntax": "off",
58+
"no-underscore-dangle": "off",
59+
60+
"jsx-a11y/alt-text": "off",
61+
"jsx-a11y/anchor-is-valid": "off",
62+
"jsx-a11y/click-events-have-key-events": "off",
63+
"jsx-a11y/label-has-associated-control": "off",
64+
"jsx-a11y/no-static-element-interactions": "off",
65+
66+
"react/jsx-fragments": "off",
67+
"react/jsx-no-bind": "off",
68+
"react/self-closing-comp": "off",
69+
70+
"sonarjs/prefer-immediate-return": "off",
71+
72+
"@typescript-eslint/dot-notation": "off", // prefer warn but needs different parserOptions
73+
"@typescript-eslint/naming-convention": "off", // prefer warn but needs different parserOptions
74+
"@typescript-eslint/ban-types": "off", // also, see override below
75+
76+
//
77+
// Initial release: set to error
78+
"@typescript-eslint/no-inferrable-types": "error",
79+
"eqeqeq": "error",
80+
"no-alert": "error",
81+
"no-console": "error",
82+
"no-fallthrough": "error",
83+
"no-undef": "error",
84+
"no-unused-vars": "error",
85+
"no-var": "error",
86+
"prefer-const": "error",
87+
"yoda": "error",
88+
89+
"import/no-mutable-exports": "error",
90+
"sonarjs/max-switch-cases": "error",
91+
"sonarjs/no-collapsible-if": "error",
92+
"sonarjs/no-all-duplicated-branches": "error",
93+
"sonarjs/no-duplicated-branches": "error",
94+
"sonarjs/no-gratuitous-expressions": "error",
95+
"sonarjs/no-ignored-return": "error",
96+
"sonarjs/no-small-switch": "error",
97+
"sonarjs/prefer-object-literal": "error",
98+
"sonarjs/prefer-single-boolean-return": "error",
99+
"@typescript-eslint/no-shadow": "error",
100+
"react/default-props-match-prop-types": "error",
101+
"react/no-unescaped-entities": "error",
102+
"react/no-unused-prop-types": "error",
103+
"react/static-property-placement": "error",
104+
"array-callback-return": "error",
105+
"camelcase": "error",
106+
"default-case": "error",
107+
"func-names": "error",
108+
"no-case-declarations": "error",
109+
"no-lonely-if": "error",
110+
"no-nested-ternary": "error",
111+
"no-plusplus": "error",
112+
"no-restricted-globals": "error",
113+
"no-restricted-properties": "error",
114+
"no-shadow": "error",
115+
"radix": "error",
116+
"spaced-comment": "error",
117+
118+
"import/newline-after-import": "error",
119+
"sonarjs/no-nested-switch": "error",
120+
"@typescript-eslint/no-array-constructor": "error",
121+
"@typescript-eslint/no-empty-function": "error",
122+
"@typescript-eslint/no-unused-vars": "error",
123+
"@typescript-eslint/no-useless-constructor": "error",
124+
"react/button-has-type": "error",
125+
"react/jsx-curly-brace-presence": "error",
126+
"react/jsx-boolean-value": "error",
127+
"react/no-array-index-key": "error",
128+
"class-methods-use-this": "error",
129+
"guard-for-in": "error",
130+
"no-unneeded-ternary": "error",
131+
"no-unused-expressions": "error",
132+
"operator-assignment": "error",
133+
"prefer-template": "error",
134+
"vars-on-top": "error",
135+
136+
"no-use-before-define": "off", // doc for @typescript-eslint/no-use-before-define says to turn off the base implementation
137+
"@typescript-eslint/no-use-before-define": "error"
138+
139+
},
140+
"overrides": [
141+
{
142+
"files": "*.@(ts|tsx)",
143+
"rules": {
144+
"@typescript-eslint/method-signature-style": ["error", "property"],
145+
// "@typescript-eslint/ban-types": [
146+
// "warn",
147+
// {
148+
// "types": {
149+
// "Omit": "Please use the 'OmitStrict' type from 'src/types/' instead.",
150+
// "object": false,
151+
// "Function": false
152+
// },
153+
// "extendDefaults": true
154+
// }
155+
// ],
156+
157+
"quotes": "off",
158+
"@typescript-eslint/quotes": "off"
159+
// [
160+
// "error",
161+
// "single",
162+
// {
163+
// "avoidEscape": true,
164+
// "allowTemplateLiterals": false
165+
// }
166+
// ]
167+
}
168+
},
169+
{
170+
"files": "*.@(jsx|tsx|mdx)",
171+
"rules": {
172+
"react/react-in-jsx-scope": "off",
173+
// Set up configuration for future sweep
174+
"react-hooks/exhaustive-deps": [
175+
"off",
176+
{
177+
"additionalHooks": "useAfterInitialEffect"
178+
}
179+
]
180+
}
181+
},
182+
{
183+
"files": "*.@(js|jsx|ts|tsx|mdx)",
184+
"rules": {
185+
}
186+
},
187+
{
188+
"files": ".storybook/*.js",
189+
"extends": ["@pega/eslint-config/script"]
190+
},
191+
{
192+
"files": "*/**/mocks/**.@(mocks|styles).@(tsx|ts)",
193+
"rules": {
194+
"import/prefer-default-export": ["off"]
195+
}
196+
}
197+
]
198+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Checkout and lint
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [14.x]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: Install dependencies and run lint
22+
run: npm ci
23+
- run: npm run lint
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Checkout, install dependencies, and build dev and prod
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- main
9+
- 'release/**'
10+
11+
pull_request:
12+
branches:
13+
- main
14+
- 'release/**'
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
node-version: [14.x]
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: "finnp/create-file-action@master"
28+
env:
29+
FILE_NAME: "constellation/lib_asset.json"
30+
FILE_DATA: "{}"
31+
- uses: "finnp/create-file-action@master"
32+
env:
33+
FILE_NAME: "constellation/bootstrap-shell.js"
34+
FILE_DATA: "// placeholder for bootstrap-shell.js"
35+
- uses: "finnp/create-file-action@master"
36+
env:
37+
FILE_NAME: "constellation/constellation-core.placeholder.js"
38+
FILE_DATA: "// placeholder for constellaiton-core.js"
39+
- name: Use Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v2
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
- name: Install dependencies
44+
run: npm ci
45+
- name: Run build:dev
46+
run: npm run build:dev
47+
- name: Run build:prod
48+
run: npm run build:prod
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: GitHub Actions Example
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
Info_About_Action_And_Repo:
7+
runs-on:
8+
ubuntu-latest
9+
10+
steps:
11+
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
12+
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!"
13+
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
14+
- name: Check out repository code
15+
uses: actions/checkout@v2
16+
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
17+
- run: echo "The workflow is now ready to test your code on the runner."
18+
- name: List files in the repository
19+
run: |
20+
ls ${{ github.workspace }}
21+
- run: echo "This job's status is ${{ job.status }}."

.github/workflows/playwright.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: '14.x'
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install Playwright
19+
run: npx playwright install --with-deps
20+
- uses: actions/upload-artifact@v2
21+
if: always()
22+
with:
23+
name: playwright-report
24+
path: tests/playwright-report/
25+
retention-days: 30

0 commit comments

Comments
 (0)