|
24 | 24 |
|
25 | 25 | - `@tanstack/cta-frameworks-react-cra` - The React (Create React App) framework for TanStack CTA.
|
26 | 26 | - `@tanstack/cta-frameworks-solid` - The Solid framework for TanStack CTA.
|
| 27 | + |
| 28 | +## File Templates |
| 29 | + |
| 30 | +The CTA system uses EJS to render the files into the final application. |
| 31 | + |
| 32 | +Below are all of the variables that are available to the file templates. |
| 33 | + |
| 34 | +| Variable | Description | |
| 35 | +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 36 | +| `packageManager` | The package manager that is being used (e.g. `npm`, `yarn`, `pnpm`) | |
| 37 | +| `projectName` | The name of the project | |
| 38 | +| `typescript` | Boolean value that is `true` if TypeScript is being used, otherwise it is `false` | |
| 39 | +| `tailwind` | Boolean value that is `true` if Tailwind CSS is being used, otherwise it is `false` | |
| 40 | +| `js` | The file extension for files that do not include JSX. When in TypeScript mode it is `ts`. When in JavaScript mode it is `js`. | |
| 41 | +| `jsx` | The file extension for files that include JSX. When in TypeScript mode it is `tsx`. When in JavaScript mode it is `jsx`. | |
| 42 | +| `fileRouter` | Boolean value that is `true` if the file router is being used, otherwise it is `false` | |
| 43 | +| `codeRouter` | Boolean value that is `true` if the code router is being used, otherwise it is `false` | |
| 44 | +| `addOnEnabled` | An object that contains the enabled add-ons. The keys are the `id` values of the add-ons. For example, if the tanstack-query add-on is enabled the `addOnEnabled]['tanstack-query']` will be `true`. | |
| 45 | +| `addOns` | An array of the enabled add-on objects | |
| 46 | +| `integrations` | An array of the enabled integrations | |
| 47 | +| `routes` | An array containing all of the routes from all of the add-ons. (Used by the header and the `code-router` setup.) | |
| 48 | +| `getPackageManagerAddScript` | A function that returns the script to add a dependency to the project. | |
| 49 | +| `getPackageManagerRunScript` | A function that returns the script to run a command in the project. | |
| 50 | +| `relativePath` | A function that returns the relative path from the current file to the specified target file. | |
| 51 | +| `ignoreFile` | A function that if called will tell CTA to not include this file in the application. | |
0 commit comments