Skip to content

Commit be82ffa

Browse files
authored
Merge pull request #117 from akd-io/release/0.1.5
Release 0.1.5
2 parents 41dd49d + cd302b2 commit be82ffa

File tree

22 files changed

+234
-67
lines changed

22 files changed

+234
-67
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: "CI"
22

3-
on: [push]
3+
on:
4+
push:
5+
workflow_dispatch:
46

57
jobs:
68
build:

README.md

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@
1313
<a aria-label="License" href="https://github.com/akd-io/create-next-stack/blob/develop/LICENSE">
1414
<img alt="" src="https://img.shields.io/npm/l/create-next-stack?color=44cc11&style=flat-square">
1515
</a>
16+
<a aria-label="GitHub Repo stars" href="https://github.com/akd-io/create-next-stack">
17+
<img alt="" src="https://img.shields.io/github/stars/akd-io/create-next-stack?style=social">
18+
</a>
1619
</p>
1720

18-
Create Next Stack is an opinionated interactive CLI tool to easily set up the boilerplate of a new [Next.js](https://github.com/vercel/next.js) app.
21+
Create Next Stack is a website and CLI tool used to easily set up the boilerplate of new [Next.js](https://github.com/vercel/next.js) apps.
1922

2023
Where [Create Next App](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) lets you choose a single template only, Create Next Stack lets you pick and choose an array of technologies often used alongside Next.js, and free you of the pain of making them work together.
2124

22-
To get started, run:
25+
This repository covers the CLI tool, while [create-next-stack-website](https://github.com/akd-io/create-next-stack-website) covers the site.
26+
27+
To get started, go to [create-next-stack.com](https://www.create-next-stack.com) or run:
2328

2429
```bash
2530
npx create-next-stack
2631
```
2732

28-
Then, pick a project name, and your preferred technologies like so:
33+
If using the CLI, you'll be prompted to pick a project name, and your preferred technologies like so:
2934

3035
<p align="center">
3136
<img width="600" alt="Screenshot of Create Next Stack running in a terminal" src="assets/screenshot.png">
@@ -35,45 +40,38 @@ Then, pick a project name, and your preferred technologies like so:
3540

3641
The table below provides an overview of the technologies currently supported by Create Next Stack.
3742

38-
### Icons
39-
40-
A few icons are used to label different properties of these technologies. We describe these here:
41-
42-
#### <img width="14" alt="" src="assets/required-icon.png"> Required icon:
43+
### Technologies table
4344

44-
Technologies marked required are, you guessed it, required. If you don't want to use these technologies, you have three options:
45+
| Name | Links |
46+
| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47+
| [Next.js](https://nextjs.org/)| [Docs](https://nextjs.org/docs) - [Learn Next.js](https://nextjs.org/learn) - [GitHub repo](https://github.com/vercel/next.js) |
48+
| [React](https://reactjs.org/)| [Docs](https://reactjs.org/docs/getting-started.html) - [GitHub repo](https://github.com/facebook/react) |
49+
| [TypeScript](https://www.typescriptlang.org/)| [Docs](https://www.typescriptlang.org/docs/) - [GitHub repo](https://github.com/microsoft/TypeScript) |
50+
| [ESLint](https://eslint.org/)| [Configuration](https://eslint.org/docs/user-guide/configuring/) - [Rules](https://eslint.org/docs/rules/) - [GitHub Repo](https://github.com/eslint/eslint) |
51+
| [Yarn](https://yarnpkg.com/) | [CLI Docs](https://yarnpkg.com/cli) - [GitHub repo](https://github.com/yarnpkg/berry) |
52+
| [npm](https://www.npmjs.com/) | [CLI Docs](https://docs.npmjs.com/cli/) |
53+
| [Emotion](https://emotion.sh/docs/introduction) | [Docs](https://emotion.sh/docs/introduction) - [GitHub repo](https://github.com/emotion-js/emotion) |
54+
| [Styled Components](https://styled-components.com/) | [Docs](https://styled-components.com/docs) - [GitHub repo](https://github.com/styled-components/styled-components) |
55+
| [CSS Modules](https://github.com/css-modules/css-modules) | [Docs](https://github.com/css-modules/css-modules) - [Next.js-specific docs](https://nextjs.org/docs/basic-features/built-in-css-support#adding-component-level-css) |
56+
| [Sass](https://sass-lang.com/) | [Docs](https://sass-lang.com/documentation) - [Next.js-specific docs](https://nextjs.org/docs/basic-features/built-in-css-support#sass-support) |
57+
| [Chakra UI](https://chakra-ui.com/) | [Docs](https://chakra-ui.com/docs/getting-started) - [GitHub repo](https://github.com/chakra-ui/chakra-ui) |
58+
| [Material UI](https://material-ui.com/) | [Docs](https://material-ui.com/getting-started/installation/) - [GitHub repo](https://github.com/mui-org/material-ui) |
59+
| [React Hook Form](https://react-hook-form.com/) | [Docs](https://react-hook-form.com/get-started) - [GitHub repo](https://github.com/react-hook-form/react-hook-form) |
60+
| [Formik](https://formik.org/) | [Docs](https://formik.org/docs/overview) - [GitHub repo](https://github.com/formium/formik) |
61+
| [Framer Motion](https://www.framer.com/motion/) | [Docs](https://www.framer.com/docs/) - [GitHub repo](https://github.com/framer/motion) |
62+
| [Prettier](https://prettier.io/) | [Docs](https://prettier.io/docs/en/index.html) - [Options](https://prettier.io/docs/en/options.html) - [GitHub repo](https://github.com/prettier/prettier) |
63+
| [Husky](https://typicode.github.io/husky/) | [Docs](https://typicode.github.io/husky/) - [GitHub repo](https://github.com/typicode/husky) |
64+
| [lint-staged](https://github.com/okonet/lint-staged) | [GitHub repo](https://github.com/okonet/lint-staged) |
65+
| [GitHub Actions](https://github.com/features/actions) | [Docs](https://docs.github.com/en/actions) - [Workflow syntax](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions) |
66+
67+
#### ⚠ Required
68+
69+
Technologies marked with ⚠ are required. If you don't want to use these technologies, you have three options:
4570

4671
1. Set up your project using Create Next Stack anyway, and make the necessary adjustments manually.
4772
1. Set up your project manually with Create Next App.
4873
1. Find and use a template repo you can clone here on GitHub.
4974

50-
#### <img width="14" alt="" src="assets/convenience-icon.png"> Convenience install icon:
51-
52-
Technologies marked as _convenience installs_ are technologies that work out of the box with Next.js, and which Create Next Stack is making available for convenience only. If you are on the fence about a specific technology marked with the icon, you can safely skip it and install it in the future without worrying about complicated setup steps.
53-
54-
### Technologies table
55-
56-
| Name | Links |
57-
| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
58-
| [Next.js](https://nextjs.org/) <img width="14" alt="required icon" src="assets/required-icon.png"> | [Docs](https://nextjs.org/docs) - [Learn Next.js](https://nextjs.org/learn) - [GitHub repo](https://github.com/vercel/next.js) |
59-
| [React](https://reactjs.org/) <img width="14" alt="required icon" src="assets/required-icon.png"> | [Docs](https://reactjs.org/docs/getting-started.html) - [GitHub repo](https://github.com/facebook/react) |
60-
| [TypeScript](https://www.typescriptlang.org/) <img width="14" alt="required icon" src="assets/required-icon.png"> | [Docs](https://www.typescriptlang.org/docs/) - [GitHub repo](https://github.com/microsoft/TypeScript) |
61-
| [ESLint](https://eslint.org/) <img width="14" alt="required icon" src="assets/required-icon.png"> | [Configuration](https://eslint.org/docs/user-guide/configuring/) - [Rules](https://eslint.org/docs/rules/) - [GitHub Repo](https://github.com/eslint/eslint) |
62-
| [Yarn](https://yarnpkg.com/) | [CLI Docs](https://yarnpkg.com/cli) - [GitHub repo](https://github.com/yarnpkg/berry) |
63-
| [npm](https://www.npmjs.com/) | [CLI Docs](https://docs.npmjs.com/cli/) |
64-
| [Emotion](https://emotion.sh/docs/introduction) | [Docs](https://emotion.sh/docs/introduction) - [GitHub repo](https://github.com/emotion-js/emotion) |
65-
| [Styled Components](https://styled-components.com/) | [Docs](https://styled-components.com/docs) - [GitHub repo](https://github.com/styled-components/styled-components) |
66-
| [CSS Modules](https://github.com/css-modules/css-modules) | [Docs](https://github.com/css-modules/css-modules) - [Next.js-specific docs](https://nextjs.org/docs/basic-features/built-in-css-support#adding-component-level-css) |
67-
| [Sass](https://sass-lang.com/) <img width="14" alt="convenience install icon" src="assets/convenience-icon.png"> | [Docs](https://sass-lang.com/documentation) - [Next.js-specific docs](https://nextjs.org/docs/basic-features/built-in-css-support#sass-support) |
68-
| [Chakra UI](https://chakra-ui.com/) | [Docs](https://chakra-ui.com/docs/getting-started) - [GitHub repo](https://github.com/chakra-ui/chakra-ui) |
69-
| [React Hook Form](https://react-hook-form.com/) <img width="14" alt="convenience install icon" src="assets/convenience-icon.png"> | [Docs](https://react-hook-form.com/get-started) - [GitHub repo](https://github.com/react-hook-form/react-hook-form) |
70-
| [Formik](https://formik.org/) <img width="14" alt="convenience install icon" src="assets/convenience-icon.png"> | [Docs](https://formik.org/docs/overview) - [GitHub repo](https://github.com/formium/formik) |
71-
| [Framer Motion](https://www.framer.com/motion/) <img width="14" alt="convenience install icon" src="assets/convenience-icon.png"> | [Docs](https://www.framer.com/docs/) - [GitHub repo](https://github.com/framer/motion) |
72-
| [Prettier](https://prettier.io/) | [Docs](https://prettier.io/docs/en/index.html) - [Options](https://prettier.io/docs/en/options.html) - [GitHub repo](https://github.com/prettier/prettier) |
73-
| [Husky](https://typicode.github.io/husky/) | [Docs](https://typicode.github.io/husky/) - [GitHub repo](https://github.com/typicode/husky) |
74-
| [lint-staged](https://github.com/okonet/lint-staged) | [GitHub repo](https://github.com/okonet/lint-staged) |
75-
| [GitHub Actions](https://github.com/features/actions) | [Docs](https://docs.github.com/en/actions) - [Workflow syntax](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions) |
76-
7775
## Usage
7876

7977
Below you see an overview of Create Next Stack's usage, including detailed information about arguments and options. The overview is the result of running `create-next-stack --help`

assets/banner.png

-472 KB
Loading

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "create-next-stack",
3-
"version": "0.1.4",
3+
"description": "Create Next Stack is a website and CLI tool used to easily set up the boilerplate of new Next.js apps.",
4+
"version": "0.1.5",
45
"author": "Anders Kjær Damgaard @akd-io",
56
"bin": {
67
"create-next-stack": "./bin/run"

src/main/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { performSetupSteps } from "./setup/setup"
1515

1616
class CreateNextStack extends Command {
1717
static description =
18-
"Create Next Stack is an opinionated interactive CLI tool to easily set up the boilerplate of a new Next.js app."
18+
"Create Next Stack is a website and CLI tool used to easily set up the boilerplate of new Next.js apps."
1919

2020
static args = [
2121
{
@@ -65,6 +65,10 @@ class CreateNextStack extends Command {
6565
"Adds Chakra UI. (Component library) (Requires Emotion and Framer Motion)",
6666
}),
6767

68+
"material-ui": flags.boolean({
69+
description: "Adds Material UI. (Component library)",
70+
}),
71+
6872
// Form libraries:
6973
"react-hook-form": flags.boolean({
7074
description: "Adds React Hook Form. (Form library)",

src/main/questionnaire/flags-questionnaire.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export const performFlagsQuestionnaire =
8989
"formattingPreCommitHook"
9090
),
9191
chakra: technologies.has("chakra"),
92+
"material-ui": technologies.has("material-ui"),
9293
}
9394

9495
return result

src/main/questionnaire/questions/categories/component-libraries.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import inquirer from "inquirer"
22
import { arrayToKeyToKeyMap } from "../../../helpers/array-to-key-to-key-map"
33
import { Technology } from "../../flags-questionnaire"
44

5-
const componentLibraryOptions = ["chakra"] as const
5+
const componentLibraryOptions = ["chakra", "material-ui"] as const
66
export type ComponentLibraryValue = typeof componentLibraryOptions[number]
77
const componentLibraryValues = arrayToKeyToKeyMap(componentLibraryOptions)
88

@@ -25,6 +25,11 @@ export const promptComponentLibraries = async (
2525
checked: technologies.has("emotion"),
2626
disabled: !technologies.has("emotion"),
2727
},
28+
{
29+
value: componentLibraryValues["material-ui"],
30+
name: "Material UI",
31+
checked: false,
32+
},
2833
],
2934
})
3035

src/main/setup/packages.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const packages = {
107107
},
108108
"create-next-app": {
109109
name: "create-next-app",
110-
version: "~11.1.0", // Note: Create Next App uses an exact minor
110+
version: "~11.1.0", // Note: Equivalent to 11.1.x. However, when used with npx, the version range is interpreted exactly instead.
111111
},
112112
mrm: {
113113
name: "mrm",
@@ -125,4 +125,12 @@ export const packages = {
125125
name: "@chakra-ui/react",
126126
version: "^1.0.0",
127127
},
128+
"@material-ui/core": {
129+
name: "@material-ui/core",
130+
version: "^4.0.0",
131+
},
132+
"@material-ui/icons": {
133+
name: "@material-ui/icons",
134+
version: "^4.0.0",
135+
},
128136
} as const

src/main/setup/setup.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { capitalizeFirstLetter } from "../helpers/capitalize-first-letter"
33
import { logInfo } from "../logging"
44
import { printFinalMessages } from "./print-final-messages"
55
import { Step } from "./step"
6-
import { addBaseBabelConfigStep } from "./steps/add-base-babel-config"
76
import { addBaseTestScriptStep } from "./steps/add-base-test-script"
87
import { addContentStep } from "./steps/add-content/add-content"
98
import { addGitAttributesStep } from "./steps/add-git-attributes"
109
import { addGithubWorkflowStep } from "./steps/add-github-workflow"
1110
import { addReadmeStep } from "./steps/add-readme/add-readme"
11+
import { addBaseBabelConfigStep } from "./steps/babel/add-base-babel-config"
12+
import { removeBaseBabelConfigStep } from "./steps/babel/remove-base-babel-config copy"
1213
import { copyAssetsStep } from "./steps/copy-assets"
1314
import { createNextAppStep } from "./steps/create-next-app"
1415
import { formatProjectStep } from "./steps/format-project"
@@ -22,6 +23,7 @@ import { setUpCssModulesWithSassStep } from "./steps/set-up-css-modules-with-sas
2223
import { setUpEmotionStep } from "./steps/set-up-emotion"
2324
import { setUpEslintStep } from "./steps/set-up-eslint"
2425
import { setUpLintStagedStep } from "./steps/set-up-lint-staged"
26+
import { setUpMaterialUIStep } from "./steps/set-up-material-ui"
2527
import { setUpPrettierStep } from "./steps/set-up-prettier"
2628
import { setUpStyledComponentsStep } from "./steps/set-up-styled-components"
2729
import { updateYarnStep } from "./steps/update-yarn"
@@ -50,6 +52,7 @@ export const performSetupSteps = async (
5052

5153
// Component libraries
5254
setUpChakraUIStep,
55+
setUpMaterialUIStep,
5356

5457
// Formatting
5558
setUpPrettierStep,
@@ -70,6 +73,9 @@ export const performSetupSteps = async (
7073
addContentStep,
7174
addReadmeStep,
7275

76+
// Cleanup
77+
removeBaseBabelConfigStep,
78+
7379
// Format & initial commit
7480
formatProjectStep,
7581
gitCommitStep,

src/main/setup/steps/add-content/add-content.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ export const addContentStep: Step = {
4444
)
4545
}
4646

47-
if (styling === "emotion" && inputs.flags.chakra) {
48-
promises.push(fs.writeFile("theme.ts", generateTheme()))
47+
if (
48+
(styling === "emotion" && inputs.flags.chakra) ||
49+
inputs.flags["material-ui"]
50+
) {
51+
promises.push(...generateTheme(inputs))
4952
}
5053

5154
await Promise.all(promises)

0 commit comments

Comments
 (0)