This repository has been archived by the owner on Mar 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract core pipeline stages into its own package
- Loading branch information
1 parent
b29663f
commit 7f22b53
Showing
148 changed files
with
184 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/gatsby-generator/docs/build-pipeline/4-build-website-stage.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/gatsby-generator/docs/build-pipeline/5-start-website-stage.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 9 additions & 6 deletions
15
packages/gatsby-generator/src/pipeline/buildPagesPipeline.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Brisk Docs Core Pipeline | ||
|
||
This library contains the core modules that Brisk Docs uses to read docs from a monorepo and generate the code for | ||
pages in the docs website. | ||
|
||
Brisk's website generation functionality is broken down into a series of stages that can be run independently or in a | ||
complete pipeline. This package exposes the following stages: | ||
|
||
- Scan metadata: Scans the source of a monorepo and extract information about packages and docs within | ||
- Generate website info: Creates a plan for the structure of the docs website using provided metadata | ||
- Generate pages: Writes files to disk for all the pages to be built into the running website | ||
|
||
For creating and running a docs website end to end please use `@brisk-docs/gatsby-generator`. |
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"metaData": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"packages": [], | ||
"docs": [], | ||
"readme": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"siteName": "", | ||
"packages": {}, | ||
"docs": [] | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "@brisk-docs/pipeline-stages", | ||
"version": "0.1.0", | ||
"main": "dist/pipeline-stages.cjs.js", | ||
"files": [ | ||
"default-pages", | ||
"dist" | ||
], | ||
"dependencies": { | ||
"@babel/runtime": "^7.4.3", | ||
"filenamify": "^4.0.0", | ||
"fs-extra": "^7.0.1", | ||
"glob": "^7.1.3", | ||
"js-yaml": "^3.13.1", | ||
"lodash.flatten": "^4.4.0", | ||
"outdent": "^0.7.0", | ||
"pkg-dir": "^4.2.0", | ||
"remark-frontmatter": "^1.3.2", | ||
"remark-parse": "^6.0.3", | ||
"title-case": "^2.1.1", | ||
"unified": "^7.1.0" | ||
}, | ||
"peerDependencies": {}, | ||
"devDependencies": { | ||
"jest-fixtures": "^0.6.0" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ne/stages/common/configuration-options.ts → ...tages/src/common/configuration-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
packages/pipeline-stages/src/generate-pages/get-default-pages-path.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import path from 'path'; | ||
import pkgDir from 'pkg-dir'; | ||
|
||
// Utility to get the absolute path to the default-pages directory | ||
export default async () => { | ||
const packageRoot = await pkgDir(__dirname); | ||
if (!packageRoot) throw new Error('could not resolve default-pages path'); | ||
|
||
return path.join(packageRoot, 'default-pages') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ages/templates/wrapped-component/index.ts → ...ages/templates/wrapped-component/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { default as makePipelineStage } from './make-pipeline-stage'; | ||
export { default as generatePagesStage } from './generate-pages'; | ||
export { default as generateWebsiteInfoStage } from './generate-website-info'; | ||
export { default as scanMetadataStage } from './scan-metadata'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** This is metadata specified in the frontmatter of markdown pages */ | ||
export type PageMeta = { | ||
/** Title of the page, defaults to titlecased version of doc.id (filename) */ | ||
title: string; | ||
}; | ||
|
||
export interface BasePage<T> { | ||
id: string; | ||
pagePath: string; | ||
children?: Array<T>; | ||
} | ||
|
||
export interface DocsPage extends BasePage<DocsPage> { | ||
meta: PageMeta; | ||
} | ||
|
||
export interface ExamplePage extends BasePage<ExamplePage> { | ||
isolatedPath: string; | ||
} | ||
|
||
export interface NestedExamplePage extends ExamplePage { | ||
children: ExamplePage[]; | ||
} | ||
|
||
export type Page = DocsPage | ExamplePage | NestedExamplePage; | ||
|
||
type Maintainers = string | string[]; | ||
|
||
type Repository = string | { type: string; url: string; directory?: string }; | ||
|
||
type PackageMeta = { | ||
id: string; | ||
description: string; | ||
version: string; | ||
maintainers?: Maintainers; | ||
repository?: Repository; | ||
}; | ||
|
||
export declare type PackageMetadata = { | ||
metaData: PackageMeta[]; | ||
}; | ||
|
||
export declare type PackageInfo = { | ||
id: string; | ||
description: string; | ||
version: string; | ||
maintainers?: Maintainers; | ||
packageId: string; | ||
homePath: string; | ||
homeMeta: PageMeta | undefined; | ||
changelogPath: string; | ||
docs: DocsPage[]; | ||
examples: ExamplePage[]; | ||
subExamples: NestedExamplePage[]; | ||
repository: Repository; | ||
parentId?: string; | ||
packageTitle?: string; | ||
}; | ||
|
||
export type pageType = | ||
| 'package:changelog' | ||
| 'package:doc' | ||
| 'package:exampe' | ||
| 'package:home' | ||
| 'doc:doc'; | ||
|
||
export type TemplateSpecifier = { | ||
page: pageType; | ||
position: 'above' | 'below' | 'replace'; | ||
// Path to the component from the docs config | ||
component: string; | ||
}; |
Oops, something went wrong.