Skip to content

Commit 5f2266a

Browse files
committed
Add extra scripts and update docs
1 parent 07153d3 commit 5f2266a

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,32 @@ Make sure you are set up locally by following the [Getting Started](#getting-sta
7070

7171
- `git checkout -b feature/support-my-favorite-technology`
7272

73-
2. Add a new .ts file for your plugin in the plugins directory at `packages\create-next-stack\src\main\plugins`
73+
2. Useful npm scripts of `packages/create-next-stack` to run during development:
74+
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+
- `test` - Runs e2e tests. Note that this will run all e2e tests, which can take quite a while.
78+
- `lint` - Runs ESLint to lint the project.
79+
- `test:manual`
80+
- For example, `pnpm run test:manual --package-manager=pnpm --styling=emotion`.
81+
- 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.
82+
- 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.
83+
- `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.
84+
- `clean` - Removes all generated files, including build files and the `create-next-stack-tests` directory created by the e2e tests.
85+
86+
3. Add a new .ts file for your plugin in the plugins directory at `packages\create-next-stack\src\main\plugins`
7487

7588
- See the [Writing a plugin section](#writing-a-plugin) below to learn how to write a Create Next Stack plugin.
7689

77-
3. 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).
78-
4. Add the plugin to the `plugins` array in [`setup.ts`](packages/create-next-stack/src/main/setup/setup.ts).
79-
5. Add potential plugin steps to the `steps` array in [`setup.ts`](packages/create-next-stack/src/main/setup/setup.ts). Steps are run top-to-bottom.
80-
6. Update the [`README.md`](README.md):
90+
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).
91+
5. Add the plugin to the `plugins` array in [`setup.ts`](packages/create-next-stack/src/main/setup/setup.ts).
92+
6. Add potential plugin steps to the `steps` array in [`setup.ts`](packages/create-next-stack/src/main/setup/setup.ts). Steps are run top-to-bottom.
93+
7. Update the [`README.md`](README.md):
8194
- Add the technology to the technology list
8295
- Update the `Usage` section by copy pasting the output of running `yarn print:help`
83-
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.
84-
8. Run tests using `yarn test` to ensure they all pass.
85-
9. Submit a Pull Request on GitHub.
96+
8. 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.
97+
9. Run tests using `yarn test` to ensure they all pass.
98+
10. Submit a Pull Request on GitHub.
8699

87100
## Writing a Plugin
88101

packages/create-next-stack/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@
4848
"scripts": {
4949
"prepack": "pnpm build",
5050
"check-types": "tsc --noEmit",
51+
"check-types:watch": "tsc --noEmit --watch",
5152
"build": "rimraf lib && tsc --build",
53+
"build:watch": "rimraf lib && tsc --build --watch",
5254
"clean": "rimraf lib && pnpm run clean-tests-dir",
5355
"clean-tests-dir": "ts-node src/tests/e2e/clean-tests-dir.ts",
5456
"test": "pnpm build && pnpm run jest && ts-node src/tests/e2e/test.ts",
5557
"jest": "jest",
58+
"jest:watch": "jest --watch",
5659
"test:manual": "pnpm build && ts-node src/tests/e2e/test-manual.ts --debug",
5760
"test:small": "pnpm build && ts-node src/tests/e2e/test-manual.ts --debug --package-manager=pnpm --styling=css-modules",
5861
"test:large": "pnpm build && ts-node src/tests/e2e/test-manual.ts --debug --package-manager=pnpm --styling=emotion --react-hook-form --formik --prettier --formatting-pre-commit-hook --chakra --framer-motion --github-actions",

0 commit comments

Comments
 (0)