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

Commit

Permalink
Noviny/brisk as gatsby plugin pt1 (#216)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Noviny authored Nov 18, 2019
1 parent 3c58139 commit 36693fd
Show file tree
Hide file tree
Showing 402 changed files with 1,192 additions and 614 deletions.
6 changes: 6 additions & 0 deletions .changeset/calm-zoos-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@brisk-docs/gatsby-generator': minor
'@brisk-docs/gatsby-plugin': minor
---

Switch gatsby to run using a plugin, not controlled directly by brisk
6 changes: 6 additions & 0 deletions .changeset/cuddly-rivers-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@brisk-docs/file-viewer': patch
'@brisk-docs/react-changelogs': patch
---

Safety bump
22 changes: 11 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 4
version: 5

job-setup: &job-setup
docker:
Expand All @@ -17,9 +17,9 @@ save-cache: &save-cache
- ~/.cache
key: v3-dependencies-{{ checksum "yarn.lock" }}

install-bolt: &install-bolt
name: Install Bolt
command: sudo yarn global add bolt@^0.24.3 && bolt
install-packages: &install-packages
name: Install Packages
command: yarn

jobs:
install:
Expand All @@ -31,7 +31,9 @@ jobs:
# Download and cache dependencies
- restore_cache: *restore-cache

- run: *install-bolt
- run:
name: Yarn Install
command: yarn

- run:
name: Install Cypress
Expand All @@ -46,13 +48,11 @@ jobs:

- restore_cache: *restore-cache

- run: *install-bolt

- save_cache: *save-cache

- run:
name: Lint Files
command: bolt lint
command: yarn lint

unit_tests:
<<: *job-setup
Expand All @@ -61,7 +61,7 @@ jobs:

- restore_cache: *restore-cache

- run: *install-bolt
- run: *install-packages

- run:
name: Jest Suite
Expand All @@ -80,11 +80,11 @@ jobs:

- restore_cache: *restore-cache

- run: *install-bolt
- run: *install-packages

- run:
name: Start up website (using complete-config-project)
command: bolt start:website:complete
command: yarn start:website:complete
background: true

- run:
Expand Down
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ node_modules
out
brisk-out

packages/website/pages
packages/gatsby-generator/pages

packages/website/data/**/*.json
packages/gatsby-generator/data/**/*.json

packages/website/bundles/**/*.js
packages/gatsby-generator/bundles/**/*.js

packages/**/dist/**/*

Expand Down
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ yarn-error.log
brisk-out
scratchings.js

/packages/website/pages
/packages/gatsby-generator/pages

/packages/website/data
/packages/website/static/favicon.ico
/packages/website/typings
/packages/gatsby-generator/data
/packages/gatsby-generator/static/favicon.ico
/packages/gatsby-generator/typings

/packages/**/bundles
/packages/website/public
/packages/gatsby-generator/public
/packages/**/**/yarn.lock

dist
out
public

deploy
!deploy/changeset-bot/changeset-bot.sd.yml
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.9.0
10.13.0
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ dist
/out
brisk-out
.cache
/packages/website/pages
/packages/gatsby-generator/pages
/cypress
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Brisk is an Atlassian Initiative to help with documenting code. It contains two main parts:

## [The Brisk Website Generator](./packages/website)
## [The Brisk Website Generator](./packages/gatsby-generator)

This is packaged as `@brisk-docs/website` and is designed as an all-inclusive documentation
This is packaged as `@brisk-docs/gatsby-plugin` and is designed as an all-inclusive documentation
tool for mono-repos containing react components and other packages. Check out [the package's documentation](./packages/website)
for more information on how to use it.

Expand Down
8 changes: 8 additions & 0 deletions brisk-docs-website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Docs Website

This is the documentation website for `brisk-docs`.

To get this running locally:

- run `yarn` in the root of this repository.
- run `yarn dev`
8 changes: 5 additions & 3 deletions docs.config.js → brisk-docs-website/docs.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const docs = [
{
path: './docs',
path: '../docs',
urlPath: 'docs',
name: 'Docs',
description:
'Information about brisk as a whole, and contributing to brisk',
Expand All @@ -11,7 +12,8 @@ const links = [];

if (process.env && process.env.CONTEXT !== 'production') {
docs.push({
path: './example-pages',
path: '../example-pages',
urlPath: 'example-pages',
name: 'Example Pages',
description: 'This is a collection of example pages.',
});
Expand All @@ -30,7 +32,7 @@ if (process.env && process.env.CONTEXT !== 'production') {

module.exports = () => ({
siteName: 'Brisk Docs Docs',
packages: ['./packages/*'],
packages: ['../packages/*'],
showSubExamples: false,
docs,
links,
Expand Down
7 changes: 7 additions & 0 deletions brisk-docs-website/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
plugins: [
{
resolve: require.resolve('@brisk-docs/gatsby-plugin'),
},
],
};
11 changes: 11 additions & 0 deletions brisk-docs-website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@brisk-docs/test-website",
"version": "0.0.0",
"main": "dist/test-website.cjs.js",
"private": true,
"dependencies": {
"@brisk-docs/gatsby-plugin": "^0.0.0",
"@brisk-docs/gatsby-generator": "^1.0.1",
"gatsby": "^2.17.10"
}
}
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ module.exports = () => ({
{
page: 'package:home',
position: 'above',
component: 'dummy-data/templates/package-home-extension',
component: 'templates/package-home-extension',
},
{
page: 'package:home',
position: 'replace',
component: 'dummy-data/templates/package-home-replacement',
component: 'templates/package-home-replacement',
},
],
});
7 changes: 7 additions & 0 deletions complete-test-website/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
plugins: [
{
resolve: require.resolve('@brisk-docs/gatsby-plugin'),
},
],
};
14 changes: 14 additions & 0 deletions complete-test-website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@brisk-docs/test-project-all-config",
"version": "1.0.0",
"private": true,
"dependencies": {
"@brisk-docs/gatsby-generator": "^1.0.1",
"@brisk-docs/gatsby-plugin": "^0.0.0",
"gatsby": "^2.17.10",
"react": "16.10.2"
},
"scripts": {
"start": "brisk build-pages && gatsby develop"
}
}
8 changes: 4 additions & 4 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"baseUrl": "http://localhost:8000",
"integrationFolder": "packages/website/cypress/integration",
"fixturesFolder": "packages/website/cypress/fixtures",
"screenshotsFolder": "packages/website/cypress/screenshots",
"supportFile": "packages/website/cypress/support/index.js",
"integrationFolder": "packages/gatsby-generator/cypress/integration",
"fixturesFolder": "packages/gatsby-generator/cypress/fixtures",
"screenshotsFolder": "packages/gatsby-generator/cypress/screenshots",
"supportFile": "packages/gatsby-generator/cypress/support/index.js",
"video": false
}
8 changes: 0 additions & 8 deletions deploy/Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions deploy/changeset-bot/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions deploy/changeset-bot/changeset-bot.sd.yml

This file was deleted.

14 changes: 0 additions & 14 deletions deploy/jira-frontend-docs-test.sd.yml

This file was deleted.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,34 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"build": "preconstruct build",
"build:docs": "NODE_ENV=production node packages/website/bin.js build",
"clean": "yarn clean:caches && yarn clean:dist && yarn clean:modules",
"clean:caches": "rm -rf packages/website/pages && rm -rf packages/website/.cache",
"clean:dist": "bolt ws exec --parallel -- rm -rf dist",
"clean:modules": "bolt ws exec --parallel -- rm -rf node_modules && rm -rf node_modules",
"clean": "yarn clean:caches && yarn clean:modules",
"clean:caches": "rm -rf packages/gatsby-generator/pages && rm -rf packages/gatsby-generator/.cache",
"clean:modules": "node scripts/clean.js && rm -rf node_modules",
"prettier": "prettier --write \"**/*.{js,ts,tsx}\"",
"lint": "yarn lint:eslint && yarn lint:prettier && yarn check:types",
"lint:prettier": "prettier --list-different \"**/*.{js,ts,tsx}\"",
"lint:eslint": "yarn eslint . --ext .ts,.tsx,.js",
"check:types": "yarn tsc",
"release": "yarn build && changeset publish",
"prepare:docs": "bolt && NODE_ENV=production yarn v-brisk build",
"prepare:docs": "NODE_ENV=production cd brisk-docs-website && brisk build-pages && gatsby build",
"postinstall": "preconstruct dev && manypkg check",
"bolt:fix": "manypkg fix",
"start:website:complete": "bolt w @brisk-docs/gatsby-generator run start:complete",
"v-brisk": "node packages/website/bin.js",
"quick-pack": "yarn build && cd packages/website && yarn pack"
},
"bolt": {
"version": "^0.24.3",
"workspaces": [
"packages/*"
]
"ws:fix": "manypkg fix",
"start:website:complete": "cd complete-test-website && yarn start",
"quick-pack": "yarn build && yarn quick-pack:generator && yarn quick-pack:plugin",
"quick-pack:generator": "cd packages/gatsby-generator && yarn pack",
"quick-pack:plugin": "cd packages/gatsby-plugin && yarn pack",
"dev": "cd brisk-docs-website && brisk build-pages && gatsby develop"
},
"workspaces": [
"packages/*",
"website",
"complete-test-website"
],
"preconstruct": {
"packages": [
"packages/react-changelogs",
"packages/file-viewer",
"packages/website"
"packages/react-changelogs",
"packages/gatsby-generator"
]
},
"dependencies": {
Expand Down Expand Up @@ -102,7 +101,6 @@
"babel-plugin-styled-components": "1.10.0",
"babel-plugin-transform-dynamic-import": "^2.1.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"bolt": "^0.24.3",
"command-line-args": "^5.0.2",
"cypress": "^3.1.5",
"emotion": "^9.1.3",
Expand All @@ -123,7 +121,7 @@
"extracted-loader": "^1.0.7",
"filenamify": "^4.0.0",
"fs-extra": "^7.0.1",
"gatsby": "^2.15.28",
"gatsby": "^2.17.10",
"gatsby-plugin-emotion": "^2.0",
"gatsby-plugin-manifest": "^2.2.26",
"gatsby-plugin-mdx": "^1.0.46",
Expand All @@ -132,6 +130,7 @@
"gatsby-plugin-styled-components": "^3.1.8",
"gatsby-plugin-typescript": "^2.1.11",
"gatsby-source-filesystem": "^2.1.28",
"get-workspaces": "^0.5.2",
"git-url-parse": "^11.1.2",
"glob": "^7.1.3",
"jest": "^24.1.0",
Expand Down Expand Up @@ -160,6 +159,7 @@
"react-test-renderer": "^16.0.0",
"remark-frontmatter": "^1.3.2",
"remark-parse": "^6.0.3",
"rimraf": "^3.0.0",
"semver": "^5.4.1",
"styled-components": "^3.2.6",
"title-case": "^2.1.1",
Expand Down
Loading

0 comments on commit 36693fd

Please sign in to comment.