├── .changeset ├── README.md └── config.json ├── .circleci └── config.yml ├── .eslintignore ├── .eslintrc ├── .github └── workflows │ ├── changeset-check.yml │ └── changeset-version.yml ├── .gitignore ├── .nvmrc ├── .prettierignore ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── __mocks__ ├── file-mock.js └── style-mock.js ├── babel.config.js ├── brisk-docs-website ├── README.md ├── docs.config.js ├── gatsby-config.js ├── package.json └── static │ ├── code.png │ ├── code_repo.png │ ├── file_cabinet.png │ ├── folder_with_files.png │ ├── simplify.svg │ └── skier.png ├── complete-test-website ├── CHANGELOG.md ├── docs.config.js ├── docs │ ├── README.md │ └── guides │ │ ├── docs.config.js │ │ ├── how-to-be-accomplished.md │ │ └── nifty-tricks │ │ ├── _assets │ │ └── feedback.png │ │ └── staying-at-netherfield.md ├── gatsby-config.js ├── index.md ├── otherpackages │ ├── mock-package1 │ │ ├── README.md │ │ ├── docs │ │ │ ├── docs.config.js │ │ │ ├── extended-info.md │ │ │ └── special-usecase.md │ │ ├── examples │ │ │ ├── content │ │ │ │ ├── lorem.json │ │ │ │ ├── presidents.json │ │ │ │ └── sample-data.js │ │ │ ├── example1.js │ │ │ ├── example2.js │ │ │ └── example3.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ ├── mock-package2 │ │ ├── README.md │ │ ├── docs │ │ │ ├── docs.config.js │ │ │ ├── examples.js │ │ │ ├── extended-info.md │ │ │ └── special-usecase.md │ │ ├── examples │ │ │ ├── example1.js │ │ │ ├── example2.js │ │ │ └── example3.js │ │ ├── package.json │ │ └── src │ │ │ ├── examples.js │ │ │ └── index.js │ └── package-no-readme │ │ ├── docs │ │ ├── docs.config.js │ │ ├── examples.js │ │ ├── extended-info.md │ │ └── special-usecase.md │ │ ├── examples │ │ ├── example1.js │ │ ├── example2.js │ │ └── example3.js │ │ ├── package.json │ │ └── src │ │ ├── examples.js │ │ └── index.js ├── package.json ├── packages │ ├── mock-package3 │ │ ├── README.md │ │ ├── docs │ │ │ ├── docs.config.js │ │ │ ├── extended-info.md │ │ │ └── special-usecase.md │ │ ├── examples │ │ │ ├── example1.js │ │ │ ├── example2.js │ │ │ └── example3.js │ │ ├── package.json │ │ └── src │ │ │ └── index.js │ └── package-with-changelog │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ └── package.json ├── snowboarder.png ├── snowboarder_favicon.ico ├── templates │ ├── package-home-extension.tsx │ └── package-home-replacement.tsx └── tutorial │ ├── README.md │ └── _assets │ └── truth.md ├── cypress.json ├── docs ├── contributing.md ├── getting-started.md ├── mission-statement.md └── release-process.md ├── example-pages ├── guide-1.md ├── something-else │ ├── more-place.md │ └── nestings-continue │ │ └── places.md ├── something │ └── place.md └── sub-guides │ └── guide-2.md ├── jest-setup.js ├── jest.config.js ├── package.json ├── packages ├── file-viewer │ ├── CHANGELOG.md │ ├── README.md │ ├── __tests__ │ │ ├── __fixtures__ │ │ │ └── component-with-error.tsx │ │ └── file-viewer.test.tsx │ ├── examples │ │ ├── example-files │ │ │ ├── atlaskit-button.tsx │ │ │ ├── atlaskit-checkbox.tsx │ │ │ └── atlaskit-toggle.tsx │ │ ├── view-button.tsx │ │ ├── view-checkbox.tsx │ │ └── view-toggle.tsx │ ├── package.json │ └── src │ │ ├── components │ │ ├── error-boundary.tsx │ │ └── file-viewer.tsx │ │ └── index.ts ├── gatsby-generator │ ├── CHANGELOG.md │ ├── README.md │ ├── __fixtures__ │ │ ├── custom-babel-project │ │ │ ├── babel.config.js │ │ │ ├── docs.config.js │ │ │ ├── docs │ │ │ │ └── about.md │ │ │ └── weird-babel-package │ │ │ │ ├── README.md │ │ │ │ ├── examples │ │ │ │ └── component-weird-syntax.js │ │ │ │ └── package.json │ │ ├── custom-webpack-project │ │ │ ├── docs.config.js │ │ │ ├── docs │ │ │ │ └── about.md │ │ │ └── packages │ │ │ │ └── bespoke-webpack │ │ │ │ ├── .babelrc │ │ │ │ ├── .eslintrc │ │ │ │ ├── README.md │ │ │ │ ├── examples │ │ │ │ └── custom-resolve.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ └── components │ │ │ │ └── index.js │ │ ├── default-config │ │ │ ├── custom-config-file.js │ │ │ ├── docs-with-array-config.js │ │ │ └── docs.config.js │ │ ├── docs-with-readme │ │ │ └── docs │ │ │ │ ├── derpo.jpg │ │ │ │ ├── doc-1.md │ │ │ │ ├── doc-2.md │ │ │ │ └── doc-3 │ │ │ │ ├── doc-3-2 │ │ │ │ └── README.md │ │ │ │ └── readme.md │ │ ├── index.js │ │ ├── mock-docs-with-assets │ │ │ └── docs │ │ │ │ ├── _assets │ │ │ │ └── doc-3.md │ │ │ │ ├── doc-2.md │ │ │ │ ├── resources │ │ │ │ └── 1.png │ │ │ │ └── sub-docs │ │ │ │ └── doc-1.md │ │ ├── mock-docs-with-guides │ │ │ ├── docs │ │ │ │ └── testdoc.md │ │ │ └── guides │ │ │ │ └── testguide.md │ │ ├── mock-docs-with-sorting │ │ │ └── docs │ │ │ │ ├── doc-1.md │ │ │ │ ├── doc-2.md │ │ │ │ ├── doc-3 │ │ │ │ ├── doc-3-1.md │ │ │ │ ├── doc-3-2 │ │ │ │ │ └── doc-3-2-1.md │ │ │ │ └── docs.config.js │ │ │ │ └── docs.config.js │ │ ├── mock-nested-group-packages │ │ │ └── packages │ │ │ │ ├── mock-package2 │ │ │ │ ├── README.md │ │ │ │ ├── docs │ │ │ │ │ ├── extended-info.md │ │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ │ ├── example1.js │ │ │ │ │ ├── example2.js │ │ │ │ │ └── example3.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ └── index.js │ │ │ │ └── sub-folder │ │ │ │ └── mock-package1 │ │ │ │ ├── README.md │ │ │ │ ├── docs │ │ │ │ ├── extended-info.md │ │ │ │ ├── some-subdirectory │ │ │ │ │ └── nesting-now-supported.md │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ ├── example3.js │ │ │ │ ├── not-an-example.txt │ │ │ │ └── utils-please-ignore │ │ │ │ │ └── index.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ └── index.js │ │ ├── mock-package-with-root-readme │ │ │ ├── README.md │ │ │ └── packages │ │ │ │ └── mock-package1 │ │ │ │ ├── README.md │ │ │ │ ├── docs │ │ │ │ ├── extended-info.md │ │ │ │ ├── some-subdirectory │ │ │ │ │ └── nesting-now-supported.md │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ ├── example3.js │ │ │ │ ├── not-an-example.txt │ │ │ │ └── utils-please-ignore │ │ │ │ │ └── index.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ └── index.js │ │ ├── mock-package-with-sub-examples │ │ │ └── packages │ │ │ │ └── mock-package1 │ │ │ │ ├── README.md │ │ │ │ ├── docs │ │ │ │ ├── extended-info.md │ │ │ │ ├── some-subdirectory │ │ │ │ │ └── nesting-now-supported.md │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ ├── example3.js │ │ │ │ ├── not-an-example.txt │ │ │ │ └── utils-please-ignore │ │ │ │ │ └── index.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ ├── examples.js │ │ │ │ ├── index.js │ │ │ │ ├── test-examples │ │ │ │ └── examples.js │ │ │ │ └── view │ │ │ │ ├── examples.js │ │ │ │ └── sub-dir │ │ │ │ └── examples.js │ │ ├── mock-packages-manifests │ │ │ └── packages │ │ │ │ └── manifest-app-1 │ │ │ │ └── manifest.json │ │ ├── simple-mock-docs │ │ │ └── docs │ │ │ │ ├── derpo.jpg │ │ │ │ ├── doc-1.md │ │ │ │ ├── doc-2.md │ │ │ │ └── doc-3 │ │ │ │ ├── doc-3-1.md │ │ │ │ └── doc-3-2 │ │ │ │ └── doc-3-2-1.md │ │ ├── simple-mock-packages │ │ │ └── packages │ │ │ │ ├── mock-package1 │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── README.md │ │ │ │ ├── docs │ │ │ │ │ ├── extended-info.md │ │ │ │ │ ├── some-subdirectory │ │ │ │ │ │ └── nesting-now-supported.md │ │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ │ ├── example1.js │ │ │ │ │ ├── example2.js │ │ │ │ │ ├── example3.js │ │ │ │ │ ├── not-an-example.txt │ │ │ │ │ └── utils-please-ignore │ │ │ │ │ │ └── index.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ └── index.js │ │ │ │ ├── mock-package2 │ │ │ │ ├── README.md │ │ │ │ ├── docs │ │ │ │ │ ├── extended-info.md │ │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ │ ├── example1.js │ │ │ │ │ ├── example2.js │ │ │ │ │ └── example3.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ └── index.js │ │ │ │ └── mock-package3 │ │ │ │ ├── docs │ │ │ │ ├── extended-info.md │ │ │ │ └── special-usecase.mdx │ │ │ │ ├── examples │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ └── example3.js │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ └── index.js │ │ └── typescript-project │ │ │ ├── .eslintrc │ │ │ ├── babel.config.js │ │ │ ├── docs.config.js │ │ │ ├── docs │ │ │ └── about.md │ │ │ ├── tsconfig.json │ │ │ └── typescript-package │ │ │ ├── README.md │ │ │ ├── component.tsx │ │ │ ├── examples │ │ │ └── typescript-component.js │ │ │ └── package.json │ ├── __tests__ │ │ └── components │ │ │ └── switch-link.test.tsx │ ├── babel.config.js │ ├── bin.js │ ├── cypress │ │ ├── .eslintrc.json │ │ ├── integration │ │ │ ├── navigation │ │ │ │ ├── docs.spec.js │ │ │ │ ├── home.spec.js │ │ │ │ └── packages.spec.js │ │ │ └── pages │ │ │ │ ├── docs-page.spec.js │ │ │ │ ├── home-page.spec.js │ │ │ │ ├── package-changelog.spec.js │ │ │ │ ├── package-docs-home.spec.js │ │ │ │ ├── package-docs.spec.js │ │ │ │ ├── package-example-isolated.spec.js │ │ │ │ ├── package-example.spec.js │ │ │ │ ├── package-examples-home.spec.js │ │ │ │ └── package-home.spec.js │ │ └── support │ │ │ └── index.js │ ├── default-pages │ │ ├── _app.tsx │ │ ├── _layout.tsx │ │ ├── healthcheck.tsx │ │ ├── index.tsx │ │ └── packages.tsx │ ├── docs │ │ ├── build-pipeline │ │ │ ├── 1-scan-metadata-stage.md │ │ │ ├── 2-generate-website-info-stage.md │ │ │ ├── 3-generate-pages-stage.md │ │ │ ├── 4-build-website-stage.md │ │ │ ├── 5-start-website-stage.md │ │ │ └── README.md │ │ ├── configuration.md │ │ ├── configuring-webpack.md │ │ ├── debugging.md │ │ └── writing-package-docs.md │ ├── dummy-data │ │ └── simple-project │ │ │ ├── docs.config.js │ │ │ ├── docs │ │ │ ├── README.md │ │ │ └── guides │ │ │ │ ├── docs.config.js │ │ │ │ ├── how-to-be-accomplished.md │ │ │ │ └── nifty-tricks │ │ │ │ ├── _assets │ │ │ │ └── feedback.png │ │ │ │ └── staying-at-netherfield.md │ │ │ ├── favicon.ico │ │ │ └── packages │ │ │ ├── mock-package1 │ │ │ ├── README.md │ │ │ ├── docs │ │ │ │ ├── docs.config.js │ │ │ │ ├── extended-info.md │ │ │ │ └── special-usecase.md │ │ │ ├── examples │ │ │ │ ├── content │ │ │ │ │ ├── lorem.json │ │ │ │ │ ├── presidents.json │ │ │ │ │ └── sample-data.js │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ └── example3.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ └── index.js │ │ │ ├── mock-package2 │ │ │ ├── README.md │ │ │ ├── docs │ │ │ │ ├── docs.config.js │ │ │ │ ├── extended-info.md │ │ │ │ └── special-usecase.md │ │ │ ├── examples │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ └── example3.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ └── index.js │ │ │ ├── mock-package3 │ │ │ ├── README.md │ │ │ ├── docs │ │ │ │ ├── docs.config.js │ │ │ │ ├── extended-info.md │ │ │ │ └── special-usecase.md │ │ │ ├── examples │ │ │ │ ├── example1.js │ │ │ │ ├── example2.js │ │ │ │ └── example3.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ └── index.js │ │ │ └── package-with-changelog │ │ │ ├── CHANGELOG.md │ │ │ ├── README.md │ │ │ └── package.json │ ├── examples │ │ ├── markdown-code-blocks.js │ │ └── sample-markdown │ │ │ └── code-blocks.md │ ├── handle-config │ │ └── package.json │ ├── package.json │ ├── src │ │ ├── get-command-line-options.ts │ │ ├── handle-config │ │ │ └── index.ts │ │ ├── index.ts │ │ └── pipeline │ │ │ ├── buildPagesPipeline.ts │ │ │ ├── buildPipeline.ts │ │ │ ├── devPipeline.ts │ │ │ ├── exportPipeline.ts │ │ │ ├── getAllPaths.ts │ │ │ ├── index.ts │ │ │ ├── stages │ │ │ ├── build-website │ │ │ │ ├── index.ts │ │ │ │ └── test.ts │ │ │ ├── common │ │ │ │ ├── configuration-options.ts │ │ │ │ ├── page-specs.ts │ │ │ │ └── project-info.ts │ │ │ ├── generate-pages │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── page-writers.integration.test.js.snap │ │ │ │ ├── index.ts │ │ │ │ ├── integration.test.ts │ │ │ │ ├── page-writers.integration.test.js │ │ │ │ ├── page-writers.ts │ │ │ │ ├── templates │ │ │ │ │ ├── changelog │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── test.js │ │ │ │ │ ├── example │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── test.js │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── single-component │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── test.js │ │ │ │ │ ├── test-utils.js │ │ │ │ │ └── wrapped-component │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── test.js │ │ │ │ └── test.ts │ │ │ ├── generate-website-info │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── test.ts.snap │ │ │ │ ├── generate-docs-info.test.ts │ │ │ │ ├── generate-docs-info.ts │ │ │ │ ├── generate-examples-info.test.ts │ │ │ │ ├── generate-examples-info.ts │ │ │ │ ├── generate-package-info.test.ts │ │ │ │ ├── generate-package-info.ts │ │ │ │ ├── index.ts │ │ │ │ ├── sample-data.ts │ │ │ │ └── test.ts │ │ │ ├── get-configuration │ │ │ │ ├── default-config.ts │ │ │ │ └── handle-config.ts │ │ │ ├── make-pipeline-stage.test.ts │ │ │ ├── make-pipeline-stage.ts │ │ │ ├── run-gatsby │ │ │ │ ├── gatsby-server.ts │ │ │ │ └── index.ts │ │ │ ├── run-website │ │ │ │ ├── index.ts │ │ │ │ ├── next-server.ts │ │ │ │ └── test.ts │ │ │ └── scan-metadata │ │ │ │ ├── get-docs-info.test.ts │ │ │ │ ├── get-docs-info.ts │ │ │ │ ├── get-markdown-meta.test.ts │ │ │ │ ├── get-markdown-meta.ts │ │ │ │ ├── get-package-info.test.ts │ │ │ │ ├── get-package-info.ts │ │ │ │ ├── index.ts │ │ │ │ └── test.ts │ │ │ ├── startServerPipeline.ts │ │ │ └── test.ts │ ├── tsconfig.json │ ├── types.ts │ └── un-src │ │ ├── README.md │ │ ├── components │ │ ├── breadcrumbs.test.tsx │ │ ├── breadcrumbs.tsx │ │ ├── code-example │ │ │ └── code-view.tsx │ │ ├── common │ │ │ └── page-status-context.tsx │ │ ├── content-style-wrapper.test.tsx │ │ ├── content-style-wrapper.tsx │ │ ├── link-button.test.tsx │ │ ├── link-button.tsx │ │ ├── mdx │ │ │ ├── Heading.tsx │ │ │ ├── HorizontalRule.tsx │ │ │ ├── code │ │ │ │ ├── block.test.tsx │ │ │ │ ├── block.tsx │ │ │ │ ├── index.ts │ │ │ │ └── inline.tsx │ │ │ └── index.tsx │ │ ├── meta-context.tsx │ │ ├── navigation-wrapper.tsx │ │ ├── navigation │ │ │ ├── all-packages-nav-content.tsx │ │ │ ├── docs-nav-content.tsx │ │ │ ├── link-component.tsx │ │ │ ├── nav-header.tsx │ │ │ ├── nav-link.tsx │ │ │ ├── package-nav-content.tsx │ │ │ ├── search-drawer.tsx │ │ │ ├── tree-nav-content.test.tsx │ │ │ └── tree-nav-content.tsx │ │ ├── package-metadata.test.js │ │ ├── package-metadata.tsx │ │ ├── page-templates │ │ │ ├── documents-index.tsx │ │ │ ├── item-list.tsx │ │ │ ├── package-changelog.js │ │ │ ├── package-changelog.test.js │ │ │ ├── package-docs.js │ │ │ ├── package-example.js │ │ │ ├── package-home.js │ │ │ ├── package-home.test.js │ │ │ └── project-docs.js │ │ ├── page-title.tsx │ │ ├── page.tsx │ │ ├── panel.tsx │ │ └── switch-link.tsx │ │ ├── custom-plugins │ │ └── mdx-image-loader.js │ │ ├── model │ │ └── page.ts │ │ └── pages-list.ts ├── gatsby-plugin │ ├── CHANGELOG.md │ ├── babel.config.js │ ├── gatsby-browser.js │ ├── gatsby-config.js │ ├── gatsby-node.js │ ├── index.js │ ├── package.json │ └── static │ │ └── skier.png └── react-changelogs │ ├── CHANGELOG.md │ ├── README.md │ ├── __tests__ │ ├── changelog.test.tsx │ ├── divide-changelog.test.ts │ └── filter-changelog.test.ts │ ├── examples │ ├── display-changelog.tsx │ ├── filter-changelogs.tsx │ └── set-changelog-entries-per-page.tsx │ ├── package.json │ └── src │ ├── __tests__ │ ├── changelog.test.tsx │ ├── divide-changelog.test.ts │ └── filter-changelog.test.ts │ ├── components │ └── changelog.tsx │ ├── index.ts │ ├── types │ └── changeLog.ts │ └── utils │ ├── divide-changelog.ts │ └── filter-changelog.ts ├── scripts ├── clean.js ├── deploy_changeset_bot.sh └── micros_deploy.sh ├── tsconfig.json ├── typings ├── atlaskit.d.ts ├── git-url-parse.d.ts ├── jest-fixtures.d.ts ├── lodash.d.ts ├── mdx-js__react.d.ts ├── mdx-js__tag.d.ts ├── prismjs.d.ts └── react-addons-text-content.d.ts └── yarn.lock /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@0.2.0/schema.json", 3 | "changelog": "@changesets/changelog-git", 4 | "commit": false, 5 | "linked": [], 6 | "access": "public" 7 | } -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .next 3 | out 4 | brisk-out 5 | 6 | packages/gatsby-generator/pages 7 | 8 | packages/gatsby-generator/data/**/*.json 9 | 10 | packages/gatsby-generator/bundles/**/*.js 11 | 12 | packages/**/dist/**/* 13 | 14 | packages/file-viewer/examples/example-files 15 | 16 | cypress/plugins 17 | -------------------------------------------------------------------------------- /.github/workflows/changeset-check.yml: -------------------------------------------------------------------------------- 1 | name: Changeset Check 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | check: 7 | name: Changeset Check 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@master 11 | - name: Comment on PR 12 | uses: changesets/check-action@master 13 | env: 14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 15 | -------------------------------------------------------------------------------- /.github/workflows/changeset-version.yml: -------------------------------------------------------------------------------- 1 | name: Version 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | release: 10 | name: Release 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout Repo 14 | uses: actions/checkout@master 15 | 16 | - name: Setup Node.js 10.x 17 | uses: actions/setup-node@master 18 | with: 19 | version: 10.x 20 | 21 | - name: Install Yarn 22 | run: npm install --global yarn 23 | 24 | - name: Install Dependencies 25 | run: yarn 26 | 27 | - name: Create Release Pull Request 28 | uses: changesets/action@master 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | .next 4 | .DS_Store 5 | .idea 6 | .vscode 7 | .env 8 | 9 | .cache 10 | *.tgz 11 | 12 | package-lock.json 13 | yarn-error.log 14 | 15 | /cypress 16 | **/cypress/screenshots 17 | 18 | brisk-out 19 | scratchings.js 20 | 21 | /packages/gatsby-generator/pages 22 | 23 | /packages/gatsby-generator/data 24 | /packages/gatsby-generator/static/favicon.ico 25 | /packages/gatsby-generator/typings 26 | 27 | /packages/**/bundles 28 | /packages/gatsby-generator/public 29 | /packages/**/**/yarn.lock 30 | 31 | dist 32 | out 33 | public 34 | 35 | deploy 36 | !deploy/changeset-bot/changeset-bot.sd.yml 37 | !deploy/changeset-bot/Dockerfile 38 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 10.13.0 -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | *.json 3 | dist 4 | /out 5 | brisk-out 6 | .cache 7 | /packages/gatsby-generator/pages 8 | /cypress 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 brisk-docs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## This repo is no longer maintained and has been archived for historic purposes. 2 | 3 | # Brisk Docs 4 | 5 | > Tools to document your mono-repos and React Packages 6 | 7 | Brisk is an Atlassian Initiative to help with documenting code. It contains two main parts: 8 | 9 | ## [The Brisk Website Generator](./packages/gatsby-generator) 10 | 11 | This is packaged as `@brisk-docs/gatsby-plugin` and is designed as an all-inclusive documentation 12 | tool for mono-repos containing react components and other packages. Check out [the package's documentation](./packages/website) 13 | for more information on how to use it. 14 | 15 | ## Support Packages 16 | 17 | As part of being maximally useful, we want to make sure where possible, our helper components exist as 18 | their own packages. As such, there are a number of other libraries we maintain that you might be interested 19 | in, even if you don't need the complete set of things that brisk does: 20 | 21 | - [file viewer](./packages/file-viewer) - simple package to run a live component example alongside displaying its code 22 | - [react changelogs]('./packages/react-changelogs) - Component that accepts raw changelog files and formats them for display. Allows filtering to semver versions 23 | - [extract-react-types](https://extract-react-types.com/) - a way to extract and display types for components, works on both flow and typescript 24 | - [codesandboxer](https://github.com/codesandbox/codesandboxer) - Deploy a single file to codesandbox to make your code easy to share and collaborate on - can be used from node or from within a react app 25 | -------------------------------------------------------------------------------- /__mocks__/file-mock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /__mocks__/style-mock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@babel/preset-env', '@babel/react', '@babel/preset-typescript'], 3 | plugins: [ 4 | 'emotion', 5 | [ 6 | 'styled-components', 7 | { 8 | ssr: true, 9 | displayName: true, 10 | preprocess: false, 11 | }, 12 | ], 13 | '@babel/proposal-class-properties', 14 | '@babel/proposal-object-rest-spread', 15 | '@babel/transform-runtime', 16 | 'transform-dynamic-import', 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /brisk-docs-website/README.md: -------------------------------------------------------------------------------- 1 | # Docs Website 2 | 3 | This is the documentation website for `brisk-docs`. 4 | 5 | To get this running locally: 6 | 7 | - run `yarn` in the root of this repository. 8 | - run `yarn dev` 9 | -------------------------------------------------------------------------------- /brisk-docs-website/docs.config.js: -------------------------------------------------------------------------------- 1 | const docs = [ 2 | { 3 | path: '../docs', 4 | urlPath: 'docs', 5 | name: 'Docs', 6 | description: 7 | 'Information about brisk as a whole, and contributing to brisk', 8 | }, 9 | ]; 10 | 11 | const links = []; 12 | 13 | if (process.env && process.env.CONTEXT !== 'production') { 14 | docs.push({ 15 | path: '../example-pages', 16 | urlPath: 'example-pages', 17 | name: 'Example Pages', 18 | description: 'This is a collection of example pages.', 19 | }); 20 | 21 | links.push({ 22 | href: '/example-pages/guide-1', 23 | label: 'Example guide 1', 24 | description: 'This is an example arbitrary internal link.', 25 | }); 26 | links.push({ 27 | href: 'https://atlaskit.atlassian.com', 28 | label: 'Atlaskit', 29 | description: 'This is an example arbitrary external link.', 30 | }); 31 | } 32 | 33 | module.exports = () => ({ 34 | siteName: 'Brisk Docs Docs', 35 | packages: ['../packages/*'], 36 | showSubExamples: false, 37 | docs, 38 | links, 39 | }); 40 | -------------------------------------------------------------------------------- /brisk-docs-website/gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | { 4 | resolve: require.resolve('@brisk-docs/gatsby-plugin'), 5 | }, 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /brisk-docs-website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@brisk-docs/test-website", 3 | "version": "0.0.0", 4 | "main": "dist/test-website.cjs.js", 5 | "private": true, 6 | "dependencies": { 7 | "@brisk-docs/gatsby-plugin": "^0.0.0", 8 | "@brisk-docs/gatsby-generator": "^1.0.1", 9 | "gatsby": "^2.17.10" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /brisk-docs-website/static/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/brisk-docs-website/static/code.png -------------------------------------------------------------------------------- /brisk-docs-website/static/code_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/brisk-docs-website/static/code_repo.png -------------------------------------------------------------------------------- /brisk-docs-website/static/file_cabinet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/brisk-docs-website/static/file_cabinet.png -------------------------------------------------------------------------------- /brisk-docs-website/static/folder_with_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/brisk-docs-website/static/folder_with_files.png -------------------------------------------------------------------------------- /brisk-docs-website/static/skier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/brisk-docs-website/static/skier.png -------------------------------------------------------------------------------- /complete-test-website/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @brisk-docs/test-project-all-config 2 | 3 | ## 1.0.1 4 | ### Patch Changes 5 | 6 | - Updated dependencies [36693fd] 7 | - Updated dependencies [3c58139] 8 | - @brisk-docs/gatsby-generator@1.1.0 9 | - @brisk-docs/gatsby-plugin@0.1.0 10 | -------------------------------------------------------------------------------- /complete-test-website/docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | version: 0.0.1 3 | --- 4 | 5 | Welcome to the Jane Austen inspired docs on how to improve your life! 6 | -------------------------------------------------------------------------------- /complete-test-website/docs/guides/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['nifty-tricks', 'how-to-be-accomplished'], 3 | }); 4 | -------------------------------------------------------------------------------- /complete-test-website/docs/guides/how-to-be-accomplished.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Being accomplished' 3 | --- 4 | 5 | # Being accomplished 6 | 7 | To be considered truly accomplished[^1] you must: 8 | 9 | - paint tables 10 | - cover screens 11 | - be a master of languages 12 | - possess a certain something in your manner of walking and tone of voice 13 | - improve your mind through extensive reading 14 | 15 | [^1]: Such people may not exist. 16 | -------------------------------------------------------------------------------- /complete-test-website/docs/guides/nifty-tricks/_assets/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/complete-test-website/docs/guides/nifty-tricks/_assets/feedback.png -------------------------------------------------------------------------------- /complete-test-website/docs/guides/nifty-tricks/staying-at-netherfield.md: -------------------------------------------------------------------------------- 1 | --- 2 | worthIt: yes 3 | --- 4 | 5 | # Mrs Bennet's guide to securing a stay at Netherfield Park 6 | 7 | One sure fire technique for turning a short visit into a long stay is to begin your journey to 8 | Netherfield on horseback just before it rains. Upon your arrival the good Mr Bingley will be 9 | compelled to allow you to stay until the weather clears. You may catch a terrible cold, but it will 10 | be worth it. 11 | 12 | ![Feedback](./_assets/feedback.png) 13 | -------------------------------------------------------------------------------- /complete-test-website/gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | { 4 | resolve: require.resolve('@brisk-docs/gatsby-plugin'), 5 | }, 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /complete-test-website/index.md: -------------------------------------------------------------------------------- 1 | Welcome to the README which is located at index.md. 2 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | status: VFD 3 | keywords: ['friends'] 4 | --- 5 | 6 | import SectionMessage from '@atlaskit/section-message'; 7 | 8 |
9 | 10 | 11 | Every developer’s experience with their code base is joyful and productive. Reliable documentation is quick to find, and creating rich documentation is simple. 12 | 13 | 14 |
15 | 16 | 17 | This is all VFD, and subject to change 18 | 19 | 20 | One Paragraph of project description goes here. This is ReadMe for the package 1. 21 | 22 | ## Getting Started 23 | 24 | These instructions will get you a copy of the project up and running on your local machine for 25 | development and testing purposes. See deployment for notes on how to deploy the project on a live 26 | system. 27 | 28 | [Link to extended info](./docs/extended-info.md) 29 | 30 | ### Prerequisites 31 | 32 | What things you need to install the software and how to install them 33 | 34 |
35 | 39 |
40 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['special-usecase'], 3 | }); 4 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Extended Information 3 | --- 4 | 5 | ``` 6 | Give examples 7 | ``` 8 | 9 | ### Installing 10 | 11 | A step by step series of examples that tell you how to get a development env running 12 | 13 | Say what the step will be 14 | 15 | ``` 16 | Give the example 17 | ``` 18 | 19 | And repeat 20 | 21 | ``` 22 | until finished 23 | ``` 24 | 25 | End with an example of getting some data out of the system or using it for a little demo 26 | 27 | ## Versioning 28 | 29 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 30 | [tags on this repository](https://github.com/your/project/tags). 31 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/examples/content/lorem.json: -------------------------------------------------------------------------------- 1 | [ 2 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 3 | "Suspendisse tincidunt vehicula eleifend.", 4 | "Nunc tristique nisi tortor, at pretium purus interdum sed.", 5 | "Sed vel augue sit amet sapien elementum bibendum. Aenean aliquam elementum dui, quis euismod metus ultrices ut.", 6 | "Curabitur est sapien, feugiat vel est eget, molestie suscipit nibh.", 7 | "Nunc libero orci, lacinia id orci aliquam, pharetra facilisis leo.", 8 | "Quisque et turpis nec lacus luctus ultrices quis vel nisi.", 9 | "Cras maximus ex lorem, sit amet bibendum nibh placerat eu.", 10 | "In hac habitasse platea dictumst. ", 11 | "Duis molestie sem vel ante varius, rhoncus pretium arcu dictum." 12 | ] 13 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import DynamicTable from '@atlaskit/dynamic-table'; 3 | import { caption, head, rows } from './content/sample-data'; 4 | 5 | // prettier-ignore 6 | const Example1 = () => ( 7 | 19 | ); 20 | 21 | export default Example1; 22 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 page'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 page'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-1", 3 | "version": "1.0.0", 4 | "description": "This is a mock package to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test1", 8 | "maintainers": [ 9 | "Peter Y", 10 | "Ben C", 11 | "Dean P", 12 | "Aparna R" 13 | ], 14 | "license": "", 15 | "repository": { 16 | "type" : "git", 17 | "url" : "fake-repo-fix-later", 18 | "directory": "packages/website" 19 | }, 20 | "dependencies": { 21 | "@atlaskit/avatar": "^14.1.8", 22 | "@atlaskit/dropdown-menu": "^6.1.26", 23 | "@atlaskit/dynamic-table": "^10.0.23", 24 | "react": "^16.7.0", 25 | "react-dom": "^16.7.0", 26 | "styled-components": "^3.2.6" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package1/src/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | 4 | type FriendsInfo = { 5 | /* Name of the person who is asking for a new friend */ 6 | me: string, 7 | /* Name of the person the asker wants to be friends with */ 8 | you: string, 9 | /* a hobby to make it easier to start a conversation */ 10 | 11 | hobby: string | void, 12 | }; 13 | 14 | const BeFriends = ({ me, you, hobby }: FriendsInfo) => ( 15 |

