Skip to content

Commit 71f78ee

Browse files
committed
Added custom navigation bar
Signed-off-by: Paul Schultz <[email protected]> Added index html functionality Signed-off-by: Paul Schultz <[email protected]> Fixed event propagation Signed-off-by: Paul Schultz <[email protected]> Fixed navbar html setter Signed-off-by: Paul Schultz <[email protected]> Added asciidoctor css Signed-off-by: Paul Schultz <[email protected]> Changed docs hierarchy Signed-off-by: Paul Schultz <[email protected]> Delete webpage_info/docs/1. 2.1.0/2. Authoring Stacks directory Signed-off-by: Paul Schultz <[email protected]> Delete webpage_info/docs/1. 2.1.0/5. Devfile samples directory Signed-off-by: Paul Schultz <[email protected]> Removed temp files Signed-off-by: Paul Schultz <[email protected]> Added syntax highlighting, updated type checking, and updated debug options Signed-off-by: Paul Schultz <[email protected]> Updated css and added copy button for code blocks Signed-off-by: Paul Schultz <[email protected]> Added href when navigating Signed-off-by: Paul Schultz <[email protected]> fixed launch.json Signed-off-by: Paul Schultz <[email protected]> removed launch.json because its autogenerated when yarn dev is run Signed-off-by: Paul Schultz <[email protected]> Added useHtml Signed-off-by: Paul Schultz <[email protected]> updated header to also include navbar when under 1200px Signed-off-by: Paul Schultz <[email protected]> Added bullet for ul Signed-off-by: Paul Schultz <[email protected]> Updated analytics Signed-off-by: Paul Schultz <[email protected]> Updated eslint configuration Signed-off-by: Paul Schultz <[email protected]> Changed eslint rule Signed-off-by: Paul Schultz <[email protected]> Changed the navbar from vertical to horizontal Signed-off-by: Paul Schultz <[email protected]> Updated footer Signed-off-by: Paul Schultz <[email protected]> Finish sidenav Signed-off-by: Paul Schultz <[email protected]> fixed errors Signed-off-by: Paul Schultz <[email protected]> updated test Signed-off-by: Paul Schultz <[email protected]> dockerfile fix Signed-off-by: Paul Schultz <[email protected]> dockerfile fix? Signed-off-by: Paul Schultz <[email protected]> dockerfile fix? Signed-off-by: Paul Schultz <[email protected]>
1 parent 4ab316f commit 71f78ee

File tree

90 files changed

+6482
-3572
lines changed

Some content is hidden

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

90 files changed

+6482
-3572
lines changed

.babelrc

-4
This file was deleted.

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ next-env.d.ts
1010

