-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin Library build fixes #3906
Merged
Merged
Changes from all commits
Commits
Show all changes
284 commits
Select commit
Hold shift + click to select a range
40df85e
Support URLs that end in SemVer ranges (#3305)
danoc 396ae6e
page path defaults to '/' (#3325)
luczaki114 3492447
Use graymatter excerpt in gatsby-transformer-remark (#2883)
blairwilcox 771f241
handles integer with valida date format correctly (#3461)
Khaledgarbaya 9c1935a
Upgrade style-loader to fix CSS modules issue (#3283)
eramdam 95e5af7
format/bootstrap
KyleAMathews 03c19fb
Publish
KyleAMathews de876dd
Updated links for Glamor and Styled Components (#3462)
virenb c881201
Update tutorial.js
KyleAMathews f1eb95c
Add link to the using-remark website
KyleAMathews 65e851f
Don't create pages for test files (#3464)
kpollich 74b1ebe
Add gatsby-source-behance to plugins list (#3465)
LekoArts 60c0533
activated mergeLinkHeaders (#3463)
zionis137 5ad3b38
Add cache-control examples to caching docs page (#3468)
KyleAMathews 4c1bbeb
Publish
KyleAMathews 4ef16d0
Revert "Upgrade style-loader to fix CSS modules issue (#3283)"
KyleAMathews ec1b7ac
Publish
KyleAMathews 80775eb
Fix Links Redirection (#3471)
deadcoder0904 74be3d8
Fix typo (#3470)
deepakjois b007e5a
Update tutorial-links.yml
KyleAMathews d4cc9f1
Cleanup Glamor / Styled Component mini-tutorials (#3474)
KyleAMathews f9846a2
Fix typo in building with components section (#3476)
dannywils 84c31f6
Fix typo (#3477)
LekoArts f95f249
Update Deploy Gatsby page - Gitlab Pages (#3482)
travis-r6s 3fbba4e
correct key behavior (#3483)
calcsam bbc764c
Publish
KyleAMathews 5d3a508
Add Strata starter (#3488)
ChangoMan 2f4cf0e
Use `_.isPlainObject` to prevent false Array positives (#3490)
3c1fa01
Publish
KyleAMathews 2fba7b4
update styled-jsx dep in gatsby-plugin-styled-jsx (#3493)
zgreen cee6352
Publish
KyleAMathews b6ae588
gatsby-image docs (#3500)
gillkyle 94b2b7a
Easy edits based off of observing Eden go thru tutorials (#3501)
shannonbux e5b24d4
[gatsby] don't run service-workers outside of https or localhost (#…
busticated 08a0ae0
format
KyleAMathews b812df8
Publish
KyleAMathews 9341256
Properly use `withPrefix` in adding-images-fonts-files docs (#3503)
trotzig d0f58e0
Create new npm keyword for gatsby components (#3507)
KyleAMathews 86b5d9d
Publish
KyleAMathews 7c2982d
Fix typo in docs (#3511)
adrienharnay 6144049
Add Netlify CMS plugin, related docs (#3509)
erquhart 71f939a
Publish
KyleAMathews c079cf2
Fix clone instructions (#3514)
KyleAMathews 07dd840
Search and replace the hostname in URLs. (#3498)
moshie 8d39adf
Add documentation on adding list of blog posts (#3510)
adrienharnay d4946b1
[DOCS] Adding Markdown pages: Remove useless fields (#3517)
adrienharnay 1a4e765
[DOCS] Links: Remove emphasis from implem stubs (#3518)
adrienharnay a3194fc
fix link (#3513)
roman-kosov 3360f7d
Add missing comma in sitemap example (#3520)
danoc d19cc12
Move inlined webpack manifest to the end of body element (#3519)
szimek 20d856c
Adds email capture to bottom of blog (#3333)
benjaminhoffman e5a71eb
Fix `gatsby-plugin-nprogress` default options param (#3533)
e303054
Format
KyleAMathews 88f77e2
Publish
KyleAMathews c6f5fb1
Don't use internal name when reporting there's an error in gatsby-nod…
KyleAMathews fb06047
Publish
KyleAMathews 7d70a07
Add Developer Ecosystem to websites (#3540)
durkinio 870e05c
Removes words like 'simple' & 'easy' from docs/www (#3523)
benjaminhoffman 3912e79
cpinnix/verious starter (#3543)
cpinnix ccd179c
gatsby-plugin-sharp: Remove warning for resolutions when requested wi…
dannywils 301833e
Add to instructions that you need gatsby-plugin-sharp fixes #3545 (#3…
KyleAMathews bc433fb
Update katex package to 0.8.3 (#3548)
thomask-gh 2b0996c
add unique titles to docs, tutorial, blog (#3550)
9528157
Fix typo in KaTeX usage example (#3549)
thomask-gh efb237e
format
KyleAMathews a838d81
Publish
KyleAMathews 5c71c64
[www] Fix <link rel=„author“> href (#3555)
fk cb7c848
[www] Fix email-capture-form cross browser issues (#3553)
fk 878f821
Add docs page with overview of Gatsby's usage of GraphQL (#3557)
KyleAMathews 6e6933a
Debugging HTML Builds - fix copy&paste error (#3565)
zionis137 b74a2ea
Update outdated snapshot (#3566)
KyleAMathews 6854d7d
Update readme with demo link (#3573)
RyKilleen 9efb99f
Move script loader after webpack manifest (#3569)
szimek e882c31
Publish
KyleAMathews e2d50bb
Added 'Steve Meredith's Portfolio' to 'Showcase' (#3576)
Steveeeie d2d4f02
City of Boston case study blog post (#3583)
calcsam edee33b
Add Put.io landing page to showcase (#3580)
altaywtf 0739bd5
Allow arrays with more than one file path & ignore empty strings (#3577)
KyleAMathews 10cc9d2
Publish
KyleAMathews 252b2ca
Add search form to site (#3421)
m-allanson 31cc5e8
Some minor edits (#3586)
shannonbux 3390a5f
Add sample code showing off gatsby-image + image processing to query …
KyleAMathews a9d9c4f
Improve documentation for createParentChildLink (#3594)
KyleAMathews ff7de90
Some updates to the awesome gatsby page (#3595)
KyleAMathews 037914e
Add Ryan Wiemer's Portfolio to the showcase (#3578)
ryanwiemer c065540
Updated Plugins.md (#3593)
iKonrad b352e42
[www] Add gatsby-plugin-postcss-sass (#3590)
fk b78b2bf
[www] Improve docsearch UI for small devices (#3597)
fk edcfb2f
Add section why GraphQL is *cool* (#3606)
KyleAMathews c54f190
[www] Increase navigation z-index (#3599)
fk 69764bb
Added `gatsby-plugin-bugherd` to community plugins (#3605)
crgeary 5f6a99b
[gatsby-source-contentful] Delete original link regardless of ID vali…
sarahatwork ad71018
Publish
KyleAMathews f8d4f40
Create new page docs/creating-hybrid-pages-with-static-and-dynamic-co…
dominicfallows 6de400f
Add link to new docs page
KyleAMathews d023db2
Enable filtering on linked nodes (#3600)
alvinthen b53d822
Update comment
KyleAMathews abaaf42
Publish
KyleAMathews 5ffdaf0
Bundle Netlify CMS styles (#3611)
erquhart 2eb64d8
Fix images disappearing from rendered markdown files (#3612)
kripod 9aa445a
Revert "Enable filtering on linked nodes" (#3613)
KyleAMathews 8ef3ccf
Add yerevancoder (#3598)
fxfactorial 43cb33d
Publish
KyleAMathews 9e84510
Fix gatsby-remark-image (#3620)
KyleAMathews 925e6d6
Publish
KyleAMathews 8ac5f18
WordPress Media Download Basic Auth Fix (#3614)
flmuel 2333593
Publish
KyleAMathews cfe5d32
Set default auth object
KyleAMathews 240a519
Publish
KyleAMathews c9df375
Improve checks on authentication so have wiggle room in future
KyleAMathews 9935773
Publish
KyleAMathews 6b87e0d
Fix passing auth info to createRemoteFileNode (#3628)
KyleAMathews c1bfd74
Fix copying "dev-404-page.js" to the cache folder on Windows (#3627)
kripod 827edbc
Publish
KyleAMathews 27d89ed
Publish
KyleAMathews 6759fb7
Tweak copy on the new building apps with gatsby docs page (#3631)
KyleAMathews d82de7c
Added gatsby-starter-lumen
alxshelepenok 972016a
Add link to Gentics Mesh source community plugin (#3629)
Jotschi 02cb881
Add section about deploying with now to the docs (#3641)
hamlim 83050a5
docs: gatsby config options (#3095) (#3646)
amberleyromo 562c083
index.md (#3638)
kavanLi 02ae0c9
All the author info for Pierre (#3651)
shannonbux 2c50ce3
Strapi blog post content (#3618)
shannonbux b9791f5
Add tutorial series links to docs (#3634)
n370 3b033cf
[WIP] Update Gatsbygram to make it work with current (unofficial) JSO…
9d80bcf
Contributing (#3619)
shannonbux 526db89
[gatsby-transformer-remark] Add `htmlAst` field (#3596)
ryaninvents d2c30ef
Publish
KyleAMathews a354d8b
Update building-apps-with-gatsby.md (#3653)
calcsam d76d4a9
fix extract-text--webpack-plugin instance reuse errors (#3652)
erquhart dbc7a1b
Publish
KyleAMathews 0011656
Minor change to tutorial part four index.md (#3649)
danielemesh af6afcb
Added deploy task to gh-pages in Org pages (#3642)
leandrw 3f0fd1f
Added community plugin: gatsby-plugin-pathdata (#3644)
barskern 414d0bd
Add gatsby-starter-strict (#3645)
kripod ade0ff6
blog: add getting started with gatsby and wordpress (#3647)
amberleyromo 785e4f7
[www] Search shortcut (#3654)
m-allanson dba20b2
Remove note about their being more parts to the tutorial (#3655)
KyleAMathews 4e6aa9a
Add images in Strapi tutorial (#3660)
pierreburgy 8dbdf2b
added gatsby ^1.0.0 as a peer dependency for all plugins (#3637)
tsriram dd03f4c
README showcase update (#3661)
Harrison1 46bed46
Add gatsby-starter-portfolio-emilia (#3664)
LekoArts 5d360d6
[gatsby-source-medium] fetch users and publications (#3623)
racedale 44d7ac9
Publish
KyleAMathews 46f356a
[gatsby-source-contentful] Make base64 query to field-level to speed …
sarahatwork c5d205e
Publish
KyleAMathews e4a64ee
show help and recommend when the command is wrong (#3668)
cricrio 02eb3da
Fix gatsby-starter-portfolio-emilia PR (#3667)
LekoArts bda4c72
Add Flooring Factories Outlets to Showcase (#3666)
akadop 97e8a7c
Publish
KyleAMathews 1217a00
Add a podcast website/player to the showcase (#3672)
AbeEstrada 2c99cbf
[www] Update/consolidate palette, monogram and logo, favicons (#3639)
fk 4f6a239
Update building-apps-with-gatsby.md
KyleAMathews 3f60eda
Merge branch 'master' of https://github.com/gatsbyjs/gatsby
jastack c9459f7
Add plugins.js and searchbar-body.js for searching and displaying gat…
jastack 8486bf0
Remove unneccesary css
jastack f2467b0
Removed package-lock.json and renamed plugins.js to packages.js
jastack 06f58ff
Add algolia-npm search and url syncing
jastack 1891a85
Add background color when plugin selected
jastack b832e70
Fix doubling-up layout bug, add border to hits component, add margin …
jastack 0273f12
Remove unnecessary dependencies from package.json
jastack 4c3d038
Remove withUrlSync.js
jastack 9194b76
Change Algolia link from Link to a tag
jastack 9e183bf
Add gatsby-component as keyword search, change searchbox placeholder
jastack 457335a
Add email-validator to package.json to merge with updated site
jastack f1b88ec
Add source plugin to pull in npm package info, add metadata to cards …
jastack 16f0c59
Remove results display when no results
jastack a08b581
Remove multiple div
jastack 45c01a8
Remove startes and filters from packages description
jastack 610d83d
Fix merge conflicts
jastack 5a4b511
Update searchbar styles
jastack 86b8308
Remove searchbar scroll
jastack 55136bb
Update packages.js
jastack ed42acb
Empty commit
jastack a403325
Empty commit
jastack 47da85d
Merge branch 'master' of https://github.com/gatsbyjs/gatsby
jastack 82f797e
Add plugins.js and searchbar-body.js for searching and displaying gat…
jastack 2e47389
Remove unneccesary css
jastack a32b9ca
Removed package-lock.json and renamed plugins.js to packages.js
jastack 08ecb97
Add algolia-npm search and url syncing
jastack 00639a8
Add background color when plugin selected
jastack 78bd170
Fix doubling-up layout bug, add border to hits component, add margin …
jastack 11692b2
Remove unnecessary dependencies from package.json
jastack d9413e0
Remove withUrlSync.js
jastack 14e1bca
Change Algolia link from Link to a tag
jastack 397308b
Add gatsby-component as keyword search, change searchbox placeholder
jastack 3dc2df6
Add email-validator to package.json to merge with updated site
jastack 39c0fa5
Add source plugin to pull in npm package info, add metadata to cards …
jastack 6a5dc7c
Remove results display when no results
jastack c007b3f
Remove multiple div
jastack 5f446a2
Remove startes and filters from packages description
jastack fdb3c3f
Add plugins.js and searchbar-body.js for searching and displaying gat…
jastack 4ee73f7
Remove unneccesary css
jastack dd6b9ec
Removed package-lock.json and renamed plugins.js to packages.js
jastack 05ec13b
Add algolia-npm search and url syncing
jastack 22349bf
Add background color when plugin selected
jastack d5e4a67
Fix doubling-up layout bug, add border to hits component, add margin …
jastack 9807e5b
Remove unnecessary dependencies from package.json
jastack de22f28
Remove withUrlSync.js
jastack 45a0d2f
Change Algolia link from Link to a tag
jastack 9e147ca
Add email-validator to package.json to merge with updated site
jastack c6d8e7b
Add source plugin to pull in npm package info, add metadata to cards …
jastack 2bb8d13
Remove results display when no results
jastack ce4878f
Remove multiple div
jastack 96c4839
Remove startes and filters from packages description
jastack a6ce75b
Update searchbar styles
jastack 9224b8e
Remove searchbar scroll
jastack a0987d0
Update packages.js
jastack dd20c4c
Empty commit
jastack 9976291
Update template-docs to account for both local and remote packages
jastack 8d32524
Remove duplicate code
jastack 99da0b6
Fix merge conflicts
jastack cb316ca
Remove commented out code
jastack 350b3ff
Merge remote-tracking branch 'upstream/master'
gillkyle 20a8054
linting fixes to run tests
gillkyle 9c153ff
Merge remote-tracking branch 'upstream/master'
gillkyle 9a1235f
Merge branch 'master' into plugins-fixes, resolving dependency issues
gillkyle 771cf35
removed package-lock
gillkyle 708dce8
minor fixes to html head, package.json description, TODO notes
gillkyle 4479e4c
minor fixes across files in prep for merge
gillkyle dafdbb4
removed unused icons
gillkyle 6128a86
Merge branch 'master' into plugins-fixes
gillkyle c7062e9
removed unused gatsby-browser.js, used createNodeId on readmes
gillkyle 8a8cbee
Merge remote-tracking branch 'upstream/master'
gillkyle c7bea21
Merge branch 'master' into plugins-fixes
gillkyle 82c64e4
Merge remote-tracking branch 'upstream/master'
gillkyle f5ef7e0
Merge branch 'master' into plugins-fixes
gillkyle 2198108
conditional rendering for packages that aren't found, UI tweaks to se…
gillkyle c0220da
plugin library mobile layout
gillkyle 0a21870
Merge remote-tracking branch 'upstream/master'
gillkyle bcb75bd
Merge branch 'master' into plugins-fixes
gillkyle 23ac85b
2nd implementation of mobile ui
gillkyle 94e9e6d
Merge remote-tracking branch 'upstream/master'
gillkyle b1e9cda
Merge branch 'master' into plugins-fixes
gillkyle d3f602b
Fix getting access to createNodeId
KyleAMathews dcc5b54
css deletions overhaul
gillkyle 3cacd0d
separate components for template doc packages
gillkyle e94abfc
using package readme component on template doc packages
gillkyle 16ac490
Merge remote-tracking branch 'upstream/master'
gillkyle 779f518
Merge branch 'master' into plugins-fixes
gillkyle fe18055
added missing dependencies (date-fns and react-instant-search) to pac…
gillkyle c5e7bf6
keeping undefined objects from being accessed with default values, co…
gillkyle 3e6c48c
fix loadNodeContent error, remove old comments
gillkyle 159126c
added infinite scroll for plugins
gillkyle 86ecd9a
Merge remote-tracking branch 'upstream/master'
gillkyle 473ca9b
Merge branch 'master' into plugins-fixes
gillkyle 4695344
highlighting results list with pagination fix
gillkyle 41b8362
Merge remote-tracking branch 'upstream/master'
gillkyle dc290f8
Merge branch 'master' into plugins-fixes
gillkyle 6a0af0f
refactor create page logic to make sure all packages have pages creat…
gillkyle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/*.js | ||
!index.js | ||
yarn.lock | ||
gatsby-node.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
*.un~ | ||
yarn.lock | ||
src | ||
flow-typed | ||
coverage | ||
decls | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# gatsby-source-npm-package-search | ||
|
||
This plugin uses Yarn's Algolia search to import all gatsby-related package info (any package with the gatsby-component or gatsby-plugin keyword). Check back for updates to search for other npm packages based on keyword. | ||
|
||
## Install | ||
`npm install --save gatsby-source-npm` | ||
|
||
## How to use | ||
|
||
```javascript | ||
// In your gatsby-config.js | ||
plugins: [ | ||
resolve: `gatsby-source-npm`, | ||
options: { | ||
keywords: [`keyword1`, `keyword2`] | ||
} | ||
] | ||
``` | ||
|
||
## How to query | ||
|
||
You can query npm nodes like the following | ||
|
||
```graphql | ||
{ | ||
allNpmPackages{ | ||
edges{ | ||
node{ | ||
name | ||
humanDownloadsLast30Days | ||
readme{ | ||
childMarkdownRemark{ | ||
html | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// noop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "gatsby-source-npm-package-search", | ||
"version": "1.0.1", | ||
"description": "Search gatsby plugins and pull metadata with algolia search", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "babel src --out-dir . --ignore __tests__", | ||
"watch": "babel -w src --out-dir . --ignore __tests__", | ||
"prepublish": "cross-env NODE_ENV=production npm run build" | ||
}, | ||
"keywords": ["gatsby"], | ||
"author": "james.a.stack@gmail.com", | ||
"license": "MIT", | ||
"dependencies": { | ||
"algoliasearch": "^3.24.9", | ||
"babel-runtime": "^6.26.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"cross-env": "^5.0.5" | ||
} | ||
} |
Empty file.
80 changes: 80 additions & 0 deletions
80
packages/gatsby-source-npm-package-search/src/gatsby-node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
const algoliasearch = require(`algoliasearch`) | ||
const crypto = require(`crypto`) | ||
|
||
const client = algoliasearch(`OFCNCOG2CU`, `f54e21fa3a2a0160595bb058179bfb1e`) | ||
var index = client.initIndex(`npm-search`) | ||
|
||
const createContentDigest = obj => | ||
crypto | ||
.createHash(`md5`) | ||
.update(JSON.stringify(obj)) | ||
.digest(`hex`) | ||
|
||
exports.sourceNodes = async ( | ||
{ boundActionCreators, createNodeId }, | ||
{ keywords } | ||
) => { | ||
const { createNode } = boundActionCreators | ||
|
||
console.log(`Grabbing local NPM packages...`) | ||
|
||
let buildFilter = [] | ||
|
||
keywords.forEach(keyword => { | ||
buildFilter.push(`keywords:${keyword}`) | ||
}) | ||
|
||
const data = await index.search({ | ||
query: ``, | ||
filters: `(${buildFilter.join(` OR `)})`, | ||
hitsPerPage: 1000, | ||
}) | ||
|
||
data.hits.forEach(hit => { | ||
// commented changed remove all badges and images from readme content to keep the creation of the node from failing below | ||
// if (hit.readme.includes(`![`)) { | ||
// hit.readme = hit.readme.replace(/[[]?!\[.*\b/gi, ``) | ||
// console.log(hit.name) | ||
// } | ||
|
||
const parentId = createNodeId(`plugin ${hit.objectID}`) | ||
const readmeNode = { | ||
id: createNodeId(`readme ${hit.objectID}`), | ||
parent: parentId, | ||
slug: `/packages/en/${hit.objectID}`, | ||
children: [], | ||
internal: { | ||
type: `NPMPackageReadme`, | ||
mediaType: `text/markdown`, | ||
content: hit.readme !== undefined ? hit.readme : ``, | ||
}, | ||
} | ||
readmeNode.internal.contentDigest = createContentDigest(readmeNode) | ||
// Remove unneeded data | ||
delete hit.readme | ||
delete hit._highlightResult | ||
delete hit.versions | ||
|
||
const node = { | ||
...hit, | ||
deprecated: `${hit.deprecated}`, | ||
created: new Date(hit.created), | ||
modified: new Date(hit.modified), | ||
id: parentId, | ||
parent: null, | ||
children: [], | ||
slug: `/packages/${hit.objectID}/`, | ||
readme___NODE: readmeNode.id, | ||
title: `${hit.objectID}`, | ||
internal: { | ||
type: `NPMPackage`, | ||
content: hit.readme !== undefined ? hit.readme : ``, | ||
}, | ||
} | ||
node.internal.contentDigest = createContentDigest(node) | ||
createNode(readmeNode) | ||
createNode(node) | ||
}) | ||
|
||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't finished — the idea here is for packages in this repo to use that README instead of what's grabbed from Algolia. The reason is that the Algolia README often doesn't have good links to images.
So take this
localPackagesArr
and use it to filter out the result of the query below getting all NPM package names.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand exactly what needs to change on this, do you mean
localPackagesArr
would give the readme data to thetemplate-docs-packages.js
file so that we don't have to rely on Algolia for the readmes? From what I understand that's what it's doing now. So the data displayed would be from the local folders rather than Algolia's search of npm that struggles with images?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah — Algolia (via NPM) has a copy of the READMEs for packages in this repo. We'd prefer to use those as they any referenced images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came back to this this evening to look into finishing it up, sorry for the confusion on this, I want to make sure I can wrap my head around the actual issue though.
As of now
www/gatsby-node
is creating all the pages for the packages library based off of its own query ofallNpmPackage
(which is just getting all the names to create the pages, when I run that query in GraphiQL I don't see html returned for all the packages, just a handful of them). So to fill in the content on each page thetemplate-docs-packages.js
has it's own query that's filling the content on the screen from themarkdownRemark
type. Apparently there are packages that have images in their readme and they're causing errors? Do we know what any of those packages are?And then the packages that are fetched but aren't in the docs (like the typegen packages) should be filtered out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should create two template components. One for local packages and the other for remote. They'd share the same components for rendering data but the local package would query the local README while remote packages would query the NPM readme. Make sense?
So when you're creating pages, filter out of the NPM packages anything in
localPackagesArr
and then create pages forlocalPackagesArr
w/ the local package template.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I'm getting on this now, thanks for the explanation that helps a lot 🙂
So rather than just having the template-docs-packages that renders local and remote packages, there will be two templates for the packages (like template-docs-local-packages/template-docs-remote-packages) that renders its respective data.