Skip to content

Commit b3abab6

Browse files
Chore/website quality checks (#1212)
* chore/website-quality-checks - adding in prettier and lint scripts for docs website
1 parent ee95207 commit b3abab6

File tree

7 files changed

+81
-23
lines changed

7 files changed

+81
-23
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ on:
88
push:
99
branches:
1010
- main
11-
paths-ignore:
12-
- "docs/**"
1311
pull_request:
1412
branches:
1513
- main
16-
paths-ignore:
17-
- "docs/**"
1814

1915
jobs:
2016
build:

package-scripts.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ module.exports = {
4141
'nps prettier:base -- -- --config ../../.prettierrc --ignore-path ../../.prettierignore',
4242
'prettier:pkg:fix':
4343
'nps prettier:base:fix -- -- --config ../../.prettierrc --ignore-path ../../.prettierignore',
44+
'prettier:website':
45+
'nps prettier:base -- -- --config ../.prettierrc --ignore-path ../.prettierignore',
46+
'prettier:website:fix':
47+
'nps prettier:base:fix -- -- --config ../.prettierrc --ignore-path ../.prettierignore',
4448

4549
// - Lint
4650
'lint:base': 'eslint --cache --color',

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"dependencies": [
167167
"./packages/spectacle:lint",
168168
"./packages/create-spectacle:lint",
169+
"./website:lint",
169170
"./examples/js:lint",
170171
"./examples/md:lint",
171172
"./examples/one-page:lint",
@@ -176,6 +177,7 @@
176177
"dependencies": [
177178
"./packages/spectacle:lint:fix",
178179
"./packages/create-spectacle:lint:fix",
180+
"./website:lint:fix",
179181
"./examples/js:lint:fix",
180182
"./examples/md:lint:fix",
181183
"./examples/one-page:lint:fix",
@@ -224,6 +226,7 @@
224226
"dependencies": [
225227
"./packages/spectacle:prettier",
226228
"./packages/create-spectacle:prettier",
229+
"./website:prettier",
227230
"./examples/js:prettier",
228231
"./examples/md:prettier",
229232
"./examples/one-page:prettier",
@@ -234,6 +237,7 @@
234237
"dependencies": [
235238
"./packages/spectacle:prettier:fix",
236239
"./packages/create-spectacle:prettier:fix",
240+
"./website:prettier:fix",
237241
"./examples/js:prettier:fix",
238242
"./examples/md:prettier:fix",
239243
"./examples/one-page:prettier:fix",

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async function createConfig() {
6565
],
6666

6767
themeConfig:
68-
/** @type {import("@docusaurus/preset-classic").ThemeConfig} */
68+
/** @type {import("@docusaurus/preset-classic").ThemeConfig} */
6969
({
7070
navbar: {
7171
title: 'SPECTACLE',

website/package.json

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@
55
"engines": {
66
"node": "<18"
77
},
8-
"scripts": {
9-
"docusaurus": "docusaurus",
10-
"start": "docusaurus start",
11-
"build": "docusaurus build --out-dir build/open-source/spectacle",
12-
"clear": "docusaurus clear",
13-
"serve": "formideploy serve",
14-
"deploy:stage": "formideploy deploy --staging",
15-
"deploy:prod": "formideploy deploy --production",
16-
"write-translations": "docusaurus write-translations",
17-
"write-heading-ids": "docusaurus write-heading-ids",
18-
"typecheck": "tsc"
19-
},
208
"devDependencies": {
219
"@docusaurus/core": "^2.0.1",
2210
"@docusaurus/module-type-aliases": "^2.0.1",
@@ -41,6 +29,76 @@
4129
"styled-components": "^5.3.5",
4230
"typescript": "^4.6.3"
4331
},
32+
"scripts": {
33+
"docusaurus": "docusaurus",
34+
"start": "docusaurus start",
35+
"build": "docusaurus build --out-dir build/open-source/spectacle",
36+
"clear": "docusaurus clear",
37+
"serve": "formideploy serve",
38+
"deploy:stage": "formideploy deploy --staging",
39+
"deploy:prod": "formideploy deploy --production",
40+
"write-translations": "docusaurus write-translations",
41+
"write-heading-ids": "docusaurus write-heading-ids",
42+
"typecheck": "tsc",
43+
"lint": "wireit",
44+
"lint:fix": "wireit",
45+
"prettier": "wireit",
46+
"prettier:fix": "wireit"
47+
},
48+
"wireit": {
49+
"lint": {
50+
"command": "nps lint:pkg -- -- \"*.js\" src",
51+
"files": [
52+
"../.eslintignore",
53+
"../.eslintrc",
54+
"*.js",
55+
"src/**"
56+
],
57+
"output": [],
58+
"packageLocks": [
59+
"pnpm-lock.yaml"
60+
]
61+
},
62+
"lint:fix": {
63+
"command": "pnpm run lint || nps lint:pkg:fix -- -- \"*.js\" src",
64+
"files": [
65+
"../.eslintignore",
66+
"../.eslintrc",
67+
"*.js",
68+
"src/**"
69+
],
70+
"output": [],
71+
"packageLocks": [
72+
"pnpm-lock.yaml"
73+
]
74+
},
75+
"prettier": {
76+
"command": "nps prettier:website -- -- \"*.js\" src",
77+
"files": [
78+
"../.prettierignore",
79+
"../.prettierrc",
80+
"*.js",
81+
"src/**"
82+
],
83+
"output": [],
84+
"packageLocks": [
85+
"pnpm-lock.yaml"
86+
]
87+
},
88+
"prettier:fix": {
89+
"command": "pnpm run prettier || nps prettier:website:fix -- -- \"*.js\" src",
90+
"files": [
91+
"../.prettierignore",
92+
"../.prettierrc",
93+
"*.js",
94+
"src/**"
95+
],
96+
"output": [],
97+
"packageLocks": [
98+
"pnpm-lock.yaml"
99+
]
100+
}
101+
},
44102
"browserslist": {
45103
"production": [
46104
">0.5%",

website/src/components/global/body-copy.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ type BodyCopy = {
1010

1111
const BodyCopy = ({ className, theme, children }: BodyCopy) => {
1212
const isLight = theme === 'Light' || theme === 'Color';
13-
const classNames = clsx(
14-
styles.bodyCopy,
15-
isLight && styles.light,
16-
className
17-
);
13+
const classNames = clsx(styles.bodyCopy, isLight && styles.light, className);
1814

1915
return <p className={classNames}>{children}</p>;
2016
};

website/src/utils/numbers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ module.exports.romanize = function romanize(num) {
4242
let i = 3;
4343
while (i--) roman = (key[+digits.pop() + i * 10] || '') + roman;
4444
return Array(+digits.join('') + 1).join('M') + roman;
45-
}
45+
};

0 commit comments

Comments
 (0)