1111
/public/*.js
1212
/public/*.js.map
13+
14+
/scripts/*.js

.eslintrc.json

+107-117
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,35 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"es2021": true,
5-
"node": true,
6-
"cypress/globals": true,
7-
"jest": true
8-
},
9-
"plugins": [
10-
"@typescript-eslint",
11-
"react",
12-
"react-hooks",
13-
"eslint-plugin-tsdoc",
14-
"cypress",
15-
"prettier",
16-
"patternfly-react"
17-
],
2+
"plugins": ["eslint-comments", "promise", "unicorn"],
183
"extends": [
19-
"plugin:cypress/recommended",
20-
"eslint:recommended",
21-
"plugin:@typescript-eslint/recommended",
22-
"plugin:react/recommended",
4+
"airbnb",
5+
"airbnb/hooks",
6+
"plugin:eslint-comments/recommended",
7+
"plugin:promise/recommended",
8+
"plugin:unicorn/recommended",
9+
"prettier",
2310
"next"
2411
],
25-
"parserOptions": {
26-
"project": "./tsconfig.json",
27-
"sourceType": "module",
28-
"ecmaFeatures": {
29-
"jsx": true
30-
}
12+
"env": {
13+
"browser": true,
14+
"node": true
3115
},
3216
"settings": {
3317
"react": {
3418
"version": "detect"
3519
}
3620
},
37-
"globals": {
38-
"describe": "readonly",
39-
"test": "readonly",
40-
"jest": "readonly",
41-
"expect": "readonly",
42-
"require": "readonly",
43-
"global": "writable",
44-
"it": "readonly",
45-
"afterEach": "readonly",
46-
"beforeEach": "readonly"
21+
"parserOptions": {
22+
"project": "./tsconfig.json",
23+
"ecmaVersion": 13,
24+
"sourceType": "module",
25+
"ecmaFeatures": {
26+
"jsx": true
27+
}
4728
},
4829
"rules": {
30+
// React is already in-scope for all files compiled with Next.js
31+
"react/react-in-jsx-scope": "off",
32+
// SSR does not support useLayoutEffect
4933
"no-restricted-imports": [
5034
"error",
5135
{
@@ -54,92 +38,98 @@
5438
"message": "`useLayoutEffect` causes a warning in SSR. Use `useEffect`"
5539
}
5640
],
57-
"tsdoc/syntax": "warn",
58-
"cypress/no-assigning-return-values": "error",
59-
"cypress/no-unnecessary-waiting": "error",
60-
"cypress/assertion-before-screenshot": "warn",
61-
"cypress/no-force": "warn",
62-
"cypress/no-async-tests": "error",
63-
"@typescript-eslint/no-unsafe-member-access": [0],
64-
"@typescript-eslint/no-non-null-assertion": "off",
65-
"react/react-in-jsx-scope": "off",
66-
"@typescript-eslint/adjacent-overload-signatures": "error",
67-
"@typescript-eslint/array-type": "error",
68-
"@typescript-eslint/ban-types": "error",
69-
"@typescript-eslint/consistent-type-assertions": "error",
70-
"@typescript-eslint/consistent-type-definitions": "error",
71-
"@typescript-eslint/explicit-member-accessibility": "error",
72-
"@typescript-eslint/explicit-module-boundary-types": "error",
73-
"@typescript-eslint/indent": "off",
74-
"@typescript-eslint/no-empty-function": "error",
75-
"@typescript-eslint/no-empty-interface": "error",
76-
"@typescript-eslint/no-explicit-any": "error",
77-
"@typescript-eslint/no-inferrable-types": "error",
78-
"@typescript-eslint/no-misused-new": "error",
79-
"@typescript-eslint/no-namespace": "error",
80-
"@typescript-eslint/no-unused-vars": [
81-
"error",
82-
{
83-
"argsIgnorePattern": "^_"
84-
}
85-
],
86-
"@typescript-eslint/no-use-before-define": "off",
87-
"@typescript-eslint/no-var-requires": "error",
88-
"@typescript-eslint/prefer-for-of": "error",
89-
"@typescript-eslint/prefer-function-type": "error",
90-
"@typescript-eslint/prefer-namespace-keyword": "error",
91-
"@typescript-eslint/unified-signatures": "error",
92-
"@typescript-eslint/explicit-function-return-type": "error",
93-
"quotes": ["error", "single"],
94-
"arrow-body-style": "error",
41+
// Enables for of and for in loops since airbnb does not allow them
42+
"no-restricted-syntax": "off",
43+
// Enforces camelcase
9544
"camelcase": [
9645
"error",
9746
{
9847
"ignoreDestructuring": true
9948
}
10049
],
101-
"constructor-super": "error",
102-
"curly": "error",
103-
"dot-notation": "error",
104-
"eqeqeq": ["error", "smart"],
105-
"guard-for-in": "error",
106-
"max-classes-per-file": ["error", 1],
107-
"max-len": "off",
108-
"no-nested-ternary": "error",
109-
"no-bitwise": "error",
110-
"no-caller": "error",
111-
"no-cond-assign": "error",
112-
"no-console": "error",
113-
"no-debugger": "error",
114-
"no-empty": "error",
115-
"no-eval": "error",
116-
"no-new-wrappers": "error",
117-
"no-prototype-builtins": "error",
118-
"no-shadow": "off",
119-
"no-throw-literal": "error",
120-
"no-trailing-spaces": "off",
121-
"no-undef-init": "error",
122-
"no-unsafe-finally": "error",
123-
"no-unused-expressions": [
124-
"error",
125-
{
126-
"allowTernary": true,
127-
"allowShortCircuit": true
50+
// Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
51+
"no-prototype-builtins": "off",
52+
// Does not allow unreachable loops unless its a for of loop
53+
"no-unreachable-loop": ["error", { "ignore": ["ForInStatement", "ForOfStatement"] }],
54+
// The default case may not be necessary when explicitly knowing return types
55+
"default-case": "warn",
56+
// Can make ugly code
57+
"consistent-return": "off",
58+
// Can make ugly code
59+
"no-case-declarations": "off",
60+
// Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
61+
"react/destructuring-assignment": "off",
62+
// No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
63+
"react/jsx-filename-extension": "off",
64+
// Allow only arrow function based components
65+
"react/function-component-definition": [2, { "namedComponents": "arrow-function" }],
66+
// Common practice in React
67+
"react/jsx-props-no-spreading": "off",
68+
// Warn when the index is used as a key instead of a unique value
69+
"react/no-array-index-key": "warn",
70+
// Sometimes its useful to return a useless fragment instead of adding a null as a union type
71+
"react/jsx-no-useless-fragment": "warn",
72+
// Common abbreviations are known and readable
73+
"unicorn/prevent-abbreviations": "off",
74+
// Airbnb prefers forEach
75+
"unicorn/no-array-for-each": "off",
76+
// React prefers capitalized file names for components
77+
"unicorn/filename-case": "off",
78+
// Enables Array.reduce()
79+
"unicorn/no-array-reduce": "off",
80+
// https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
81+
"import/prefer-default-export": "off",
82+
// It's not accurate in the monorepo style
83+
"import/no-extraneous-dependencies": "off",
84+
// Import for import of components
85+
"import/no-cycle": "off"
86+
},
87+
"overrides": [
88+
{
89+
"files": ["**/*.js"],
90+
"rules": {
91+
// Allow CJS until ESM support improves
92+
"unicorn/prefer-module": "off"
12893
}
129-
],
130-
"no-unused-labels": "error",
131-
"no-var": "error",
132-
"object-shorthand": "error",
133-
"one-var": ["error", "never"],
134-
"patternfly-react/import-tokens-icons": "error",
135-
"patternfly-react/no-anonymous-functions": "error",
136-
"prefer-const": "error",
137-
"prettier/prettier": "error",
138-
"radix": ["error", "as-needed"],
139-
"react/prop-types": 0,
140-
"react/display-name": 0,
141-
"react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }],
142-
"spaced-comment": "error",
143-
"use-isnan": "error"
144-
}
94+
},
95+
{
96+
"files": ["**/*.ts", "**/*.tsx"],
97+
"plugins": ["@typescript-eslint"],
98+
"extends": [
99+
"airbnb-typescript",
100+
"plugin:@typescript-eslint/recommended",
101+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
102+
],
103+
"parser": "@typescript-eslint/parser",
104+
"rules": {
105+
// It's not accurate in the monorepo style
106+
"import/no-extraneous-dependencies": "off",
107+
// Requires return type
108+
"@typescript-eslint/explicit-function-return-type": "error",
109+
// Allows the use of functions before definition
110+
"@typescript-eslint/no-use-before-define": ["off"],
111+
// Allows variables starting with _ to be ignored if not used
112+
"@typescript-eslint/no-unused-vars": [
113+
"error",
114+
{
115+
"argsIgnorePattern": "^_"
116+
}
117+
],
118+
// Disallows function overloading
119+
"@typescript-eslint/unified-signatures": "error",
120+
// Requires function return types
121+
"@typescript-eslint/prefer-function-type": "error",
122+
// Requires classes to make member access explicit
123+
"@typescript-eslint/explicit-member-accessibility": "error",
124+
// Requires the use of interface over type when possible
125+
"@typescript-eslint/consistent-type-definitions": "error",
126+
// Requires consistent type casting
127+
"@typescript-eslint/consistent-type-assertions": "error",
128+
// Requires the T[] type syntax for an array
129+
"@typescript-eslint/array-type": "error",
130+
// Next.js does not require all anchor tags to have an href
131+
"jsx-a11y/anchor-is-valid": "off"
132+
}
133+
}
134+
]
145135
}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ yarn-error.log*
4343
package-lock.json
4444

