rsnext/packages/create-next-app/helpers
Julius Marminge 9f93d34061
fix: create-next-app copies files it shouldn't (#43131)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

Closes #43130

This fixes the bug where the CLI copies files it shouldn't, by adding a
`/` separator at the end of the directory name.

Given `examples/next-prisma-starter` and
`examples/next-prisma-starter-websockets`, only files inside the
`examples/next-prisma-starter` will now be copied.

Here is a repo created by the CLI after this fix, using

```bash
# Inside packages/create-next-app
pnpm build
node dist/index.js --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter
```

https://github.com/juliusmarminge/create-next-app-bugfix

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-21 16:51:57 -08:00
..
examples.ts fix: create-next-app copies files it shouldn't (#43131) 2022-11-21 16:51:57 -08:00
get-pkg-manager.ts Add npm to create-next-app environment package manager parser (#41279) 2022-10-13 14:34:55 -07:00
git.ts feat: update create-next-app to init with main as initial branch (#17745) 2020-11-07 14:46:17 +00:00
install.ts Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
is-folder-empty.ts Add yarn 2 Setup Files to Valid Files for create-next-app (#30936) 2022-08-07 22:05:48 -05:00
is-online.ts Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
is-writeable.ts CNA: Add warning about permission (#14889) 2020-08-19 17:09:34 +00:00
make-dir.ts CNA: replace make-dir with core recursive mkdir (#15006) 2020-07-10 01:29:03 +00:00
validate-pkg.ts Update to latest babel versions (#28174) 2021-08-17 09:18:08 +02:00