-
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
[1.0] Change directory structure #802
[1.0] Change directory structure #802
Conversation
Deploy preview ready! Built with commit 04a8508 |
Deploy preview ready! Built with commit 04a8508 |
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.
Hey! Another great PR. Love refactoring page extensions to use Redux plus the other small fixes.
Let's not allow people to change the rootPath
. First webpack/babel sometimes have trouble if they're processing files that are in different file directories. Second it seems to be a pointless option. What benefit is there to being able to change the root directory? A general rule for products is avoid all options unless they're absolutely necessary and I don't see setting rootPath to be absolutely necessary.
docs/docs/gatsby-on-windows.md
Outdated
|
||
## Installing dependencies without troubles. | ||
|
||
Even if you love using a pretty terminal as [hyper](https://hyper.is/) with a git bash, |
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.
no need to mention hyper here... Hyper is great but it's irrelevant to using Gatsby. My preferred "voice" for documentation is a "helpful, focused, and neutral".
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.
Ok ;) It's noted, I will correct this
I understand your point with So three options:
|
@@ -16,3 +16,7 @@ powershell console. On installing this package, it downloads and installs the | |||
Visual C++ Build Tools 2015, provided free of charge by Microsoft. These tools | |||
are required to compile popular native modules. It will also install Python | |||
2.7, configuring your machine and npm appropriately. | |||
|
|||
## Installing dependencies without troubles. |
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.
Is there some pages discussing this issue that you can link to?
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.
Just my personal experience for instant, but I can search ;)
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.
Looks like this is what you need to do to get Hyper setup vercel/hyper#946 (comment)
Perhaps just add this to the instructions instead of this section?
packages/gatsby-link/README.md
Outdated
</div> | ||
} | ||
``` | ||
|
||
In typescript: |
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 Typescript example is superfluous. It's 95% identical to the JS one and anyone writing Typescript would know how to translate the JS example to Typescript.
I can see value in maintaining code samples in different languages in the future but if we do, we'd want to put them in a toggleable interface so it's hiding the languages you're not interested in.
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.
No problem, it was just a proposition ;)
The problem isn't with moving js files into a deeper directory—it's if you move it out of the file tree into a different file tree e.g. the path to I'll think more about the idea of letting people move their files into a deeper directory ala your |
All is working! My test list:
[Edit] Arf my typescript starter as a last conflict between tsconfig/webpack but it's works for others projects without typescript ^^ |
.vscode/settings.json
Outdated
@@ -0,0 +1,6 @@ | |||
// Placez vos paramètres dans ce fichier pour remplacer les paramètres par défaut et les paramètres utilisateur. |
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.
Let's stick with english here :-)
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.
Daim! It's the auto-comment of my editor ^^
@@ -90,17 +91,20 @@ module.exports = async (program: any) => { | |||
|
|||
// Try opening the site's gatsby-config.js file. | |||
console.time(`open and validate gatsby-config.js`) | |||
let config = {} | |||
let config = { |
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.
Let's put defaults in Redux so data processing is centralized there.
This configuration works with basics configuration and with a custom `rootPath` (even with a typescript stack) It was tested with build and develop commands
// Then in the special directory of isomorphic modules Gatsby ships with. | ||
root: [directory, path.resolve(__dirname, `..`, `isomorphic`)], | ||
root: [ |
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.
Please revert this. I don't want multiple roots as in practice this is quite confusing. Just src should be a root now.
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.
Actually I'll just merge this and then make the change.
And thanks again for all the work here! Really nice PR! |
* Add a note on windows installation * Add missing dependencies into gatsby-plugin-typescript doc * Make HTMLPath configurable * Fix dev-cli readme * Use redux to managed program.extensions * Slashify all paths * Fix relativePath and clean no-used var * Get program.extensions from redux * Add a rootPath config * Some refactors * Run yarn format * Deal with config.rootPath for default layout * Fix bad rebase * Fix documention style * Add typescript definition for gatsby-link * Remove superfluous typescript example * Add vscode config to execute prettier on save More info: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode * Imprive joi validation on rootPath * Remove useless tsconfig.json * Remove unused var * Use program from redux * Improve rootPath config (default config and regex validator) * Ensure schema is created even if the project hasn't got any source plugin Fix gatsbyjs#811 * Find a webpack config that deals with all env \o/ This configuration works with basics configuration and with a custom `rootPath` (even with a typescript stack) It was tested with build and develop commands * Move default config into redux * Take english version to vscode/settings comment * Add some unit-test for `rootPath` * Make `src` as default rootPath * Rename `intermediate-representation` to `cache` * Add `public` into webpack root entries * Ignore .cache folders * Refactor `www` project with the new file directory * Refactor gatsbygram project with the new file directory
Since I'm working on my starter with typescript (not working for instant, but I progress) I made some refactors and improvements:
program.extensions
const {program, config} = store.getState()
to improve readability[Update] Finally, we decide to change directory structure to: (#814 (comment))