Skip to content

Commit 4653393

Browse files
feat(init): initial creation of extracted react-console (#1)
* feat(init): initial creation of extracted react-console * Move test files out of __tests__ * Fix typescript complains * Update snapshots and bring in newer react-dom to make jest happy * Bump down testing library to match the version from patternfly-react * Fix testing-library complaining about toBeInTheDocument() not a function Install the library extensions. * Fix jest Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) * Remove ununsed yarn targets * Create workflow for adding issues to extensions board Similar to patternfly/react-catalog-view@474e4ae * chore(docs): remove design guidelines * feat(CI): enable release config Co-authored-by: Austin Sullivan <[email protected]>
1 parent 8f47cd5 commit 4653393

File tree

77 files changed

+18521
-1
lines changed

Some content is hidden

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

77 files changed

+18521
-1
lines changed

Diff for: .eslintignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Javascript builds
2+
node_modules
3+
dist
4+
tsc_out
5+
.out
6+
.changelog
7+
.DS_Store
8+
coverage
9+
.cache
10+
.tmp
11+
.eslintcache
12+
generated
13+
14+
# package managers
15+
yarn-error.log
16+
lerna-debug.log
17+
18+
# IDEs and editors
19+
.idea
20+
.project
21+
.classpath
22+
.c9
23+
*.launch
24+
.settings
25+
*.sublime-workspace
26+
.history
27+
.vscode
28+
.yo-rc.json
29+
30+
# IDE - VSCode
31+
.vscode
32+
# For vim
33+
*.swp
34+
35+
public

Diff for: .eslintrc-md.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"plugins": [
3+
"markdown",
4+
"react"
5+
],
6+
"parserOptions": {
7+
"ecmaVersion": 9,
8+
"sourceType": "module",
9+
"ecmaFeatures": {
10+
"jsx": true
11+
}
12+
},
13+
"settings": {
14+
"react": {
15+
"version": "16.4.0"
16+
}
17+
},
18+
"rules": {
19+
"eol-last": 2,
20+
"spaced-comment": 2,
21+
"no-unused-vars": 0,
22+
"no-this-before-super": 2,
23+
"react/jsx-uses-react": "error",
24+
"react/jsx-uses-vars": "error",
25+
"react/no-unknown-property": 2,
26+
"react/jsx-no-undef": 2
27+
}
28+
}

Diff for: .eslintrc.json

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:react/recommended",
10+
"plugin:react-hooks/recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"prettier"
13+
],
14+
"overrides": [
15+
{
16+
"files": ["**/patternfly-docs/pages/*"],
17+
"rules": {
18+
"arrow-body-style": "off"
19+
}
20+
}
21+
],
22+
"parserOptions": {
23+
"ecmaVersion": "latest",
24+
"sourceType": "module",
25+
"ecmaFeatures": {
26+
"jsx": true
27+
}
28+
},
29+
"settings": {
30+
"react": {
31+
"version": "detect"
32+
}
33+
},
34+
"plugins": ["react", "react-hooks", "@typescript-eslint"],
35+
"rules": {
36+
"@typescript-eslint/adjacent-overload-signatures": "error",
37+
"@typescript-eslint/array-type": "error",
38+
"@typescript-eslint/consistent-type-assertions": "error",
39+
"@typescript-eslint/consistent-type-definitions": "error",
40+
"@typescript-eslint/no-misused-new": "error",
41+
"@typescript-eslint/no-namespace": "error",
42+
"@typescript-eslint/no-unused-vars": [
43+
"error",
44+
{
45+
"argsIgnorePattern": "^_"
46+
}
47+
],
48+
"@typescript-eslint/prefer-for-of": "error",
49+
"@typescript-eslint/prefer-function-type": "error",
50+
"@typescript-eslint/prefer-namespace-keyword": "error",
51+
"@typescript-eslint/unified-signatures": "error",
52+
"@typescript-eslint/no-var-requires": "off",
53+
"arrow-body-style": "error",
54+
"camelcase": [
55+
"error",
56+
{
57+
"ignoreDestructuring": true
58+
}
59+
],
60+
"constructor-super": "error",
61+
"curly": "error",
62+
"dot-notation": "error",
63+
"eqeqeq": ["error", "smart"],
64+
"guard-for-in": "error",
65+
"max-classes-per-file": ["error", 1],
66+
"no-nested-ternary": "error",
67+
"no-bitwise": "error",
68+
"no-caller": "error",
69+
"no-cond-assign": "error",
70+
"no-console": "error",
71+
"no-debugger": "error",
72+
"no-empty": "error",
73+
"no-eval": "error",
74+
"no-new-wrappers": "error",
75+
"no-undef-init": "error",
76+
"no-unsafe-finally": "error",
77+
"no-unused-expressions": [
78+
"error",
79+
{
80+
"allowTernary": true,
81+
"allowShortCircuit": true
82+
}
83+
],
84+
"no-unused-labels": "error",
85+
"no-var": "error",
86+
"object-shorthand": "error",
87+
"one-var": ["error", "never"],
88+
"prefer-const": "error",
89+
"radix": ["error", "as-needed"],
90+
"react/prop-types": 0,
91+
"react/display-name": 0,
92+
"react-hooks/exhaustive-deps": "warn",
93+
"react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }],
94+
"spaced-comment": "error",
95+
"use-isnan": "error"
96+
}
97+
}