4545
/docs
46+
47+
/scripts/*.js
48+
/.vscode/launch.json

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ next-env.d.ts
1010

1111
/public/*.js
1212
/public/*.js.map
13+
14+
/scripts/*.js
15+
16+
.vscode

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules\\typescript\\lib"
3+
}

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USER root
66
WORKDIR /app
77
RUN npm install -g yarn
88
COPY . .
9+
RUN $(npm get prefix)/bin/yarn add -D @swc/cli @swc/core
910
RUN $(npm get prefix)/bin/yarn install --frozen-lockfile --ignore-optional
1011
RUN $(npm get prefix)/bin/yarn build
1112
RUN $(npm get prefix)/bin/yarn install --production --ignore-scripts --prefer-offline --ignore-optional

__tests__/integration/home-page.spec.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
export {};
55

66
describe('Testing links on the home page', () => {
7-
it('successfully loads', () => {
8-
cy.visit('/'); // change URL to match your dev URL
7+
beforeEach(() => {
8+
// run these tests as if in a desktop
9+
// browser with a 720p monitor
10+
cy.viewport(1280, 720);
911
});
10-
it('site navigation works', () => {
11-
cy.contains('Getting Started').click();
12-
cy.url().should('include', '/getting-started');
1312

14-
cy.get('[data-testid=go-home-button]').click();
15-
cy.url().should('eq', Cypress.config().baseUrl);
13+
it('successfully loads', () => {
14+
cy.visit('/'); // change URL to match your dev URL
1615
});
1716
});

__tests__/plugins/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
/* eslint-disable eslint-comments/disable-enable-pair */
12
/* eslint-disable @typescript-eslint/no-var-requires */
3+
/* eslint-disable unicorn/prefer-module */
4+
/* eslint-disable @typescript-eslint/no-unsafe-call */
5+
/* eslint-disable global-require */
26
// eslint-disable-next-line spaced-comment
37
/// <reference types="cypress" />
48

0 commit comments

Comments
 (0)