create-tsrouter-app 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/templates/base/README.md.ejs +2 -2
- package/templates/base/package.json +1 -1
- package/templates/base/public/manifest.json +2 -2
- package/templates/base/src/App.test.tsx.ejs +1 -1
- package/templates/base/tsconfig.json +19 -5
- package/templates/code-router/src/main.tsx.ejs +2 -2
- package/templates/file-router/src/main.tsx.ejs +1 -1
- package/templates/base/tsconfig.dev.json +0 -10
package/dist/index.js
CHANGED
|
@@ -145,7 +145,7 @@ async function createApp(projectName, options) {
|
|
|
145
145
|
await templateFile(templateDirBase, './index.html.ejs');
|
|
146
146
|
// Setup tsconfig
|
|
147
147
|
if (options.typescript) {
|
|
148
|
-
await copyFiles(templateDirBase, ['./tsconfig.json'
|
|
148
|
+
await copyFiles(templateDirBase, ['./tsconfig.json']);
|
|
149
149
|
}
|
|
150
150
|
// Setup the package.json file, optionally with typescript and tailwind
|
|
151
151
|
await createPackageJSON(projectName, options, templateDirBase, templateDirRouter, targetDir);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -236,7 +236,7 @@ async function createApp(projectName: string, options: Required<Options>) {
|
|
|
236
236
|
|
|
237
237
|
// Setup tsconfig
|
|
238
238
|
if (options.typescript) {
|
|
239
|
-
await copyFiles(templateDirBase, ['./tsconfig.json'
|
|
239
|
+
await copyFiles(templateDirBase, ['./tsconfig.json'])
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
// Setup the package.json file, optionally with typescript and tailwind
|
|
@@ -61,7 +61,7 @@ With this set up you should be able to navigate to `/about` and see the about pa
|
|
|
61
61
|
Of course you don't need to implement the About page in the `main.<%= jsx %>` file. You can create that component in another file and import it into the `main.<%= jsx %>` file, then use it in the `component` property of the `createRoute` call, like so:
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
|
-
import About from "./components/About";
|
|
64
|
+
import About from "./components/About.<%= jsx %>";
|
|
65
65
|
|
|
66
66
|
const aboutRoute = createRoute({
|
|
67
67
|
getParentRoute: () => rootRoute,
|
|
@@ -298,7 +298,7 @@ import { RouterProvider, createRouter } from "@tanstack/react-router";
|
|
|
298
298
|
import { routeTree } from "./routeTree.gen";
|
|
299
299
|
|
|
300
300
|
import "./styles.css";
|
|
301
|
-
import reportWebVitals from "./reportWebVitals";
|
|
301
|
+
import reportWebVitals from "./reportWebVitals.<%= js %>";
|
|
302
302
|
|
|
303
303
|
// Create a new router instance
|
|
304
304
|
const router = createRouter({ routeTree });
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"types": ["vite/client", "node"],
|
|
5
|
-
"esModuleInterop": true,
|
|
4
|
+
"target": "ES2022",
|
|
6
5
|
"jsx": "react-jsx",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedSideEffectImports": true
|
|
9
23
|
}
|
|
10
24
|
}
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
|
|
11
11
|
|
|
12
12
|
import "./styles.css";
|
|
13
|
-
import reportWebVitals from "./reportWebVitals";
|
|
13
|
+
import reportWebVitals from "./reportWebVitals.<%= js %>";
|
|
14
14
|
|
|
15
|
-
import App from "./App";
|
|
15
|
+
import App from "./App.<%= jsx %>";
|
|
16
16
|
|
|
17
17
|
const rootRoute = createRootRoute({
|
|
18
18
|
component: () => (
|
|
@@ -6,7 +6,7 @@ import { RouterProvider, createRouter } from "@tanstack/react-router";
|
|
|
6
6
|
import { routeTree } from "./routeTree.gen";
|
|
7
7
|
|
|
8
8
|
import "./styles.css";
|
|
9
|
-
import reportWebVitals from "./reportWebVitals";
|
|
9
|
+
import reportWebVitals from "./reportWebVitals.<%= js %>";
|
|
10
10
|
|
|
11
11
|
// Create a new router instance
|
|
12
12
|
const router = createRouter({ routeTree });
|