Diff for: .github/workflows/build-lint-test.yml

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: build-lint-test
2+
on:
3+
workflow_call:
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
env:
8+
GH_PR_NUM: ${{ github.event.number }}
9+
steps:
10+
- uses: actions/checkout@v2
11+
- run: |
12+
if [[ ! -z "${GH_PR_NUM}" ]]; then
13+
echo "Checking out PR"
14+
git fetch origin pull/$GH_PR_NUM/head:tmp
15+
git checkout tmp
16+
fi
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: '14'
20+
- uses: actions/cache@v2
21+
id: yarn-cache
22+
name: Cache npm deps
23+
with:
24+
path: |
25+
node_modules
26+
**/node_modules
27+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
28+
- run: yarn install --frozen-lockfile
29+
if: steps.yarn-cache.outputs.cache-hit != 'true'
30+
- uses: actions/cache@v2
31+
id: dist
32+
name: Cache dist
33+
with:
34+
path: |
35+
packages/*/dist
36+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
37+
- name: Build dist
38+
run: yarn build
39+
if: steps.dist.outputs.cache-hit != 'true'
40+
lint:
41+
runs-on: ubuntu-latest
42+
env:
43+
GH_PR_NUM: ${{ github.event.number }}
44+
needs: build
45+
steps:
46+
- uses: actions/checkout@v2
47+
- run: |
48+
if [[ ! -z "${GH_PR_NUM}" ]]; then
49+
echo "Checking out PR"
50+
git fetch origin pull/$GH_PR_NUM/head:tmp
51+
git checkout tmp
52+
fi
53+
- uses: actions/setup-node@v1
54+
with:
55+
node-version: '14'
56+
- uses: actions/cache@v2
57+
id: yarn-cache
58+
name: Cache npm deps
59+
with:
60+
path: |
61+
node_modules
62+
**/node_modules
63+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
64+
- run: yarn install --frozen-lockfile
65+
if: steps.yarn-cache.outputs.cache-hit != 'true'
66+
- uses: actions/cache@v2
67+
id: lint-cache
68+
name: Load lint cache
69+
with:
70+
path: '.eslintcache'
71+
key: ${{ runner.os }}-lint-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
72+
- name: ESLint
73+
run: yarn lint:js
74+
- name: MDLint
75+
run: yarn lint:md
76+
test_jest:
77+
runs-on: ubuntu-latest
78+
env:
79+
GH_PR_NUM: ${{ github.event.number }}
80+
needs: build
81+
steps:
82+
- uses: actions/checkout@v2
83+
# Yes, we really want to checkout the PR
84+
- run: |
85+
if [[ ! -z "${GH_PR_NUM}" ]]; then
86+
echo "Checking out PR"
87+
git fetch origin pull/$GH_PR_NUM/head:tmp
88+
git checkout tmp
89+
fi
90+
- uses: actions/setup-node@v1
91+
with:
92+
node-version: '14'
93+
- uses: actions/cache@v2
94+
id: yarn-cache
95+
name: Cache npm deps
96+
with:
97+
path: |
98+
node_modules
99+
**/node_modules
100+
~/.cache/Cypress
101+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
102+
- run: yarn install --frozen-lockfile
103+
if: steps.yarn-cache.outputs.cache-hit != 'true'
104+
- uses: actions/cache@v2
105+
id: dist
106+
name: Cache dist
107+
with:
108+
path: |
109+
packages/*/dist
110+
packages/react-styles/css
111+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
112+
- name: Build dist
113+
run: yarn build
114+
if: steps.dist.outputs.cache-hit != 'true'
115+
- name: PF4 Jest Tests
116+
run: yarn test --maxWorkers=2
117+
test_a11y:
118+
runs-on: ubuntu-latest
119+
env:
120+
GH_PR_NUM: ${{ github.event.number }}
121+
needs: build
122+
steps:
123+
- uses: actions/checkout@v2
124+
# Yes, we really want to checkout the PR
125+
- run: |
126+
if [[ ! -z "${GH_PR_NUM}" ]]; then
127+
echo "Checking out PR"
128+
git fetch origin pull/$GH_PR_NUM/head:tmp
129+
git checkout tmp
130+
fi
131+
- uses: actions/setup-node@v1
132+
with:
133+
node-version: '14'
134+
- uses: actions/cache@v2
135+
id: yarn-cache
136+
name: Cache npm deps
137+
with:
138+
path: |
139+
node_modules
140+
**/node_modules
141+
~/.cache/Cypress
142+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
143+
- run: yarn install --frozen-lockfile
144+
if: steps.yarn-cache.outputs.cache-hit != 'true'
145+
- uses: actions/cache@v2
146+
id: dist
147+
name: Cache dist
148+
with:
149+
path: |
150+
packages/*/dist
151+
packages/react-styles/css
152+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
153+
- name: Build dist
154+
run: yarn build
155+
if: steps.dist.outputs.cache-hit != 'true'
156+
- name: Build docs
157+
run: yarn build:docs
158+
- name: A11y tests
159+
run: yarn serve:docs & yarn test:a11y

Diff for: .github/workflows/build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build
2+
on:
3+
workflow_call:
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
env:
8+
GH_PR_NUM: ${{ github.event.number }}
9+
steps:
10+
- uses: actions/checkout@v2
11+
- run: |
12+
if [[ ! -z "${GH_PR_NUM}" ]]; then
13+
echo "Checking out PR"
14+
git fetch origin pull/$GH_PR_NUM/head:tmp
15+
git checkout tmp
16+
fi
17+
- uses: actions/cache@v2
18+
id: setup-cache
19+
name: Cache setup
20+
with:
21+
path: |
22+
README.md
23+
package.json
24+
.tmplr.yml
25+
packages/*/package.json
26+
packages/*/patternfly-docs/content/**
27+
packages/*/patternfly-docs/generated/**
28+
key: ${{ runner.os }}-setup-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package.json', 'packages/module/package.json') }}
29+
- name: Run build script
30+
run: ./devSetup.sh
31+
shell: bash
32+
if: steps.setup-cache.outputs.cache-hit != 'true'
33+
- uses: actions/setup-node@v1
34+
with:
35+
node-version: '14'
36+
- uses: actions/cache@v2
37+
id: yarn-cache
38+
name: Cache npm deps
39+
with:
40+
path: |
41+
node_modules
42+
**/node_modules
43+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
44+
- run: yarn install --frozen-lockfile
45+
if: steps.yarn-cache.outputs.cache-hit != 'true'
46+
- uses: actions/cache@v2
47+
id: dist
48+
name: Cache dist
49+
with:
50+
path: |
51+
packages/*/dist
52+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
53+
- name: Build dist
54+
run: yarn build
55+
if: steps.dist.outputs.cache-hit != 'true'

Diff for: .github/workflows/check-pr.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: check-pr
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
call-build-lint-test-workflow:
8+
uses: ./.github/workflows/build-lint-test.yml

0 commit comments

Comments
 (0)