Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Commit 36693fd

Browse files
authored
Noviny/brisk as gatsby plugin pt1 (#216)
This PR is step one in moving brisk to being run entirely as a gatsby plugin. Here, what we are doing is running brisk, then loading the data it generates in a gatsby plugin. Pt2 is going to focus on allowing just gatsby to be run.
1 parent 3c58139 commit 36693fd

File tree

402 files changed

+1192
-614
lines changed

Some content is hidden

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

402 files changed

+1192
-614
lines changed

.changeset/calm-zoos-notice.md

+6

.changeset/cuddly-rivers-press.md

+6

.circleci/config.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 4
1+
version: 5
22

33
job-setup: &job-setup
44
docker:
@@ -17,9 +17,9 @@ save-cache: &save-cache
1717
- ~/.cache
1818
key: v3-dependencies-{{ checksum "yarn.lock" }}
1919

20-
install-bolt: &install-bolt
21-
name: Install Bolt
22-
command: sudo yarn global add bolt@^0.24.3 && bolt
20+
install-packages: &install-packages
21+
name: Install Packages
22+
command: yarn
2323

2424
jobs:
2525
install:
@@ -31,7 +31,9 @@ jobs:
3131
# Download and cache dependencies
3232
- restore_cache: *restore-cache
3333

34-
- run: *install-bolt
34+
- run:
35+
name: Yarn Install
36+
command: yarn
3537

3638
- run:
3739
name: Install Cypress
@@ -46,13 +48,11 @@ jobs:
4648

4749
- restore_cache: *restore-cache
4850

49-
- run: *install-bolt
50-
5151
- save_cache: *save-cache
5252

5353
- run:
5454
name: Lint Files
55-
command: bolt lint
55+
command: yarn lint
5656

5757
unit_tests:
5858
<<: *job-setup
@@ -61,7 +61,7 @@ jobs:
6161

6262
- restore_cache: *restore-cache
6363

64-
- run: *install-bolt
64+
- run: *install-packages
6565

6666
- run:
6767
name: Jest Suite
@@ -80,11 +80,11 @@ jobs:
8080

8181
- restore_cache: *restore-cache
8282

83-
- run: *install-bolt
83+
- run: *install-packages
8484

8585
- run:
8686
name: Start up website (using complete-config-project)
87-
command: bolt start:website:complete
87+
command: yarn start:website:complete
8888
background: true
8989

9090
- run:

.eslintignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ node_modules
33
out
44
brisk-out
55

6-
packages/website/pages
6+
packages/gatsby-generator/pages
77

8-
packages/website/data/**/*.json
8+
packages/gatsby-generator/data/**/*.json
99

10-
packages/website/bundles/**/*.js
10+
packages/gatsby-generator/bundles/**/*.js
1111

1212
packages/**/dist/**/*
1313

.gitignore

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ yarn-error.log
1818
brisk-out
1919
scratchings.js
2020

21-
/packages/website/pages
21+
/packages/gatsby-generator/pages
2222

23-
/packages/website/data
24-
/packages/website/static/favicon.ico
25-
/packages/website/typings
23+
/packages/gatsby-generator/data
24+
/packages/gatsby-generator/static/favicon.ico
25+
/packages/gatsby-generator/typings
2626

2727
/packages/**/bundles
28-
/packages/website/public
28+
/packages/gatsby-generator/public
2929
/packages/**/**/yarn.lock
3030

3131
dist
3232
out
33+
public
3334

3435
deploy
3536
!deploy/changeset-bot/changeset-bot.sd.yml

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.9.0
1+
10.13.0

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ dist
44
/out
55
brisk-out
66
.cache
7-
/packages/website/pages
7+
/packages/gatsby-generator/pages
88
/cypress

README.md

+2-2

brisk-docs-website/README.md

+8

docs.config.js brisk-docs-website/docs.config.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const docs = [
22
{
3-
path: './docs',
3+
path: '../docs',
4+
urlPath: 'docs',
45
name: 'Docs',
56
description:
67
'Information about brisk as a whole, and contributing to brisk',
@@ -11,7 +12,8 @@ const links = [];
1112

1213
if (process.env && process.env.CONTEXT !== 'production') {
1314
docs.push({
14-
path: './example-pages',
15+
path: '../example-pages',
16+
urlPath: 'example-pages',
1517
name: 'Example Pages',
1618
description: 'This is a collection of example pages.',
1719
});
@@ -30,7 +32,7 @@ if (process.env && process.env.CONTEXT !== 'production') {
3032

3133
module.exports = () => ({
3234
siteName: 'Brisk Docs Docs',
33-
packages: ['./packages/*'],
35+
packages: ['../packages/*'],
3436
showSubExamples: false,
3537
docs,
3638
links,

brisk-docs-website/gatsby-config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: [
3+
{
4+
resolve: require.resolve('@brisk-docs/gatsby-plugin'),
5+
},
6+
],
7+
};

brisk-docs-website/package.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@brisk-docs/test-website",
3+
"version": "0.0.0",
4+
"main": "dist/test-website.cjs.js",
5+
"private": true,
6+
"dependencies": {
7+
"@brisk-docs/gatsby-plugin": "^0.0.0",
8+
"@brisk-docs/gatsby-generator": "^1.0.1",
9+
"gatsby": "^2.17.10"
10+
}
11+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/website/dummy-data/complete-config-project/docs.config.js complete-test-website/docs.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ module.exports = () => ({
5454
{
5555
page: 'package:home',
5656
position: 'above',
57-
component: 'dummy-data/templates/package-home-extension',
57+
component: 'templates/package-home-extension',
5858
},
5959
{
6060
page: 'package:home',
6161
position: 'replace',
62-
component: 'dummy-data/templates/package-home-replacement',
62+
component: 'templates/package-home-replacement',
6363
},
6464
],
6565
});
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: [
3+
{
4+
resolve: require.resolve('@brisk-docs/gatsby-plugin'),
5+
},
6+
],
7+
};

complete-test-website/package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@brisk-docs/test-project-all-config",
3+
"version": "1.0.0",
4+
"private": true,
5+
"dependencies": {
6+
"@brisk-docs/gatsby-generator": "^1.0.1",
7+
"@brisk-docs/gatsby-plugin": "^0.0.0",
8+
"gatsby": "^2.17.10",
9+
"react": "16.10.2"
10+
},
11+
"scripts": {
12+
"start": "brisk build-pages && gatsby develop"
13+
}
14+
}

cypress.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"baseUrl": "http://localhost:8000",
3-
"integrationFolder": "packages/website/cypress/integration",
4-
"fixturesFolder": "packages/website/cypress/fixtures",
5-
"screenshotsFolder": "packages/website/cypress/screenshots",
6-
"supportFile": "packages/website/cypress/support/index.js",
3+
"integrationFolder": "packages/gatsby-generator/cypress/integration",
4+
"fixturesFolder": "packages/gatsby-generator/cypress/fixtures",
5+
"screenshotsFolder": "packages/gatsby-generator/cypress/screenshots",
6+
"supportFile": "packages/gatsby-generator/cypress/support/index.js",
77
"video": false
88
}

deploy/Dockerfile

-8
This file was deleted.

deploy/changeset-bot/Dockerfile

-10
This file was deleted.

deploy/changeset-bot/changeset-bot.sd.yml

-17
This file was deleted.

deploy/jira-frontend-docs-test.sd.yml

-14
This file was deleted.

package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,34 @@
1010
"cypress:open": "cypress open",
1111
"cypress:run": "cypress run",
1212
"build": "preconstruct build",
13-
"build:docs": "NODE_ENV=production node packages/website/bin.js build",
14-
"clean": "yarn clean:caches && yarn clean:dist && yarn clean:modules",
15-
"clean:caches": "rm -rf packages/website/pages && rm -rf packages/website/.cache",
16-
"clean:dist": "bolt ws exec --parallel -- rm -rf dist",
17-
"clean:modules": "bolt ws exec --parallel -- rm -rf node_modules && rm -rf node_modules",
13+
"clean": "yarn clean:caches && yarn clean:modules",
14+
"clean:caches": "rm -rf packages/gatsby-generator/pages && rm -rf packages/gatsby-generator/.cache",
15+
"clean:modules": "node scripts/clean.js && rm -rf node_modules",
1816
"prettier": "prettier --write \"**/*.{js,ts,tsx}\"",
1917
"lint": "yarn lint:eslint && yarn lint:prettier && yarn check:types",
2018
"lint:prettier": "prettier --list-different \"**/*.{js,ts,tsx}\"",
2119
"lint:eslint": "yarn eslint . --ext .ts,.tsx,.js",
2220
"check:types": "yarn tsc",
2321
"release": "yarn build && changeset publish",
24-
"prepare:docs": "bolt && NODE_ENV=production yarn v-brisk build",
22+
"prepare:docs": "NODE_ENV=production cd brisk-docs-website && brisk build-pages && gatsby build",
2523
"postinstall": "preconstruct dev && manypkg check",
26-
"bolt:fix": "manypkg fix",
27-
"start:website:complete": "bolt w @brisk-docs/gatsby-generator run start:complete",
28-
"v-brisk": "node packages/website/bin.js",
29-
"quick-pack": "yarn build && cd packages/website && yarn pack"
30-
},
31-
"bolt": {
32-
"version": "^0.24.3",
33-
"workspaces": [
34-
"packages/*"
35-
]
24+
"ws:fix": "manypkg fix",
25+
"start:website:complete": "cd complete-test-website && yarn start",
26+
"quick-pack": "yarn build && yarn quick-pack:generator && yarn quick-pack:plugin",
27+
"quick-pack:generator": "cd packages/gatsby-generator && yarn pack",
28+
"quick-pack:plugin": "cd packages/gatsby-plugin && yarn pack",
29+
"dev": "cd brisk-docs-website && brisk build-pages && gatsby develop"
3630
},
31+
"workspaces": [
32+
"packages/*",
33+
"website",
34+
"complete-test-website"
35+
],
3736
"preconstruct": {
3837
"packages": [
39-
"packages/react-changelogs",
4038
"packages/file-viewer",
41-
"packages/website"
39+
"packages/react-changelogs",
40+
"packages/gatsby-generator"
4241
]
4342
},
4443
"dependencies": {
@@ -102,7 +101,6 @@
102101
"babel-plugin-styled-components": "1.10.0",
103102
"babel-plugin-transform-dynamic-import": "^2.1.0",
104103
"babel-plugin-transform-flow-strip-types": "^6.22.0",
105-
"bolt": "^0.24.3",
106104
"command-line-args": "^5.0.2",
107105
"cypress": "^3.1.5",
108106
"emotion": "^9.1.3",
@@ -123,7 +121,7 @@
123121
"extracted-loader": "^1.0.7",
124122
"filenamify": "^4.0.0",
125123
"fs-extra": "^7.0.1",
126-
"gatsby": "^2.15.28",
124+
"gatsby": "^2.17.10",
127125
"gatsby-plugin-emotion": "^2.0",
128126
"gatsby-plugin-manifest": "^2.2.26",
129127
"gatsby-plugin-mdx": "^1.0.46",
@@ -132,6 +130,7 @@
132130
"gatsby-plugin-styled-components": "^3.1.8",
133131
"gatsby-plugin-typescript": "^2.1.11",
134132
"gatsby-source-filesystem": "^2.1.28",
133+
"get-workspaces": "^0.5.2",
135134
"git-url-parse": "^11.1.2",
136135
"glob": "^7.1.3",
137136
"jest": "^24.1.0",
@@ -160,6 +159,7 @@
160159
"react-test-renderer": "^16.0.0",
161160
"remark-frontmatter": "^1.3.2",
162161
"remark-parse": "^6.0.3",
162+
"rimraf": "^3.0.0",
163163
"semver": "^5.4.1",
164164
"styled-components": "^3.2.6",
165165
"title-case": "^2.1.1",

0 commit comments

Comments
 (0)