Skip to content

Commit d8b71bd

Browse files
authored
Merge pull request #126 from akd-io/release/0.1.6
Release 0.1.6
2 parents be82ffa + 9231acf commit d8b71bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+336
-96
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
node: ["12", "14"]
13+
node: ["14", "16"]
1414
os: [ubuntu-latest, windows-latest, macOS-latest]
1515

1616
runs-on: ${{ matrix.os }}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The table below provides an overview of the technologies currently supported by
5252
| [npm](https://www.npmjs.com/) | [CLI Docs](https://docs.npmjs.com/cli/) |
5353
| [Emotion](https://emotion.sh/docs/introduction) | [Docs](https://emotion.sh/docs/introduction) - [GitHub repo](https://github.com/emotion-js/emotion) |
5454
| [Styled Components](https://styled-components.com/) | [Docs](https://styled-components.com/docs) - [GitHub repo](https://github.com/styled-components/styled-components) |
55+
| [Tailwind CSS](https://tailwindcss.com/) | [Docs](https://tailwindcss.com/docs) - [GitHub repo](https://github.com/tailwindlabs/tailwindcss) |
5556
| [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) |
5657
| [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) |
5758
| [Chakra UI](https://chakra-ui.com/) | [Docs](https://chakra-ui.com/docs/getting-started) - [GitHub repo](https://github.com/chakra-ui/chakra-ui) |
@@ -92,10 +93,11 @@ OPTIONS
9293
--formik Adds Formik. (Form library)
9394
--framer-motion Adds Framer Motion. (Animation library)
9495
--github-actions Adds a GitHub Actions continuous integration workflow.
96+
--material-ui Adds Material UI. (Component library)
9597
--package-manager=(yarn|npm) Sets the preferred package manager. (Required)
9698
--prettier Adds Prettier. (Code formatting)
9799
--react-hook-form Adds React Hook Form. (Form library)
98-
--styling=<styling-method> Sets the preferred styling method. (Required) <styling-method> = emotion|styled-components|css-modules|css-modules-with-sass
100+
--styling=<styling-method> Sets the preferred styling method. (Required) <styling-method> = emotion|styled-components|tailwind-css|css-modules|css-modules-with-sass
99101
```
100102

101103
## License

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "create-next-stack",
33
"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",
4+
"version": "0.1.6",
55
"author": "Anders Kjær Damgaard @akd-io",
66
"bin": {
77
"create-next-stack": "./bin/run"
@@ -39,7 +39,7 @@
3939
"uuid": "^8.3.2"
4040
},
4141
"engines": {
42-
"node": ">=12.0.0"
42+
"node": ">=14.0.0"
4343
},
4444
"files": [
4545
"/bin",

src/main/create-next-stack-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const writablePackageManagerOptions = packageManagerOptions as Writable<
3636
export const stylingOptions = [
3737
"emotion",
3838
"styled-components",
39+
"tailwind-css",
3940
"css-modules",
4041
"css-modules-with-sass",
4142
] as const

src/main/helpers/exit-with-error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ExitError } from "@oclif/errors"
22
import { logError } from "../logging"
3-
import { inDebugMode } from "./is-debug-enabled"
3+
import { inDebugMode } from "./in-debug-mode"
44

55
export const exitWithError = (error: unknown): never => {
66
if (error instanceof ExitError && error.oclif.exit === 0) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { promises as fs } from "fs"
2+
import { logDebug } from "../logging"
23
import { isUnknownArray } from "./is-unknown-array"
34
import { isUnknownObject } from "./is-unknown-object"
45

6+
export const writeFile: typeof fs.writeFile = async (file, data, options) => {
7+
logDebug("Writing file:", file.toString())
8+
return fs.writeFile(file, data, options)
9+
}
10+
511
export const modifyJsonFile = async (
612
path: string,
713
callback: (oldObject: Record<string, unknown>) => Record<string, unknown>
@@ -14,6 +20,7 @@ export const modifyJsonFile = async (
1420
export const readJsonFile = async (
1521
path: string
1622
): Promise<Record<string, unknown>> => {
23+
logDebug("Reading json file:", path)
1724
const jsonString = await fs.readFile(path, "utf8")
1825
const jsonObject = JSON.parse(jsonString)
1926

@@ -28,6 +35,7 @@ export const writeJsonFile = async (
2835
fileName: string,
2936
object: Record<string, unknown>
3037
): Promise<void> => {
38+
logDebug("Writing json file:", fileName)
3139
const objectString = JSON.stringify(object, null, 2)
3240
await fs.writeFile(fileName, objectString)
3341
}

src/main/logging.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import chalk from "chalk"
2-
import { inDebugMode } from "./helpers/is-debug-enabled"
2+
import { inDebugMode } from "./helpers/in-debug-mode"
33
import { prefixLines } from "./helpers/prefix-lines"
44

55
const infoPrefix = chalk.cyan("info ")
66
const debugPrefix = chalk.white("debug ")
77
const warningPrefix = chalk.yellow("warning ")
88
const errorPrefix = chalk.red("error ")
99

10-
export const logInfo = (str: string): void => {
11-
console.info(prefixLines(infoPrefix, chalk.white(str)))
10+
export const logInfo = (...str: string[]): void => {
11+
console.info(prefixLines(infoPrefix, chalk.white(str.join(" "))))
1212
}
1313

14-
export const logDebug = (str: string): void => {
14+
export const logDebug = (...str: string[]): void => {
1515
if (inDebugMode()) {
16-
console.debug(prefixLines(debugPrefix, chalk.white(str)))
16+
console.debug(prefixLines(debugPrefix, chalk.white(str.join(" "))))
1717
}
1818
}
1919

20-
export const logWarning = (str: string): void => {
21-
console.warn(prefixLines(warningPrefix, chalk.yellow(str)))
20+
export const logWarning = (...str: string[]): void => {
21+
console.warn(prefixLines(warningPrefix, chalk.yellow(str.join(" "))))
2222
}
2323

24-
export const logError = (str: string): void => {
25-
console.error(prefixLines(errorPrefix, chalk.red(str)))
24+
export const logError = (...str: string[]): void => {
25+
console.error(prefixLines(errorPrefix, chalk.red(str.join(" "))))
2626
}

src/main/questionnaire/questions/categories/styling.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export const promptStyling = async (): Promise<StylingValue> => {
2525
value: stylingValues["styled-components"],
2626
name: "Styled Components",
2727
},
28+
{
29+
value: stylingValues["tailwind-css"],
30+
name: "Tailwind CSS",
31+
},
2832
{
2933
value: stylingValues["css-modules"],
3034
name: "CSS Modules",

src/main/run-command.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import execa, { ExecaChildProcess, Options } from "execa"
2+
import { logDebug } from "./logging"
3+
4+
export const runCommand = (
5+
file: string,
6+
args: string[],
7+
options?: Options
8+
): ExecaChildProcess<string> => {
9+
logDebug("Running command:", [file, ...args].join(" "))
10+
return execa(file, args, options)
11+
}

0 commit comments

Comments
 (0)