Skip to content

Commit

Permalink
fix(create-start): readme changes and little fixes (#3142)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasballinger authored Jan 12, 2025
1 parent 9c9d0f4 commit e39eee5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
37 changes: 37 additions & 0 deletions packages/create-start/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# @tanstack/create-start

CLI tool for creating and modifying TanStack Start projects.

```
pnpm create @tanstack/start
```

Run

```
pnpm create @tanstack/start --help
```

to see all options.

Until peer dependency issues are worked out, `npm create @tanstack/start` doesn't work.

Use pnpm or maybe a bundled version could be published instead.

# Contributing

## Modules

Modules represent templates and functionality that can be added later to a TanStack Start project. A module is created using a chain of methods specifying callbacks which receives arguments from the previous step.

- `createModule(schema)`: Set the schema of values that will be passed in from command line options.

- `.init((configFromSchema) => { ... })`: Crawl the filesystem to infer configuration, for example detecting the current package manager

- `.prompt((configFromInit) => { ... })`: Prompt the user for configuration, skipping config that has already been specified.

- `.validateAndApply({ validate, apply })`

- `validate({ cfg, targetPath })`: check if preconditions met (is there a package.json? is a library already installed?) and return an array of strings that are issues to address

- `apply({ cfg, targetPath })`: modify the filesystem: install libraries, modify files
2 changes: 2 additions & 0 deletions packages/create-start/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default [
'ts-nocheck': false,
},
],
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/require-await': 'off',
},
},
]
2 changes: 1 addition & 1 deletion packages/create-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"url": "https://github.com/sponsors/tannerlinsley"
},
"bin": {
"create-router": "index.js"
"create-start": "index.js"
},
"scripts": {
"dev": "BUILD_ENV=development unbuild --stub --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-start/src/utils/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const debugCliOption = createOption(
).argParser((value) => {
if (!DEBUG_LEVELS.includes(value as DebugLevels)) {
throw new InvalidArgumentError(
`Invalid IDE: ${value}. Only the following are allowed: ${DEBUG_LEVELS.join(', ')}`,
`Invalid debug level: ${value}. Only the following are allowed: ${DEBUG_LEVELS.join(', ')}`,
)
}
return value as DebugLevels
Expand Down

0 comments on commit e39eee5

Please sign in to comment.