16 | Hello {you}. My name is {me}. {hobby ? `I enjoy ${hobby}` : ''}. Would you 17 | like to be friends with me? 18 |

19 | ); 20 | 21 | export default BeFriends; 22 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 2. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['special-usecase', '*'], 3 | }); 4 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/docs/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Subexample = () =>

Hello, from a subexample inside docs/

; 4 | 5 | export default Subexample; 6 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package 2'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package 2'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package 2'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-2", 3 | "version": "1.0.0", 4 | "description": "This is a mock package2 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test2", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/src/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Subexample = () =>

Hello, from a subexample

; 4 | 5 | export default Subexample; 6 | 7 | export const AnotherExample = () =>
another example
; 8 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/mock-package2/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 2'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['special-usecase', '*'], 3 | }); 4 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/docs/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Subexample = () =>

Hello, from a subexample inside docs/

; 4 | 5 | export default Subexample; 6 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package 2'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package 2'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package 2'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-no-readme", 3 | "version": "1.0.0", 4 | "description": "This mock package has no readme", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test2", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/src/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Subexample = () =>

Hello, from a subexample

; 4 | 5 | export default Subexample; 6 | 7 | export const AnotherExample = () =>
another example
; 8 | -------------------------------------------------------------------------------- /complete-test-website/otherpackages/package-no-readme/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 2'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /complete-test-website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@brisk-docs/test-project-all-config", 3 | "version": "1.0.1", 4 | "private": true, 5 | "dependencies": { 6 | "@brisk-docs/gatsby-generator": "^1.1.0", 7 | "@brisk-docs/gatsby-plugin": "^0.1.0", 8 | "gatsby": "^2.17.10", 9 | "react": "16.10.2" 10 | }, 11 | "scripts": { 12 | "start": "brisk build-pages && gatsby develop" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | Hypnotherapy: 'I totes think this is fine' 3 | --- 4 | 5 | # Project Title 6 | 7 | One Paragraph of project description goes here. This is ReadMe for the package 3. 8 | 9 | ## Getting Started 10 | 11 | These instructions will get you a copy of the project up and running on your local machine for 12 | development and testing purposes. See deployment for notes on how to deploy the project on a live 13 | system. 14 | 15 | ### Prerequisites 16 | 17 | What things you need to install the software and how to install them 18 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['*', 'extended-info'], 3 | }); 4 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 |
This is my MDX Demo example
24 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package3'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package3'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package3'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-3", 3 | "version": "1.0.0", 4 | "description": "This is a mock package3 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test3", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /complete-test-website/packages/mock-package3/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /complete-test-website/packages/package-with-changelog/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # package-with-changelog 2 | 3 | ## 0.1.2 4 | 5 | - [patch] 23d71c7: 6 | - This is one change 7 | 8 | ## 0.1.1 9 | 10 | - [patch] e342242: 11 | 12 | - this is another change 13 | -------------------------------------------------------------------------------- /complete-test-website/packages/package-with-changelog/README.md: -------------------------------------------------------------------------------- 1 | Blahs 2 | -------------------------------------------------------------------------------- /complete-test-website/packages/package-with-changelog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-changelog", 3 | "version": "1.0.0", 4 | "description": "This is a mock package that has a changelog", 5 | "main": "index.js", 6 | "keywords": ["react", "changelog", "simple"], 7 | "author": "Test4", 8 | "license": "MIT", 9 | "repository": { 10 | "url": "https://github.com/brisk-docs/brisk-docs/", 11 | "type": "git" 12 | }, 13 | "dependencies": { 14 | "react": "^16.7.0", 15 | "react-dom": "^16.7.0", 16 | "styled-components": "^4.1.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /complete-test-website/snowboarder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/complete-test-website/snowboarder.png -------------------------------------------------------------------------------- /complete-test-website/snowboarder_favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/complete-test-website/snowboarder_favicon.ico -------------------------------------------------------------------------------- /complete-test-website/templates/package-home-extension.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default ({ 4 | data, 5 | }: { 6 | data: { name: string; version: string }; 7 | pageComponent: React.ElementType; 8 | }) => ( 9 | // @ts-ignore 10 |
15 | 16 | npm install {data.name}@^{data.version} 17 | 18 |
19 | ); 20 | -------------------------------------------------------------------------------- /complete-test-website/templates/package-home-replacement.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default ({ 4 | pageComponent: Component, 5 | }: { 6 | data: Object; 7 | pageComponent: React.ElementType; 8 | }) => ( 9 |
19 | 20 |
21 | ); 22 | -------------------------------------------------------------------------------- /complete-test-website/tutorial/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Truth 3 | --- 4 | 5 | import truthTxt from './_assets/truth.md'; 6 | 7 | # Truth 8 | 9 | Welcome to the Jane Austen inspired docs on how to improve your life! 10 | 11 |
{truthTxt}
12 | -------------------------------------------------------------------------------- /complete-test-website/tutorial/_assets/truth.md: -------------------------------------------------------------------------------- 1 | It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife. 2 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:8000", 3 | "integrationFolder": "packages/gatsby-generator/cypress/integration", 4 | "fixturesFolder": "packages/gatsby-generator/cypress/fixtures", 5 | "screenshotsFolder": "packages/gatsby-generator/cypress/screenshots", 6 | "supportFile": "packages/gatsby-generator/cypress/support/index.js", 7 | "video": false 8 | } 9 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | First off, thank you for contributing! 4 | 5 | Make sure you read the [getting started](./getting-started.md) guide. 6 | 7 | ## Submitting a PR 8 | 9 | In a PR we expect: 10 | 11 | - tests to demonstrate your change. 12 | - a changeset to document your change (run `bolt changeset` and it will walk you through making a changeset). If you want to know more about changesets, read the documentation on our [release process](./release-process.md) 13 | -------------------------------------------------------------------------------- /docs/getting-started.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | > This document is for deving on this mono-repo. For information on using brisk in your own project see the [@brisk-docs/website documentation](../packages/website) 4 | 5 | This project is a monorepo of several packages which can be managed using bolt. 6 | Before starting your work on any of the packages make sure you run: 7 | 8 | ```sh 9 | yarn global add bolt 10 | # install dependencies 11 | bolt 12 | ``` 13 | 14 | Our docs website is the main way to work on components and get feedback on changes. 15 | To start the website locally run: 16 | 17 | ```sh 18 | bolt docs 19 | ``` 20 | 21 | ## Testing 22 | 23 | We use Jest for unit testing and Cypress for integration tests. 24 | 25 | ```sh 26 | bolt test 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/mission-statement.md: -------------------------------------------------------------------------------- 1 | # Brisk's Goal 2 | 3 | > Build the best tool to document multi-package repositories 4 | 5 | Brisk aims to meet this goal by understanding package information from multi-package repositories, as well as creating a consistent formula of docs, examples, changelogs, meta which they work to. 6 | 7 | Brisk also draws clear lines and supports a distinction between system documentation and package documentation. 8 | -------------------------------------------------------------------------------- /example-pages/guide-1.md: -------------------------------------------------------------------------------- 1 | This is a guide 1. -------------------------------------------------------------------------------- /example-pages/something-else/nestings-continue/places.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/example-pages/something-else/nestings-continue/places.md -------------------------------------------------------------------------------- /example-pages/something/place.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/example-pages/something/place.md -------------------------------------------------------------------------------- /example-pages/sub-guides/guide-2.md: -------------------------------------------------------------------------------- 1 | This is a guide 2. -------------------------------------------------------------------------------- /jest-setup.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | const Enzyme = require('enzyme'); 3 | const Adapter = require('enzyme-adapter-react-16'); 4 | 5 | // eslint-disable-next-line no-underscore-dangle 6 | global.___loader = { 7 | enqueue: jest.fn(), 8 | }; 9 | 10 | Enzyme.configure({ adapter: new Adapter() }); 11 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | setupFiles: ['./jest-setup.js'], 3 | testPathIgnorePatterns: ['./cypress/', '__fixtures__', `.cache`, `public`], 4 | testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.([tj]sx?)$', 5 | transformIgnorePatterns: ['node_modules/(?!(@atlaskit|gatsby)/)'], 6 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], 7 | moduleNameMapper: { 8 | '\\.(css|less)$': '/__mocks__/style-mock.js', 9 | '.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `/__mocks__/file-mock.js`, 10 | }, 11 | globals: { 12 | __PATH_PREFIX__: ``, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /packages/file-viewer/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @brisk-docs/file-viewer 2 | 3 | ## 0.2.5 4 | 5 | ### Patch Changes 6 | 7 | - 36693fd: Safety bump 8 | 9 | ## 0.2.4 10 | 11 | ### Patch Changes 12 | 13 | - 4a3112c: Update react dependency 14 | 15 | ## 0.2.3 16 | 17 | ### Patch Changes 18 | 19 | - 23c4f43: Patch release - previous release does not include built dists 20 | 21 | ## 0.2.2 22 | 23 | ### Patch Changes 24 | 25 | - 6dbc7dc: Fix babel configs for building packages to produce working dists for node scripts. 26 | 27 | ## 0.2.1 28 | 29 | ### Patch Changes 30 | 31 | - d6ad582: Update extract-react-types to support new features in that package 32 | 33 | ## 0.2.0 34 | 35 | ### Minor Changes 36 | 37 | - f49737e: Initial release 38 | Version update of extract react type loader 39 | -------------------------------------------------------------------------------- /packages/file-viewer/README.md: -------------------------------------------------------------------------------- 1 | import FileViewer from './src/components/file-viewer' 2 | import ButtonExample from './examples/view-button' 3 | 4 | ## File Viewer Component 5 | This library is designed to help you display inline examples and their corresponding source code. 6 | 7 | ### Usage 8 | ```js 9 | import FileViewer from '@brisk-docs/file-viewer' 10 | ``` 11 | 12 | ```jsx 13 | 14 | ``` 15 | 16 | 17 | 18 |
19 | 23 |
-------------------------------------------------------------------------------- /packages/file-viewer/__tests__/__fixtures__/component-with-error.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default () => { 4 | throw new Error('I crashed!'); 5 | 6 | // eslint-disable-next-line no-unreachable 7 | return
Not reached
; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/file-viewer/examples/example-files/atlaskit-button.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Button from '@atlaskit/button'; 3 | 4 | export default () => ; 5 | -------------------------------------------------------------------------------- /packages/file-viewer/examples/example-files/atlaskit-toggle.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Toggle from '@atlaskit/toggle'; 3 | 4 | export default () => ( 5 |
6 |

Regular

7 | 8 |

Large (checked by default)

9 | 10 |
11 | ); 12 | -------------------------------------------------------------------------------- /packages/file-viewer/examples/view-button.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable global-require */ 2 | /* eslint-disable import/no-webpack-loader-syntax */ 3 | import * as React from 'react'; 4 | import FileViewer from '../src/components/file-viewer'; 5 | import ButtonExample from './example-files/atlaskit-button'; 6 | 7 | export default () => ( 8 | 13 | ); 14 | -------------------------------------------------------------------------------- /packages/file-viewer/examples/view-checkbox.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable global-require */ 2 | /* eslint-disable import/no-webpack-loader-syntax */ 3 | import * as React from 'react'; 4 | import FileViewer from '../src/components/file-viewer'; 5 | import CheckboxExample from './example-files/atlaskit-checkbox'; 6 | 7 | export default () => ( 8 | 13 | ); 14 | -------------------------------------------------------------------------------- /packages/file-viewer/examples/view-toggle.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable global-require */ 2 | /* eslint-disable import/no-webpack-loader-syntax */ 3 | import * as React from 'react'; 4 | import FileViewer from '../src/components/file-viewer'; 5 | import ToggleExample from './example-files/atlaskit-toggle'; 6 | 7 | export default () => ( 8 | 13 | ); 14 | -------------------------------------------------------------------------------- /packages/file-viewer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@brisk-docs/file-viewer", 3 | "version": "0.2.5", 4 | "description": "This package is used for rendering examples and their source code", 5 | "main": "dist/file-viewer.cjs.js", 6 | "module": "dist/file-viewer.esm.js", 7 | "repository": "git@github.com:brisk-docs/brisk-docs.git", 8 | "maintainers": [ 9 | "Peter Yu" 10 | ], 11 | "author": "Peter Yu", 12 | "license": "MIT", 13 | "files": ["dist"], 14 | "peerDependencies": { 15 | "react": "16.10.2", 16 | "react-dom": "^16.8.4" 17 | }, 18 | "devDependencies": { 19 | "@types/enzyme": "^2.8.11", 20 | "@types/jest": "^21.1.2", 21 | "@types/react": "^16.4.18", 22 | "enzyme": "^3.9.0", 23 | "enzyme-adapter-react-16": "^1.9.1", 24 | "extract-react-types-loader": "^0.3.7", 25 | "jest": "^24.1.0", 26 | "react": "16.10.2", 27 | "react-dom": "^16.8.4", 28 | "react-test-renderer": "^16.0.0", 29 | "ts-jest": "^24.0.0" 30 | }, 31 | "dependencies": { 32 | "@atlaskit/button": "^8.2.4", 33 | "@atlaskit/checkbox": "^7.0.0", 34 | "@atlaskit/css-reset": "^3.0.5", 35 | "@atlaskit/icon": "^16.0.1", 36 | "@atlaskit/theme": "^6.0.0", 37 | "@atlaskit/toggle": "^7.0.0", 38 | "@babel/runtime": "^7.4.3", 39 | "@babel/runtime-corejs2": "^7.4.3", 40 | "@emotion/core": "^10.0.9", 41 | "@emotion/styled": "^10.0.9", 42 | "@emotion/styled-base": "^10.0.10", 43 | "prismjs": "^1.15.0", 44 | "raw-loader": "^1.0.0", 45 | "react-addons-text-content": "^0.0.4", 46 | "react-markdown": "^2.5.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/file-viewer/src/components/error-boundary.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-duplicates */ 2 | import * as React from 'react'; 3 | 4 | type Props = { 5 | children: React.ComponentType | React.ReactNode; 6 | onError?: (error: Error, info: any) => void; 7 | }; 8 | 9 | type State = { 10 | hasError: boolean; 11 | }; 12 | 13 | export default class ErrorBoundary extends React.Component { 14 | state = { 15 | hasError: false, 16 | }; 17 | 18 | componentDidCatch(error: Error, info: any) { 19 | const { onError } = this.props; 20 | this.setState({ hasError: true }); 21 | if (onError) { 22 | onError(error, info); 23 | } 24 | } 25 | 26 | render() { 27 | const { children } = this.props; 28 | const { hasError } = this.state; 29 | if (hasError) { 30 | return

Something went wrong loading this example.

; 31 | } 32 | return children; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/file-viewer/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './components/file-viewer'; 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-babel-project/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@babel/preset-env', '@babel/preset-react'], 3 | plugins: ['@babel/plugin-proposal-optional-chaining'], 4 | }; 5 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-babel-project/docs.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const webpack = config => { 4 | config.module.rules.push({ 5 | test: new RegExp(`${__dirname}/.*\\.(js|jsx)$`), 6 | exclude: /node_modules/, 7 | use: { 8 | loader: 'babel-loader', 9 | options: { 10 | root: __dirname, 11 | }, 12 | }, 13 | }); 14 | return config; 15 | }; 16 | 17 | module.exports = () => ({ 18 | packages: path.join(__dirname, 'weird-babel-package'), 19 | docs: { path: path.join(__dirname, 'docs'), name: 'docs' }, 20 | siteName: 'Babel/webpack Test Docs', 21 | webpack, 22 | packagesDescription: 'View sample documentation for packages', 23 | }); 24 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-babel-project/docs/about.md: -------------------------------------------------------------------------------- 1 | This is a project which uses an experimental babel plugin 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-babel-project/weird-babel-package/README.md: -------------------------------------------------------------------------------- 1 | This is a project written with the @babel/plugin-proposal-nullish-coalescing-operator 2 | and is bundled with webpack 3 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-babel-project/weird-babel-package/examples/component-weird-syntax.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Example = props => ( 4 |
5 |

Hello

Thank you for building me.

6 |

You are visitor #

7 | {props?.visitor?.count} 8 |
9 | ); 10 | 11 | export default () => ; 12 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-babel-project/weird-babel-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-package", 3 | "version": "1.0.0", 4 | "description": "This is a project bundled with webpack that uses experimental babel plugins", 5 | "main": "index.js", 6 | "directories": { 7 | "example": "examples" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "@babel/plugin-proposal-optional-chaining": "^7.2.0", 16 | "react": "^16.8.4" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/docs.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const webpack = config => { 4 | config.resolve.modules.push(path.join(__dirname, 'packages')); 5 | 6 | return config; 7 | }; 8 | 9 | module.exports = () => ({ 10 | packages: path.join(__dirname, 'packages', '*'), 11 | docs: { path: path.join(__dirname, 'docs'), name: 'docs' }, 12 | siteName: 'Webpack Test Docs', 13 | webpack, 14 | }); 15 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/docs/about.md: -------------------------------------------------------------------------------- 1 | This project contains code that uses some custom build rules: 2 | 3 | - custom source root via resolutions -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/packages/bespoke-webpack/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"] 3 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/packages/bespoke-webpack/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "babel-eslint" 4 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/packages/bespoke-webpack/README.md: -------------------------------------------------------------------------------- 1 | This is a package that uses a custom webpack config to build its code -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/packages/bespoke-webpack/examples/custom-resolve.js: -------------------------------------------------------------------------------- 1 | // This file uses a custom resolution rule to import the example 2 | 3 | import React from 'react'; 4 | import Example from 'bespoke-webpack/src/components'; 5 | 6 | export default () => ; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/packages/bespoke-webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bespoke-webpack", 3 | "version": "1.0.0", 4 | "description": "A package using some bespoke webpack build process", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "react": "^16.8.4" 13 | }, 14 | "devDependencies": { 15 | "@babel/core": "^7.3.4", 16 | "@babel/preset-env": "^7.3.4", 17 | "@babel/preset-react": "^7.0.0", 18 | "babel-loader": "^8.0.5" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/custom-webpack-project/packages/bespoke-webpack/src/components/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default () => ( 4 |
5 |

Hello

Thank you for building me.

6 |
7 | ); 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/default-config/custom-config-file.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | docs: { path: 'now/is/the/winter', description: 'View custom documentation' }, 3 | packages: ['of/our/disco/tents'], 4 | packagesDescription: 'View custom documentation about individual packages', 5 | }); 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/default-config/docs-with-array-config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | docs: [ 3 | { 4 | path: 'now/is/the/winter', 5 | name: 'docs', 6 | description: 'View custom documentation', 7 | }, 8 | { 9 | path: 'now/is/the/summer', 10 | name: 'guides', 11 | description: 'View custom guides', 12 | }, 13 | ], 14 | packages: ['of/our/disco/tents'], 15 | packagesDescription: 'View custom documentation about individual packages', 16 | }); 17 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/default-config/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | docs: { path: 'a/b/c', name: 'docs' }, 3 | packages: ['x/y/z'], 4 | }); 5 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/docs-with-readme/docs/derpo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/__fixtures__/docs-with-readme/docs/derpo.jpg -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-1.md: -------------------------------------------------------------------------------- 1 | # This is doc 1 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-2.md: -------------------------------------------------------------------------------- 1 | # This is doc 2 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-3/doc-3-2/README.md: -------------------------------------------------------------------------------- 1 | # This is doc 1 inside doc 2 inside doc 3 2 | 3 | #docception 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/docs-with-readme/docs/doc-3/readme.md: -------------------------------------------------------------------------------- 1 | # This is doc 1 nested in doc-3 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/index.js: -------------------------------------------------------------------------------- 1 | // This utility is to reduce the need to litter usages 2 | // of __dirname across our tests which make it hard to 3 | // move files 4 | 5 | module.exports.fixturesPath = __dirname; 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/_assets/doc-3.md -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/doc-2.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/doc-2.md -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/resources/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/resources/1.png -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/__fixtures__/mock-docs-with-assets/docs/sub-docs/doc-1.md -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-guides/docs/testdoc.md: -------------------------------------------------------------------------------- 1 | This is a test document for mocking. -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-guides/guides/testguide.md: -------------------------------------------------------------------------------- 1 | This is a test guide document for mocking. 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-1.md: -------------------------------------------------------------------------------- 1 | # This is doc 1 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-2.md: -------------------------------------------------------------------------------- 1 | # This is doc 2 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-1.md: -------------------------------------------------------------------------------- 1 | # This is doc 1 nested in doc-3 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/doc-3-2/doc-3-2-1.md: -------------------------------------------------------------------------------- 1 | # This is doc 1 inside doc 2 inside doc 3 2 | 3 | #docception 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/doc-3/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['*', 'doc-3-1'], 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-docs-with-sorting/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['doc-2'], 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 2. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package 2'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package 2'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package 2'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-2", 3 | "version": "1.0.0", 4 | "description": "This is a mock package2 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test2", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/mock-package2/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 2'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 1. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/some-subdirectory/nesting-now-supported.md: -------------------------------------------------------------------------------- 1 | Technically we could show this, but we're just not gonna 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 page'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 page'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 page'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/not-an-example.txt: -------------------------------------------------------------------------------- 1 | I am but a humble text file. -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/examples/utils-please-ignore/index.js: -------------------------------------------------------------------------------- 1 | // This should not be used in the docs website. 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-1", 3 | "version": "1.0.0", 4 | "description": "This is a mock package to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test1", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-nested-group-packages/packages/sub-folder/mock-package1/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/README.md: -------------------------------------------------------------------------------- 1 | This is the root level doc file for the site. -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 1. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md: -------------------------------------------------------------------------------- 1 | Technically we could show this, but we're just not gonna 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 page'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 page'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 page'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/examples/not-an-example.txt: -------------------------------------------------------------------------------- 1 | I am but a humble text file. -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/examples/utils-please-ignore/index.js: -------------------------------------------------------------------------------- 1 | // This should not be used in the docs website. 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-1", 3 | "version": "1.0.0", 4 | "description": "This is a mock package to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test1", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-root-readme/packages/mock-package1/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 1. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md: -------------------------------------------------------------------------------- 1 | Technically we could show this, but we're just not gonna 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 page'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 page'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 page'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/not-an-example.txt: -------------------------------------------------------------------------------- 1 | I am but a humble text file. -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/examples/utils-please-ignore/index.js: -------------------------------------------------------------------------------- 1 | // This should not be used in the docs website. 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-1", 3 | "version": "1.0.0", 4 | "description": "This is a mock package to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test1", 8 | "license": "", 9 | "dependencies": { 10 | "@atlaskit/button": "^12.0.2", 11 | "@atlaskit/dropdown-menu": "^7.0.5", 12 | "@atlaskit/section-message": "^2.0.2", 13 | "@atlaskit/select": "^8.1.0", 14 | "@emotion/styled": "^10.0.10", 15 | "react": "^16.7.0", 16 | "react-dom": "^16.7.0", 17 | "styled-components": "^4.1.3" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/test-examples/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Example page'; 4 | const Examples = () =>

