Skip to content

Commit 33b5740

Browse files
committed
fix: dot file fixes
1 parent 334751c commit 33b5740

File tree

16 files changed

+28
-19
lines changed

16 files changed

+28
-19
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Available options:
4343

4444
- `--template <type>`: Choose between `file-router`, `typescript`, or `javascript`
4545
- `--tailwind`: Enable Tailwind CSS
46-
- `--package-manager`: Specify your preferred package manager (`npm`, `yarn`, `pnpm`, or `bun`)
46+
- `--package-manager`: Specify your preferred package manager (`npm`, `yarn`, `pnpm`, `bun`, or `deno`)
4747
- `--no-git`: Do not initialize a git repository
4848

4949
When using flags, the CLI will display which options were provided and only prompt for the remaining choices.
@@ -88,7 +88,7 @@ Enable Tailwind CSS either through the interactive CLI or by adding the `--tailw
8888

8989
### Package Manager
9090

91-
Choose your preferred package manager (`npm`, `bun`, `yarn`, or `pnpm`) either through the interactive CLI or using the `--package-manager` flag.
91+
Choose your preferred package manager (`npm`, `bun`, `yarn`, `pnpm`, or `deno`) either through the interactive CLI or using the `--package-manager` flag.
9292

9393
Extensive documentation on using the TanStack Router, migrating to a File Base Routing approach, as well as integrating [@tanstack/react-query](https://tanstack.com/query/latest) and [@tanstack/store](https://tanstack.com/store/latest) can be found in the generated `README.md` for your project.
9494

src/create-app.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -195,23 +195,31 @@ async function copyFilesRecursively(
195195
)
196196
}
197197
} else {
198-
if (source.endsWith('.ejs')) {
199-
const targetPath = target.replace('.ejs', '')
200-
await mkdir(dirname(targetPath), {
201-
recursive: true,
202-
})
198+
let targetFile = basename(target).replace(/_dot_/, '.')
199+
let isTemplate = false
200+
if (targetFile.endsWith('.ejs')) {
201+
targetFile = targetFile.replace('.ejs', '')
202+
isTemplate = true
203+
}
204+
let isAppend = false
205+
if (targetFile.endsWith('.append')) {
206+
targetFile = targetFile.replace('.append', '')
207+
isAppend = true
208+
}
209+
210+
const targetPath = resolve(dirname(target), targetFile)
211+
212+
await mkdir(dirname(targetPath), {
213+
recursive: true,
214+
})
215+
216+
if (isTemplate) {
203217
await templateFile(source, targetPath)
204218
} else {
205-
await mkdir(dirname(target), {
206-
recursive: true,
207-
})
208-
if (source.endsWith('.append')) {
209-
await appendFile(
210-
target.replace('.append', ''),
211-
(await readFile(source)).toString(),
212-
)
219+
if (isAppend) {
220+
await appendFile(targetPath, (await readFile(source)).toString())
213221
} else {
214-
await copyFile(source, target)
222+
await copyFile(source, targetPath)
215223
}
216224
}
217225
}
@@ -252,7 +260,7 @@ export async function createApp(options: Required<Options>) {
252260
// Setup the .vscode directory
253261
await mkdir(resolve(targetDir, '.vscode'), { recursive: true })
254262
await copyFile(
255-
resolve(templateDirBase, '.vscode/settings.json'),
263+
resolve(templateDirBase, '_dot_vscode/settings.json'),
256264
resolve(targetDir, '.vscode/settings.json'),
257265
)
258266

@@ -427,7 +435,7 @@ export async function createApp(options: Required<Options>) {
427435

428436
// Add .gitignore
429437
await copyFile(
430-
resolve(templateDirBase, 'gitignore'),
438+
resolve(templateDirBase, '_dot_gitignore'),
431439
resolve(targetDir, '.gitignore'),
432440
)
433441

@@ -453,7 +461,7 @@ export async function createApp(options: Required<Options>) {
453461
454462
Use the following commands to start your app:
455463
% cd ${options.projectName}
456-
% ${options.packageManager} ${isAddOnEnabled('start') ? 'dev' : 'start'}
464+
% ${options.packageManager === 'deno' ? 'deno start' : options.packageManager} ${isAddOnEnabled('start') ? 'dev' : 'start'}
457465
458466
Please read README.md for more information on testing, styling, adding routes, react-query, etc.
459467
`)

src/package-manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export const SUPPORTED_PACKAGE_MANAGERS = [
33
'yarn',
44
'pnpm',
55
'bun',
6+
'deno',
67
] as const
78
export type PackageManager = (typeof SUPPORTED_PACKAGE_MANAGERS)[number]
89
export const DEFAULT_PACKAGE_MANAGER: PackageManager = 'npm'
File renamed without changes.

0 commit comments

Comments
 (0)