From a44c120972afbdd437dd02853ecca9f246aeb993 Mon Sep 17 00:00:00 2001 From: atanasster Date: Mon, 10 Aug 2020 10:42:46 +0300 Subject: [PATCH] fix: remove console.log --- .../getting-started/external-libraries.mdx | 1 - .../.config/buildtime.js | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 examples/theme-ui-design-system/.config/buildtime.js diff --git a/examples/stories/src/tutorial/getting-started/external-libraries.mdx b/examples/stories/src/tutorial/getting-started/external-libraries.mdx index 51ed3622d..fe24e7783 100644 --- a/examples/stories/src/tutorial/getting-started/external-libraries.mdx +++ b/examples/stories/src/tutorial/getting-started/external-libraries.mdx @@ -149,7 +149,6 @@ module.exports = { path.dirname(filePath), `../index.d.ts`, ); - console.log(resolved); return resolved; } }, diff --git a/examples/theme-ui-design-system/.config/buildtime.js b/examples/theme-ui-design-system/.config/buildtime.js new file mode 100644 index 000000000..b4b81c324 --- /dev/null +++ b/examples/theme-ui-design-system/.config/buildtime.js @@ -0,0 +1,48 @@ +const path = require('path'); + +module.exports = { + stories: [ + '../src/docs/*.@(mdx|tsx)', + ], + instrument: { + components: { + package: { + browseLink: (componentName, filePath ) => { + if (filePath.includes('system-ui/theme-ui/tree/master/dist/index.js')) { + return `https://github.com/system-ui/theme-ui/tree/master/packages/components/src/${componentName}.js` + } + if (filePath.includes('/component-controls/tree/master/ui/components/dist/index.js')) { + return `https://github.com/ccontrols/component-controls/blob/master/ui/components/src/${componentName}/${componentName}.tsx` + } + return filePath; + } + }, + resolveFile: (componentName, filePath) => { + if (filePath.includes('theme-ui/dist')) { + const resolved = path.resolve( + path.dirname(filePath), + `../../@theme-ui/components/src/${componentName}.js`, + ); + return resolved; + } + if (filePath.includes('@component-controls/components/dist')) { + const resolved = path.resolve( + path.dirname(filePath), + `../src/${componentName}/${componentName}.tsx`, + ); + return resolved; + } + return filePath; + }, + resolvePropsFile: (componentName, filePath) => { + if (filePath.includes('@theme-ui/components/src')) { + const resolved = path.resolve( + path.dirname(filePath), + `../index.d.ts`, + ); + return resolved; + } + }, + }, + } +}; \ No newline at end of file