Skip to content

Commit 8668c1d

Browse files
authored
Merge pull request #234 from akd-io/release/0.2.7
Release 0.2.7
2 parents 663f0d5 + 8f9ae7f commit 8668c1d

File tree

98 files changed

+3121
-5973
lines changed

Some content is hidden

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

98 files changed

+3121
-5973
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ on: [pull_request]
44

55
jobs:
66
build:
7-
name: "Check formatting"
7+
name: "CI"
88

99
runs-on: ubuntu-latest
1010

11+
env:
12+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
13+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
14+
1115
steps:
1216
- name: "Checkout repo"
1317
uses: actions/checkout@v3
@@ -27,4 +31,13 @@ jobs:
2731
run: pnpm install
2832

2933
- name: "Check formatting"
30-
run: pnpm format:check
34+
run: npx turbo format:check
35+
36+
- name: "Build"
37+
run: pnpm build
38+
39+
- name: "Lint"
40+
run: pnpm lint
41+
42+
- name: "Test"
43+
run: pnpm test

.github/workflows/cli-ci.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/cli-e2e.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: "CLI - CI"
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
get-test-files:
7+
name: "Get e2e test files"
8+
9+
runs-on: ubuntu-latest
10+
11+
outputs:
12+
test-files: ${{ steps.set-test-files.outputs.files }}
13+
14+
steps:
15+
- name: "Checkout repo"
16+
uses: actions/checkout@v3
17+
18+
- name: "Set up pnpm"
19+
uses: pnpm/action-setup@v2
20+
with:
21+
version: 8
22+
23+
- name: "Set up latest Node LTS"
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: "lts/*"
27+
cache: pnpm
28+
29+
- name: "Install dependencies"
30+
run: pnpm install
31+
32+
# Build is necessary, as the `get-e2e-test-files-array` script returns built files
33+
- name: "Build"
34+
working-directory: packages/create-next-stack
35+
run: npx turbo build
36+
37+
- name: "Set test files"
38+
id: set-test-files
39+
working-directory: packages/create-next-stack
40+
run: |
41+
echo "files=$(pnpm --silent get-e2e-test-files-array)" >> $GITHUB_OUTPUT
42+
43+
build:
44+
name: "Test - ${{ matrix.test-file.fileName }} - ${{ matrix.os }}"
45+
46+
needs: get-test-files
47+
48+
strategy:
49+
matrix:
50+
os: [ubuntu-latest, windows-latest, macOS-latest]
51+
test-file: ${{ fromJSON(needs.get-test-files.outputs.test-files) }}
52+
53+
runs-on: ${{ matrix.os }}
54+
55+
env:
56+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
57+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
58+
59+
steps:
60+
- name: "Checkout repo"
61+
uses: actions/checkout@v3
62+
63+
- name: "Set up pnpm"
64+
uses: pnpm/action-setup@v2
65+
with:
66+
version: 8
67+
68+
- name: "Set up latest Node LTS"
69+
uses: actions/setup-node@v3
70+
with:
71+
node-version: "lts/*"
72+
cache: pnpm
73+
74+
- name: "Install dependencies"
75+
run: pnpm install
76+
77+
- name: "Build"
78+
working-directory: packages/create-next-stack
79+
run: npx turbo build
80+
81+
- name: "Run e2e test: ${{ matrix.test-file.fileName }}"
82+
working-directory: packages/create-next-stack
83+
run: pnpm e2e:single:ci ${{ matrix.test-file.filePath }}

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ jobs:
1414
name: Publish
1515
runs-on: ubuntu-latest
1616

17+
env:
18+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
19+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
20+
1721
steps:
1822
- name: "Checkout repo"
1923
uses: actions/checkout@v3
@@ -34,6 +38,6 @@ jobs:
3438
run: pnpm install
3539

3640
- name: "Publish packages"
37-
run: pnpm publish -r
41+
run: pnpm publish --filter="./packages/**"
3842
env:
3943
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/web-ci.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@
5858
.history
5959
.ionide
6060

61-
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
61+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
62+
63+
.turbo

.prettierignore

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# Prettier
1+
# These are extensions to .gitignore.
2+
# .gitignore is used alongside .prettierignore using both `--ignore-path=.prettierignore` and `--ignore-path=.gitignore` at the same time.
23
**/prod-assets
4+
pnpm-lock.yaml
35

4-
##############################################
5-
### REST SHOULD BE IDENTICAL TO .gitignore ###
6-
##############################################
6+
#######################################################################################
7+
### REST SHOULD BE IDENTICAL TO .gitignore ###
8+
### TODO: Fix this when https://github.com/prettier/prettier/pull/14332 is released ###
9+
#######################################################################################
10+
11+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
712

813
# dependencies
914
**/node_modules
@@ -63,4 +68,6 @@
6368
.history
6469
.ionide
6570

66-
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
71+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
72+
73+
.turbo

CONTRIBUTING.md

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Hey there! We're excited that you're interested in contributing to Create Next S
66

77
- [Getting Started](#getting-started)
88
- [Repository Overview](#repository-overview)
9+
- [Scripts](#scripts)
910
- [Creating a pull request](#creating-a-pull-request)
1011
- [Adding support for a new technology](#adding-support-for-a-new-technology)
1112
- [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
3031
```yaml
3132
packages:
3233
- "packages/**"
33-
- "website"
34+
- "apps/**"
3435
```
3536
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.
44+
45+
| Script | Description |
46+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47+
| `build` | Builds the project. |
48+
| `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. |
5565

5666
## Creating a Pull Request
5767

@@ -70,18 +80,14 @@ Make sure you are set up locally by following the [Getting Started](#getting-sta
7080

7181
- `git checkout -b feature/support-my-favorite-technology`
7282

73-
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:
7484

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.
8190
- 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.
8591
- `clean` - Removes all generated files, including build files and the `create-next-stack-tests` directory created by the e2e tests.
8692

8793
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
9197
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).
9298
5. Add the plugin to the `plugins` array in [`setup.ts`](packages/create-next-stack/src/main/setup/setup.ts).
9399
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.
95101
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.
97103
- 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).
98104
9. Run tests using `yarn test` to ensure they all pass.
99105
10. Submit a Pull Request on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)