Skip to content

Commit

Permalink
Stub designql package
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed Mar 21, 2019
1 parent a8a22ed commit f2a5d35
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 46 deletions.
8 changes: 7 additions & 1 deletion examples/basic/gatsby-config.js
@@ -1,3 +1,4 @@
require('dotenv').config()
const path = require('path')
const Components = require('gatsby-ui')

Expand All @@ -12,7 +13,12 @@ module.exports = {
components: Components,
theme: Components.theme,
docsPath: path.join(__dirname, './docs'),
componentsPath: path.join(__dirname, '../../node_modules/gatsby-ui/src')
componentsPath: path.join(__dirname, '../../node_modules/gatsby-ui/src'),
figma: {
fileId: process.env.FIGMA_FILE_ID,
//projectId: process.env.FIGMA_PROJECT_ID,
accessToken: process.env.FIGMA_TOKEN,
}
}
}
]
Expand Down
1 change: 1 addition & 0 deletions examples/basic/package.json
Expand Up @@ -7,6 +7,7 @@
"build": "gatsby build"
},
"dependencies": {
"dotenv": "^6.2.0",
"gatsby": "latest",
"gatsby-theme-designql": "*"
}
Expand Down
Empty file added packages/designql/index.js
Empty file.
12 changes: 12 additions & 0 deletions packages/designql/package.json
@@ -0,0 +1,12 @@
{
"name": "designql",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
98 changes: 54 additions & 44 deletions packages/gatsby-theme-designql/gatsby-config.js
Expand Up @@ -7,59 +7,69 @@ module.exports = ({
docsPath = 'docs',
componentsPath = 'src/docs',
components = {},
theme = {}
theme = {},
figma
} = {}) => {
const themeLayouts = {
default: require.resolve('./src/components/Layout')
}

return {
siteMetadata: {
title: 'Gatsby Blog',
siteUrl: 'https://gatsbyjs.org'
},
plugins: [
{
resolve: 'gatsby-mdx',
options: {
extensions: [".md", ".mdx"],
defaultLayouts: {
...themeLayouts,
...defaultLayouts
}
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'components',
path: componentsPath
const plugins = [
{
resolve: 'gatsby-mdx',
options: {
extensions: [".md", ".mdx"],
defaultLayouts: {
...themeLayouts,
...defaultLayouts
}
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'components',
path: componentsPath
}
},
{
resolve: 'gatsby-plugin-page-creator',
options: {
name: 'docs',
path: docsPath,
ignore: ['**/\.*']
},
{
resolve: 'gatsby-plugin-page-creator',
options: {
name: 'docs',
path: docsPath,
ignore: ['**/\.*']
},
},
{
resolve: 'gatsby-transformer-react-docgen',
options: {
resolver: (ast, recast) => {
const { findAllExportedComponentDefinitions } = resolver
const annotatedComponents = annotationResolver(ast, recast)
const exportedComponents = findAllExportedComponentDefinitions(ast, recast)
},
{
resolve: 'gatsby-transformer-react-docgen',
options: {
resolver: (ast, recast) => {
const { findAllExportedComponentDefinitions } = resolver
const annotatedComponents = annotationResolver(ast, recast)
const exportedComponents = findAllExportedComponentDefinitions(ast, recast)

return annotatedComponents.concat(exportedComponents)
}
return annotatedComponents.concat(exportedComponents)
}
},
{
resolve: 'gatsby-transformer-styled-system',
options: { components, theme }
}
]
},
{
resolve: 'gatsby-transformer-styled-system',
options: { components, theme }
}
]

if (figma) {
plugins.push({
resolve: 'gatsby-source-figma',
options: figma
})
}

return {
siteMetadata: {
title: 'Gatsby Blog',
siteUrl: 'https://gatsbyjs.org'
},
plugins
}
}
1 change: 1 addition & 0 deletions packages/gatsby-theme-designql/package.json
Expand Up @@ -15,6 +15,7 @@
"@mdx-js/tag": "^0.16.6",
"gatsby-mdx": "^0.3.3",
"gatsby-plugin-page-creator": "^2.0.5",
"gatsby-source-figma": "^1.0.0",
"gatsby-source-filesystem": "^2.0.13",
"gatsby-theme-redirects": "^0.0.5",
"gatsby-transformer-react-docgen": "^3.0.0",
Expand Down
23 changes: 22 additions & 1 deletion yarn.lock
Expand Up @@ -1473,6 +1473,14 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==

axios@^0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102"
integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=
dependencies:
follow-redirects "^1.3.0"
is-buffer "^1.1.5"

axobject-query@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9"
Expand Down Expand Up @@ -3314,6 +3322,11 @@ dotenv@^4.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d"
integrity sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=

dotenv@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==

duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
Expand Down Expand Up @@ -4190,7 +4203,7 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^3.1.1"

follow-redirects@^1.0.0:
follow-redirects@^1.0.0, follow-redirects@^1.3.0:
version "1.6.1"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb"
integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==
Expand Down Expand Up @@ -4426,6 +4439,14 @@ gatsby-react-router-scroll@^2.0.4:
scroll-behavior "^0.9.9"
warning "^3.0.0"

gatsby-source-figma@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/gatsby-source-figma/-/gatsby-source-figma-1.0.0.tgz#e855d25e992405e9a9e00a7011e4fc338e6bc3ca"
integrity sha512-ST2n/u9lKSkugdf8emPN2O76DvJOVVw0HVSgY4URlmYqVOmIIS+EdRjEDkb4Sj9I3VSNm/VGuKuO5N7lmiXw2g==
dependencies:
axios "^0.18.0"
babel-runtime "^6.26.0"

gatsby-source-filesystem@^2.0.13:
version "2.0.20"
resolved "https://registry.yarnpkg.com/gatsby-source-filesystem/-/gatsby-source-filesystem-2.0.20.tgz#0bb3dcf905c6856d87e7a44d73bd8ff056cd5b95"
Expand Down

0 comments on commit f2a5d35

Please sign in to comment.