-
Notifications
You must be signed in to change notification settings - Fork 1
Basic support for starters #1
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 |
|---|---|---|
| @@ -1,3 +1,48 @@ | ||
| # create-stackbit-app | ||
|
|
||
| Run `npx create-stackbit-app` in your terminal to create a new Stackbit application or add Stackbit into an existing site. | ||
|
|
||
| ## Usage | ||
|
|
||
| To create a new Stackbit project from a starter, run the following command: | ||
|
|
||
| ```txt | ||
| npx create-stackbit-app [dir] | ||
| ``` | ||
|
|
||
| To see a full list of options use the `--help` flag: | ||
|
|
||
| ```txt | ||
| > npx create-stackbit-app --help | ||
|
|
||
| Options: | ||
| --version Show version number [boolean] | ||
| -s, --starter Choose a starter [choices: "nextjs", "ts-mui-nextjs"] | ||
| --help Show help [boolean] | ||
| ``` | ||
|
|
||
| ### Choosing a Starter | ||
|
|
||
| Use the `--starter` option for specifying a starter. Run the command with the `--help` flag to see a full list of available starters. | ||
|
|
||
| ```txt | ||
| npx create-stackbit-app --starter ts-mui-nextjs | ||
| ``` | ||
|
|
||
| If no starter option is provided, [the default starter](https://github.com/stackbit-themes/nextjs-starter) is used. | ||
|
|
||
| ### Setting Project Directory | ||
|
|
||
| Pass a directory name as the only argument when running the command. For example, if you wanted your directory to be name `my-site`, the command would look something like this: | ||
|
|
||
| ```txt | ||
| npx create-stackbit-app my-site | ||
| ``` | ||
|
|
||
| If no name is provided, the directory will be `my-stackbit-site-[id]`, where `[id]` is a randomly-generated string used to avoid directory conflicts. | ||
|
|
||
| ## Adding Stackbit to Existing Projects | ||
|
|
||
| The script detects when you may be working with an existing project (it looks for a `package.json` file in the working directory). | ||
|
|
||
| If in an existing project, the script asks if you'd like to add Stackbit to the project. Today, this only prints a resource URL. If you choose _no_, the command exits. |
This file contains hidden or 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,15 @@ | ||
| const starters = [ | ||
| { | ||
| name: "nextjs", | ||
| repoUrl: "https://github.com/stackbit-themes/nextjs-starter", | ||
| }, | ||
| { | ||
| name: "ts-mui-nextjs", | ||
| repoUrl: "https://github.com/stackbit-themes/ts-mui-nextjs-starter", | ||
| }, | ||
| ]; | ||
|
|
||
| export default { | ||
| defaults: { dirName: "my-stackbit-site", starter: starters[0] }, | ||
| starters, | ||
| }; | ||
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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.
can you make it into "ts-nextjs" and if needed we'll add other names and aliases later? (same as we don't say "tailwind" in the default one)
(yeah, we may want to change the repo name as well, but that's not a blocker)
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.
btw the exact commands the app will show are in this file
https://github.com/stackbit/stackbit-app/commit/5e3c8507aa18099e10efa9e5863e21ed7437bb7c