Skip to content
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 284 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
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 Jan 10, 2018
396ae6e
page path defaults to '/' (#3325)
luczaki114 Jan 10, 2018
3492447
Use graymatter excerpt in gatsby-transformer-remark (#2883)
reccanti Jan 10, 2018
771f241
handles integer with valida date format correctly (#3461)
Khaledgarbaya Jan 10, 2018
9c1935a
Upgrade style-loader to fix CSS modules issue (#3283)
eramdam Jan 10, 2018
95e5af7
format/bootstrap
KyleAMathews Jan 10, 2018
03c19fb
Publish
KyleAMathews Jan 10, 2018
de876dd
Updated links for Glamor and Styled Components (#3462)
virenb Jan 10, 2018
c881201
Update tutorial.js
KyleAMathews Jan 10, 2018
f1eb95c
Add link to the using-remark website
KyleAMathews Jan 10, 2018
65e851f
Don't create pages for test files (#3464)
kpollich Jan 10, 2018
74b1ebe
Add gatsby-source-behance to plugins list (#3465)
LekoArts Jan 10, 2018
60c0533
activated mergeLinkHeaders (#3463)
zionis137 Jan 10, 2018
5ad3b38
Add cache-control examples to caching docs page (#3468)
KyleAMathews Jan 11, 2018
4c1bbeb
Publish
KyleAMathews Jan 11, 2018
4ef16d0
Revert "Upgrade style-loader to fix CSS modules issue (#3283)"
KyleAMathews Jan 11, 2018
ec1b7ac
Publish
KyleAMathews Jan 11, 2018
80775eb
Fix Links Redirection (#3471)
deadcoder0904 Jan 11, 2018
74be3d8
Fix typo (#3470)
deepakjois Jan 11, 2018
b007e5a
Update tutorial-links.yml
KyleAMathews Jan 11, 2018
d4cc9f1
Cleanup Glamor / Styled Component mini-tutorials (#3474)
KyleAMathews Jan 11, 2018
f9846a2
Fix typo in building with components section (#3476)
dannywils Jan 11, 2018
84c31f6
Fix typo (#3477)
LekoArts Jan 11, 2018
f95f249
Update Deploy Gatsby page - Gitlab Pages (#3482)
travis-r6s Jan 11, 2018
3fbba4e
correct key behavior (#3483)
calcsam Jan 11, 2018
bbc764c
Publish
KyleAMathews Jan 11, 2018
5d3a508
Add Strata starter (#3488)
ChangoMan Jan 12, 2018
2f4cf0e
Use `_.isPlainObject` to prevent false Array positives (#3490)
Jan 12, 2018
3c1fa01
Publish
KyleAMathews Jan 12, 2018
2fba7b4
update styled-jsx dep in gatsby-plugin-styled-jsx (#3493)
zgreen Jan 12, 2018
cee6352
Publish
KyleAMathews Jan 12, 2018
b6ae588
gatsby-image docs (#3500)
gillkyle Jan 12, 2018
94b2b7a
Easy edits based off of observing Eden go thru tutorials (#3501)
shannonbux Jan 12, 2018
e5b24d4
[gatsby] don't run service-workers outside of https or localhost (#…
busticated Jan 12, 2018
08a0ae0
format
KyleAMathews Jan 12, 2018
b812df8
Publish
KyleAMathews Jan 12, 2018
9341256
Properly use `withPrefix` in adding-images-fonts-files docs (#3503)
trotzig Jan 12, 2018
d0f58e0
Create new npm keyword for gatsby components (#3507)
KyleAMathews Jan 13, 2018
86b5d9d
Publish
KyleAMathews Jan 13, 2018
7c2982d
Fix typo in docs (#3511)
adrienharnay Jan 13, 2018
6144049
Add Netlify CMS plugin, related docs (#3509)
erquhart Jan 13, 2018
71f939a
Publish
KyleAMathews Jan 13, 2018
c079cf2
Fix clone instructions (#3514)
KyleAMathews Jan 13, 2018
07dd840
Search and replace the hostname in URLs. (#3498)
moshie Jan 14, 2018
8d39adf
Add documentation on adding list of blog posts (#3510)
adrienharnay Jan 14, 2018
d4946b1
[DOCS] Adding Markdown pages: Remove useless fields (#3517)
adrienharnay Jan 14, 2018
1a4e765
[DOCS] Links: Remove emphasis from implem stubs (#3518)
adrienharnay Jan 14, 2018
a3194fc
fix link (#3513)
roman-kosov Jan 14, 2018
3360f7d
Add missing comma in sitemap example (#3520)
danoc Jan 15, 2018
d19cc12
Move inlined webpack manifest to the end of body element (#3519)
szimek Jan 15, 2018
20d856c
Adds email capture to bottom of blog (#3333)
benjaminhoffman Jan 15, 2018
e5a71eb
Fix `gatsby-plugin-nprogress` default options param (#3533)
Jan 15, 2018
e303054
Format
KyleAMathews Jan 15, 2018
88f77e2
Publish
KyleAMathews Jan 15, 2018
c6f5fb1
Don't use internal name when reporting there's an error in gatsby-nod…
KyleAMathews Jan 15, 2018
fb06047
Publish
KyleAMathews Jan 15, 2018
7d70a07
Add Developer Ecosystem to websites (#3540)
durkinio Jan 16, 2018
870e05c
Removes words like 'simple' & 'easy' from docs/www (#3523)
benjaminhoffman Jan 16, 2018
3912e79
cpinnix/verious starter (#3543)
cpinnix Jan 16, 2018
ccd179c
gatsby-plugin-sharp: Remove warning for resolutions when requested wi…
dannywils Jan 16, 2018
301833e
Add to instructions that you need gatsby-plugin-sharp fixes #3545 (#3…
KyleAMathews Jan 16, 2018
bc433fb
Update katex package to 0.8.3 (#3548)
thomask-gh Jan 16, 2018
2b0996c
add unique titles to docs, tutorial, blog (#3550)
Jan 16, 2018
9528157
Fix typo in KaTeX usage example (#3549)
thomask-gh Jan 16, 2018
efb237e
format
KyleAMathews Jan 16, 2018
a838d81
Publish
KyleAMathews Jan 16, 2018
5c71c64
[www] Fix <link rel=„author“> href (#3555)
fk Jan 16, 2018
cb7c848
[www] Fix email-capture-form cross browser issues (#3553)
fk Jan 16, 2018
878f821
Add docs page with overview of Gatsby's usage of GraphQL (#3557)
KyleAMathews Jan 16, 2018
6e6933a
Debugging HTML Builds - fix copy&paste error (#3565)
zionis137 Jan 17, 2018
b74a2ea
Update outdated snapshot (#3566)
KyleAMathews Jan 18, 2018
6854d7d
Update readme with demo link (#3573)
RyKilleen Jan 18, 2018
9efb99f
Move script loader after webpack manifest (#3569)
szimek Jan 18, 2018
e882c31
Publish
KyleAMathews Jan 18, 2018
e2d50bb
Added 'Steve Meredith's Portfolio' to 'Showcase' (#3576)
Steveeeie Jan 18, 2018
d2d4f02
City of Boston case study blog post (#3583)
calcsam Jan 18, 2018
edee33b
Add Put.io landing page to showcase (#3580)
altaywtf Jan 18, 2018
0739bd5
Allow arrays with more than one file path & ignore empty strings (#3577)
KyleAMathews Jan 18, 2018
10cc9d2
Publish
KyleAMathews Jan 18, 2018
252b2ca
Add search form to site (#3421)
m-allanson Jan 18, 2018
31cc5e8
Some minor edits (#3586)
shannonbux Jan 18, 2018
3390a5f
Add sample code showing off gatsby-image + image processing to query …
KyleAMathews Jan 18, 2018
a9d9c4f
Improve documentation for createParentChildLink (#3594)
KyleAMathews Jan 19, 2018
ff7de90
Some updates to the awesome gatsby page (#3595)
KyleAMathews Jan 19, 2018
037914e
Add Ryan Wiemer's Portfolio to the showcase (#3578)
ryanwiemer Jan 19, 2018
c065540
Updated Plugins.md (#3593)
iKonrad Jan 19, 2018
b352e42
[www] Add gatsby-plugin-postcss-sass (#3590)
fk Jan 19, 2018
b78b2bf
[www] Improve docsearch UI for small devices (#3597)
fk Jan 19, 2018
edcfb2f
Add section why GraphQL is *cool* (#3606)
KyleAMathews Jan 19, 2018
c54f190
[www] Increase navigation z-index (#3599)
fk Jan 19, 2018
69764bb
Added `gatsby-plugin-bugherd` to community plugins (#3605)
crgeary Jan 19, 2018
5f6a99b
[gatsby-source-contentful] Delete original link regardless of ID vali…
sarahatwork Jan 19, 2018
ad71018
Publish
KyleAMathews Jan 19, 2018
f8d4f40
Create new page docs/creating-hybrid-pages-with-static-and-dynamic-co…
dominicfallows Jan 19, 2018
6de400f
Add link to new docs page
KyleAMathews Jan 19, 2018
d023db2
Enable filtering on linked nodes (#3600)
alvinthen Jan 19, 2018
b53d822
Update comment
KyleAMathews Jan 19, 2018
abaaf42
Publish
KyleAMathews Jan 19, 2018
5ffdaf0
Bundle Netlify CMS styles (#3611)
erquhart Jan 19, 2018
2eb64d8
Fix images disappearing from rendered markdown files (#3612)
kripod Jan 19, 2018
9aa445a
Revert "Enable filtering on linked nodes" (#3613)
KyleAMathews Jan 19, 2018
8ef3ccf
Add yerevancoder (#3598)
fxfactorial Jan 19, 2018
43cb33d
Publish
KyleAMathews Jan 19, 2018
9e84510
Fix gatsby-remark-image (#3620)
KyleAMathews Jan 20, 2018
925e6d6
Publish
KyleAMathews Jan 20, 2018
8ac5f18
WordPress Media Download Basic Auth Fix (#3614)
flmuel Jan 20, 2018
2333593
Publish
KyleAMathews Jan 20, 2018
cfe5d32
Set default auth object
KyleAMathews Jan 20, 2018
240a519
Publish
KyleAMathews Jan 20, 2018
c9df375
Improve checks on authentication so have wiggle room in future
KyleAMathews Jan 20, 2018
9935773
Publish
KyleAMathews Jan 20, 2018
6b87e0d
Fix passing auth info to createRemoteFileNode (#3628)
KyleAMathews Jan 20, 2018
c1bfd74
Fix copying "dev-404-page.js" to the cache folder on Windows (#3627)
kripod Jan 20, 2018
827edbc
Publish
KyleAMathews Jan 20, 2018
27d89ed
Publish
KyleAMathews Jan 20, 2018
6759fb7
Tweak copy on the new building apps with gatsby docs page (#3631)
KyleAMathews Jan 20, 2018
d82de7c
Added gatsby-starter-lumen
alxshelepenok Jan 21, 2018
972016a
Add link to Gentics Mesh source community plugin (#3629)
Jotschi Jan 21, 2018
02cb881
Add section about deploying with now to the docs (#3641)
hamlim Jan 21, 2018
83050a5
docs: gatsby config options (#3095) (#3646)
amberleyromo Jan 22, 2018
562c083
index.md (#3638)
kavanLi Jan 22, 2018
02ae0c9
All the author info for Pierre (#3651)
shannonbux Jan 22, 2018
2c50ce3
Strapi blog post content (#3618)
shannonbux Jan 22, 2018
b9791f5
Add tutorial series links to docs (#3634)
n370 Jan 22, 2018
3b033cf
[WIP] Update Gatsbygram to make it work with current (unofficial) JSO…
Jan 22, 2018
9d80bcf
Contributing (#3619)
shannonbux Jan 22, 2018
526db89
[gatsby-transformer-remark] Add `htmlAst` field (#3596)
ryaninvents Jan 22, 2018
d2c30ef
Publish
KyleAMathews Jan 22, 2018
a354d8b
Update building-apps-with-gatsby.md (#3653)
calcsam Jan 22, 2018
d76d4a9
fix extract-text--webpack-plugin instance reuse errors (#3652)
erquhart Jan 22, 2018
dbc7a1b
Publish
KyleAMathews Jan 22, 2018
0011656
Minor change to tutorial part four index.md (#3649)
danielemesh Jan 22, 2018
af6afcb
Added deploy task to gh-pages in Org pages (#3642)
leandrw Jan 22, 2018
3f0fd1f
Added community plugin: gatsby-plugin-pathdata (#3644)
barskern Jan 22, 2018
414d0bd
Add gatsby-starter-strict (#3645)
kripod Jan 22, 2018
ade0ff6
blog: add getting started with gatsby and wordpress (#3647)
amberleyromo Jan 23, 2018
785e4f7
[www] Search shortcut (#3654)
m-allanson Jan 23, 2018
dba20b2
Remove note about their being more parts to the tutorial (#3655)
KyleAMathews Jan 23, 2018
4e6aa9a
Add images in Strapi tutorial (#3660)
pierreburgy Jan 23, 2018
8dbdf2b
added gatsby ^1.0.0 as a peer dependency for all plugins (#3637)
tsriram Jan 23, 2018
dd03f4c
README showcase update (#3661)
Harrison1 Jan 23, 2018
46bed46
Add gatsby-starter-portfolio-emilia (#3664)
LekoArts Jan 23, 2018
5d360d6
[gatsby-source-medium] fetch users and publications (#3623)
racedale Jan 23, 2018
44d7ac9
Publish
KyleAMathews Jan 23, 2018
46f356a
[gatsby-source-contentful] Make base64 query to field-level to speed …
sarahatwork Jan 23, 2018
c5d205e
Publish
KyleAMathews Jan 23, 2018
e4a64ee
show help and recommend when the command is wrong (#3668)
cricrio Jan 23, 2018
02eb3da
Fix gatsby-starter-portfolio-emilia PR (#3667)
LekoArts Jan 23, 2018
bda4c72
Add Flooring Factories Outlets to Showcase (#3666)
akadop Jan 23, 2018
97e8a7c
Publish
KyleAMathews Jan 23, 2018
1217a00
Add a podcast website/player to the showcase (#3672)
AbeEstrada Jan 24, 2018
2c99cbf
[www] Update/consolidate palette, monogram and logo, favicons (#3639)
fk Jan 24, 2018
4f6a239
Update building-apps-with-gatsby.md
KyleAMathews Jan 24, 2018
3f60eda
Merge branch 'master' of https://github.com/gatsbyjs/gatsby
jastack Jan 24, 2018
c9459f7
Add plugins.js and searchbar-body.js for searching and displaying gat…
jastack Jan 9, 2018
8486bf0
Remove unneccesary css
jastack Jan 9, 2018
f2467b0
Removed package-lock.json and renamed plugins.js to packages.js
jastack Jan 10, 2018
06f58ff
Add algolia-npm search and url syncing
jastack Jan 12, 2018
1891a85
Add background color when plugin selected
jastack Jan 12, 2018
b832e70
Fix doubling-up layout bug, add border to hits component, add margin …
jastack Jan 12, 2018
0273f12
Remove unnecessary dependencies from package.json
jastack Jan 12, 2018
4c3d038
Remove withUrlSync.js
jastack Jan 13, 2018
9194b76
Change Algolia link from Link to a tag
jastack Jan 13, 2018
9e183bf
Add gatsby-component as keyword search, change searchbox placeholder
jastack Jan 13, 2018
457335a
Add email-validator to package.json to merge with updated site
jastack Jan 17, 2018
f1b88ec
Add source plugin to pull in npm package info, add metadata to cards …
jastack Jan 24, 2018
16f0c59
Remove results display when no results
jastack Jan 24, 2018
a08b581
Remove multiple div
jastack Jan 24, 2018
45c01a8
Remove startes and filters from packages description
jastack Jan 24, 2018
610d83d
Fix merge conflicts
jastack Jan 24, 2018
5a4b511
Update searchbar styles
jastack Jan 24, 2018
86b8308
Remove searchbar scroll
jastack Jan 24, 2018
55136bb
Update packages.js
jastack Jan 25, 2018
ed42acb
Empty commit
jastack Jan 25, 2018
a403325
Empty commit
jastack Jan 25, 2018
47da85d
Merge branch 'master' of https://github.com/gatsbyjs/gatsby
jastack Jan 26, 2018
82f797e
Add plugins.js and searchbar-body.js for searching and displaying gat…
jastack Jan 9, 2018
2e47389
Remove unneccesary css
jastack Jan 9, 2018
a32b9ca
Removed package-lock.json and renamed plugins.js to packages.js
jastack Jan 10, 2018
08ecb97
Add algolia-npm search and url syncing
jastack Jan 12, 2018
00639a8
Add background color when plugin selected
jastack Jan 12, 2018
78bd170
Fix doubling-up layout bug, add border to hits component, add margin …
jastack Jan 12, 2018
11692b2
Remove unnecessary dependencies from package.json
jastack Jan 12, 2018
d9413e0
Remove withUrlSync.js
jastack Jan 13, 2018
14e1bca
Change Algolia link from Link to a tag
jastack Jan 13, 2018
397308b
Add gatsby-component as keyword search, change searchbox placeholder
jastack Jan 13, 2018
3dc2df6
Add email-validator to package.json to merge with updated site
jastack Jan 17, 2018
39c0fa5
Add source plugin to pull in npm package info, add metadata to cards …
jastack Jan 24, 2018
6a5dc7c
Remove results display when no results
jastack Jan 24, 2018
c007b3f
Remove multiple div
jastack Jan 24, 2018
5f446a2
Remove startes and filters from packages description
jastack Jan 24, 2018
fdb3c3f
Add plugins.js and searchbar-body.js for searching and displaying gat…
jastack Jan 9, 2018
4ee73f7
Remove unneccesary css
jastack Jan 9, 2018
dd6b9ec
Removed package-lock.json and renamed plugins.js to packages.js
jastack Jan 10, 2018
05ec13b
Add algolia-npm search and url syncing
jastack Jan 12, 2018
22349bf
Add background color when plugin selected
jastack Jan 12, 2018
d5e4a67
Fix doubling-up layout bug, add border to hits component, add margin …
jastack Jan 12, 2018
9807e5b
Remove unnecessary dependencies from package.json
jastack Jan 12, 2018
de22f28
Remove withUrlSync.js
jastack Jan 13, 2018
45a0d2f
Change Algolia link from Link to a tag
jastack Jan 13, 2018
9e147ca
Add email-validator to package.json to merge with updated site
jastack Jan 17, 2018
c6d8e7b
Add source plugin to pull in npm package info, add metadata to cards …
jastack Jan 24, 2018
2bb8d13
Remove results display when no results
jastack Jan 24, 2018
ce4878f
Remove multiple div
jastack Jan 24, 2018
96c4839
Remove startes and filters from packages description
jastack Jan 24, 2018
a6ce75b
Update searchbar styles
jastack Jan 24, 2018
9224b8e
Remove searchbar scroll
jastack Jan 24, 2018
a0987d0
Update packages.js
jastack Jan 25, 2018
dd20c4c
Empty commit
jastack Jan 25, 2018
9976291
Update template-docs to account for both local and remote packages
jastack Jan 26, 2018
8d32524
Remove duplicate code
jastack Jan 26, 2018
99da0b6
Fix merge conflicts
jastack Jan 26, 2018
cb316ca
Remove commented out code
jastack Jan 30, 2018
350b3ff
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 7, 2018
20a8054
linting fixes to run tests
gillkyle Feb 7, 2018
9c153ff
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 7, 2018
9a1235f
Merge branch 'master' into plugins-fixes, resolving dependency issues
gillkyle Feb 8, 2018
771cf35
removed package-lock
gillkyle Feb 8, 2018
708dce8
minor fixes to html head, package.json description, TODO notes
gillkyle Feb 8, 2018
4479e4c
minor fixes across files in prep for merge
gillkyle Feb 8, 2018
dafdbb4
removed unused icons
gillkyle Feb 9, 2018
6128a86
Merge branch 'master' into plugins-fixes
gillkyle Feb 9, 2018
c7062e9
removed unused gatsby-browser.js, used createNodeId on readmes
gillkyle Feb 11, 2018
8a8cbee
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 11, 2018
c7bea21
Merge branch 'master' into plugins-fixes
gillkyle Feb 11, 2018
82c64e4
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 14, 2018
f5ef7e0
Merge branch 'master' into plugins-fixes
gillkyle Feb 14, 2018
2198108
conditional rendering for packages that aren't found, UI tweaks to se…
gillkyle Feb 14, 2018
c0220da
plugin library mobile layout
gillkyle Feb 15, 2018
0a21870
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 15, 2018
bcb75bd
Merge branch 'master' into plugins-fixes
gillkyle Feb 15, 2018
23ac85b
2nd implementation of mobile ui
gillkyle Feb 17, 2018
94e9e6d
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 17, 2018
b1e9cda
Merge branch 'master' into plugins-fixes
gillkyle Feb 17, 2018
d3f602b
Fix getting access to createNodeId
KyleAMathews Feb 18, 2018
dcc5b54
css deletions overhaul
gillkyle Feb 21, 2018
3cacd0d
separate components for template doc packages
gillkyle Feb 24, 2018
e94abfc
using package readme component on template doc packages
gillkyle Feb 26, 2018
16ac490
Merge remote-tracking branch 'upstream/master'
gillkyle Feb 26, 2018
779f518
Merge branch 'master' into plugins-fixes
gillkyle Feb 26, 2018
fe18055
added missing dependencies (date-fns and react-instant-search) to pac…
gillkyle Feb 28, 2018
c5e7bf6
keeping undefined objects from being accessed with default values, co…
gillkyle Feb 28, 2018
3e6c48c
fix loadNodeContent error, remove old comments
gillkyle Mar 1, 2018
159126c
added infinite scroll for plugins
gillkyle Mar 4, 2018
86ecd9a
Merge remote-tracking branch 'upstream/master'
gillkyle Mar 4, 2018
473ca9b
Merge branch 'master' into plugins-fixes
gillkyle Mar 4, 2018
4695344
highlighting results list with pagination fix
gillkyle Mar 5, 2018
41b8362
Merge remote-tracking branch 'upstream/master'
gillkyle Mar 5, 2018
dc290f8
Merge branch 'master' into plugins-fixes
gillkyle Mar 5, 2018
6a0af0f
refactor create page logic to make sure all packages have pages creat…
gillkyle Mar 6, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/gatsby-source-npm-package-search/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*.js
!index.js
yarn.lock
gatsby-node.js
34 changes: 34 additions & 0 deletions packages/gatsby-source-npm-package-search/.npmignore
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
40 changes: 40 additions & 0 deletions packages/gatsby-source-npm-package-search/README.md
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
}
}
}
}
}
}
```
1 change: 1 addition & 0 deletions packages/gatsby-source-npm-package-search/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// noop
22 changes: 22 additions & 0 deletions packages/gatsby-source-npm-package-search/package.json
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 packages/gatsby-source-npm-package-search/src/gatsby-node.js
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
}
6 changes: 6 additions & 0 deletions www/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ module.exports = {
"MarkdownRemark.frontmatter.author": `AuthorYaml`,
},
plugins: [
{
resolve: `gatsby-source-npm-package-search`,
options: {
keywords: [`gatsby-plugin`, `gatsby-component`]
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
Expand Down
56 changes: 52 additions & 4 deletions www/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const fs = require(`fs-extra`)
const slash = require(`slash`)
const slugify = require(`limax`)

const localPackages = `../packages`
const localPackagesArr = []
fs.readdirSync(localPackages).forEach(file => {
Copy link
Contributor

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.

Copy link
Contributor Author

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 the template-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?

Copy link
Contributor

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.

Copy link
Contributor Author

@gillkyle gillkyle Feb 13, 2018

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 of allNpmPackage (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 the template-docs-packages.js has it's own query that's filling the content on the screen from the markdownRemark 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?

Copy link
Contributor

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 for localPackagesArr w/ the local package template.

Copy link
Contributor Author

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.

localPackagesArr.push(file)
})
// convert a string like `/some/long/path/name-of-docs/` to `name-of-docs`
const slugToAnchor = slug =>
slug
Expand All @@ -29,14 +34,17 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
const contributorPageTemplate = path.resolve(
`src/templates/template-contributor-page.js`
)
const packageTemplate = path.resolve(
`src/templates/template-docs-packages.js`
const localPackageTemplate = path.resolve(
`src/templates/template-docs-local-packages.js`
)
const remotePackageTemplate = path.resolve(
`src/templates/template-docs-remote-packages.js`
)
// Query for markdown nodes to use in creating pages.
resolve(
graphql(
`
{
query {
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 1000
Expand Down Expand Up @@ -65,6 +73,22 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
}
}
}
allNpmPackage {
edges {
node {
id
title
slug
readme {
id
childMarkdownRemark {
id
html
}
}
}
}
}
}
`
).then(result => {
Expand Down Expand Up @@ -122,7 +146,7 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
createPage({
path: `${edge.node.fields.slug}`, // required
component: slash(
edge.node.fields.package ? packageTemplate : docsTemplate
edge.node.fields.package ? localPackageTemplate : docsTemplate
),
context: {
slug: edge.node.fields.slug,
Expand All @@ -131,6 +155,30 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
}
})

const allPackages = result.data.allNpmPackage.edges
// Create package readme
allPackages.forEach(edge => {
if (_.includes(localPackagesArr, edge.node.title)) {
createPage({
path: edge.node.slug,
component: slash(localPackageTemplate),
context: {
slug: edge.node.slug,
id: edge.node.id,
},
})
} else {
createPage({
path: edge.node.slug,
component: slash(remotePackageTemplate),
context: {
slug: edge.node.slug,
id: edge.node.id,
},
})
}
})

return
})
)
Expand Down
2 changes: 2 additions & 0 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"bluebird": "^3.5.1",
"date-fns": "^1.29.0",
"email-validator": "^1.1.1",
"gatsby": "^1.9.210",
"gatsby-image": "^1.0.39",
Expand Down Expand Up @@ -47,6 +48,7 @@
"parse-filepath": "^1.0.2",
"react-helmet": "^5.2.0",
"react-icons": "^2.2.7",
"react-instantsearch": "^4.5.1",
"slash": "^1.0.0",
"typeface-space-mono": "^0.0.54",
"typeface-spectral": "^0.0.54",
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/markdown-page-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class MarkdownPageFooter extends React.Component {
}}
href={`https://github.com/gatsbyjs/gatsby/blob/master/${
this.props.packagePage ? `packages` : `docs`
}/${this.props.page.parent.relativePath}`}
}/${this.props.page ? this.props.page.parent.relativePath : ""}`}
>
<EditIcon css={{ fontSize: 20, position: `relative`, top: -2 }} />
{` `}
Expand Down
Loading