-
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
[feat] Extract internal plugin for automatically creating pages so we can reuse for other directories #4490
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3d1b166
[feat] create page creator plugin
nodox e116257
Not sure what I am doing.
nodox 601c8f1
remove internal auto page creator
nodox 87e5a16
update readme
nodox d636e09
resolve plugin attributes
nodox c0588de
[feat] create page creator plugin
nodox 9e11a16
Update README.md
KyleAMathews aac2e89
Update package.json
KyleAMathews 8f803f4
cleanup the old component-page-creator
nodox e58a328
Merge branch 'plugin-page-creator' of github.com:nodox/gatsby into pl…
nodox 9f7e69c
Merge remote-tracking branch 'upstream/master' into plugin-page-creator
pieh 87001d7
simplify loading default `gatsby-plugin-page-creator` plugin using ex…
pieh 1f8c7d6
add option to skip strict path existence check and use it in default …
pieh 8939a4b
slash default path, update snapshot
pieh eb02d69
move tests to src
pieh 45c5827
update package description
pieh 3919910
add used packages to dependencies
pieh 778e427
Update URL
m-allanson 32edb33
Mention React
m-allanson 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
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,32 @@ | ||
# 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 | ||
|
||
decls | ||
dist | ||
|
||
/*.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,36 @@ | ||
# gatsby-plugin-page-creator | ||
|
||
Gatsby plugin that automatically creates pages from React components in specified directories. Gatsby | ||
includes this plugin automatically in all sites for creating pages from components in `src/pages`. | ||
|
||
## Install | ||
|
||
`npm install --save gatsby-plugin-page-creator` | ||
|
||
## How to use | ||
|
||
```javascript | ||
// gatsby-config.js | ||
|
||
module.exports = { | ||
plugins: [ | ||
// You can have multiple instances of this plugin | ||
// to create pages from React components in different directories. | ||
// | ||
// The following sets up the pattern of having multiple | ||
// "pages" directories in your project | ||
{ | ||
resolve: `gatsby-plugin-page-creator`, | ||
options: { | ||
path: `${__dirname}/src/account/pages`, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-plugin-page-creator`, | ||
options: { | ||
path: `${__dirname}/src/settings/pages`, | ||
}, | ||
}, | ||
], | ||
}; | ||
``` |
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,33 @@ | ||
{ | ||
"name": "gatsby-plugin-page-creator", | ||
"version": "1.0.0", | ||
"description": "Gatsby plugin that automatically creates pages from React components in specified directories", | ||
"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", | ||
"gatsby-plugin" | ||
], | ||
"author": "Kyle Mathews <mathews.kyle@gmail.com>", | ||
"contributors": [ | ||
"Steven Natera <tektekpush@gmail.com> (https://twitter.com/stevennatera)" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"babel-runtime": "^6.26.0", | ||
"bluebird": "^3.5.0", | ||
"chokidar": "^1.7.0", | ||
"glob": "^7.1.1", | ||
"lodash": "^4.17.4", | ||
"parse-filepath": "^1.0.1", | ||
"slash": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"cross-env": "^5.0.5" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
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
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
12 changes: 0 additions & 12 deletions
12
packages/gatsby/src/internal-plugins/component-page-creator/package.json
This file was deleted.
Oops, something went wrong.
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
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.
adding
pathCheck
and setting to false in default gatsby config is hacky way to address #4490 (review) :Is this fine?
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 seems Ok to me? it could be given an awkward name to discourage people from using it -
__dangerouslyIgnoreMissingPathsWithoutErroringAreYouSureYouWantToDoThis
? (or similar)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 option is not documented in README, so they would have to dive into code to discover it and even then I don't consider it harmless if they use that option
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.
👍