olly-docs-wrapper
v0.0.2
Published
Gatsby Theme for building Olly documentation
Downloads
1
Readme
Requirements:
- Remove the template entry from
package.json
- Remove
doczrc.js
,gatsby-node.js
, andgatsby-theme-docz
insidesrc
(if these are already available inside in the project, during postinstall these files will be auto generated) - Remove the webstudio copy command if it is mentioned in start script inside
package.json
installation
step1
npm install olly-docs-wrapper --save-dev
Note: If you face any issue, make sure to have [email protected]
version installed
and run npm dedupe(deduplicate the node_modules)
step2
Make sure to verify files gatsby-config.js
, doczrc.js
and gatsby-node.js
which are generated.
//gatsby-config.js
module.exports = {
plugins: [
// ...
{
resolve: `olly-docs-wrapper`,
}
]
};
//doczrc.js
export default {
title: "OllyStudio DLS: 3.1",
description: "OllyStudio Design System components, Powered by: OLLY 3.1",
typescript: true,
dest: "/public",
docgenConfig: {
propFilter: (prop) =>
prop.parent ? prop.parent.fileName.indexOf("@types/react") === -1 : true,
searchPath:
process.env.DOC_TYPE === "document" ? "node_modules/olly" : "src",
},
files: ["./src/**/*.mdx", "./documents/**/*.mdx"],
ignore: ["README.md"],
filterComponents: (files) =>
files.filter((filepath) => /\w*\.(ts|tsx)$/.test(filepath)),
};
//gatsby-node.js
const path = require("path");
let { dependencies = {}, name, devDependencies = {} } = require(path.join(
__dirname,
`../package.json`
));
const depEntries = Object.keys({ ...dependencies, ...devDependencies })
.filter((name) => name.indexOf("olly") !== -1)
.reduce(
(map, name) => {
map[name + "/src"] = path.resolve(
__dirname,
`../node_modules/${name}/src`
);
return map;
},
{ [name + "/src"]: path.resolve(__dirname, `../src`) }
);
exports.onCreateWebpackConfig = (args) => {
args.actions.setWebpackConfig({
resolve: {
alias: depEntries,
},
});
};