Hello, {name}

; 5 | 6 | export default Examples; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'View Example page'; 4 | const Examples = () =>

Hello, {name}

; 5 | 6 | export default Examples; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-package-with-sub-examples/packages/mock-package1/src/view/sub-dir/examples.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Sub Example page'; 4 | const Examples = () =>

Hello, {name}

; 5 | 6 | export default Examples; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/mock-packages-manifests/packages/manifest-app-1/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "contactStaffId": "cdebourgh", 3 | "team": "Rosings Park", 4 | "jiraProjectUrl": "https://tldr-TODO-fic-this", 5 | "maintainers": ["cdebourgh", "wcollins"] 6 | } 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/derpo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/derpo.jpg -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Document One' 3 | --- 4 | 5 | # This is doc 1 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-2.md: -------------------------------------------------------------------------------- 1 | # This is doc 2 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | readingTime: '1 second' 3 | --- 4 | 5 | # This is doc 1 nested in doc-3 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-docs/docs/doc-3/doc-3-2/doc-3-2-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | usefulness: 'yes' 3 | --- 4 | 5 | # This is doc 1 inside doc 2 inside doc 3 6 | 7 | #docception 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # mock-package-1 2 | 3 | ## 1.0.0 4 | 5 | ### Patch Changes 6 | 7 | - 23c4f43: This exists 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: ['project', 'react'] 3 | --- 4 | 5 | # Project Title 6 | 7 | One Paragraph of project description goes here. This is ReadMe for the package 1. 8 | 9 | ## Getting Started 10 | 11 | These instructions will get you a copy of the project up and running on your local machine for 12 | development and testing purposes. See deployment for notes on how to deploy the project on a live 13 | system. 14 | 15 | ### Prerequisites 16 | 17 | What things you need to install the software and how to install them 18 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Extended Information' 3 | --- 4 | 5 | ``` 6 | Give examples 7 | ``` 8 | 9 | ### Installing 10 | 11 | A step by step series of examples that tell you how to get a development env running 12 | 13 | Say what the step will be 14 | 15 | ``` 16 | Give the example 17 | ``` 18 | 19 | And repeat 20 | 21 | ``` 22 | until finished 23 | ``` 24 | 25 | End with an example of getting some data out of the system or using it for a little demo 26 | 27 | ## Versioning 28 | 29 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 30 | [tags on this repository](https://github.com/your/project/tags). 31 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/some-subdirectory/nesting-now-supported.md: -------------------------------------------------------------------------------- 1 | --- 2 | status: 'WIP' 3 | --- 4 | 5 | Technically we could show this, but we're just not gonna 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 page'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 page'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 page'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/not-an-example.txt: -------------------------------------------------------------------------------- 1 | I am but a humble text file. -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/examples/utils-please-ignore/index.js: -------------------------------------------------------------------------------- 1 | // This should not be used in the docs website. 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-1", 3 | "version": "1.0.0", 4 | "description": "This is a mock package to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test1", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package1/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 2. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package 2'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package 2'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package 2'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-2", 3 | "version": "1.0.0", 4 | "description": "This is a mock package2 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test2", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package2/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 2'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | export const Demo = () => ( 24 | 25 |
This is my MDX Demo example
26 | ); 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/docs/special-usecase.mdx: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package3'; 4 | const Example1 = () =>

Hello, {name}

; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package3'; 4 | const Example2 = () =>

Hello, {name}

; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package3'; 4 | const Example3 = () =>

Hello, {name}

; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-3", 3 | "version": "1.0.0", 4 | "description": "This is a mock package3 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test3", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/simple-mock-packages/packages/mock-package3/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element =

Hello, {name}

; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "import/extensions": "off" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@babel/preset-env', '@babel/preset-react'], 3 | }; 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/docs.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = () => ({ 4 | packages: path.join(__dirname, 'typescript-package'), 5 | docs: { path: path.join(__dirname, 'docs'), name: 'docs' }, 6 | siteName: 'Typescript/webpack Test Docs', 7 | }); 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/docs/about.md: -------------------------------------------------------------------------------- 1 | This is a project which uses typescript -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "preserve" 4 | }, 5 | "files": ["typescript-package/component.tsx"] 6 | } 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/typescript-package/README.md: -------------------------------------------------------------------------------- 1 | This is a project written in typescript that is bundled with webpack -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/typescript-package/component.tsx: -------------------------------------------------------------------------------- 1 | // This example demonstrates a react component written in tsx 2 | import * as React from 'react'; 3 | 4 | export interface HelloProps { 5 | compiler: string; 6 | } 7 | 8 | export default ({ compiler }: HelloProps) =>

