From 7f22b53b7bd7da8cd5f9005473a9ab9bd607b18b Mon Sep 17 00:00:00 2001 From: Dean Pisani Date: Tue, 14 Jan 2020 11:48:05 +1100 Subject: [PATCH] Extract core pipeline stages into its own package --- package.json | 3 +- .../build-pipeline/4-build-website-stage.md | 1 - .../build-pipeline/5-start-website-stage.md | 1 - packages/gatsby-generator/package.json | 2 +- .../src/pipeline/buildPagesPipeline.ts | 15 ++-- .../src/pipeline/buildPipeline.ts | 14 ++-- .../src/pipeline/devPipeline.ts | 14 ++-- .../pipeline/stages/build-website/index.ts | 4 +- .../src/pipeline/stages/run-gatsby/index.ts | 4 +- .../src/pipeline/stages/run-website/index.ts | 4 +- packages/pipeline-stages/README.md | 13 ++++ .../docs-with-readme/docs/derpo.jpg | Bin .../docs-with-readme/docs/doc-1.md | 0 .../docs-with-readme/docs/doc-2.md | 0 .../docs/doc-3/doc-3-2/README.md | 0 .../docs-with-readme/docs/doc-3/readme.md | 0 .../docs/_assets/doc-3.md | 0 .../mock-docs-with-assets/docs/doc-2.md | 0 .../docs/resources/1.png | Bin .../docs/sub-docs/doc-1.md | 0 .../mock-docs-with-sorting/docs/doc-1.md | 0 .../mock-docs-with-sorting/docs/doc-2.md | 0 .../docs/doc-3/doc-3-1.md | 0 .../docs/doc-3/doc-3-2/doc-3-2-1.md | 0 .../docs/doc-3/docs.config.js | 0 .../docs/docs.config.js | 0 .../packages/mock-package2/README.md | 0 .../mock-package2/docs/extended-info.md | 0 .../mock-package2/docs/special-usecase.mdx | 0 .../mock-package2/examples/example1.js | 0 .../mock-package2/examples/example2.js | 0 .../mock-package2/examples/example3.js | 0 .../packages/mock-package2/package.json | 0 .../packages/mock-package2/src/index.js | 0 .../sub-folder/mock-package1/README.md | 0 .../mock-package1/docs/extended-info.md | 0 .../nesting-now-supported.md | 0 .../mock-package1/docs/special-usecase.mdx | 0 .../mock-package1/examples/example1.js | 0 .../mock-package1/examples/example2.js | 0 .../mock-package1/examples/example3.js | 0 .../mock-package1/examples/not-an-example.txt | 0 .../examples/utils-please-ignore/index.js | 0 .../sub-folder/mock-package1/package.json | 0 .../sub-folder/mock-package1/src/index.js | 0 .../packages/mock-package1/README.md | 0 .../mock-package1/docs/extended-info.md | 0 .../nesting-now-supported.md | 0 .../mock-package1/docs/special-usecase.mdx | 0 .../mock-package1/examples/example1.js | 0 .../mock-package1/examples/example2.js | 0 .../mock-package1/examples/example3.js | 0 .../mock-package1/examples/not-an-example.txt | 0 .../examples/utils-please-ignore/index.js | 0 .../packages/mock-package1/package.json | 0 .../packages/mock-package1/src/examples.js | 0 .../packages/mock-package1/src/index.js | 0 .../src/test-examples/examples.js | 0 .../mock-package1/src/view/examples.js | 0 .../src/view/sub-dir/examples.js | 0 .../simple-mock-docs/docs/derpo.jpg | Bin .../simple-mock-docs/docs/doc-1.md | 0 .../simple-mock-docs/docs/doc-2.md | 0 .../simple-mock-docs/docs/doc-3/doc-3-1.md | 0 .../docs/doc-3/doc-3-2/doc-3-2-1.md | 0 .../packages/mock-package1/CHANGELOG.md | 0 .../packages/mock-package1/README.md | 0 .../mock-package1/docs/extended-info.md | 0 .../nesting-now-supported.md | 0 .../mock-package1/docs/special-usecase.mdx | 0 .../mock-package1/examples/example1.js | 0 .../mock-package1/examples/example2.js | 0 .../mock-package1/examples/example3.js | 0 .../mock-package1/examples/not-an-example.txt | 0 .../examples/utils-please-ignore/index.js | 0 .../packages/mock-package1/package.json | 0 .../packages/mock-package1/src/index.js | 0 .../packages/mock-package2/README.md | 0 .../mock-package2/docs/extended-info.md | 0 .../mock-package2/docs/special-usecase.mdx | 0 .../mock-package2/examples/example1.js | 0 .../mock-package2/examples/example2.js | 0 .../mock-package2/examples/example3.js | 0 .../packages/mock-package2/package.json | 0 .../packages/mock-package2/src/index.js | 0 .../mock-package3/docs/extended-info.md | 0 .../mock-package3/docs/special-usecase.mdx | 0 .../mock-package3/examples/example1.js | 0 .../mock-package3/examples/example2.js | 0 .../mock-package3/examples/example3.js | 0 .../packages/mock-package3/package.json | 0 .../packages/mock-package3/src/index.js | 0 .../pipeline-stages/data/packages-data.json | 3 + packages/pipeline-stages/data/pages-list.json | 5 ++ packages/pipeline-stages/data/site-meta.json | 5 ++ .../default-pages/_app.tsx | 0 .../default-pages/_layout.tsx | 0 .../default-pages/healthcheck.tsx | 0 .../default-pages/index.tsx | 0 .../default-pages/packages.tsx | 0 .../docs}/1-scan-metadata-stage.md | 0 .../docs}/2-generate-website-info-stage.md | 0 .../docs}/3-generate-pages-stage.md | 0 .../docs}/README.md | 2 - packages/pipeline-stages/package.json | 27 +++++++ .../src}/common/configuration-options.ts | 2 +- .../src}/common/page-specs.ts | 0 .../src}/common/project-info.ts | 0 .../page-writers.integration.test.js.snap | 0 .../generate-pages/get-default-pages-path.ts | 10 +++ .../src}/generate-pages/index.ts | 4 +- .../src}/generate-pages/integration.test.ts | 2 +- .../page-writers.integration.test.js | 0 .../src}/generate-pages/page-writers.ts | 7 +- .../templates/changelog/index.ts | 0 .../templates/changelog/test.js | 0 .../generate-pages/templates/example/index.ts | 0 .../generate-pages/templates/example/test.js | 0 .../src}/generate-pages/templates/index.ts | 0 .../templates/single-component/index.ts | 0 .../templates/single-component/test.js | 0 .../generate-pages/templates/test-utils.js | 0 .../templates/wrapped-component/index.ts | 2 +- .../templates/wrapped-component/test.js | 0 .../src}/generate-pages/test.ts | 0 .../__snapshots__/test.ts.snap | 0 .../generate-docs-info.test.ts | 0 .../generate-docs-info.ts | 0 .../generate-examples-info.test.ts | 0 .../generate-examples-info.ts | 0 .../generate-package-info.test.ts | 0 .../generate-package-info.ts | 0 .../src}/generate-website-info/index.ts | 0 .../src}/generate-website-info/sample-data.ts | 0 .../src}/generate-website-info/test.ts | 0 packages/pipeline-stages/src/index.ts | 4 + .../src}/make-pipeline-stage.test.ts | 0 .../src}/make-pipeline-stage.ts | 0 .../src}/scan-metadata/get-docs-info.test.ts | 0 .../src}/scan-metadata/get-docs-info.ts | 0 .../scan-metadata/get-markdown-meta.test.ts | 0 .../src}/scan-metadata/get-markdown-meta.ts | 0 .../scan-metadata/get-package-info.test.ts | 0 .../src}/scan-metadata/get-package-info.ts | 0 .../src}/scan-metadata/index.ts | 0 .../src}/scan-metadata/test.ts | 0 packages/pipeline-stages/src/types.ts | 72 ++++++++++++++++++ yarn.lock | 4 +- 148 files changed, 184 insertions(+), 40 deletions(-) delete mode 100644 packages/gatsby-generator/docs/build-pipeline/4-build-website-stage.md delete mode 100644 packages/gatsby-generator/docs/build-pipeline/5-start-website-stage.md create mode 100644 packages/pipeline-stages/README.md rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/docs-with-readme/docs/derpo.jpg (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/docs-with-readme/docs/doc-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/docs-with-readme/docs/doc-2.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/docs-with-readme/docs/doc-3/doc-3-2/README.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/docs-with-readme/docs/doc-3/readme.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-assets/docs/doc-2.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-assets/docs/resources/1.png (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-sorting/docs/doc-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-sorting/docs/doc-2.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-2/doc-3-2-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-sorting/docs/doc-3/docs.config.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-docs-with-sorting/docs/docs.config.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/README.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/extended-info.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/special-usecase.mdx (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example1.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example2.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example3.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/package.json (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/mock-package2/src/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/README.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/extended-info.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/some-subdirectory/nesting-now-supported.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/special-usecase.mdx (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example1.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example2.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example3.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/not-an-example.txt (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/utils-please-ignore/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/package.json (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/src/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/README.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/extended-info.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/special-usecase.mdx (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example1.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example2.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example3.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/not-an-example.txt (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/utils-please-ignore/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/package.json (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/examples.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/test-examples/examples.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/examples.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/sub-dir/examples.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-docs/docs/derpo.jpg (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-docs/docs/doc-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-docs/docs/doc-2.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-2/doc-3-2-1.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/CHANGELOG.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/README.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/docs/extended-info.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/docs/special-usecase.mdx (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example1.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example2.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example3.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/examples/not-an-example.txt (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/examples/utils-please-ignore/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/package.json (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package1/src/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/README.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/docs/extended-info.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/docs/special-usecase.mdx (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example1.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example2.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example3.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/package.json (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package2/src/index.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/docs/extended-info.md (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/docs/special-usecase.mdx (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example1.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example2.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example3.js (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/package.json (100%) rename packages/{gatsby-generator => pipeline-stages}/__fixtures__/simple-mock-packages/packages/mock-package3/src/index.js (100%) create mode 100644 packages/pipeline-stages/data/packages-data.json create mode 100644 packages/pipeline-stages/data/pages-list.json create mode 100644 packages/pipeline-stages/data/site-meta.json rename packages/{gatsby-generator => pipeline-stages}/default-pages/_app.tsx (100%) rename packages/{gatsby-generator => pipeline-stages}/default-pages/_layout.tsx (100%) rename packages/{gatsby-generator => pipeline-stages}/default-pages/healthcheck.tsx (100%) rename packages/{gatsby-generator => pipeline-stages}/default-pages/index.tsx (100%) rename packages/{gatsby-generator => pipeline-stages}/default-pages/packages.tsx (100%) rename packages/{gatsby-generator/docs/build-pipeline => pipeline-stages/docs}/1-scan-metadata-stage.md (100%) rename packages/{gatsby-generator/docs/build-pipeline => pipeline-stages/docs}/2-generate-website-info-stage.md (100%) rename packages/{gatsby-generator/docs/build-pipeline => pipeline-stages/docs}/3-generate-pages-stage.md (100%) rename packages/{gatsby-generator/docs/build-pipeline => pipeline-stages/docs}/README.md (76%) create mode 100644 packages/pipeline-stages/package.json rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/common/configuration-options.ts (96%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/common/page-specs.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/common/project-info.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/__snapshots__/page-writers.integration.test.js.snap (100%) create mode 100644 packages/pipeline-stages/src/generate-pages/get-default-pages-path.ts rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/index.ts (95%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/integration.test.ts (98%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/page-writers.integration.test.js (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/page-writers.ts (97%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/changelog/index.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/changelog/test.js (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/example/index.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/example/test.js (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/index.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/single-component/index.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/single-component/test.js (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/test-utils.js (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/wrapped-component/index.ts (96%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/templates/wrapped-component/test.js (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-pages/test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/__snapshots__/test.ts.snap (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/generate-docs-info.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/generate-docs-info.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/generate-examples-info.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/generate-examples-info.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/generate-package-info.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/generate-package-info.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/index.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/sample-data.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/generate-website-info/test.ts (100%) create mode 100644 packages/pipeline-stages/src/index.ts rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/make-pipeline-stage.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/make-pipeline-stage.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/get-docs-info.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/get-docs-info.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/get-markdown-meta.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/get-markdown-meta.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/get-package-info.test.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/get-package-info.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/index.ts (100%) rename packages/{gatsby-generator/src/pipeline/stages => pipeline-stages/src}/scan-metadata/test.ts (100%) create mode 100644 packages/pipeline-stages/src/types.ts diff --git a/package.json b/package.json index 47a34d68..3d008180 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "packages": [ "packages/file-viewer", "packages/react-changelogs", - "packages/gatsby-generator" + "packages/gatsby-generator", + "packages/pipeline-stages" ] }, "dependencies": { diff --git a/packages/gatsby-generator/docs/build-pipeline/4-build-website-stage.md b/packages/gatsby-generator/docs/build-pipeline/4-build-website-stage.md deleted file mode 100644 index 27907cbf..00000000 --- a/packages/gatsby-generator/docs/build-pipeline/4-build-website-stage.md +++ /dev/null @@ -1 +0,0 @@ -# Build website build stage diff --git a/packages/gatsby-generator/docs/build-pipeline/5-start-website-stage.md b/packages/gatsby-generator/docs/build-pipeline/5-start-website-stage.md deleted file mode 100644 index d3832c87..00000000 --- a/packages/gatsby-generator/docs/build-pipeline/5-start-website-stage.md +++ /dev/null @@ -1 +0,0 @@ -# Start website build stage diff --git a/packages/gatsby-generator/package.json b/packages/gatsby-generator/package.json index 6dd8e1e3..aa9a5368 100644 --- a/packages/gatsby-generator/package.json +++ b/packages/gatsby-generator/package.json @@ -35,7 +35,6 @@ }, "files": [ "static", - "default-pages", "babel.config.js", "gatsby-node.js", "gatsby-config.js", @@ -66,6 +65,7 @@ "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.4.3", "@brisk-docs/file-viewer": "^0.2.5", + "@brisk-docs/pipeline-stages": "^0.1.0", "@brisk-docs/react-changelogs": "^0.1.11", "@emotion/core": "^10.0.9", "@emotion/styled": "^10.0.9", diff --git a/packages/gatsby-generator/src/pipeline/buildPagesPipeline.ts b/packages/gatsby-generator/src/pipeline/buildPagesPipeline.ts index 60088949..f1a97953 100644 --- a/packages/gatsby-generator/src/pipeline/buildPagesPipeline.ts +++ b/packages/gatsby-generator/src/pipeline/buildPagesPipeline.ts @@ -1,6 +1,9 @@ -import scanMetadata from './stages/scan-metadata'; -import generateWebsiteInfo from './stages/generate-website-info'; -import generatePages from './stages/generate-pages'; +import { + scanMetadataStage, + generateWebsiteInfoStage, + generatePagesStage, +} from '@brisk-docs/pipeline-stages'; + import allPaths from './getAllPaths'; const buildPipeline = async (configPath?: string) => { @@ -8,16 +11,16 @@ const buildPipeline = async (configPath?: string) => { configPath, ); - return scanMetadata({ + return scanMetadataStage({ rootPath, packagePathPatterns: config.packagesPaths, customPackageFields: config.customPackageFields, docs: config.docs, showSubExamples: config.showSubExamples, }) - .then(projectData => generateWebsiteInfo(projectData)) + .then(projectData => generateWebsiteInfoStage(projectData)) .then(websiteInfo => - generatePages({ + generatePagesStage({ wrappersPath, pagesPath, packageRoot: pkgRoot, diff --git a/packages/gatsby-generator/src/pipeline/buildPipeline.ts b/packages/gatsby-generator/src/pipeline/buildPipeline.ts index aa2801ef..f0e121e7 100644 --- a/packages/gatsby-generator/src/pipeline/buildPipeline.ts +++ b/packages/gatsby-generator/src/pipeline/buildPipeline.ts @@ -1,8 +1,10 @@ import path from 'path'; import fs from 'fs-extra'; -import scanMetadata from './stages/scan-metadata'; -import generateWebsiteInfo from './stages/generate-website-info'; -import generatePages from './stages/generate-pages'; +import { + scanMetadataStage, + generateWebsiteInfoStage, + generatePagesStage, +} from '@brisk-docs/pipeline-stages'; import runGatsby from './stages/run-gatsby'; import allPaths from './getAllPaths'; @@ -15,16 +17,16 @@ const buildPipeline = async ( configPath, ); - return scanMetadata({ + return scanMetadataStage({ rootPath, packagePathPatterns: config.packagesPaths, customPackageFields: config.customPackageFields, docs: config.docs, showSubExamples: config.showSubExamples, }) - .then(projectData => generateWebsiteInfo(projectData)) + .then(projectData => generateWebsiteInfoStage(projectData)) .then(websiteInfo => - generatePages({ + generatePagesStage({ wrappersPath, pagesPath, packageRoot: pkgRoot, diff --git a/packages/gatsby-generator/src/pipeline/devPipeline.ts b/packages/gatsby-generator/src/pipeline/devPipeline.ts index b62b98db..45148f9c 100644 --- a/packages/gatsby-generator/src/pipeline/devPipeline.ts +++ b/packages/gatsby-generator/src/pipeline/devPipeline.ts @@ -1,6 +1,8 @@ -import scanMetadata from './stages/scan-metadata'; -import generateWebsiteInfo from './stages/generate-website-info'; -import generatePages from './stages/generate-pages'; +import { + scanMetadataStage, + generateWebsiteInfoStage, + generatePagesStage, +} from '@brisk-docs/pipeline-stages'; import runGatsby from './stages/run-gatsby'; import allPaths from './getAllPaths'; @@ -9,16 +11,16 @@ const devPipeline = async (configPath?: string, gatsbyOptions?: string[]) => { configPath, ); - return scanMetadata({ + return scanMetadataStage({ rootPath, packagePathPatterns: config.packagesPaths, customPackageFields: config.customPackageFields, docs: config.docs, showSubExamples: config.showSubExamples, }) - .then(projectData => generateWebsiteInfo(projectData)) + .then(projectData => generateWebsiteInfoStage(projectData)) .then(websiteInfo => - generatePages({ + generatePagesStage({ wrappersPath, pagesPath, packageRoot: pkgRoot, diff --git a/packages/gatsby-generator/src/pipeline/stages/build-website/index.ts b/packages/gatsby-generator/src/pipeline/stages/build-website/index.ts index 993f06f7..140d1c0b 100644 --- a/packages/gatsby-generator/src/pipeline/stages/build-website/index.ts +++ b/packages/gatsby-generator/src/pipeline/stages/build-website/index.ts @@ -1,4 +1,4 @@ -import createStage from '../make-pipeline-stage'; +import { makePipelineStage } from '@brisk-docs/pipeline-stages'; // @ts-ignore import createNextServer from '../run-website/next-server'; @@ -10,7 +10,7 @@ interface StageInput { nextOptions?: string[]; } -export default createStage( +export default makePipelineStage( 'build-website', async (input: StageInput): Promise => { return createNextServer(input); diff --git a/packages/gatsby-generator/src/pipeline/stages/run-gatsby/index.ts b/packages/gatsby-generator/src/pipeline/stages/run-gatsby/index.ts index 73c9b452..c441d913 100644 --- a/packages/gatsby-generator/src/pipeline/stages/run-gatsby/index.ts +++ b/packages/gatsby-generator/src/pipeline/stages/run-gatsby/index.ts @@ -1,4 +1,4 @@ -import createStage from '../make-pipeline-stage'; +import { makePipelineStage } from '@brisk-docs/pipeline-stages'; // @ts-ignore: Importing non-ts file with no definition import createGatsbyServer from './gatsby-server'; @@ -14,7 +14,7 @@ interface StageInput { // Boilerplate, uncomment when used // interface StageConfig {} -export default createStage( +export default makePipelineStage( 'run-gatsby', async (input: StageInput): Promise => createGatsbyServer(input), ); diff --git a/packages/gatsby-generator/src/pipeline/stages/run-website/index.ts b/packages/gatsby-generator/src/pipeline/stages/run-website/index.ts index 9ab15fe0..9c2ebe61 100644 --- a/packages/gatsby-generator/src/pipeline/stages/run-website/index.ts +++ b/packages/gatsby-generator/src/pipeline/stages/run-website/index.ts @@ -1,4 +1,4 @@ -import createStage from '../make-pipeline-stage'; +import { makePipelineStage } from '@brisk-docs/pipeline-stages'; // @ts-ignore: Importing non-ts file with no definition import createNextServer from './next-server'; @@ -14,7 +14,7 @@ interface StageInput { // Boilerplate, uncomment when used // interface StageConfig {} -export default createStage( +export default makePipelineStage( 'run-website', async (input: StageInput): Promise => { createNextServer(input); diff --git a/packages/pipeline-stages/README.md b/packages/pipeline-stages/README.md new file mode 100644 index 00000000..2be3c8f5 --- /dev/null +++ b/packages/pipeline-stages/README.md @@ -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`. diff --git a/packages/gatsby-generator/__fixtures__/docs-with-readme/docs/derpo.jpg b/packages/pipeline-stages/__fixtures__/docs-with-readme/docs/derpo.jpg similarity index 100% rename from packages/gatsby-generator/__fixtures__/docs-with-readme/docs/derpo.jpg rename to packages/pipeline-stages/__fixtures__/docs-with-readme/docs/derpo.jpg diff --git a/packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-1.md b/packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-1.md rename to packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-1.md diff --git a/packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-2.md b/packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-2.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-2.md rename to packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-2.md diff --git a/packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-3/doc-3-2/README.md b/packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-3/doc-3-2/README.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-3/doc-3-2/README.md rename to packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-3/doc-3-2/README.md diff --git a/packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-3/readme.md b/packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-3/readme.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-3/readme.md rename to packages/pipeline-stages/__fixtures__/docs-with-readme/docs/doc-3/readme.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/doc-2.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/doc-2.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/doc-2.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/doc-2.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/resources/1.png b/packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/resources/1.png similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/resources/1.png rename to packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/resources/1.png diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-1.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-1.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-1.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-2.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-2.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-2.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-2.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-1.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-1.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-1.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-2/doc-3-2-1.md b/packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-2/doc-3-2-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-2/doc-3-2-1.md rename to packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-2/doc-3-2-1.md diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/docs.config.js b/packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-3/docs.config.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/docs.config.js rename to packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/doc-3/docs.config.js diff --git a/packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/docs.config.js b/packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/docs.config.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/docs.config.js rename to packages/pipeline-stages/__fixtures__/mock-docs-with-sorting/docs/docs.config.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/README.md b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/README.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/README.md rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/README.md diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/extended-info.md b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/extended-info.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/extended-info.md rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/extended-info.md diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/special-usecase.mdx b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/special-usecase.mdx similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/special-usecase.mdx rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/special-usecase.mdx diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example1.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example1.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example1.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example1.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example2.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example2.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example2.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example2.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example3.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example3.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example3.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example3.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/package.json b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/package.json similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/package.json rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/package.json diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/src/index.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/src/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/src/index.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/mock-package2/src/index.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/README.md b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/README.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/README.md rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/README.md diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/extended-info.md b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/extended-info.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/extended-info.md rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/extended-info.md diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/some-subdirectory/nesting-now-supported.md b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/some-subdirectory/nesting-now-supported.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/some-subdirectory/nesting-now-supported.md rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/some-subdirectory/nesting-now-supported.md diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/special-usecase.mdx b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/special-usecase.mdx similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/special-usecase.mdx rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/special-usecase.mdx diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example1.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example1.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example1.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example1.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example2.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example2.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example2.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example2.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example3.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example3.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example3.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example3.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/not-an-example.txt b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/not-an-example.txt similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/not-an-example.txt rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/not-an-example.txt diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/utils-please-ignore/index.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/utils-please-ignore/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/utils-please-ignore/index.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/utils-please-ignore/index.js diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/package.json b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/package.json similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/package.json rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/package.json diff --git a/packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/src/index.js b/packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/src/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/src/index.js rename to packages/pipeline-stages/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/src/index.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/README.md b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/README.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/README.md rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/README.md diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/extended-info.md b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/extended-info.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/extended-info.md rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/extended-info.md diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/special-usecase.mdx b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/special-usecase.mdx similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/special-usecase.mdx rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/special-usecase.mdx diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example1.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example1.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example1.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example1.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example2.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example2.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example2.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example2.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example3.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example3.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example3.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example3.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/not-an-example.txt b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/not-an-example.txt similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/not-an-example.txt rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/not-an-example.txt diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/utils-please-ignore/index.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/utils-please-ignore/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/utils-please-ignore/index.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/utils-please-ignore/index.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/package.json b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/package.json similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/package.json rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/package.json diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/examples.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/examples.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/examples.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/examples.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/index.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/index.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/index.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/test-examples/examples.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/test-examples/examples.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/test-examples/examples.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/test-examples/examples.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/examples.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/examples.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/examples.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/examples.js diff --git a/packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/sub-dir/examples.js b/packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/sub-dir/examples.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/sub-dir/examples.js rename to packages/pipeline-stages/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/sub-dir/examples.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/derpo.jpg b/packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/derpo.jpg similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/derpo.jpg rename to packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/derpo.jpg diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-1.md b/packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-1.md rename to packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-1.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-2.md b/packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-2.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-2.md rename to packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-2.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-1.md b/packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-1.md rename to packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-1.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-2/doc-3-2-1.md b/packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-2/doc-3-2-1.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-2/doc-3-2-1.md rename to packages/pipeline-stages/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-2/doc-3-2-1.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/CHANGELOG.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/CHANGELOG.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/CHANGELOG.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/CHANGELOG.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/README.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/README.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/README.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/README.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/extended-info.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/docs/extended-info.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/extended-info.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/docs/extended-info.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/special-usecase.mdx b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/docs/special-usecase.mdx similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/special-usecase.mdx rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/docs/special-usecase.mdx diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example1.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example1.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example1.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example1.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example2.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example2.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example2.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example2.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example3.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example3.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example3.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example3.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/not-an-example.txt b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/not-an-example.txt similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/not-an-example.txt rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/not-an-example.txt diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/utils-please-ignore/index.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/utils-please-ignore/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/utils-please-ignore/index.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/examples/utils-please-ignore/index.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/package.json b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/package.json similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/package.json rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/package.json diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/src/index.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/src/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/src/index.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package1/src/index.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/README.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/README.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/README.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/README.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/docs/extended-info.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/docs/extended-info.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/docs/extended-info.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/docs/extended-info.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/docs/special-usecase.mdx b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/docs/special-usecase.mdx similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/docs/special-usecase.mdx rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/docs/special-usecase.mdx diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example1.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example1.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example1.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example1.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example2.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example2.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example2.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example2.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example3.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example3.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example3.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example3.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/package.json b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/package.json similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/package.json rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/package.json diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/src/index.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/src/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/src/index.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package2/src/index.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/docs/extended-info.md b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/docs/extended-info.md similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/docs/extended-info.md rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/docs/extended-info.md diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/docs/special-usecase.mdx b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/docs/special-usecase.mdx similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/docs/special-usecase.mdx rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/docs/special-usecase.mdx diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example1.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example1.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example1.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example1.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example2.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example2.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example2.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example2.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example3.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example3.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example3.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example3.js diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/package.json b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/package.json similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/package.json rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/package.json diff --git a/packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/src/index.js b/packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/src/index.js similarity index 100% rename from packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/src/index.js rename to packages/pipeline-stages/__fixtures__/simple-mock-packages/packages/mock-package3/src/index.js diff --git a/packages/pipeline-stages/data/packages-data.json b/packages/pipeline-stages/data/packages-data.json new file mode 100644 index 00000000..1f5ac0ea --- /dev/null +++ b/packages/pipeline-stages/data/packages-data.json @@ -0,0 +1,3 @@ +{ + "metaData": [] +} \ No newline at end of file diff --git a/packages/pipeline-stages/data/pages-list.json b/packages/pipeline-stages/data/pages-list.json new file mode 100644 index 00000000..ad920eaf --- /dev/null +++ b/packages/pipeline-stages/data/pages-list.json @@ -0,0 +1,5 @@ +{ + "packages": [], + "docs": [], + "readme": [] +} \ No newline at end of file diff --git a/packages/pipeline-stages/data/site-meta.json b/packages/pipeline-stages/data/site-meta.json new file mode 100644 index 00000000..342476e5 --- /dev/null +++ b/packages/pipeline-stages/data/site-meta.json @@ -0,0 +1,5 @@ +{ + "siteName": "", + "packages": {}, + "docs": [] +} \ No newline at end of file diff --git a/packages/gatsby-generator/default-pages/_app.tsx b/packages/pipeline-stages/default-pages/_app.tsx similarity index 100% rename from packages/gatsby-generator/default-pages/_app.tsx rename to packages/pipeline-stages/default-pages/_app.tsx diff --git a/packages/gatsby-generator/default-pages/_layout.tsx b/packages/pipeline-stages/default-pages/_layout.tsx similarity index 100% rename from packages/gatsby-generator/default-pages/_layout.tsx rename to packages/pipeline-stages/default-pages/_layout.tsx diff --git a/packages/gatsby-generator/default-pages/healthcheck.tsx b/packages/pipeline-stages/default-pages/healthcheck.tsx similarity index 100% rename from packages/gatsby-generator/default-pages/healthcheck.tsx rename to packages/pipeline-stages/default-pages/healthcheck.tsx diff --git a/packages/gatsby-generator/default-pages/index.tsx b/packages/pipeline-stages/default-pages/index.tsx similarity index 100% rename from packages/gatsby-generator/default-pages/index.tsx rename to packages/pipeline-stages/default-pages/index.tsx diff --git a/packages/gatsby-generator/default-pages/packages.tsx b/packages/pipeline-stages/default-pages/packages.tsx similarity index 100% rename from packages/gatsby-generator/default-pages/packages.tsx rename to packages/pipeline-stages/default-pages/packages.tsx diff --git a/packages/gatsby-generator/docs/build-pipeline/1-scan-metadata-stage.md b/packages/pipeline-stages/docs/1-scan-metadata-stage.md similarity index 100% rename from packages/gatsby-generator/docs/build-pipeline/1-scan-metadata-stage.md rename to packages/pipeline-stages/docs/1-scan-metadata-stage.md diff --git a/packages/gatsby-generator/docs/build-pipeline/2-generate-website-info-stage.md b/packages/pipeline-stages/docs/2-generate-website-info-stage.md similarity index 100% rename from packages/gatsby-generator/docs/build-pipeline/2-generate-website-info-stage.md rename to packages/pipeline-stages/docs/2-generate-website-info-stage.md diff --git a/packages/gatsby-generator/docs/build-pipeline/3-generate-pages-stage.md b/packages/pipeline-stages/docs/3-generate-pages-stage.md similarity index 100% rename from packages/gatsby-generator/docs/build-pipeline/3-generate-pages-stage.md rename to packages/pipeline-stages/docs/3-generate-pages-stage.md diff --git a/packages/gatsby-generator/docs/build-pipeline/README.md b/packages/pipeline-stages/docs/README.md similarity index 76% rename from packages/gatsby-generator/docs/build-pipeline/README.md rename to packages/pipeline-stages/docs/README.md index 2fefc09c..e1f3e6d4 100644 --- a/packages/gatsby-generator/docs/build-pipeline/README.md +++ b/packages/pipeline-stages/docs/README.md @@ -7,5 +7,3 @@ Brisk docs uses a pipeline of build stages to take the docs in a codebase and tu - [Scan metadata stage](./1-scan-metadata-stage.md) - [Generate website info stage](./2-generate-website-info-stage.md) - [Generate pages stage](./3-generate-pages-stage.md) -- [Build website stage](./4-build-website-stage.md) -- [Start website stage](./5-start-website-stage.md) diff --git a/packages/pipeline-stages/package.json b/packages/pipeline-stages/package.json new file mode 100644 index 00000000..264d6949 --- /dev/null +++ b/packages/pipeline-stages/package.json @@ -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" + } +} diff --git a/packages/gatsby-generator/src/pipeline/stages/common/configuration-options.ts b/packages/pipeline-stages/src/common/configuration-options.ts similarity index 96% rename from packages/gatsby-generator/src/pipeline/stages/common/configuration-options.ts rename to packages/pipeline-stages/src/common/configuration-options.ts index b42d4586..0be6f7bd 100644 --- a/packages/gatsby-generator/src/pipeline/stages/common/configuration-options.ts +++ b/packages/pipeline-stages/src/common/configuration-options.ts @@ -1,4 +1,4 @@ -import { TemplateSpecifier } from '../../../../types'; +import { TemplateSpecifier } from '../types'; export interface ProjectDocsConfig { // absolute path to the docs in the filesystem diff --git a/packages/gatsby-generator/src/pipeline/stages/common/page-specs.ts b/packages/pipeline-stages/src/common/page-specs.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/common/page-specs.ts rename to packages/pipeline-stages/src/common/page-specs.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/common/project-info.ts b/packages/pipeline-stages/src/common/project-info.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/common/project-info.ts rename to packages/pipeline-stages/src/common/project-info.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/__snapshots__/page-writers.integration.test.js.snap b/packages/pipeline-stages/src/generate-pages/__snapshots__/page-writers.integration.test.js.snap similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/__snapshots__/page-writers.integration.test.js.snap rename to packages/pipeline-stages/src/generate-pages/__snapshots__/page-writers.integration.test.js.snap diff --git a/packages/pipeline-stages/src/generate-pages/get-default-pages-path.ts b/packages/pipeline-stages/src/generate-pages/get-default-pages-path.ts new file mode 100644 index 00000000..b1b56f0c --- /dev/null +++ b/packages/pipeline-stages/src/generate-pages/get-default-pages-path.ts @@ -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') +} diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/index.ts b/packages/pipeline-stages/src/generate-pages/index.ts similarity index 95% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/index.ts rename to packages/pipeline-stages/src/generate-pages/index.ts index 0a559d66..c26e6382 100644 --- a/packages/gatsby-generator/src/pipeline/stages/generate-pages/index.ts +++ b/packages/pipeline-stages/src/generate-pages/index.ts @@ -4,6 +4,7 @@ import { BriskConfiguration } from '../common/configuration-options'; import { StageOutput as WebsiteInfoSpec } from '../generate-website-info'; import * as pageWriters from './page-writers'; +import getDefaultPagesPath from './get-default-pages-path'; const { generatePackageDocPage, @@ -49,7 +50,8 @@ export default createStage( async (input: StageInput): Promise => { const { pagesPath, wrappersPath } = input; await cleanPages(pagesPath); - await addBasePages(input.packageRoot, pagesPath); + const defaultPagesPath = await getDefaultPagesPath(); + await addBasePages(defaultPagesPath, pagesPath); const generatorConfig = { pagesPath, wrappersPath }; diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/integration.test.ts b/packages/pipeline-stages/src/generate-pages/integration.test.ts similarity index 98% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/integration.test.ts rename to packages/pipeline-stages/src/generate-pages/integration.test.ts index f201ff9c..b331c7d7 100644 --- a/packages/gatsby-generator/src/pipeline/stages/generate-pages/integration.test.ts +++ b/packages/pipeline-stages/src/generate-pages/integration.test.ts @@ -79,7 +79,7 @@ describe('Generate pages build stage integration', () => { }, ], }, - packageRoot: path.resolve(__dirname, '..', '..', '..', '..'), + packageRoot: path.resolve(__dirname, '..', '..'), sitemap: { packages: [], docs: { docs: [] } }, readmePageData: [], packagesMeta: [], diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/page-writers.integration.test.js b/packages/pipeline-stages/src/generate-pages/page-writers.integration.test.js similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/page-writers.integration.test.js rename to packages/pipeline-stages/src/generate-pages/page-writers.integration.test.js diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/page-writers.ts b/packages/pipeline-stages/src/generate-pages/page-writers.ts similarity index 97% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/page-writers.ts rename to packages/pipeline-stages/src/generate-pages/page-writers.ts index ba41b795..eced8fae 100644 --- a/packages/gatsby-generator/src/pipeline/stages/generate-pages/page-writers.ts +++ b/packages/pipeline-stages/src/generate-pages/page-writers.ts @@ -10,7 +10,7 @@ import { singleComponentTemplate, wrappedComponentTemplate, } from './templates'; -import { TemplateSpecifier } from '../../../../types'; +import { TemplateSpecifier } from '../types'; export type StageInput = { // Absolute path to directory containing page wrapper components @@ -281,11 +281,10 @@ export const cleanPages = async (pagesPath: string) => { /** * Adds the default pages into the pages directory - * @param packageRoot root path of packages + * @param defaultPagesPath absolure path to where the default pages are located * @param pagesPath the pages directory path */ -export const addBasePages = async (packageRoot: string, pagesPath: string) => { - const defaultPagesPath = path.join(packageRoot, 'default-pages'); +export const addBasePages = async (defaultPagesPath: string, pagesPath: string) => { await fs.copy(defaultPagesPath, pagesPath); }; diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/changelog/index.ts b/packages/pipeline-stages/src/generate-pages/templates/changelog/index.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/changelog/index.ts rename to packages/pipeline-stages/src/generate-pages/templates/changelog/index.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/changelog/test.js b/packages/pipeline-stages/src/generate-pages/templates/changelog/test.js similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/changelog/test.js rename to packages/pipeline-stages/src/generate-pages/templates/changelog/test.js diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/example/index.ts b/packages/pipeline-stages/src/generate-pages/templates/example/index.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/example/index.ts rename to packages/pipeline-stages/src/generate-pages/templates/example/index.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/example/test.js b/packages/pipeline-stages/src/generate-pages/templates/example/test.js similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/example/test.js rename to packages/pipeline-stages/src/generate-pages/templates/example/test.js diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/index.ts b/packages/pipeline-stages/src/generate-pages/templates/index.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/index.ts rename to packages/pipeline-stages/src/generate-pages/templates/index.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/single-component/index.ts b/packages/pipeline-stages/src/generate-pages/templates/single-component/index.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/single-component/index.ts rename to packages/pipeline-stages/src/generate-pages/templates/single-component/index.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/single-component/test.js b/packages/pipeline-stages/src/generate-pages/templates/single-component/test.js similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/single-component/test.js rename to packages/pipeline-stages/src/generate-pages/templates/single-component/test.js diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/test-utils.js b/packages/pipeline-stages/src/generate-pages/templates/test-utils.js similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/test-utils.js rename to packages/pipeline-stages/src/generate-pages/templates/test-utils.js diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/wrapped-component/index.ts b/packages/pipeline-stages/src/generate-pages/templates/wrapped-component/index.ts similarity index 96% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/wrapped-component/index.ts rename to packages/pipeline-stages/src/generate-pages/templates/wrapped-component/index.ts index dfa86b46..51bf327a 100644 --- a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/wrapped-component/index.ts +++ b/packages/pipeline-stages/src/generate-pages/templates/wrapped-component/index.ts @@ -1,4 +1,4 @@ -import { TemplateSpecifier } from '../../../../../../types'; +import { TemplateSpecifier } from '../../../types'; const outdent = require('outdent'); diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/wrapped-component/test.js b/packages/pipeline-stages/src/generate-pages/templates/wrapped-component/test.js similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/wrapped-component/test.js rename to packages/pipeline-stages/src/generate-pages/templates/wrapped-component/test.js diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-pages/test.ts b/packages/pipeline-stages/src/generate-pages/test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-pages/test.ts rename to packages/pipeline-stages/src/generate-pages/test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/__snapshots__/test.ts.snap b/packages/pipeline-stages/src/generate-website-info/__snapshots__/test.ts.snap similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/__snapshots__/test.ts.snap rename to packages/pipeline-stages/src/generate-website-info/__snapshots__/test.ts.snap diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-docs-info.test.ts b/packages/pipeline-stages/src/generate-website-info/generate-docs-info.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-docs-info.test.ts rename to packages/pipeline-stages/src/generate-website-info/generate-docs-info.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-docs-info.ts b/packages/pipeline-stages/src/generate-website-info/generate-docs-info.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-docs-info.ts rename to packages/pipeline-stages/src/generate-website-info/generate-docs-info.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-examples-info.test.ts b/packages/pipeline-stages/src/generate-website-info/generate-examples-info.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-examples-info.test.ts rename to packages/pipeline-stages/src/generate-website-info/generate-examples-info.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-examples-info.ts b/packages/pipeline-stages/src/generate-website-info/generate-examples-info.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-examples-info.ts rename to packages/pipeline-stages/src/generate-website-info/generate-examples-info.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-package-info.test.ts b/packages/pipeline-stages/src/generate-website-info/generate-package-info.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-package-info.test.ts rename to packages/pipeline-stages/src/generate-website-info/generate-package-info.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-package-info.ts b/packages/pipeline-stages/src/generate-website-info/generate-package-info.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/generate-package-info.ts rename to packages/pipeline-stages/src/generate-website-info/generate-package-info.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/index.ts b/packages/pipeline-stages/src/generate-website-info/index.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/index.ts rename to packages/pipeline-stages/src/generate-website-info/index.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/sample-data.ts b/packages/pipeline-stages/src/generate-website-info/sample-data.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/sample-data.ts rename to packages/pipeline-stages/src/generate-website-info/sample-data.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/generate-website-info/test.ts b/packages/pipeline-stages/src/generate-website-info/test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/generate-website-info/test.ts rename to packages/pipeline-stages/src/generate-website-info/test.ts diff --git a/packages/pipeline-stages/src/index.ts b/packages/pipeline-stages/src/index.ts new file mode 100644 index 00000000..480eb003 --- /dev/null +++ b/packages/pipeline-stages/src/index.ts @@ -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'; diff --git a/packages/gatsby-generator/src/pipeline/stages/make-pipeline-stage.test.ts b/packages/pipeline-stages/src/make-pipeline-stage.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/make-pipeline-stage.test.ts rename to packages/pipeline-stages/src/make-pipeline-stage.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/make-pipeline-stage.ts b/packages/pipeline-stages/src/make-pipeline-stage.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/make-pipeline-stage.ts rename to packages/pipeline-stages/src/make-pipeline-stage.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-docs-info.test.ts b/packages/pipeline-stages/src/scan-metadata/get-docs-info.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-docs-info.test.ts rename to packages/pipeline-stages/src/scan-metadata/get-docs-info.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-docs-info.ts b/packages/pipeline-stages/src/scan-metadata/get-docs-info.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-docs-info.ts rename to packages/pipeline-stages/src/scan-metadata/get-docs-info.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-markdown-meta.test.ts b/packages/pipeline-stages/src/scan-metadata/get-markdown-meta.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-markdown-meta.test.ts rename to packages/pipeline-stages/src/scan-metadata/get-markdown-meta.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-markdown-meta.ts b/packages/pipeline-stages/src/scan-metadata/get-markdown-meta.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-markdown-meta.ts rename to packages/pipeline-stages/src/scan-metadata/get-markdown-meta.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-package-info.test.ts b/packages/pipeline-stages/src/scan-metadata/get-package-info.test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-package-info.test.ts rename to packages/pipeline-stages/src/scan-metadata/get-package-info.test.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-package-info.ts b/packages/pipeline-stages/src/scan-metadata/get-package-info.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-package-info.ts rename to packages/pipeline-stages/src/scan-metadata/get-package-info.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/index.ts b/packages/pipeline-stages/src/scan-metadata/index.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/index.ts rename to packages/pipeline-stages/src/scan-metadata/index.ts diff --git a/packages/gatsby-generator/src/pipeline/stages/scan-metadata/test.ts b/packages/pipeline-stages/src/scan-metadata/test.ts similarity index 100% rename from packages/gatsby-generator/src/pipeline/stages/scan-metadata/test.ts rename to packages/pipeline-stages/src/scan-metadata/test.ts diff --git a/packages/pipeline-stages/src/types.ts b/packages/pipeline-stages/src/types.ts new file mode 100644 index 00000000..6c3fe7d9 --- /dev/null +++ b/packages/pipeline-stages/src/types.ts @@ -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 { + id: string; + pagePath: string; + children?: Array; +} + +export interface DocsPage extends BasePage { + meta: PageMeta; +} + +export interface ExamplePage extends BasePage { + 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; +}; diff --git a/yarn.lock b/yarn.lock index 0d304584..7fe2d5ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11629,7 +11629,7 @@ jest-environment-node@^24.0.0: jest-fixtures@^0.6.0: version "0.6.0" resolved "https://packages.atlassian.com/api/npm/npm-remote/jest-fixtures/-/jest-fixtures-0.6.0.tgz#7a58475aa7f404d84c9b72d324ed0b285ba6f3ae" - integrity sha512-ugqOq1HnJYgFGfmK8cc2jQbjcw4g00KqJNZfajTRZlYjnRschnmYuMrsb20aG74pg8R+zh6q72P3yPG7SnPMfA== + integrity sha1-elhHWqf0BNhMm3LTJO0LKFum864= dependencies: find-up "^2.1.0" fs-extra "^4.0.2" @@ -13952,7 +13952,7 @@ outdent@^0.5.0: outdent@^0.7.0: version "0.7.0" resolved "https://packages.atlassian.com/api/npm/npm-remote/outdent/-/outdent-0.7.0.tgz#cfd1f1956305141e0cf3e898ada6547373c1997a" - integrity sha512-Ue462G+UIFoyQmOzapGIKWS3d/9NHeD/018WGEDZIhN2/VaQpVXbofMcZX0socv1fw4/tmEn7Vd3McOdPZfKzQ== + integrity sha1-z9HxlWMFFB4M8+iYraZUc3PBmXo= output-file-sync@^2.0.0: version "2.0.1"