You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+38-32Lines changed: 38 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ Hey there! We're excited that you're interested in contributing to Create Next S
6
6
7
7
-[Getting Started](#getting-started)
8
8
-[Repository Overview](#repository-overview)
9
+
-[Scripts](#scripts)
9
10
-[Creating a pull request](#creating-a-pull-request)
10
11
-[Adding support for a new technology](#adding-support-for-a-new-technology)
11
12
-[Writing a plugin](#writing-a-plugin)
@@ -30,28 +31,37 @@ You can see where the monorepo looks for packages in the `pnpm-workspace.yaml` f
30
31
```yaml
31
32
packages:
32
33
- "packages/**"
33
-
- "website"
34
+
- "apps/**"
34
35
```
35
36
36
-
Packages that are published to npm are located inside the [`packages`](packages) directory. A single [`website`](website) package is located outside of the `packages` directory, as it is not published to npm. The `website` package is used to build the [create-next-stack.com](https://create-next-stack.com/).
37
-
38
-
You can find a list of generally useful npm scripts available in the root by checking out the root [`package.json`](package.json) file.
39
-
40
-
A couple of notable scripts that allow you to build, lint, and test the entire repository, or specific packages are:
41
-
42
-
- `build`
43
-
- `build:cli`
44
-
- `build:web`
45
-
- `lint`
46
-
- `lint:cli`
47
-
- `lint:web`
48
-
- `test`
49
-
- `test:cli`
50
-
- `test:web`
51
-
52
-
Each package has its own `package.json` file, which contains scripts specific to that package. The above list are just wrapper scripts that call the underlying packages' `build`, `test`, and `test` scripts.
53
-
54
-
Note that running scripts inside a specific package's directory will only run the script for that package. For example, running `pnpm run build` inside the `packages/create-next-stack` directory will run the `build` script specified in the `create-next-stack` package's `package.json` file.
37
+
### Scripts
38
+
39
+
Each package's `package.json` file contains scripts useful during development. These scripts can be run using `pnpm <script>`, but we are also use [Turbo repo](https://turbo.build/repo) to speed up development. This means there is an array of scripts you can run using `turbo <script>` instead of `pnpm <script>`. `build`, `lint`, and `test` are examples of such scripts. You can see the configuration in the [`turbo.json`](../../turbo.json) file.
40
+
41
+
Note that running scripts inside a specific package's directory will only run the script for that package. This is true for both `turbo` and `pnpm`. For example, running `turbo build` inside the `packages/create-next-stack` directory will build the `create-next-stack` package only.
42
+
43
+
The table below provides names and descriptions of the npm scripts available in the `create-next-stack` package.
| `build:watch` | Builds the project on every code change. |
49
+
| `lint` | Lints the project. |
50
+
| `test` | Alias for `unit` script. |
51
+
| `unit` | Runs unit tests. |
52
+
| `unit:watch` | Runs unit tests on every code change. |
53
+
| `unit:ci` | CI-specific unit test script. |
54
+
| `get-e2e-test-files-array` | Gets a list of all e2e test files, for GitHub Actions to be able to run them in parallel. |
55
+
| `e2e` | Runs all end-to-end tests in series. |
56
+
| `e2e:single` | Runs a single e2e test. Usage: `pnpm e2e:single <file path filter>`. |
57
+
| `e2e:single:ci` | CI-specific single e2e test script. |
58
+
| `e2e:manual` | Runs `create-next-stack` in a test directory and runs simple tests on the result.<br/>Specify your own CLI flags, eg.: `pnpm run e2e:manual --package-manager=pnpm --styling=emotion`<br />Note that the `app_name` argument is set automatically. |
59
+
| `e2e:cna` | Runs `npx create-next-app@latest` in a test directory. Specify your own CLI flags. |
60
+
| `e2e:cns` | Runs `npx create-next-stack@latest` in a test directory and runs simple tests on the result. Specify your own CLI flags. |
61
+
| `e2e:raw` | Alias to the `create-next-stack` binary at `./bin/dev`. Specify your own CLI flags. |
62
+
| `clean` | Cleans up the `lib` and `create-next-stack-tests` directories. |
63
+
| `clean-tests-dir` | Cleans up the `create-next-stack-tests` directory. |
64
+
| `update-readme` | Updates the auto-generated sections of the readme. Automatically run on commit. |
55
65
56
66
## Creating a Pull Request
57
67
@@ -70,18 +80,14 @@ Make sure you are set up locally by following the [Getting Started](#getting-sta
2. Useful npm scripts of `packages/create-next-stack` to run during development:
83
+
2. Make sure you check out the [scripts](#scripts) section above. Most notably:
74
84
75
-
- `check-types:watch`- Runs TypeScript in watch mode to check types as you make changes. You can run this instead of `build:watch` while working on the CLI, as the e2e tests do just-in-time compilation via `ts-node`.
76
-
- `jest:watch`- Runs Jest in watch mode to run unit tests as you make changes.
77
-
- These tests were specifically made to ease the plugin authoring process, so don't forget this one.
78
-
- `test`- Runs e2e tests. Note that this will run all e2e tests, which can take quite a while.
79
-
- `lint`- Runs ESLint to lint the project.
80
-
- `test:manual`
85
+
- `build:watch`- Make sure to have `build:watch` running if you are running tests, as tests are run on the built files.
86
+
- `unit:watch`- Some of these tests were specifically made to ease the plugin authoring process, so don't forget this one.
87
+
- `e2e`- Runs e2e tests. Note that this will run all e2e tests, which can take quite a while.
88
+
- `e2e:manual`
89
+
- This is performing a manual run of the CLI. Pass flags to the CLI that you want to test.
81
90
- For example, `pnpm run test:manual --package-manager=pnpm --styling=emotion`.
82
-
- Sets up a new directory for a test run of the CLI, runs the CLI with the specified flags, and builds the generated Next app, and checks formatting and linting.
83
-
- This is useful for manually testing the CLI. Pass whatever flags to the CLI that you want to test. The `app_name` argument will be set automatically.
84
-
- `test:raw`- Runs the binary directly. Rarely used, but can be useful for manual tests where you want to be able to specify the `app_name` argument yourself.
85
91
- `clean`- Removes all generated files, including build files and the `create-next-stack-tests` directory created by the e2e tests.
86
92
87
93
3. Add a new .ts file for your plugin in the plugins directory at [`packages/create-next-stack/src/main/plugins`](packages/create-next-stack/src/main/plugins)
@@ -91,9 +97,9 @@ Make sure you are set up locally by following the [Getting Started](#getting-sta
91
97
4. Add new flags to the `create-next-stack` command in [`create-next-stack.ts`](packages/create-next-stack/src/main/commands/create-next-stack.ts).
92
98
5. Add the plugin to the `plugins` array in [`setup.ts`](packages/create-next-stack/src/main/setup/setup.ts).
93
99
6. Add potential plugin steps to the `steps` array in [`steps.ts`](packages/create-next-stack/src/main/steps.ts). Steps are run top-to-bottom.
94
-
7. Consider expanding some of the e2e tests to include the new technology. See [`test.ts`](packages/create-next-stack/src/tests/e2e/test.ts) for current tests.
100
+
7. Consider expanding some of the e2e tests to include the new technology. See the [`tests`](packages/create-next-stack/src/tests/e2e/tests) directory for current e2e tests.
95
101
8. Go and add the technology to the technology selection form of the website.
96
-
- See the [TechnologiesForm](website/templates/LandingPage/components/TechnologiesForm.tsx) component.
102
+
- See the [TechnologiesForm](apps/website/templates/LandingPage/components/TechnologiesForm.tsx) component.
97
103
- This component is currently pretty hideous, and updating it will be automated in the future. See [issue #188](https://github.com/akd-io/create-next-stack/issues/188).
98
104
9. Run tests using `yarn test` to ensure they all pass.
0 commit comments