Hello from {compiler}!

; 9 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/typescript-package/examples/typescript-component.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Example from '../component.tsx'; 3 | 4 | export default () => ; 5 | -------------------------------------------------------------------------------- /packages/gatsby-generator/__fixtures__/typescript-project/typescript-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-package", 3 | "version": "1.0.0", 4 | "description": "This is a project written in typescript that is bundled with webpack", 5 | "main": "index.js", 6 | "directories": { 7 | "example": "examples" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "react": "^16.8.4" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/gatsby-generator/babel.config.js: -------------------------------------------------------------------------------- 1 | const fse = require('fs-extra'); 2 | const path = require('path'); 3 | 4 | const handleConfig = require('./handle-config').default; 5 | 6 | const configPath = process.env.DOCS_WEBSITE_CONFIG_PATH; 7 | const cwd = process.env.DOCS_WEBSITE_CWD; 8 | 9 | if (!cwd) { 10 | throw new Error('DOCS_WEBSITE_CWD is not defined'); 11 | } 12 | 13 | const { babelConfig: clientBabelConfig, loadBabel } = handleConfig( 14 | cwd, 15 | configPath, 16 | ); 17 | 18 | let babelConfig = { 19 | presets: ['@babel/react'], 20 | plugins: [ 21 | '@babel/plugin-proposal-class-properties', 22 | '@babel/syntax-dynamic-import', 23 | ], 24 | }; 25 | 26 | if ( 27 | cwd !== __dirname && 28 | clientBabelConfig && 29 | fse.existsSync(path.resolve(cwd, clientBabelConfig)) 30 | ) { 31 | /* eslint-disable global-require */ 32 | /* eslint-disable import/no-dynamic-require */ 33 | const clientBabel = require(path.resolve(cwd, clientBabelConfig)); 34 | babelConfig = clientBabel; 35 | } else if (loadBabel) { 36 | babelConfig = loadBabel(babelConfig); 37 | } 38 | 39 | module.exports = babelConfig; 40 | -------------------------------------------------------------------------------- /packages/gatsby-generator/bin.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* eslint-disable strict */ 3 | 4 | 'use strict'; 5 | 6 | const runBinary = require('./').default; 7 | 8 | runBinary().catch(e => console.error(e)); 9 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "cypress" 4 | ], 5 | "env": { 6 | "cypress/globals": true 7 | } 8 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/navigation/docs.spec.js: -------------------------------------------------------------------------------- 1 | describe('Docs page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/docco'); 4 | }); 5 | 6 | it('should navigate to docs README', () => { 7 | cy.get('div[role=rowgroup]').within(() => { 8 | cy.get('[href="/docco/README"]').click(); 9 | }); 10 | cy.url().should('eq', `${Cypress.config().baseUrl}/docco/README`); 11 | }); 12 | 13 | it('should expand Guides and navigate to a doc page', () => { 14 | cy.get('div[role=rowgroup]').within(() => { 15 | cy.get('[aria-label="Expand"]').click({ force: true }); 16 | cy.get('[href="/docco/guides/how-to-be-accomplished"]').click(); 17 | }); 18 | 19 | cy.url().should('include', 'guides/how-to-be-accomplished'); 20 | 21 | cy.go('back'); 22 | cy.url().should('eq', `${Cypress.config().baseUrl}/docco`); 23 | }); 24 | 25 | it('should expand Guides, expand Nifty Tricks and navigate to a doc page', () => { 26 | cy.get('div[role=rowgroup]').within(() => { 27 | cy.get('[aria-label="Expand"]').click({ force: true }); 28 | cy.get('[aria-label="Expand"]').click({ force: true }); 29 | cy.get( 30 | '[href="/docco/guides/nifty-tricks/staying-at-netherfield"]', 31 | ).click(); 32 | }); 33 | 34 | cy.url().should('include', 'guides/nifty-tricks/staying-at-netherfield'); 35 | cy.go('back'); 36 | cy.url().should('eq', `${Cypress.config().baseUrl}/docco`); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/navigation/home.spec.js: -------------------------------------------------------------------------------- 1 | describe('Home page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/'); 4 | }); 5 | 6 | it('should navigate to the packages page from the packages panel', () => { 7 | cy.get('[href="/packages"]').click(); 8 | 9 | cy.url().should('include', '/packages'); 10 | 11 | cy.get('table').within(() => { 12 | cy.get('a') 13 | .contains('Mock Package1') 14 | .should('have.attr', 'href', '/packages/mock-package-1'); 15 | 16 | cy.get('a') 17 | .contains('Mock Package2') 18 | .should('have.attr', 'href', '/packages/mock-package-2'); 19 | 20 | cy.get('a') 21 | .contains('Mock Package3') 22 | .should('have.attr', 'href', '/packages/mock-package-3'); 23 | }); 24 | // cy.screenshot('packages-page'); 25 | }); 26 | 27 | it('should navigate to the docs page from the docs panel', () => { 28 | cy.get('[href="/docco"]').click(); 29 | 30 | cy.url().should('include', '/docco'); 31 | // cy.screenshot('docs-page); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/docs-page.spec.js: -------------------------------------------------------------------------------- 1 | describe('Docs page tests', () => { 2 | it('has the correct page title', () => { 3 | cy.visit('/docco/guides/nifty-tricks/staying-at-netherfield'); 4 | cy.title().should('eq', 'Staying At Netherfield - Complete Config Project'); 5 | }); 6 | 7 | it('has the correct page title for page with custom title', () => { 8 | cy.visit('/docco/guides/how-to-be-accomplished'); 9 | cy.title().should('eq', 'Being accomplished - Complete Config Project'); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-changelog.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package changelog page tests', () => { 2 | describe('Package with a changelog', () => { 3 | beforeEach(() => { 4 | cy.visit('/packages/package-with-changelog/changelog'); 5 | }); 6 | 7 | it('has the correct page title', () => { 8 | cy.title().should('eq', 'Changelog - Complete Config Project'); 9 | }); 10 | }); 11 | 12 | describe('Package missing a changelog', () => { 13 | beforeEach(() => { 14 | cy.visit('/packages/mock-package-1/changelog'); 15 | }); 16 | 17 | it('has the correct page title', () => { 18 | cy.title().should('eq', 'Changelog - Complete Config Project'); 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-docs-home.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package docs home page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/packages/mock-package-1/docs'); 4 | }); 5 | 6 | it('has the correct page title', () => { 7 | cy.title().should('eq', 'Documents - Complete Config Project'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-docs.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package docs page tests', () => { 2 | it('has the correct page title', () => { 3 | cy.visit('/packages/mock-package-2/docs/extended-info'); 4 | cy.title().should('eq', 'Extended Info - Complete Config Project'); 5 | }); 6 | 7 | it('has the correct page title with custom page title', () => { 8 | cy.visit('/packages/mock-package-1/docs/extended-info'); 9 | cy.title().should('eq', 'Extended Information - Complete Config Project'); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-example-isolated.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package isolated example page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/packages/mock-package-1/examples/isolated/example1'); 4 | }); 5 | 6 | it('has the correct page title', () => { 7 | cy.title().should('eq', 'Complete Config Project'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-example.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package example page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/packages/mock-package-1/examples/example1'); 4 | }); 5 | 6 | it('has the correct page title', () => { 7 | cy.title().should('eq', 'Example1 - Complete Config Project'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-examples-home.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package examples home page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/packages/mock-package-1/examples'); 4 | }); 5 | 6 | it('has the correct page title', () => { 7 | cy.title().should('eq', 'Examples - Complete Config Project'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/integration/pages/package-home.spec.js: -------------------------------------------------------------------------------- 1 | describe('Package home page tests', () => { 2 | beforeEach(() => { 3 | cy.visit('/packages/mock-package-1'); 4 | }); 5 | 6 | it('has the correct page title', () => { 7 | cy.title().should('eq', 'Mock Package 1 - Complete Config Project'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gatsby-generator/cypress/support/index.js: -------------------------------------------------------------------------------- 1 | Cypress.Commands.add('getTestElement', selector => 2 | cy.get(`[data-testid=${selector}]`), 3 | ); 4 | 5 | /** 6 | * Override the visit command to also wait until the client-side code has loaded. 7 | * This prevents flakiness involving cypress retrieving elements in the SSR'd DOM 8 | * that then become stale due to the client (React) flushing the DOM with fresh contents. 9 | * See https://github.com/cypress-io/cypress/issues/695#issuecomment-333154635 10 | */ 11 | Cypress.Commands.overwrite('visit', (originalFn, url, options) => { 12 | return originalFn(url, options).get('body[data-client-loaded]'); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/default-pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import '@atlaskit/css-reset'; 3 | import { MDXProvider } from '@mdx-js/react'; 4 | import components from '../un-src/components/mdx'; 5 | import Meta, { metadata } from '../un-src/components/meta-context'; 6 | 7 | export default class AppProvider extends React.Component { 8 | componentDidMount() { 9 | /** 10 | * Set a marker on body indicating that we've rendered on the client side (componentDidMount does not execute on the server). 11 | * This is required for our cypress tests to wait before trying to fetch elements otherwise they may become stale if they are 12 | * fetched before React renders over the server-side DOM. 13 | * See https://github.com/cypress-io/cypress/issues/695#issuecomment-333158645 14 | */ 15 | // eslint-disable-next-line no-undef 16 | document.body.dataset.clientLoaded = 'true'; 17 | } 18 | 19 | render() { 20 | const { children } = this.props; 21 | 22 | return ( 23 | 24 | {children} 25 | 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/gatsby-generator/default-pages/_layout.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Title from '../un-src/components/page-title'; 3 | 4 | const Layout = ({ children }: { children: any }) => ( 5 | <> 6 | 7 | {children} 8 | </> 9 | ); 10 | 11 | export default Layout; 12 | -------------------------------------------------------------------------------- /packages/gatsby-generator/default-pages/healthcheck.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default () => <div>OK</div>; 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/build-pipeline/1-scan-metadata-stage.md: -------------------------------------------------------------------------------- 1 | # Scan metadata build stage 2 | 3 | This is the start of the Brisk pipeline. During this stage, the target project is scanned in order to find all the 4 | packages, examples and docs that will be used in the final website. The output of this stage is a data structure 5 | containing all of this info. 6 | 7 | This stage should be the only one in the pipeline to be reading the user's filesystem to find the location of important 8 | files or for other metadata. This is to avoid harmful couplings of the filesystem to the finished website. 9 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/build-pipeline/2-generate-website-info-stage.md: -------------------------------------------------------------------------------- 1 | # Generate website info build stage 2 | 3 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/build-pipeline/3-generate-pages-stage.md: -------------------------------------------------------------------------------- 1 | # Generate pages build stage 2 | 3 | This stage receives specifications for various types of pages to be created for the website, and then generates a js file 4 | for each page using a page-specific template. 5 | 6 | TODO: Input type definition docs 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/build-pipeline/4-build-website-stage.md: -------------------------------------------------------------------------------- 1 | # Build website build stage 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/build-pipeline/5-start-website-stage.md: -------------------------------------------------------------------------------- 1 | # Start website build stage 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/build-pipeline/README.md: -------------------------------------------------------------------------------- 1 | # The brisk website build pipeline 2 | 3 | Brisk docs uses a pipeline of build stages to take the docs in a codebase and turn it into a website. 4 | 5 | ## Build stages reference 6 | 7 | - [Scan metadata stage](./1-scan-metadata-stage.md) 8 | - [Generate website info stage](./2-generate-website-info-stage.md) 9 | - [Generate pages stage](./3-generate-pages-stage.md) 10 | - [Build website stage](./4-build-website-stage.md) 11 | - [Start website stage](./5-start-website-stage.md) 12 | -------------------------------------------------------------------------------- /packages/gatsby-generator/docs/configuring-webpack.md: -------------------------------------------------------------------------------- 1 | # Customising the webpack config 2 | 3 | If your project needs special build configurations to run your code it's possible to pass these options 4 | to Brisk Docs so that your components can be displayed within the website. 5 | 6 | This is done by adding a function into your `docs.config.js` file, e.g. 7 | 8 | ```js 9 | // docs.config.js 10 | module.exports = () => ({ 11 | webpack: config => { 12 | // Add support for importing Sass files 13 | config.module.rules.push({ 14 | test: /\.scss?$/, 15 | use: ['style-loader', 'css-loader', 'sass-loader'], 16 | }); 17 | 18 | return config; 19 | }, 20 | }); 21 | ``` 22 | 23 | The first argument provided to your function is a [webpack configuration](https://webpack.js.org/configuration) object that you can extend. The returned configuration is then used to build the website. 24 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/docs.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = () => ({ 4 | packages: path.join(__dirname, 'packages', '*'), 5 | docs: [ 6 | { 7 | path: path.join(__dirname, 'docs'), 8 | name: 'Project docs', 9 | // Override the default url path which is derived from cwd 10 | urlPath: 'docs', 11 | }, 12 | ], 13 | siteName: 'Dummy Data Docs', 14 | favicon: path.join(__dirname, 'favicon.ico'), 15 | }); 16 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | version: 0.0.1 3 | --- 4 | 5 | Welcome to the Jane Austen inspired docs on how to improve your life! 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/docs/guides/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['nifty-tricks', 'how-to-be-accomplished'], 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/docs/guides/how-to-be-accomplished.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Being accomplished' 3 | --- 4 | 5 | # Being accomplished 6 | 7 | To be considered truly accomplished[^1] you must: 8 | 9 | - paint tables 10 | - cover screens 11 | - be a master of languages 12 | - possess a certain something in your manner of walking and tone of voice 13 | - improve your mind through extensive reading 14 | 15 | [^1]: Such people may not exist. 16 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/docs/guides/nifty-tricks/_assets/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/dummy-data/simple-project/docs/guides/nifty-tricks/_assets/feedback.png -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/docs/guides/nifty-tricks/staying-at-netherfield.md: -------------------------------------------------------------------------------- 1 | --- 2 | worthIt: yes 3 | --- 4 | 5 | # Mrs Bennet's guide to securing a stay at Netherfield Park 6 | 7 | One sure fire technique for turning a short visit into a long stay is to begin your journey to 8 | Netherfield on horseback just before it rains. Upon your arrival the good Mr Bingley will be 9 | compelled to allow you to stay until the weather clears. You may catch a terrible cold, but it will 10 | be worth it. 11 | 12 | ![Feedback](./_assets/feedback.png) 13 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-generator/dummy-data/simple-project/favicon.ico -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | status: VFD 3 | keywords: ['friends'] 4 | --- 5 | 6 | import SectionMessage from '@atlaskit/section-message'; 7 | 8 | <div style={{height: '16px'}} /> 9 | 10 | <SectionMessage title="vision/mission" appearance="confirmation"> 11 | Every developer’s experience with their code base is joyful and productive. Reliable documentation is quick to find, and creating rich documentation is simple. 12 | </SectionMessage> 13 | 14 | <div style={{height: '16px'}} /> 15 | 16 | <SectionMessage appearance="warning"> 17 | This is all VFD, and subject to change 18 | </SectionMessage> 19 | 20 | One Paragraph of project description goes here. This is ReadMe for the package 1. 21 | 22 | ## Getting Started 23 | 24 | These instructions will get you a copy of the project up and running on your local machine for 25 | development and testing purposes. See deployment for notes on how to deploy the project on a live 26 | system. 27 | 28 | [Link to extended info](./docs/extended-info.md) 29 | 30 | ### Prerequisites 31 | 32 | What things you need to install the software and how to install them 33 | 34 | <div> 35 | <Props 36 | heading="Friends Component" 37 | props={require('!!extract-react-types-loader!./src')} 38 | /> 39 | </div> 40 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['special-usecase'], 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Extended Information 3 | --- 4 | 5 | ``` 6 | Give examples 7 | ``` 8 | 9 | ### Installing 10 | 11 | A step by step series of examples that tell you how to get a development env running 12 | 13 | Say what the step will be 14 | 15 | ``` 16 | Give the example 17 | ``` 18 | 19 | And repeat 20 | 21 | ``` 22 | until finished 23 | ``` 24 | 25 | End with an example of getting some data out of the system or using it for a little demo 26 | 27 | ## Versioning 28 | 29 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 30 | [tags on this repository](https://github.com/your/project/tags). 31 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/examples/content/lorem.json: -------------------------------------------------------------------------------- 1 | [ 2 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", 3 | "Suspendisse tincidunt vehicula eleifend.", 4 | "Nunc tristique nisi tortor, at pretium purus interdum sed.", 5 | "Sed vel augue sit amet sapien elementum bibendum. Aenean aliquam elementum dui, quis euismod metus ultrices ut.", 6 | "Curabitur est sapien, feugiat vel est eget, molestie suscipit nibh.", 7 | "Nunc libero orci, lacinia id orci aliquam, pharetra facilisis leo.", 8 | "Quisque et turpis nec lacus luctus ultrices quis vel nisi.", 9 | "Cras maximus ex lorem, sit amet bibendum nibh placerat eu.", 10 | "In hac habitasse platea dictumst. ", 11 | "Duis molestie sem vel ante varius, rhoncus pretium arcu dictum." 12 | ] 13 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import DynamicTable from '@atlaskit/dynamic-table'; 3 | import { caption, head, rows } from './content/sample-data'; 4 | 5 | // prettier-ignore 6 | const Example1 = () => ( 7 | <DynamicTable 8 | caption={caption} 9 | head={head} 10 | rows={rows} 11 | rowsPerPage={10} 12 | defaultPage={1} 13 | loadingSpinnerSize="large" 14 | isLoading={false} 15 | isFixedSize 16 | defaultSortKey="term" 17 | defaultSortOrder="ASC" 18 | /> 19 | ); 20 | 21 | export default Example1; 22 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 page'; 4 | const Example2 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 page'; 4 | const Example3 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-1", 3 | "version": "1.0.0", 4 | "description": "This is a mock package to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test1", 8 | "maintainers": [ 9 | "Peter Y", 10 | "Ben C", 11 | "Dean P", 12 | "Aparna R" 13 | ], 14 | "license": "", 15 | "repository": { 16 | "type" : "git", 17 | "url" : "fake-repo-fix-later", 18 | "directory": "packages/website" 19 | }, 20 | "dependencies": { 21 | "@atlaskit/avatar": "^14.1.8", 22 | "@atlaskit/dropdown-menu": "^6.1.26", 23 | "@atlaskit/dynamic-table": "^10.0.23", 24 | "react": "^16.7.0", 25 | "react-dom": "^16.7.0", 26 | "styled-components": "^3.2.6" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package1/src/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | 4 | type FriendsInfo = { 5 | /* Name of the person who is asking for a new friend */ 6 | me: string, 7 | /* Name of the person the asker wants to be friends with */ 8 | you: string, 9 | /* a hobby to make it easier to start a conversation */ 10 | 11 | hobby: string | void, 12 | }; 13 | 14 | const BeFriends = ({ me, you, hobby }: FriendsInfo) => ( 15 | <p> 16 | Hello {you}. My name is {me}. {hobby ? `I enjoy ${hobby}` : ''}. Would you 17 | like to be friends with me? 18 | </p> 19 | ); 20 | 21 | export default BeFriends; 22 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 2. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['special-usecase', '*'], 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | ## Versioning 24 | 25 | We use [Vertool](http://semver.org/) for versioning. For the versions available, see the 26 | [tags on this repository](https://github.com/your/project/tags). 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package 2'; 4 | const Example1 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package 2'; 4 | const Example2 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package 2'; 4 | const Example3 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-2", 3 | "version": "1.0.0", 4 | "description": "This is a mock package2 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test2", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package2/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 2'; 4 | const Element = <h1>Hello, {name}</h1>; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/README.md: -------------------------------------------------------------------------------- 1 | # Project Title 2 | 3 | One Paragraph of project description goes here. This is ReadMe for the package 3. 4 | 5 | ## Getting Started 6 | 7 | These instructions will get you a copy of the project up and running on your local machine for 8 | development and testing purposes. See deployment for notes on how to deploy the project on a live 9 | system. 10 | 11 | ### Prerequisites 12 | 13 | What things you need to install the software and how to install them 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/docs/docs.config.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | sortOrder: ['*', 'extended-info'], 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/docs/extended-info.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Give examples 3 | ``` 4 | 5 | ### Installing 6 | 7 | A step by step series of examples that tell you how to get a development env running 8 | 9 | Say what the step will be 10 | 11 | ``` 12 | Give the example 13 | ``` 14 | 15 | And repeat 16 | 17 | ``` 18 | until finished 19 | ``` 20 | 21 | End with an example of getting some data out of the system or using it for a little demo 22 | 23 | <div style={{ color: 'hotpink', backgroundColor: 'rebeccapurple', width: '300px' }}>This is my MDX Demo example</div> 24 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/docs/special-usecase.md: -------------------------------------------------------------------------------- 1 | ## Running the tests 2 | 3 | Explain how to run the automated tests for this system 4 | 5 | ### Break down into end to end tests 6 | 7 | Explain what these tests test and why 8 | 9 | ``` 10 | Give an example 11 | ``` 12 | 13 | ### And coding style tests 14 | 15 | Explain what these tests test and why 16 | 17 | ## Deployment 18 | 19 | Add additional notes about how to deploy this on a live system 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/examples/example1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 1 package3'; 4 | const Example1 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example1; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/examples/example2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 2 package3'; 4 | const Example2 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example2; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/examples/example3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Example 3 package3'; 4 | const Example3 = () => <h1>Hello, {name}</h1>; 5 | 6 | export default Example3; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mock-package-3", 3 | "version": "1.0.0", 4 | "description": "This is a mock package3 to be used for doc website", 5 | "main": "index.js", 6 | "keywords": [], 7 | "author": "Test3", 8 | "license": "", 9 | "dependencies": { 10 | "react": "^16.7.0", 11 | "react-dom": "^16.7.0", 12 | "styled-components": "^4.1.3" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/mock-package3/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const name = 'Test Package 1'; 4 | const Element = <h1>Hello, {name}</h1>; 5 | 6 | export default Element; 7 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/package-with-changelog/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # package-with-changelog 2 | 3 | ## 0.1.2 4 | 5 | - [patch] 23d71c7: 6 | - This is one change 7 | 8 | ## 0.1.1 9 | 10 | - [patch] e342242: 11 | 12 | - this is another change 13 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/package-with-changelog/README.md: -------------------------------------------------------------------------------- 1 | Blahs 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/dummy-data/simple-project/packages/package-with-changelog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-changelog", 3 | "version": "1.0.0", 4 | "description": "This is a mock package that has a changelog", 5 | "main": "index.js", 6 | "keywords": ["react", "changelog", "simple"], 7 | "author": "Test4", 8 | "license": "MIT", 9 | "repository": { 10 | "url": "https://github.com/brisk-docs/brisk-docs/", 11 | "type": "git" 12 | }, 13 | "dependencies": { 14 | "react": "^16.7.0", 15 | "react-dom": "^16.7.0", 16 | "styled-components": "^4.1.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/gatsby-generator/examples/markdown-code-blocks.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Markdown from './sample-markdown/code-blocks.md'; 3 | /* 4 | ## Inline code examples 5 | 6 | Some inline bash code `echo "You are a wonderful person" >> affirmations.txt` 7 | 8 | `const myBestFeatures = ['kind', 'generous']`, a javascript snippet 9 | 10 | ## Code block examples 11 | 12 | A js example 13 | 14 | ```js 15 | // a React component 16 | 17 | import generateAffirmation from './generate-affirmation'; 18 | 19 | const Affirmation = () => <div>{generateAffirmation()}</div>; 20 | ``` 21 | 22 | A C++ example 23 | 24 | ```c++ 25 | // Thanks to WebAssembly this is also valid for the web! 26 | #include <iostream> 27 | using namespace std; 28 | 29 | int main() 30 | { 31 | cout << "Today will be a great day!"; 32 | return 0; 33 | } 34 | ``` 35 | */ 36 | 37 | export default () => <Markdown />; 38 | -------------------------------------------------------------------------------- /packages/gatsby-generator/examples/sample-markdown/code-blocks.md: -------------------------------------------------------------------------------- 1 | ## Inline code examples 2 | 3 | Some inline bash code `echo "You are a wonderful person" >> affirmations.txt` 4 | 5 | `const myBestFeatures = ['kind', 'generous']`, a javascript snippet 6 | 7 | ## Code block examples 8 | 9 | A js example 10 | 11 | ```js 12 | // a React component 13 | 14 | import generateAffirmation from './generate-affirmation'; 15 | 16 | const Affirmation = () => <div>{generateAffirmation()}</div>; 17 | ``` 18 | 19 | A C++ example 20 | 21 | ```c++ 22 | /* Thanks to WebAssembly this is also valid for the web! */ 23 | #include <iostream> 24 | using namespace std; 25 | 26 | int main() 27 | { 28 | cout << "Today will be a great day!"; 29 | return 0; 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /packages/gatsby-generator/handle-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "dist/gatsby-generator.cjs.js", 3 | "module": "dist/gatsby-generator.esm.js", 4 | "preconstruct": { 5 | "source": "../src/handle-config" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/get-command-line-options.ts: -------------------------------------------------------------------------------- 1 | import commandLineArgs from 'command-line-args'; 2 | 3 | export default function getCommandLineOptions() { 4 | const mainDefinitions = [{ name: 'command', defaultOption: true }]; 5 | const mainOptions = commandLineArgs(mainDefinitions, { 6 | stopAtFirstUnknown: true, 7 | }); 8 | 9 | // We have no control over this dangling underscore 10 | // eslint-disable-next-line no-underscore-dangle 11 | const argv = mainOptions._unknown || []; 12 | 13 | const cliOptions = [ 14 | { name: 'config', type: String }, 15 | { name: 'port', alias: 'p', type: Number }, 16 | { name: 'debug', alias: 'd', type: Boolean }, 17 | ]; 18 | const options = commandLineArgs(cliOptions, { argv, camelCase: true }); 19 | 20 | // TODO: Do this only if the server is Next Js. Do the check for parcel/next here in future 21 | const nextOptions = []; 22 | 23 | if (options.port) nextOptions.push(`--port ${options.port}`); 24 | 25 | if (options.debugNext) nextOptions.push('debug-next'); 26 | 27 | return { command: mainOptions.command, options, nextOptions }; 28 | } 29 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/handle-config/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | I want to be clear up front this file shouldn't be here and is a hack to work around some 3 | annoying problems. 4 | 5 | We refactored a lot of the codebase to get a clearer distinction between the steps that 6 | brisk embarks on, while at the same time converting much of the code to typescript, and 7 | adding a build process for these steps, with the intent to stop publishing the `src` directory 8 | 9 | The `handle-config` function is used awkwardly by the `babel.config.js` and the `next.config.js` 10 | files. Ideally, the resolved config should be passed to these. 11 | 12 | To avoid a rabbit hole of further refactoring, I made handle-config its own entry point. 13 | */ 14 | 15 | import handleConfig from '../pipeline/stages/get-configuration/handle-config'; 16 | 17 | export default handleConfig; 18 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | devPipeline, 3 | buildPipeline, 4 | startServerPipeline, 5 | exportServerPipeline, 6 | buildPagesPipeline, 7 | } from './pipeline'; 8 | 9 | // @ts-ignore 10 | import getCommandLineOptions from './get-command-line-options'; 11 | 12 | const handleError = (err: any) => { 13 | console.error(err); 14 | process.exit(1); 15 | }; 16 | 17 | const { command, options, nextOptions } = getCommandLineOptions(); 18 | 19 | const runBinary = () => { 20 | switch (command) { 21 | case 'dev': { 22 | return devPipeline(options.config, nextOptions).catch(handleError); 23 | } 24 | case 'build-pages': { 25 | return buildPagesPipeline(options.config).catch(handleError); 26 | } 27 | case 'build': { 28 | return buildPipeline(options.config, nextOptions).catch(handleError); 29 | } 30 | case 'start': { 31 | return startServerPipeline(options.config, nextOptions).catch( 32 | handleError, 33 | ); 34 | } 35 | case 'export': { 36 | return exportServerPipeline(nextOptions, options.config).catch( 37 | handleError, 38 | ); 39 | } 40 | default: 41 | throw new Error(`Cannot run unknown command, ${command}`); 42 | } 43 | }; 44 | 45 | export default runBinary; 46 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/buildPagesPipeline.ts: -------------------------------------------------------------------------------- 1 | import scanMetadata from './stages/scan-metadata'; 2 | import generateWebsiteInfo from './stages/generate-website-info'; 3 | import generatePages from './stages/generate-pages'; 4 | import allPaths from './getAllPaths'; 5 | 6 | const buildPipeline = async (configPath?: string) => { 7 | const { rootPath, wrappersPath, pagesPath, pkgRoot, config } = await allPaths( 8 | configPath, 9 | ); 10 | 11 | return scanMetadata({ 12 | rootPath, 13 | packagePathPatterns: config.packagesPaths, 14 | customPackageFields: config.customPackageFields, 15 | docs: config.docs, 16 | showSubExamples: config.showSubExamples, 17 | }) 18 | .then(projectData => generateWebsiteInfo(projectData)) 19 | .then(websiteInfo => 20 | generatePages({ 21 | wrappersPath, 22 | pagesPath, 23 | packageRoot: pkgRoot, 24 | ...websiteInfo, 25 | ...config, 26 | }), 27 | ) 28 | .then(() => console.log('pages built')); 29 | }; 30 | 31 | export default buildPipeline; 32 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/devPipeline.ts: -------------------------------------------------------------------------------- 1 | import scanMetadata from './stages/scan-metadata'; 2 | import generateWebsiteInfo from './stages/generate-website-info'; 3 | import generatePages from './stages/generate-pages'; 4 | import runGatsby from './stages/run-gatsby'; 5 | import allPaths from './getAllPaths'; 6 | 7 | const devPipeline = async (configPath?: string, gatsbyOptions?: string[]) => { 8 | const { rootPath, wrappersPath, pagesPath, pkgRoot, config } = await allPaths( 9 | configPath, 10 | ); 11 | 12 | return scanMetadata({ 13 | rootPath, 14 | packagePathPatterns: config.packagesPaths, 15 | customPackageFields: config.customPackageFields, 16 | docs: config.docs, 17 | showSubExamples: config.showSubExamples, 18 | }) 19 | .then(projectData => generateWebsiteInfo(projectData)) 20 | .then(websiteInfo => 21 | generatePages({ 22 | wrappersPath, 23 | pagesPath, 24 | packageRoot: pkgRoot, 25 | ...websiteInfo, 26 | ...config, 27 | }), 28 | ) 29 | .then(() => 30 | runGatsby({ 31 | command: 'develop', 32 | configPath, 33 | pkgRoot, 34 | rootPath, 35 | gatsbyOptions, 36 | }), 37 | ); 38 | }; 39 | 40 | export default devPipeline; 41 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/exportPipeline.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import runWebsite from './stages/run-website'; 3 | import allPaths from './getAllPaths'; 4 | 5 | const exportSeverPipeline = async ( 6 | nextOptions: string[], 7 | configPath?: string, 8 | ) => { 9 | const { rootPath, pkgRoot } = await allPaths(configPath); 10 | nextOptions.push(`-o ${path.join(rootPath, 'out')}`); 11 | return runWebsite({ 12 | command: 'export', 13 | configPath, 14 | pkgRoot, 15 | rootPath, 16 | nextOptions, 17 | }); 18 | }; 19 | 20 | export default exportSeverPipeline; 21 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/getAllPaths.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import pkgDir from 'pkg-dir'; 3 | import getConfiguration from './stages/get-configuration/handle-config'; 4 | 5 | const getPathData = async (configPath?: string) => { 6 | const cwd = process.cwd(); 7 | const config = getConfiguration(cwd, configPath); 8 | 9 | const pkgRoot = await pkgDir(__dirname); 10 | if (!pkgRoot) throw new Error('could not resolve pkg root'); 11 | const wrappersPath = path.resolve( 12 | pkgRoot, 13 | `./un-src/components/page-templates`, 14 | ); 15 | const pagesPath = path.resolve(pkgRoot, `./pages`); 16 | 17 | return { 18 | rootPath: cwd, 19 | wrappersPath, 20 | pagesPath, 21 | pkgRoot, 22 | config, 23 | }; 24 | }; 25 | export default getPathData; 26 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/index.ts: -------------------------------------------------------------------------------- 1 | export { default as devPipeline } from './devPipeline'; 2 | export { default as buildPipeline } from './buildPipeline'; 3 | export { default as startServerPipeline } from './startServerPipeline'; 4 | export { default as exportServerPipeline } from './exportPipeline'; 5 | export { default as buildPagesPipeline } from './buildPagesPipeline'; 6 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/build-website/index.ts: -------------------------------------------------------------------------------- 1 | import createStage from '../make-pipeline-stage'; 2 | // @ts-ignore 3 | import createNextServer from '../run-website/next-server'; 4 | 5 | interface StageInput { 6 | command: string; 7 | configPath?: string; 8 | pkgRoot: string; 9 | rootPath: string; 10 | nextOptions?: string[]; 11 | } 12 | 13 | export default createStage( 14 | 'build-website', 15 | async (input: StageInput): Promise<void> => { 16 | return createNextServer(input); 17 | }, 18 | ); 19 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/build-website/test.ts: -------------------------------------------------------------------------------- 1 | describe('Build website stage', () => { 2 | it.skip('needs tests', () => {}); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/__snapshots__/page-writers.integration.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Page templates creates js for a package example pages 1`] = ` 4 | "import React from 'react'; 5 | import fileContents from '!!raw-loader!../example'; 6 | import * as Components from '../example'; 7 | import Wrapper from '../wrappers/package-example'; 8 | 9 | const Example = () => ( 10 | <Wrapper data={{\\"pageTitle\\":\\"\\"}} fileContents={fileContents}> 11 | { 12 | [{ 13 | name: 'default', 14 | component: <Components.default /> 15 | }, 16 | ...Object.keys(Components).filter(componentName => componentName !== 'default') 17 | .map(componentName => { 18 | const Component = Components[componentName]; 19 | return { 20 | name: componentName, 21 | component: <Component /> 22 | } 23 | }) 24 | ] 25 | } 26 | </Wrapper> 27 | ) 28 | export default Example" 29 | `; 30 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/changelog/index.ts: -------------------------------------------------------------------------------- 1 | const outdent = require('outdent'); 2 | 3 | /** 4 | * changelogTemplate - template for generating a changelog page 5 | * 6 | * @param {string} changelogPath relative path to the changelog file 7 | * @param {string} wrapperPath relative path to the page template component 8 | * @param {object} [data={}] extra data needed by the page 9 | * 10 | * @returns {string} source code for the page 11 | */ 12 | const changelogTemplate = ( 13 | changelogPath: string, 14 | wrapperPath: string, 15 | data = {}, 16 | ) => outdent` 17 | import React from 'react'; 18 | import changelog from '!!raw-loader!${changelogPath}'; 19 | import Wrapper from '${wrapperPath}'; 20 | 21 | export default () => ( 22 | <Wrapper data={${JSON.stringify(data)}}> 23 | {changelog} 24 | </Wrapper> 25 | ); 26 | `; 27 | 28 | export default changelogTemplate; 29 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/changelog/test.js: -------------------------------------------------------------------------------- 1 | import assertValidTemplate from '../test-utils'; 2 | import changelogTemplate from './index'; 3 | 4 | describe('changelog page templates', () => { 5 | it('creates valid source code for a page', () => { 6 | const source = changelogTemplate('./component/path', './wrapper/path'); 7 | 8 | assertValidTemplate(source); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/example/index.ts: -------------------------------------------------------------------------------- 1 | const outdent = require('outdent'); 2 | 3 | /** 4 | * exampleTemplate - template for an example page where the source code 5 | * for the wrapped component is also passed to the wrapper 6 | * 7 | * @param {string} componentPath absolute path to the example 8 | * @param {string} wrapperPath absolute path to the page wrapper 9 | * @param {object} [data={}] extra data needed for the page 10 | * 11 | * @returns {string} source code for the page 12 | */ 13 | const exampleTemplate = ( 14 | componentPath: string, 15 | wrapperPath: string, 16 | data = {}, 17 | ) => outdent` 18 | import React from 'react'; 19 | import fileContents from '!!raw-loader!${componentPath}'; 20 | import * as Components from '${componentPath}'; 21 | import Wrapper from '${wrapperPath}'; 22 | 23 | const Example = () => ( 24 | <Wrapper data={${JSON.stringify(data)}} fileContents={fileContents}> 25 | { 26 | [{ 27 | name: 'default', 28 | component: <Components.default /> 29 | }, 30 | ...Object.keys(Components).filter(componentName => componentName !== 'default') 31 | .map(componentName => { 32 | const Component = Components[componentName]; 33 | return { 34 | name: componentName, 35 | component: <Component /> 36 | } 37 | }) 38 | ] 39 | } 40 | </Wrapper> 41 | ) 42 | export default Example 43 | `; 44 | 45 | export default exampleTemplate; 46 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/example/test.js: -------------------------------------------------------------------------------- 1 | import assertValidTemplate from '../test-utils'; 2 | import exampleTemplate from './index'; 3 | 4 | describe('example page template', () => { 5 | const source = exampleTemplate('./component/path', './wrapper/path'); 6 | 7 | it('creates valid source code for a page', () => { 8 | assertValidTemplate(source); 9 | }); 10 | 11 | it('should create an array of children that includes the default export', () => { 12 | expect(source).toMatch( 13 | /\[{\s*name: 'default',\s*component: <Components.default \/>\s*}/, 14 | ); 15 | }); 16 | 17 | it('create an array of children that includes non-default exports', () => { 18 | expect(source).toMatch( 19 | /\.{3}Object\.keys.*componentName => componentName !== 'default'/, 20 | ); 21 | 22 | expect(source).toMatch( 23 | /map\(([a-zA-Z]*) => .*return .*name: ([a-zA-Z]*).*component: <[a-zA-Z]* \/>/s, 24 | ); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/index.ts: -------------------------------------------------------------------------------- 1 | export { default as changelogTemplate } from './changelog'; 2 | export { default as exampleTemplate } from './example'; 3 | export { default as singleComponentTemplate } from './single-component'; 4 | export { default as wrappedComponentTemplate } from './wrapped-component'; 5 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/single-component/index.ts: -------------------------------------------------------------------------------- 1 | const outdent = require('outdent'); 2 | 3 | /** 4 | * basicSingleComponentTemplate - Template for a page that renders a single component 5 | * 6 | * @param {string} wrapperPath absolute path to the component being rendered 7 | * @param {object} [data={}] extra data needed for the page 8 | * 9 | * @returns {string} source code for the page 10 | */ 11 | const basicSingleComponentTemplate = ( 12 | wrapperPath: string, 13 | data = {}, 14 | ) => outdent` 15 | import React from 'react'; 16 | import Wrapper from '${wrapperPath}'; 17 | 18 | export default () => ( 19 | <Wrapper data={${JSON.stringify(data)}} /> 20 | ); 21 | `; 22 | 23 | export default basicSingleComponentTemplate; 24 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/single-component/test.js: -------------------------------------------------------------------------------- 1 | import assertValidTemplate from '../test-utils'; 2 | import singleComponentTemplate from './index'; 3 | 4 | describe('single component page template', () => { 5 | it('creates valid source code for a page', () => { 6 | const source = singleComponentTemplate('./wrapper/path'); 7 | 8 | assertValidTemplate(source); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/test-utils.js: -------------------------------------------------------------------------------- 1 | const assertImportsReact = source => { 2 | expect(source).toMatch(/^import React from 'react';$/m); 3 | }; 4 | 5 | const assertValidTemplate = source => { 6 | assertImportsReact(source); 7 | }; 8 | 9 | export default assertValidTemplate; 10 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/generate-pages/templates/wrapped-component/test.js: -------------------------------------------------------------------------------- 1 | import assertValidTemplate from '../test-utils'; 2 | import wrappedComponentTemplate from './index'; 3 | 4 | describe('wrapped component page template', () => { 5 | it('creates valid source code for a page', () => { 6 | const source = wrappedComponentTemplate( 7 | './component/path', 8 | './wrapper/path', 9 | ); 10 | 11 | assertValidTemplate(source); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/get-configuration/default-config.ts: -------------------------------------------------------------------------------- 1 | import identityFunc from 'lodash.identity'; 2 | 3 | import { UserConfig } from '../common/configuration-options'; 4 | 5 | // type FilledConfig = 6 | 7 | const defaultConfig: UserConfig = { 8 | docs: { 9 | path: './docs', 10 | name: 'Docs', 11 | description: 'View the documentation for this project', 12 | }, 13 | links: [], 14 | packages: ['./packages/**/*'], 15 | siteName: 'Brisk Docs', 16 | webpack: identityFunc, 17 | showSubExamples: false, 18 | packagesDescription: 'View documentation about individual packages', 19 | customPackageFields: ['license', 'maintainers', 'name', 'version'], 20 | }; 21 | 22 | export default defaultConfig; 23 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/make-pipeline-stage.test.ts: -------------------------------------------------------------------------------- 1 | import { PerformanceObserver } from 'perf_hooks'; 2 | import createStage from './make-pipeline-stage'; 3 | 4 | describe('Pipeline stage generator', () => { 5 | it('creates a run property from the given function', async () => { 6 | const step = jest.fn(); 7 | step.mockReturnValue(Promise.resolve('result')); 8 | 9 | const runStage = createStage('test-stage', step); 10 | const stageInput = {}; 11 | const result = await runStage(stageInput); 12 | 13 | expect(step).toHaveBeenCalledWith(stageInput); 14 | expect(result).toBe('result'); 15 | }); 16 | 17 | it('sends a performance measure event to the performance timing API', () => { 18 | const getPerformanceMetric = new Promise((resolve, reject) => { 19 | const obs = new PerformanceObserver(items => { 20 | const entry = items 21 | .getEntries() 22 | .find(e => e.name === 'brisk-pipeline-stage-duration:test-stage'); 23 | if (!entry) { 24 | reject( 25 | new Error('brisk-pipeline-stage-duration:test-stage entry missing'), 26 | ); 27 | } else { 28 | resolve(entry.duration); 29 | } 30 | 31 | obs.disconnect(); 32 | }); 33 | obs.observe({ entryTypes: ['measure'] }); 34 | }); 35 | 36 | const runStage = createStage('test-stage', () => Promise.resolve()); 37 | runStage({}); 38 | 39 | return expect(getPerformanceMetric).resolves.toEqual(expect.any(Number)); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/make-pipeline-stage.ts: -------------------------------------------------------------------------------- 1 | import { performance } from 'perf_hooks'; 2 | 3 | export type PipelineStage<StageInput, StageOutput> = ( 4 | input: StageInput, 5 | ) => Promise<StageOutput>; 6 | 7 | /** 8 | * Creates a stage for the website build pipeline with performance profiling 9 | * built in. 10 | */ 11 | export default <StageInput, StageOutput>( 12 | id: string, 13 | buildStep: (input: StageInput) => Promise<StageOutput>, 14 | ): PipelineStage<StageInput, StageOutput> => { 15 | return async (input: StageInput): Promise<StageOutput> => { 16 | const perfBeginId = `brisk-pipeline-stage-begin:${id}`; 17 | const perfEndId = `brisk-pipeline-stage-end:${id}`; 18 | 19 | performance.mark(perfBeginId); 20 | 21 | const result = await buildStep(input); 22 | 23 | performance.mark(perfEndId); 24 | performance.measure( 25 | `brisk-pipeline-stage-duration:${id}`, 26 | perfBeginId, 27 | perfEndId, 28 | ); 29 | 30 | return result; 31 | }; 32 | }; 33 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/run-gatsby/gatsby-server.ts: -------------------------------------------------------------------------------- 1 | import { spawnSync } from 'child_process'; 2 | 3 | export default async function spawnGatsbyProcess({ 4 | command, 5 | configPath, 6 | pkgRoot, 7 | rootPath, 8 | gatsbyOptions = [], 9 | }: { 10 | command: string; 11 | configPath?: string; 12 | pkgRoot: string; 13 | rootPath: string; 14 | gatsbyOptions?: string[]; 15 | }) { 16 | const envVariables: { 17 | FORCE_EXTRACT_REACT_TYPES: boolean; 18 | DOCS_WEBSITE_CWD: string; 19 | DOCS_WEBSITE_CONFIG_PATH?: string; 20 | } = { 21 | FORCE_EXTRACT_REACT_TYPES: true, 22 | DOCS_WEBSITE_CWD: rootPath, 23 | }; 24 | if (configPath) { 25 | envVariables.DOCS_WEBSITE_CONFIG_PATH = configPath; 26 | } 27 | 28 | const nodeEnv = 'PATH=$(npm bin):$PATH; NODE_PATH=$NODE_PATH:$PWD/src'; 29 | const gatsbyBin = 'gatsby'; 30 | 31 | const { status } = spawnSync( 32 | `${nodeEnv} ${gatsbyBin} ${command} ${gatsbyOptions.join(' ')}`, 33 | [], 34 | // @ts-ignore 35 | { 36 | stdio: 'inherit', 37 | shell: true, 38 | env: { 39 | ...process.env, 40 | ...envVariables, 41 | }, 42 | cwd: pkgRoot, 43 | }, 44 | ); 45 | 46 | if (status !== 0) { 47 | throw new Error(`Gatsby ${command} failed with exit code ${status}`); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/run-gatsby/index.ts: -------------------------------------------------------------------------------- 1 | import createStage from '../make-pipeline-stage'; 2 | 3 | // @ts-ignore: Importing non-ts file with no definition 4 | import createGatsbyServer from './gatsby-server'; 5 | 6 | interface StageInput { 7 | command: string; 8 | configPath?: string; 9 | pkgRoot: string; 10 | rootPath: string; 11 | gatsbyOptions?: string[]; 12 | } 13 | 14 | // Boilerplate, uncomment when used 15 | // interface StageConfig {} 16 | 17 | export default createStage( 18 | 'run-gatsby', 19 | async (input: StageInput): Promise<void> => createGatsbyServer(input), 20 | ); 21 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/run-website/index.ts: -------------------------------------------------------------------------------- 1 | import createStage from '../make-pipeline-stage'; 2 | 3 | // @ts-ignore: Importing non-ts file with no definition 4 | import createNextServer from './next-server'; 5 | 6 | interface StageInput { 7 | command: string; 8 | configPath?: string; 9 | pkgRoot: string; 10 | rootPath: string; 11 | nextOptions?: string[]; 12 | } 13 | 14 | // Boilerplate, uncomment when used 15 | // interface StageConfig {} 16 | 17 | export default createStage( 18 | 'run-website', 19 | async (input: StageInput): Promise<void> => { 20 | createNextServer(input); 21 | }, 22 | ); 23 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/run-website/next-server.ts: -------------------------------------------------------------------------------- 1 | import { spawnSync } from 'child_process'; 2 | 3 | export default async function spawnNextProcess({ 4 | command, 5 | configPath, 6 | pkgRoot, 7 | rootPath, 8 | nextOptions = [], 9 | }: { 10 | command: string; 11 | configPath?: string; 12 | pkgRoot: string; 13 | rootPath: string; 14 | nextOptions?: string[]; 15 | }) { 16 | const envVariables: { 17 | FORCE_EXTRACT_REACT_TYPES: boolean; 18 | DOCS_WEBSITE_CWD: string; 19 | DOCS_WEBSITE_CONFIG_PATH?: string; 20 | } = { 21 | FORCE_EXTRACT_REACT_TYPES: true, 22 | DOCS_WEBSITE_CWD: rootPath, 23 | }; 24 | if (configPath) { 25 | envVariables.DOCS_WEBSITE_CONFIG_PATH = configPath; 26 | } 27 | 28 | const nodeEnv = 'PATH=$(npm bin):$PATH; NODE_PATH=$NODE_PATH:$PWD/src'; 29 | let nextBin = 'next'; 30 | 31 | const filteredArgs = nextOptions.filter(arg => arg !== 'debug-next'); 32 | if (nextOptions.length !== filteredArgs.length) { 33 | nextBin = `node --inspect-brk $(${nodeEnv} which next)`; 34 | } 35 | 36 | const { status } = spawnSync( 37 | `${nodeEnv} ${nextBin} ${command} ${filteredArgs.join(' ')}`, 38 | [], 39 | // @ts-ignore 40 | { 41 | stdio: 'inherit', 42 | shell: true, 43 | env: { 44 | ...process.env, 45 | ...envVariables, 46 | }, 47 | cwd: pkgRoot, 48 | }, 49 | ); 50 | 51 | if (status !== 0) { 52 | throw new Error(`Next ${command} failed with exit code ${status}`); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/run-website/test.ts: -------------------------------------------------------------------------------- 1 | describe('Run website stage', () => { 2 | it.skip('needs tests', () => {}); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/scan-metadata/get-markdown-meta.ts: -------------------------------------------------------------------------------- 1 | import yaml from 'js-yaml'; 2 | // @ts-ignore missing types 3 | import frontmatter from 'remark-frontmatter'; 4 | // @ts-ignore missing types 5 | import parseMarkdown from 'remark-parse'; 6 | import unified from 'unified'; 7 | import fs from 'fs'; 8 | 9 | /** 10 | * Retrieves metadata frontmatter from a markdown file 11 | * @param markdownPath path to markdown file 12 | * @return object 13 | */ 14 | const getMarkdownMeta = (markdownPath: string): object => { 15 | const tree = unified() 16 | .use(parseMarkdown) 17 | .use(frontmatter, ['yaml']) 18 | .parse(fs.readFileSync(markdownPath, 'utf8')); 19 | 20 | // @ts-ignore 21 | const frontMatterNode = tree.children[0]; 22 | if (!frontMatterNode || frontMatterNode.type !== 'yaml') { 23 | return {}; 24 | } 25 | 26 | let meta; 27 | 28 | try { 29 | meta = yaml.safeLoad(frontMatterNode.value); 30 | } catch (e) { 31 | if (e.name === 'YAMLException') { 32 | throw new Error(`Error parsing frontmatter.\n${e}`); 33 | } 34 | throw e; 35 | } 36 | 37 | return meta; 38 | }; 39 | 40 | export default getMarkdownMeta; 41 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/stages/scan-metadata/test.ts: -------------------------------------------------------------------------------- 1 | describe('Scan metadata build stage', () => { 2 | it.skip('needs tests', () => {}); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/startServerPipeline.ts: -------------------------------------------------------------------------------- 1 | import runGatsby from './stages/run-gatsby'; 2 | import allPaths from './getAllPaths'; 3 | 4 | const startSeverPipeline = async ( 5 | configPath?: string, 6 | gatsbyOptions?: string[], 7 | ) => { 8 | const { rootPath, pkgRoot } = await allPaths(configPath); 9 | 10 | runGatsby({ 11 | command: 'develop', 12 | configPath, 13 | pkgRoot, 14 | rootPath, 15 | gatsbyOptions, 16 | }); 17 | }; 18 | 19 | export default startSeverPipeline; 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/src/pipeline/test.ts: -------------------------------------------------------------------------------- 1 | import { devPipeline } from './index'; 2 | 3 | describe('Website pipeline integration', () => { 4 | it.skip('finishes', () => { 5 | return expect(devPipeline()).resolves.toBeUndefined(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "build", 4 | "allowJs": false, 5 | "alwaysStrict": true, 6 | "declaration": true, 7 | "allowSyntheticDefaultImports": true, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "jsx": "preserve", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "esModuleInterop": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": true, 19 | "sourceMap": true, 20 | "strictNullChecks": true, 21 | "skipLibCheck": true, 22 | "noImplicitReturns": true, 23 | "noUnusedParameters": true, 24 | "strict": true, 25 | "removeComments": false, 26 | "preserveConstEnums": true, 27 | "strictFunctionTypes": true, 28 | "target": "esnext", 29 | "noEmit": true, 30 | "module": "esnext", 31 | "lib": ["dom", "es2017"], 32 | }, 33 | "include": [ 34 | "**/*" 35 | ], 36 | "typeRoots": ["./typings", "./node_modules/@types"], 37 | } 38 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/README.md: -------------------------------------------------------------------------------- 1 | # What is this? 2 | 3 | Codebase cleanliness thing: 4 | 5 | Currently preconstruct is building a bunch of things, but we have these weird 6 | other files that we aren't building. We want to stop publishing src entirely 7 | so we are putting them here in the interrim. 8 | 9 | This should be refactored out, but we don't have time for that right now as we 10 | need to get these things working, so here we are. 11 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/common/page-status-context.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | export type PageStatus = { 4 | /** Whether the page has been converted from a non-index file such as a README into an index page. 5 | * This affects how relative directory paths in markdown is transformed into a link on the website. 6 | */ 7 | convertedToDir: false; 8 | }; 9 | 10 | export const PageStatusContext = createContext<PageStatus>({ 11 | convertedToDir: false, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/content-style-wrapper.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { shallow } from 'enzyme'; 3 | import ContentWrapper from './content-style-wrapper'; 4 | import Breadcrumbs from './breadcrumbs'; 5 | 6 | describe('content style wrapper component', () => { 7 | it('should not render breadcrumbs if the page path is the root', () => { 8 | const path = '/docs'; 9 | 10 | const wrapper = shallow( 11 | <ContentWrapper pagePath={path}> 12 | <div>Page content</div> 13 | </ContentWrapper>, 14 | ); 15 | 16 | expect(wrapper.find(Breadcrumbs)).toHaveLength(0); 17 | }); 18 | 19 | it('should not render breadcrumbs if the page path is not defined', () => { 20 | const wrapper = shallow( 21 | <ContentWrapper> 22 | <div>Page content</div> 23 | </ContentWrapper>, 24 | ); 25 | 26 | expect(wrapper.find(Breadcrumbs)).toHaveLength(0); 27 | }); 28 | 29 | it('should render breadcrumbs if the page path has more than one folder', () => { 30 | const path = '/docs/hello'; 31 | 32 | const wrapper = shallow( 33 | <ContentWrapper pagePath={path}> 34 | <div>Page content</div> 35 | </ContentWrapper>, 36 | ); 37 | 38 | expect(wrapper.find(Breadcrumbs)).toHaveLength(1); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/content-style-wrapper.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from '@emotion/styled'; 3 | import { math, gridSize } from '@atlaskit/theme'; 4 | 5 | import Breadcrumbs, { isPathRoot } from './breadcrumbs'; 6 | 7 | const Padding = styled.div` 8 | max-width: ${math.multiply(gridSize, 130)}px; 9 | padding: 0 ${math.multiply(gridSize, 5)}px; 10 | margin: ${math.multiply(gridSize, 5)}px auto; 11 | margin-top: 0; 12 | `; 13 | 14 | type ContentWrapperProps = { 15 | pagePath?: string; 16 | children: React.ReactNode; 17 | }; 18 | 19 | const ContentWrapper = ({ pagePath, children }: ContentWrapperProps) => ( 20 | <> 21 | {pagePath && !isPathRoot(pagePath) && <Breadcrumbs pagePath={pagePath} />} 22 | <Padding>{children}</Padding> 23 | </> 24 | ); 25 | 26 | export default ContentWrapper; 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/link-button.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { mount } from 'enzyme'; 3 | import LinkComponent from './navigation/link-component'; 4 | 5 | import LinkButton from './link-button'; 6 | 7 | describe('LinkButton', () => { 8 | it('should render an anchor', () => { 9 | const wrapper = mount(<LinkButton href="/foo">Foo</LinkButton>); 10 | 11 | const anchor = wrapper.find('a'); 12 | expect(anchor).toHaveLength(1); 13 | expect(anchor.prop('href')).toEqual('/foo'); 14 | }); 15 | 16 | it('should render a next LinkComponent component', () => { 17 | const wrapper = mount(<LinkButton href="/foo">Foo</LinkButton>); 18 | 19 | const link = wrapper.find(LinkComponent); 20 | expect(link).toHaveLength(1); 21 | expect(link.prop('href')).toEqual('/foo'); 22 | }); 23 | 24 | it('should not remount its contents across re-renders', () => { 25 | const wrapper = mount(<LinkButton href="/foo">Foo</LinkButton>); 26 | 27 | const anchorBefore = wrapper.find('a').instance(); 28 | const linkBefore = wrapper.find(LinkComponent).instance(); 29 | 30 | // Triggers a re-render 31 | wrapper.setProps({}); 32 | 33 | const anchorAfter = wrapper.find('a').instance(); 34 | const linkAfter = wrapper.find(LinkComponent).instance(); 35 | 36 | expect(anchorBefore).toBe(anchorAfter); 37 | // Note: doing expect(linkBefore).toBe(linkAfter) causes infinite loop (OOM) in jests object equality reporting tool 38 | // since the component instances are recursive. 39 | expect(linkBefore === linkAfter).toBe(true); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/link-button.tsx: -------------------------------------------------------------------------------- 1 | /* 2 | Simple wrapper to use `gatsby-link` with `@atlaskit/button`. This should be used for all links 3 | in the website, save those in places such as navigation. 4 | 5 | Passes all props other than component directly into `@atlaskit/button`. 6 | See the [@atlaskit/button](https://atlaskit.atlassian.com/packages/core/button) docs for 7 | the options available to you. 8 | */ 9 | import * as React from 'react'; 10 | 11 | import Button from '@atlaskit/button'; 12 | import LinkComponent from './navigation/link-component'; 13 | 14 | const LinkButton = (props: typeof Button) => ( 15 | <Button {...props} component={LinkComponent} /> 16 | ); 17 | 18 | export default LinkButton; 19 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/Heading.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import reactAddonsTextContent from 'react-addons-text-content'; 3 | import snakeCase from 'lodash.snakecase'; 4 | 5 | function dashcase(children?: React.ReactChild) { 6 | // this matches the IDs that are used for links naturally by remark 7 | return snakeCase(reactAddonsTextContent(children)).replace(/_/g, '-'); 8 | } 9 | 10 | export type Props = { 11 | tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; 12 | children?: React.ReactChild; 13 | }; 14 | 15 | const Heading = ({ tag: Tag, children }: Props) => ( 16 | <Tag id={dashcase(children)} style={{ marginTop: '32px' }}> 17 | {children} 18 | </Tag> 19 | ); 20 | 21 | export default Heading; 22 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/HorizontalRule.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const HorizontalRule = (props: Object) => ( 4 | <hr {...props} style={{ marginTop: '32px' }} /> 5 | ); 6 | 7 | export default HorizontalRule; 8 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/code/block.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { shallow } from 'enzyme'; 3 | import { AkCodeBlock } from '@atlaskit/code'; 4 | 5 | import CodeBlock from './block'; 6 | 7 | const sampleCode = 'const x = 1;'; 8 | 9 | describe('Code block markdown component', () => { 10 | it('renders a AkCodeBlock component', () => { 11 | const wrapper = shallow(<CodeBlock>{sampleCode}</CodeBlock>); 12 | const codeBlocks = wrapper.find(AkCodeBlock); 13 | expect(codeBlocks).toHaveLength(1); 14 | expect(codeBlocks.first().props()).toHaveProperty('text', sampleCode); 15 | }); 16 | 17 | it('transforms the language classname to select the rendered language', () => { 18 | const wrapper = shallow( 19 | <CodeBlock className="language-js">{sampleCode}</CodeBlock>, 20 | ); 21 | 22 | expect( 23 | wrapper 24 | .find(AkCodeBlock) 25 | .first() 26 | .props(), 27 | ).toHaveProperty('language', 'js'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/code/block.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { AkCodeBlock } from '@atlaskit/code'; 3 | 4 | export type Props = { 5 | children: string; 6 | className?: string; 7 | }; 8 | 9 | const getLanguageName = (className: string) => { 10 | return className.replace(/language-/, ''); 11 | }; 12 | 13 | export default ({ children, className }: Props) => ( 14 | <AkCodeBlock 15 | text={children} 16 | language={className && getLanguageName(className)} 17 | showLineNumbers={false} 18 | /> 19 | ); 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/code/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CodeBlock } from './block'; 2 | export { default as InlineCode } from './inline'; 3 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/code/inline.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { AkCode } from '@atlaskit/code'; 3 | 4 | export type Props = { 5 | children: string; 6 | }; 7 | 8 | export default ({ children }: Props) => ( 9 | <AkCode text={children} language="text" /> 10 | ); 11 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/mdx/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Heading from './Heading'; 3 | import Link from '../switch-link'; 4 | import HorizontalRule from './HorizontalRule'; 5 | import { CodeBlock, InlineCode } from './code'; 6 | 7 | const components = { 8 | h1: (props: {}) => <Heading {...props} tag="h1" />, 9 | h2: (props: {}) => <Heading {...props} tag="h2" />, 10 | h3: (props: {}) => <Heading {...props} tag="h3" />, 11 | h4: (props: {}) => <Heading {...props} tag="h4" />, 12 | h5: (props: {}) => <Heading {...props} tag="h5" />, 13 | h6: (props: {}) => <Heading {...props} tag="h6" />, 14 | a: ({ children, ...props }: { children: React.ReactChild; href: string }) => { 15 | return <Link {...props}>{children}</Link>; 16 | }, 17 | code: CodeBlock, 18 | inlineCode: InlineCode, 19 | hr: HorizontalRule, 20 | }; 21 | 22 | export default components; 23 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/meta-context.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export interface LinkObject { 4 | label: string; 5 | description?: string; 6 | href: string; 7 | imgSrc?: string; 8 | } 9 | 10 | export interface DocumentObject { 11 | docsPath: string; 12 | name: string; 13 | description?: string; 14 | imgSrc?: string; 15 | urlPath: string; 16 | } 17 | 18 | export interface ReadMeObject { 19 | imgSrc?: string; 20 | } 21 | 22 | export interface PackagesObject { 23 | description: string; 24 | imgSrc?: string; 25 | } 26 | 27 | interface ContextInterface { 28 | siteName: string; 29 | packages: PackagesObject; 30 | readMe?: ReadMeObject; 31 | links: LinkObject[]; 32 | docs: DocumentObject[]; 33 | } 34 | 35 | const ContextMeta = React.createContext<ContextInterface>({ 36 | siteName: '', 37 | packages: { 38 | description: '', 39 | }, 40 | links: [], 41 | docs: [], 42 | }); 43 | 44 | export default ContextMeta; 45 | 46 | // @ts-ignore 47 | export { default as metadata } from '../../data/site-meta.json'; 48 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/navigation/docs-nav-content.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { MenuSection } from '@atlaskit/navigation-next'; 3 | import pageInfo from '../../pages-list'; 4 | import NavHeader from './nav-header'; 5 | import TreeNavContent, { arrayToTreeItems } from './tree-nav-content'; 6 | 7 | const DocsNavContent = ({ docId }: { docId: string }) => { 8 | const treeData = { 9 | rootId: docId, 10 | items: pageInfo[docId] 11 | ? arrayToTreeItems(pageInfo[docId], { 12 | parentId: docId, 13 | parentTitle: docId, 14 | }) 15 | : {}, 16 | }; 17 | 18 | // NOTE this is not ideal - once we ahve better data mapping this should come 19 | // form the root. 20 | const homeUrl = 21 | pageInfo[docId][0] && 22 | pageInfo[docId][0].pagePath.split && 23 | pageInfo[docId][0].pagePath.split('/')[1] 24 | ? `/${pageInfo[docId][0].pagePath.split('/')[1]}` 25 | : docId; 26 | 27 | return ( 28 | <> 29 | <NavHeader headerText={docId} url={homeUrl} /> 30 | <MenuSection id="docs-section" parentId="index-section"> 31 | {/* TODO: TSFix nav typing */} 32 | {({ className }: { className: string }) => ( 33 | <div className={className}> 34 | {/* TODO: Hiding for the time being */} 35 | {/* <BackItem text="Back to home" href="/" component={LinkComponent} /> */} 36 | {/* <Separator /> */} 37 | <TreeNavContent treeData={treeData} /> 38 | </div> 39 | )} 40 | </MenuSection> 41 | </> 42 | ); 43 | }; 44 | 45 | export default DocsNavContent; 46 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/navigation/link-component.tsx: -------------------------------------------------------------------------------- 1 | // Component that can be used as the component prop in nav items 2 | 3 | import * as React from 'react'; 4 | import { Link } from 'gatsby'; 5 | import ShortcutIcon from '@atlaskit/icon/glyph/shortcut'; 6 | 7 | export type Props = { 8 | children: React.ReactChild; 9 | includeShortcutIcon?: boolean; // default true - only has an effect for external links 10 | href: string; 11 | className?: string; 12 | }; 13 | 14 | // @atlaskit/item requires a class to be passed to it (otherwise we get 15 | // ref errors from styled-components). 16 | /* eslint-disable-next-line react/prefer-stateless-function */ 17 | 18 | const LinkComponent: React.ComponentType<Props> = ({ 19 | className, 20 | children, 21 | href, 22 | includeShortcutIcon = true, 23 | ...rest 24 | }: Props) => { 25 | const internal = /^(\/|\.\/|\.\.\/)(?!\/)/.test(href); 26 | if (internal) { 27 | const newHref = href.replace(/\.md$/, ''); 28 | return ( 29 | <Link 30 | to={newHref} 31 | className={className} 32 | // @ts-ignore 33 | data-testid={rest['data-testid']} 34 | > 35 | {children} 36 | </Link> 37 | ); 38 | } 39 | return ( 40 | <a 41 | href={href} 42 | className={className} 43 | target="_blank" 44 | rel="noopener noreferrer" 45 | // @ts-ignore 46 | data-testid={rest['data-testid']} 47 | > 48 | {children} 49 | {includeShortcutIcon && <ShortcutIcon label={href} size="small" />} 50 | </a> 51 | ); 52 | }; 53 | 54 | export default LinkComponent; 55 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/navigation/nav-header.tsx: -------------------------------------------------------------------------------- 1 | // TODO: 2 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 3 | import * as React from 'react'; 4 | import { 5 | ContainerHeader, 6 | HeaderSection, 7 | ItemAvatar, 8 | } from '@atlaskit/navigation-next'; 9 | import { gridSize as gridSizeFn } from '@atlaskit/theme'; 10 | import titleCase from 'title-case'; 11 | 12 | /** @jsx jsx */ 13 | // @ts-ignore 14 | import { jsx } from '@emotion/core'; 15 | 16 | const gridSize = gridSizeFn(); 17 | 18 | export type Props = { 19 | headerText: string; 20 | url: string; 21 | }; 22 | 23 | const NavHeader = ({ headerText, url }: Props) => ( 24 | <HeaderSection> 25 | {/* TODO: TSFix - nav typings */} 26 | {({ css }: { css: {} }) => ( 27 | <div 28 | css={{ 29 | ...css, 30 | paddingTop: `${gridSize * 2.5}px`, 31 | paddingBottom: `${gridSize * 2.5}px`, 32 | }} 33 | > 34 | <ContainerHeader 35 | // TODO: TSFix - nav typings 36 | before={(itemState: any) => ( 37 | <ItemAvatar 38 | itemState={itemState} 39 | appearance="square" 40 | size="large" 41 | /> 42 | )} 43 | text={titleCase(headerText)} 44 | href={url} 45 | /> 46 | </div> 47 | )} 48 | </HeaderSection> 49 | ); 50 | 51 | export default NavHeader; 52 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/navigation/nav-link.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { Item } from '@atlaskit/navigation-next'; 3 | import { colors } from '@atlaskit/theme'; 4 | import { Location } from '@reach/router'; 5 | import LinkComponent from './link-component'; 6 | 7 | // TODO TSFix - find out if we can actually get the prop types of withRouter 8 | // here instead of defining our own 9 | export type Props = { 10 | text: string; 11 | href: string; 12 | id?: string; 13 | isHeading?: boolean; 14 | }; 15 | 16 | const NavLink = ({ text, href, isHeading }: Props) => { 17 | return ( 18 | <Location> 19 | {locationProps => { 20 | const pathName = locationProps.location.pathname; 21 | return ( 22 | <Item 23 | // @ts-ignore 24 | styles={styles => ({ 25 | ...styles, 26 | itemBase: { 27 | ...styles.itemBase, 28 | paddingLeft: '4px', 29 | height: '32px', 30 | }, 31 | textWrapper: { 32 | ...styles.textWrapper, 33 | color: isHeading ? colors.N800 : colors.N200, 34 | }, 35 | })} 36 | isSelected={pathName === href} 37 | text={text} 38 | href={href} 39 | component={LinkComponent} 40 | /> 41 | ); 42 | }} 43 | </Location> 44 | ); 45 | }; 46 | 47 | export default NavLink; 48 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/page-templates/package-docs.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import * as PropTypes from 'prop-types'; 3 | 4 | import PackageNavContent from '../navigation/package-nav-content'; 5 | import NavigationWrapper from '../navigation-wrapper'; 6 | import Wrapper from '../content-style-wrapper'; 7 | import PageTitle from '../page-title'; 8 | 9 | const PackageDocsWrapper = ({ data, children }) => ( 10 | <> 11 | <PageTitle title={data.pageTitle} /> 12 | <NavigationWrapper 13 | navContent={() => ( 14 | <PackageNavContent packageId={data.id} packageName={data.packageName} /> 15 | )} 16 | > 17 | <Wrapper pagePath={data.pagePath}>{children}</Wrapper> 18 | </NavigationWrapper> 19 | </> 20 | ); 21 | 22 | PackageDocsWrapper.propTypes = { 23 | data: PropTypes.shape({ 24 | id: PropTypes.string.isRequired, 25 | packageName: PropTypes.string.isRequired, 26 | pageTitle: PropTypes.string.isRequired, 27 | }).isRequired, 28 | children: PropTypes.node.isRequired, 29 | }; 30 | 31 | export default PackageDocsWrapper; 32 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/page-templates/project-docs.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import * as PropTypes from 'prop-types'; 3 | 4 | import DocsNavContent from '../navigation/docs-nav-content'; 5 | import NavigationWrapper from '../navigation-wrapper'; 6 | import Wrapper from '../content-style-wrapper'; 7 | import PageTitle from '../page-title'; 8 | 9 | const ProjectDocsWrapper = ({ children, data }) => ( 10 | <> 11 | <PageTitle title={data.pageTitle} /> 12 | <NavigationWrapper navContent={() => <DocsNavContent docId={data.key} />}> 13 | <Wrapper pagePath={data.pagePath}>{children}</Wrapper> 14 | </NavigationWrapper> 15 | </> 16 | ); 17 | 18 | ProjectDocsWrapper.propTypes = { 19 | children: PropTypes.node.isRequired, 20 | data: PropTypes.shape({ 21 | key: PropTypes.string, 22 | pageTitle: PropTypes.string.isRequired, 23 | }).isRequired, 24 | }; 25 | 26 | export default ProjectDocsWrapper; 27 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/page-title.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { Helmet } from 'react-helmet'; 3 | import Meta from './meta-context'; 4 | 5 | export type Props = { 6 | title?: string; 7 | }; 8 | 9 | const PageTitle = ({ title }: Props) => ( 10 | <Meta.Consumer> 11 | {({ siteName }: { siteName: string }) => ( 12 | <Helmet> 13 | <title>{title ? `${title} - ${siteName}` : siteName} 14 | 15 | )} 16 | 17 | ); 18 | 19 | export default PageTitle; 20 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/page.tsx: -------------------------------------------------------------------------------- 1 | import styled from '@emotion/styled'; 2 | import { gridSize, math } from '@atlaskit/theme'; 3 | 4 | const containerWidth = { 5 | small: '480px', 6 | medium: '640px', 7 | large: '980px', 8 | }; 9 | 10 | const PageContainer = styled.main` 11 | max-width: ${(p: { width?: 'small' | 'medium' | 'large' }) => 12 | p.width ? containerWidth[p.width] : containerWidth.large}; 13 | margin: 2rem auto; 14 | padding: 0 ${math.multiply(gridSize, 5)}px; 15 | `; 16 | 17 | export default PageContainer; 18 | 19 | export const Title = styled.h1` 20 | margin-bottom: 1em; 21 | `; 22 | 23 | export const Section = styled.section` 24 | margin-top: 3em; 25 | 26 | p { 27 | line-height: 1.4em; 28 | } 29 | `; 30 | 31 | export const Intro = styled.p` 32 | font-size: ${math.multiply(gridSize, 2)}px; 33 | font-weight: 300; 34 | line-height: 1.4em; 35 | `; 36 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/components/switch-link.tsx: -------------------------------------------------------------------------------- 1 | export { default } from './navigation/link-component'; 2 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/model/page.ts: -------------------------------------------------------------------------------- 1 | import titleCase from 'title-case'; 2 | import { DocsPage, Page } from '../../types'; 3 | /* eslint-disable import/prefer-default-export */ 4 | /** 5 | * Business logic related to pages 6 | * @file page.ts 7 | */ 8 | 9 | /** 10 | * Whether the page is a docs page. Currently just used as a typeguard so that we can access 11 | * meta when it does not exist on all types of pages. 12 | */ 13 | const isDocsPage = (page: any): page is DocsPage => { 14 | return page.meta != null; 15 | }; 16 | 17 | /** 18 | * Retrieve the title of a page. This is either the page's custom title 19 | * set via the meta.title attribute or by default, the title cased version of the page id. 20 | */ 21 | export const getTitle = (page: Page) => { 22 | return (isDocsPage(page) && page.meta.title) || titleCase(page.id); 23 | }; 24 | -------------------------------------------------------------------------------- /packages/gatsby-generator/un-src/pages-list.ts: -------------------------------------------------------------------------------- 1 | /* pages-list.json is only generated upon building the website, and so will not exist 2 | during linting. This file exists so there is a single place where pages-list.json is 3 | imported so the eslint rule only needs to be disabled here, as opposed to every file 4 | pages-list.json is used. 5 | */ 6 | 7 | // @ts-ignore 8 | import pageInfo from '../data/pages-list.json'; 9 | import { PackageInfo, DocsPage } from '../types'; 10 | 11 | type Info = { 12 | packages: PackageInfo[]; 13 | readme?: DocsPage[]; 14 | } & { 15 | [key: string]: DocsPage[]; 16 | }; 17 | 18 | const data: Info = pageInfo; 19 | 20 | export default data; 21 | -------------------------------------------------------------------------------- /packages/gatsby-plugin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @brisk-docs/gatsby-plugin 2 | 3 | ## 0.1.0 4 | ### Minor Changes 5 | 6 | - 36693fd: Switch gatsby to run using a plugin, not controlled directly by brisk 7 | 8 | ### Patch Changes 9 | 10 | - Updated dependencies [36693fd] 11 | - Updated dependencies [3c58139] 12 | - @brisk-docs/gatsby-generator@1.1.0 13 | -------------------------------------------------------------------------------- /packages/gatsby-plugin/babel.config.js: -------------------------------------------------------------------------------- 1 | const fse = require('fs-extra'); 2 | const path = require('path'); 3 | 4 | const handleConfig = require('@brisk-docs/gatsby-generator/handle-config') 5 | .default; 6 | 7 | const configPath = process.env.DOCS_WEBSITE_CONFIG_PATH; 8 | const cwd = process.env.DOCS_WEBSITE_CWD; 9 | 10 | if (!cwd) { 11 | throw new Error('DOCS_WEBSITE_CWD is not defined'); 12 | } 13 | 14 | const { babelConfig: clientBabelConfig, loadBabel } = handleConfig( 15 | cwd, 16 | configPath, 17 | ); 18 | 19 | let babelConfig = { 20 | presets: ['@babel/react'], 21 | plugins: [ 22 | '@babel/plugin-proposal-class-properties', 23 | '@babel/syntax-dynamic-import', 24 | ], 25 | }; 26 | 27 | if ( 28 | cwd !== __dirname && 29 | clientBabelConfig && 30 | fse.existsSync(path.resolve(cwd, clientBabelConfig)) 31 | ) { 32 | /* eslint-disable global-require */ 33 | /* eslint-disable import/no-dynamic-require */ 34 | const clientBabel = require(path.resolve(cwd, clientBabelConfig)); 35 | babelConfig = clientBabel; 36 | } else if (loadBabel) { 37 | babelConfig = loadBabel(babelConfig); 38 | } 39 | 40 | module.exports = babelConfig; 41 | -------------------------------------------------------------------------------- /packages/gatsby-plugin/gatsby-browser.js: -------------------------------------------------------------------------------- 1 | const React = require('react'); 2 | const AppProvider = require('@brisk-docs/gatsby-generator/pages/_app.tsx') 3 | .default; 4 | const Layout = require('@brisk-docs/gatsby-generator/pages/_layout.tsx') 5 | .default; 6 | 7 | /* eslint-disable react/prop-types */ 8 | 9 | exports.wrapRootElement = ({ element }) => { 10 | // props provide same data to Layout as Page element will get 11 | // including location, data, etc - you don't need to pass it 12 | return {element}; 13 | }; 14 | 15 | exports.wrapPageElement = ({ element, props }) => { 16 | // props provide same data to Layout as Page element will get 17 | // including location, data, etc - you don't need to pass it 18 | return {element}; 19 | }; 20 | -------------------------------------------------------------------------------- /packages/gatsby-plugin/gatsby-node.js: -------------------------------------------------------------------------------- 1 | exports.onCreateWebpackConfig = ({ actions, loaders, getConfig }) => { 2 | const config = getConfig(); 3 | 4 | config.module.rules = [ 5 | // Omit the default rule where test === '\.jsx?$' 6 | ...config.module.rules.filter( 7 | rule => String(rule.test) !== String(/\.jsx?$/), 8 | ), 9 | // Recreate it with custom exclude filter 10 | { 11 | ...loaders.js(), 12 | test: /\.jsx?$/, 13 | exclude: modulePath => 14 | /node_modules/.test(modulePath) && 15 | /* 16 | What this regex is saying is: 17 | Do not exclude: 18 | - files in node_modules 19 | - that are in a @brisk-docs scoped package 20 | - BUT still exclude things in the node_modules of that package 21 | */ 22 | !/node_modules\/@brisk-docs\/[^/]+\/(?!node_modules)/.test(modulePath), 23 | }, 24 | ]; 25 | actions.replaceWebpackConfig(config); 26 | }; 27 | -------------------------------------------------------------------------------- /packages/gatsby-plugin/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-plugin/index.js -------------------------------------------------------------------------------- /packages/gatsby-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@brisk-docs/gatsby-plugin", 3 | "version": "0.1.0", 4 | "main": "index.js", 5 | "dependencies": { 6 | "@brisk-docs/gatsby-generator": "1.1.0", 7 | "fs-extra": "^7.0.1", 8 | "pkg-dir": "^4.2.0" 9 | }, 10 | "peerDependencies": { 11 | "gatsby": "^2.17.10", 12 | "react": "16.10.2" 13 | }, 14 | "devDependencies": { 15 | "gatsby": "^2.17.10", 16 | "react": "16.10.2" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/gatsby-plugin/static/skier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atlassian-archive/brisk-docs/d40573e4c2872217f3d2f607f096098a9f63e38d/packages/gatsby-plugin/static/skier.png -------------------------------------------------------------------------------- /packages/react-changelogs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @brisk-docs/react-changelogs 2 | 3 | ## 0.1.11 4 | 5 | ### Patch Changes 6 | 7 | - 36693fd: Safety bump 8 | 9 | ## 0.1.10 10 | 11 | ### Patch Changes 12 | 13 | - 4a3112c: Update react dependency 14 | 15 | ## 0.1.9 16 | 17 | ### Patch Changes 18 | 19 | - 23c4f43: Patch release - previous release does not include built dists 20 | 21 | ## 0.1.8 22 | 23 | ### Patch Changes 24 | 25 | - 6dbc7dc: Fix babel configs for building packages to produce working dists for node scripts. 26 | - 6dbc7dc: Use emotion instead of styled components. 27 | 28 | ## 0.1.7 29 | 30 | ### Patch Changes 31 | 32 | - d6ad582: Update extract-react-types to support new features in that package 33 | 34 | ## 0.1.6 35 | 36 | ### Patch Changes 37 | 38 | - 76dc8dc: Updated the extract react loader version 39 | 40 | ## 0.1.5 41 | 42 | ### Patch Changes 43 | 44 | - fc6c572: Convert classes to hooks against advisement from react team 45 | 46 | ## 0.1.4 47 | 48 | - [patch] f97b57b: 49 | 50 | - Remove unused dependencies - moved some dependencies into dev dependencies 51 | 52 | ## 0.1.3 53 | 54 | - [patch] 1ce8baa: 55 | 56 | - Changed the babel/core version to match the packages in the monorepo 57 | 58 | ## 0.1.2 59 | 60 | - [patch] 23d71c7: 61 | - Added pagination to package changelogs. The default number of logs per page is 20. If null is given to entriesPerPage prop then the changelog is not paginated. 62 | 63 | ## 0.1.1 64 | 65 | - [patch] e342242: 66 | 67 | - Fix build to work in commonjs 68 | -------------------------------------------------------------------------------- /packages/react-changelogs/__tests__/changelog.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { mount } from 'enzyme'; 3 | 4 | import Changelog from '../src/components/changelog'; 5 | 6 | const initialProps = `# This package itself 7 | 8 | ## 1.0.0 9 | - [major] 24601 10 | ## 0.5.0 11 | - [minor] Who am I?`; 12 | 13 | describe('', () => { 14 | it('renders changelog component', () => { 15 | const wrapper = mount( 16 | null} />, 17 | ); 18 | expect(wrapper.find('LogItem')).toBeDefined(); 19 | expect(wrapper.find('a')).toHaveLength(0); 20 | }); 21 | 22 | it('renders link for changelog when version url is provided', () => { 23 | const url = `https://bitbucket.org/atlassian/atlaskit-mk-2/commits/tag/%40atlaskit%2Fbutton%4010.1.3`; 24 | const myMock = jest.fn(); 25 | myMock.mockReturnValueOnce(url); 26 | myMock.mockReturnValueOnce(url); 27 | const wrapper = mount( 28 | , 29 | ); 30 | expect(wrapper.find('a')).toHaveLength(2); 31 | }); 32 | 33 | it('renders changelog based on the specified range', () => { 34 | const wrapper = mount( 35 | null} range=">0.5.0" />, 36 | ); 37 | expect(wrapper.find('h3')).toHaveLength(1); 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /packages/react-changelogs/__tests__/divide-changelog.test.ts: -------------------------------------------------------------------------------- 1 | import divideChangelog from '../src/utils/divide-changelog'; 2 | 3 | const initialProps = `# This package itself 4 | 5 | ## 1.0.0 6 | - [major] 24601 7 | ## 0.5.0 8 | - [minor] Who am I? 9 | ## 0.4.3 10 | - [patch] And so, Honor, you see it's true, 11 | - [minor] That man bears no more guilt than you! 12 | ## 0.4.2 13 | - [patch] Who am I? 14 | - [patch] I am Jean Valjean!`; 15 | 16 | describe('create change logs array ', () => { 17 | it('converts change log string into array of items', () => { 18 | expect(divideChangelog(initialProps)).toEqual([ 19 | { 20 | version: '1.0.0', 21 | md: `## 1.0.0 22 | - [major] 24601`, 23 | }, 24 | { 25 | version: '0.5.0', 26 | md: `## 0.5.0 27 | - [minor] Who am I?`, 28 | }, 29 | { 30 | version: '0.4.3', 31 | md: `## 0.4.3 32 | - [patch] And so, Honor, you see it's true, 33 | - [minor] That man bears no more guilt than you!`, 34 | }, 35 | { 36 | version: '0.4.2', 37 | md: `## 0.4.2 38 | - [patch] Who am I? 39 | - [patch] I am Jean Valjean!`, 40 | }, 41 | ]); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /packages/react-changelogs/__tests__/filter-changelog.test.ts: -------------------------------------------------------------------------------- 1 | import filterChangelog from '../src/utils/filter-changelog'; 2 | 3 | const initialProps = [ 4 | { 5 | version: '1.0.0', 6 | md: `## 1.0.0 7 | - [major] 24601`, 8 | }, 9 | { 10 | version: '0.5.0', 11 | md: `## 0.5.0 12 | - [minor] Who am I?`, 13 | }, 14 | { 15 | version: '0.4.3', 16 | md: `## 0.4.3 17 | - [patch] And so, Honor, you see it's true, 18 | - [minor] That man bears no more guilt than you!`, 19 | }, 20 | { 21 | version: '0.4.2', 22 | md: `## 0.4.2 23 | - [patch] Who am I? 24 | - [patch] I am Jean Valjean!`, 25 | }, 26 | ]; 27 | 28 | describe('filter change logs array', () => { 29 | it('returns the original array when range is not given', () => { 30 | expect(filterChangelog(initialProps)).toEqual(initialProps); 31 | }); 32 | 33 | it('returns the filtered array according to given range', () => { 34 | expect(filterChangelog(initialProps, '>0.4.3')).toEqual([ 35 | { 36 | version: '1.0.0', 37 | md: `## 1.0.0 38 | - [major] 24601`, 39 | }, 40 | { 41 | version: '0.5.0', 42 | md: `## 0.5.0 43 | - [minor] Who am I?`, 44 | }, 45 | ]); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /packages/react-changelogs/examples/display-changelog.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import Changelog from '../src/components/changelog'; 3 | 4 | const data = `# This package itself 5 | 6 | ## 1.0.0 7 | - [major] 24601 8 | ## 0.5.0 9 | - [minor] Who am I?`; 10 | 11 | export default () => ( 12 |
13 | null} /> 14 |
15 | ); 16 | -------------------------------------------------------------------------------- /packages/react-changelogs/examples/filter-changelogs.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import styled from '@emotion/styled'; 3 | import { gridSize, math } from '@atlaskit/theme'; 4 | import Changelog from '../src/components/changelog'; 5 | 6 | const data = `# This package itself 7 | 8 | ## 1.0.0 9 | - [major] 24601 10 | ## 0.5.0 11 | - [minor] Who am I? 12 | ## 0.4.3 13 | - [patch] And so, Honor, you see it's true, 14 | - [minor] That man bears no more guilt than you! 15 | ## 0.4.2 16 | - [patch] Who am I? 17 | - [patch] I am Jean Valjean!`; 18 | 19 | const FieldWrapper = styled.div` 20 | flex-grow: 1; 21 | padding-right: ${math.multiply(gridSize, 2)}px; 22 | `; 23 | 24 | const FilterChangeLogs = () => { 25 | const [range, updateRange] = React.useState(''); 26 | 27 | const handleChange = (event: React.ChangeEvent) => { 28 | updateRange(event.target.value); 29 | }; 30 | 31 | return ( 32 |
33 | 34 | 1.0.6 <= 3.0.2"'} 38 | value={range} 39 | /> 40 | 41 | null} range={range} /> 42 |
43 | ); 44 | }; 45 | 46 | export default FilterChangeLogs; 47 | -------------------------------------------------------------------------------- /packages/react-changelogs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@brisk-docs/react-changelogs", 3 | "version": "0.1.11", 4 | "description": "This package is used for displaying changelogs from your projects", 5 | "main": "dist/react-changelogs.cjs.js", 6 | "module": "dist/react-changelogs.esm.js", 7 | "repository": "git@github.com:brisk-docs/brisk-docs.git", 8 | "maintainers": [ 9 | "Aparna Raj", 10 | "Ben Conolly" 11 | ], 12 | "author": "Aparna Raj", 13 | "license": "MIT", 14 | "files": ["dist"], 15 | "peerDependencies": { 16 | "react": "16.10.2", 17 | "react-dom": "^16.8.4" 18 | }, 19 | "devDependencies": { 20 | "@types/enzyme": "^2.8.11", 21 | "@types/jest": "^21.1.2", 22 | "@types/react": "^16.4.18", 23 | "@types/semver": "^5.5.0", 24 | "enzyme": "^3.9.0", 25 | "enzyme-adapter-react-16": "^1.9.1", 26 | "extract-react-types-loader": "^0.3.7", 27 | "jest": "^24.1.0", 28 | "react": "16.10.2", 29 | "react-dom": "^16.8.4", 30 | "react-test-renderer": "^16.0.0", 31 | "ts-jest": "^24.0.0" 32 | }, 33 | "dependencies": { 34 | "@atlaskit/css-reset": "^3.0.5", 35 | "@atlaskit/pagination": "^10.0.1", 36 | "@atlaskit/theme": "^6.0.0", 37 | "@babel/runtime": "^7.4.3", 38 | "@babel/runtime-corejs2": "^7.4.3", 39 | "@emotion/core": "^10.0.9", 40 | "@emotion/styled": "^10.0.9", 41 | "@emotion/styled-base": "^10.0.10", 42 | "prismjs": "^1.15.0", 43 | "react-addons-text-content": "^0.0.4", 44 | "react-markdown": "^2.5.0", 45 | "semver": "^5.4.1" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/react-changelogs/src/__tests__/divide-changelog.test.ts: -------------------------------------------------------------------------------- 1 | import divideChangelog from '../utils/divide-changelog'; 2 | 3 | const initialProps = `# This package itself 4 | 5 | ## 1.0.0 6 | - [major] 24601 7 | ## 0.5.0 8 | - [minor] Who am I? 9 | ## 0.4.3 10 | - [patch] And so, Honor, you see it's true, 11 | - [minor] That man bears no more guilt than you! 12 | ## 0.4.2 13 | - [patch] Who am I? 14 | - [patch] I am Jean Valjean!`; 15 | 16 | describe('create change logs array ', () => { 17 | it('converts change log string into array of items', () => { 18 | expect(divideChangelog(initialProps)).toEqual([ 19 | { 20 | version: '1.0.0', 21 | md: `## 1.0.0 22 | - [major] 24601`, 23 | }, 24 | { 25 | version: '0.5.0', 26 | md: `## 0.5.0 27 | - [minor] Who am I?`, 28 | }, 29 | { 30 | version: '0.4.3', 31 | md: `## 0.4.3 32 | - [patch] And so, Honor, you see it's true, 33 | - [minor] That man bears no more guilt than you!`, 34 | }, 35 | { 36 | version: '0.4.2', 37 | md: `## 0.4.2 38 | - [patch] Who am I? 39 | - [patch] I am Jean Valjean!`, 40 | }, 41 | ]); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /packages/react-changelogs/src/__tests__/filter-changelog.test.ts: -------------------------------------------------------------------------------- 1 | import filterChangelog from '../utils/filter-changelog'; 2 | 3 | const initialProps = [ 4 | { 5 | version: '1.0.0', 6 | md: `## 1.0.0 7 | - [major] 24601`, 8 | }, 9 | { 10 | version: '0.5.0', 11 | md: `## 0.5.0 12 | - [minor] Who am I?`, 13 | }, 14 | { 15 | version: '0.4.3', 16 | md: `## 0.4.3 17 | - [patch] And so, Honor, you see it's true, 18 | - [minor] That man bears no more guilt than you!`, 19 | }, 20 | { 21 | version: '0.4.2', 22 | md: `## 0.4.2 23 | - [patch] Who am I? 24 | - [patch] I am Jean Valjean!`, 25 | }, 26 | ]; 27 | 28 | describe('filter change logs array', () => { 29 | it('returns the original array when range is not given', () => { 30 | expect(filterChangelog(initialProps)).toEqual(initialProps); 31 | }); 32 | 33 | it('returns the filtered array according to given range', () => { 34 | expect(filterChangelog(initialProps, '>0.4.3')).toEqual([ 35 | { 36 | version: '1.0.0', 37 | md: `## 1.0.0 38 | - [major] 24601`, 39 | }, 40 | { 41 | version: '0.5.0', 42 | md: `## 0.5.0 43 | - [minor] Who am I?`, 44 | }, 45 | ]); 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /packages/react-changelogs/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default as divideChangelog } from './utils/divide-changelog'; 2 | export { default as filterChangelog } from './utils/filter-changelog'; 3 | export { default } from './components/changelog'; 4 | -------------------------------------------------------------------------------- /packages/react-changelogs/src/types/changeLog.ts: -------------------------------------------------------------------------------- 1 | export interface Log { 2 | md: string; 3 | version: string; 4 | } 5 | export type Logs = Log[]; 6 | -------------------------------------------------------------------------------- /packages/react-changelogs/src/utils/divide-changelog.ts: -------------------------------------------------------------------------------- 1 | import { Logs } from '../types/changeLog'; 2 | 3 | const divideChangelog = (changelog: string): Logs => { 4 | const splitToken = `__CHANGELOG_SPLIT_${Date.now()}__`; 5 | return changelog 6 | .replace(/[\n\r\s]## /g, `${splitToken}## `) 7 | .split(splitToken) 8 | .reduce( 9 | (all, md) => { 10 | // This should only allow us to skip the first chunk which is the name, as 11 | // well as the unreleased section. 12 | const match = md.match(/\d+\.\d+\.\d+/); 13 | 14 | const version = match ? match[0] : null; 15 | if (!version) return all; 16 | return all.concat({ 17 | version, 18 | md, 19 | }); 20 | }, 21 | [] as Logs, 22 | ); 23 | }; 24 | 25 | export default divideChangelog; 26 | -------------------------------------------------------------------------------- /packages/react-changelogs/src/utils/filter-changelog.ts: -------------------------------------------------------------------------------- 1 | import * as semver from 'semver'; 2 | import { Logs } from '../types/changeLog'; 3 | 4 | const filterChangelog = (rawLogs: Logs, range?: string): Logs => { 5 | return range 6 | ? rawLogs.filter(e => semver.satisfies(e.version, range)) 7 | : rawLogs; 8 | }; 9 | 10 | export default filterChangelog; 11 | -------------------------------------------------------------------------------- /scripts/clean.js: -------------------------------------------------------------------------------- 1 | const getWorkspaces = require('get-workspaces').default; 2 | const rimraf = require('rimraf'); 3 | const path = require('path'); 4 | 5 | const rimrafPromise = dirPath => 6 | new Promise((resolve, reject) => { 7 | rimraf(dirPath, err => { 8 | if (err) reject(err); 9 | resolve(); 10 | }); 11 | }); 12 | 13 | async function repeatedAction() { 14 | const workspaces = await getWorkspaces({ 15 | cwd: process.cwd(), 16 | tools: ['yarn'], 17 | }); 18 | 19 | await Promise.all( 20 | workspaces.map(({ dir }) => 21 | Promise.all([ 22 | rimrafPromise(path.join(dir, 'dist')), 23 | rimrafPromise(path.join(dir, 'node_modules')), 24 | ]), 25 | ), 26 | ); 27 | console.log('removed all dists and node_modules'); 28 | } 29 | 30 | repeatedAction(); 31 | -------------------------------------------------------------------------------- /scripts/deploy_changeset_bot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cp ../packages/changeset-bot/package.json ../deploy/changeset-bot 4 | cp ../packages/changeset-bot/yarn.lock ../deploy/changeset-bot 5 | cp ../packages/changeset-bot/index.js ../deploy/changeset-bot 6 | cp ../packages/changeset-bot/.env ../deploy/changeset-bot 7 | 8 | cd ../deploy/changeset-bot 9 | 10 | # Deploy 11 | docker build -t docker.atl-paas.net/atlassian/changeset-bot:0.0.1 . 12 | docker push docker.atl-paas.net/atlassian/changeset-bot:0.0.1 13 | micros service:deploy changeset-bot -f changeset-bot.sd.yml -e stg-east 14 | 15 | echo "You did it hooray" 16 | 17 | 18 | -------------------------------------------------------------------------------- /scripts/micros_deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build 4 | (cd .. && bolt build:docs) 5 | 6 | # Copy files 7 | cp ../packages/website/package.json ../deploy 8 | cp ../yarn.lock ../deploy 9 | 10 | cp -r ../packages/website/.next ../deploy 11 | cp -r ../packages/website/static ../deploy 12 | 13 | # Install dependencies 14 | cd ../deploy && yarn 15 | 16 | # Deploy 17 | docker build -t docker.atl-paas.net/atlassian/jira-frontend-docs-test:0.0.1 . 18 | docker push docker.atl-paas.net/atlassian/jira-frontend-docs-test:0.0.1 19 | micros service:deploy jira-frontend-docs-test -f jira-frontend-docs-test.sd.yml 20 | echo "You did it hooray" 21 | 22 | 23 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "build", 4 | "allowJs": false, 5 | "alwaysStrict": true, 6 | "declaration": true, 7 | "allowSyntheticDefaultImports": true, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "jsx": "preserve", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "esModuleInterop": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": true, 19 | "sourceMap": true, 20 | "strictNullChecks": true, 21 | "skipLibCheck": true, 22 | "noImplicitReturns": true, 23 | "noUnusedParameters": true, 24 | "removeComments": false, 25 | "preserveConstEnums": true, 26 | "strictFunctionTypes": true, 27 | "target": "esnext", 28 | "noEmit": true, 29 | "module": "esnext", 30 | "lib": ["dom", "es2017"] 31 | }, 32 | "include": [ 33 | "packages/file-viewer/src/**/*", 34 | "packages/react-changelogs/src/**/*", 35 | "packages/website/**/*", 36 | "typings/**/*" 37 | ], 38 | "exclude": [ 39 | "packages/website/pages/**/*" 40 | ], 41 | "typeRoots": ["./typings", "./node_modules/@types"] 42 | } 43 | -------------------------------------------------------------------------------- /typings/git-url-parse.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'git-url-parse' { 2 | export default function parseGitUrl( 3 | url: string, 4 | ): { 5 | // eslint-disable-next-line 6 | git_suffix?: string; 7 | resource: string; 8 | owner: string; 9 | toString: (why: string) => string; 10 | name: string; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /typings/jest-fixtures.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'jest-fixtures' { 2 | export function createTempDir(): string; 3 | 4 | export function copyFixtureIntoTempDir( 5 | cwd: string, 6 | fixtureName: string, 7 | ): Promise; 8 | } 9 | -------------------------------------------------------------------------------- /typings/lodash.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | WHAT THE HECK IS GOING ON? 3 | 4 | Lodash individual methods don't have types, but their type info exists in `@lodash/types` 5 | We can import and then export things in our d.ts to add types to modules without typing 6 | them ourselves. 7 | 8 | This does mean we import 'lodash' which is not a dependency. 9 | 10 | That's okay, for certain values of okay. 11 | */ 12 | 13 | /* eslint-disable */ 14 | declare module 'lodash.snakecase' { 15 | import { snakeCase } from 'lodash'; 16 | 17 | export default snakeCase; 18 | } 19 | 20 | declare module 'lodash.identity' { 21 | import { identity } from 'lodash'; 22 | 23 | export default identity; 24 | } 25 | 26 | declare module 'lodash.capitalize' { 27 | import { capitalize } from 'lodash'; 28 | 29 | export default capitalize; 30 | } 31 | 32 | declare module 'lodash.debounce' { 33 | import { debounce } from 'lodash'; 34 | 35 | export default debounce; 36 | } 37 | -------------------------------------------------------------------------------- /typings/mdx-js__react.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@mdx-js/react' { 2 | declare const MDXProvider: React.ComponentType; 3 | // eslint-disable-next-line 4 | export { MDXProvider }; 5 | } 6 | -------------------------------------------------------------------------------- /typings/mdx-js__tag.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@mdx-js/tag' { 2 | declare const MDXProvider: React.ComponentType; 3 | // eslint-disable-next-line 4 | export { MDXProvider }; 5 | } 6 | -------------------------------------------------------------------------------- /typings/prismjs.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'primsjs' { 2 | import Prism from 'prismjs'; 3 | 4 | export default Prism; 5 | } 6 | -------------------------------------------------------------------------------- /typings/react-addons-text-content.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'react-addons-text-content' { 2 | export default function ReactAddonsTextContent( 3 | child?: React.ReactChild, 4 | ): string; 5 | } 6 | --------------------------------------------------------------------------------