create-redmix-app 0.0.1
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/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/create-redmix-app.js +637 -0
- package/package.json +57 -0
- package/templates/js/.editorconfig +10 -0
- package/templates/js/.env +15 -0
- package/templates/js/.env.defaults +19 -0
- package/templates/js/.env.example +4 -0
- package/templates/js/.redwood/README.md +44 -0
- package/templates/js/.vscode/extensions.json +14 -0
- package/templates/js/.vscode/launch.json +56 -0
- package/templates/js/.vscode/settings.json +11 -0
- package/templates/js/.vscode/tasks.json +29 -0
- package/templates/js/.yarnrc.yml +15 -0
- package/templates/js/README.md +122 -0
- package/templates/js/api/db/schema.prisma +24 -0
- package/templates/js/api/jest.config.js +8 -0
- package/templates/js/api/jsconfig.json +41 -0
- package/templates/js/api/package.json +9 -0
- package/templates/js/api/src/directives/requireAuth/requireAuth.js +22 -0
- package/templates/js/api/src/directives/requireAuth/requireAuth.test.js +18 -0
- package/templates/js/api/src/directives/skipAuth/skipAuth.js +16 -0
- package/templates/js/api/src/directives/skipAuth/skipAuth.test.js +10 -0
- package/templates/js/api/src/functions/graphql.js +19 -0
- package/templates/js/api/src/graphql/.keep +0 -0
- package/templates/js/api/src/lib/auth.js +32 -0
- package/templates/js/api/src/lib/db.js +26 -0
- package/templates/js/api/src/lib/logger.js +17 -0
- package/templates/js/api/src/services/.keep +0 -0
- package/templates/js/gitignore.template +24 -0
- package/templates/js/graphql.config.js +11 -0
- package/templates/js/jest.config.js +8 -0
- package/templates/js/package.json +28 -0
- package/templates/js/prettier.config.js +18 -0
- package/templates/js/redwood.toml +21 -0
- package/templates/js/scripts/.keep +0 -0
- package/templates/js/scripts/jsconfig.json +54 -0
- package/templates/js/scripts/seed.js +27 -0
- package/templates/js/web/jest.config.js +8 -0
- package/templates/js/web/jsconfig.json +53 -0
- package/templates/js/web/package.json +25 -0
- package/templates/js/web/public/README.md +43 -0
- package/templates/js/web/public/favicon.png +0 -0
- package/templates/js/web/public/robots.txt +2 -0
- package/templates/js/web/src/App.jsx +16 -0
- package/templates/js/web/src/Routes.jsx +20 -0
- package/templates/js/web/src/components/.keep +0 -0
- package/templates/js/web/src/entry.client.jsx +35 -0
- package/templates/js/web/src/index.css +0 -0
- package/templates/js/web/src/index.html +15 -0
- package/templates/js/web/src/layouts/.keep +0 -0
- package/templates/js/web/src/pages/FatalErrorPage/FatalErrorPage.jsx +58 -0
- package/templates/js/web/src/pages/NotFoundPage/NotFoundPage.jsx +45 -0
- package/templates/js/web/vite.config.js +15 -0
- package/templates/js/yarn.lock +17991 -0
- package/templates/ts/.editorconfig +10 -0
- package/templates/ts/.env +15 -0
- package/templates/ts/.env.defaults +19 -0
- package/templates/ts/.env.example +4 -0
- package/templates/ts/.redwood/README.md +44 -0
- package/templates/ts/.vscode/extensions.json +14 -0
- package/templates/ts/.vscode/launch.json +56 -0
- package/templates/ts/.vscode/settings.json +11 -0
- package/templates/ts/.vscode/tasks.json +29 -0
- package/templates/ts/.yarnrc.yml +15 -0
- package/templates/ts/README.md +122 -0
- package/templates/ts/api/db/schema.prisma +24 -0
- package/templates/ts/api/jest.config.js +8 -0
- package/templates/ts/api/package.json +9 -0
- package/templates/ts/api/src/directives/requireAuth/requireAuth.test.ts +18 -0
- package/templates/ts/api/src/directives/requireAuth/requireAuth.ts +25 -0
- package/templates/ts/api/src/directives/skipAuth/skipAuth.test.ts +10 -0
- package/templates/ts/api/src/directives/skipAuth/skipAuth.ts +16 -0
- package/templates/ts/api/src/functions/graphql.ts +19 -0
- package/templates/ts/api/src/graphql/.keep +0 -0
- package/templates/ts/api/src/lib/auth.ts +32 -0
- package/templates/ts/api/src/lib/db.ts +26 -0
- package/templates/ts/api/src/lib/logger.ts +17 -0
- package/templates/ts/api/src/services/.keep +0 -0
- package/templates/ts/api/tsconfig.json +26 -0
- package/templates/ts/gitignore.template +24 -0
- package/templates/ts/graphql.config.js +11 -0
- package/templates/ts/jest.config.js +8 -0
- package/templates/ts/package.json +28 -0
- package/templates/ts/prettier.config.js +18 -0
- package/templates/ts/redwood.toml +21 -0
- package/templates/ts/scripts/.keep +0 -0
- package/templates/ts/scripts/seed.ts +27 -0
- package/templates/ts/scripts/tsconfig.json +29 -0
- package/templates/ts/web/jest.config.js +8 -0
- package/templates/ts/web/package.json +25 -0
- package/templates/ts/web/public/README.md +43 -0
- package/templates/ts/web/public/favicon.png +0 -0
- package/templates/ts/web/public/robots.txt +2 -0
- package/templates/ts/web/src/App.tsx +22 -0
- package/templates/ts/web/src/Routes.tsx +20 -0
- package/templates/ts/web/src/components/.keep +0 -0
- package/templates/ts/web/src/entry.client.tsx +35 -0
- package/templates/ts/web/src/index.css +0 -0
- package/templates/ts/web/src/index.html +15 -0
- package/templates/ts/web/src/layouts/.keep +0 -0
- package/templates/ts/web/src/pages/FatalErrorPage/FatalErrorPage.tsx +57 -0
- package/templates/ts/web/src/pages/NotFoundPage/NotFoundPage.tsx +44 -0
- package/templates/ts/web/tsconfig.json +44 -0
- package/templates/ts/web/vite.config.ts +16 -0
- package/templates/ts/yarn.lock +17991 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"private": true,
|
3
|
+
"workspaces": {
|
4
|
+
"packages": [
|
5
|
+
"api",
|
6
|
+
"web"
|
7
|
+
]
|
8
|
+
},
|
9
|
+
"devDependencies": {
|
10
|
+
"@redmix/core": "0.0.1",
|
11
|
+
"@redmix/project-config": "0.0.1"
|
12
|
+
},
|
13
|
+
"eslintConfig": {
|
14
|
+
"extends": "@redmix/eslint-config",
|
15
|
+
"root": true
|
16
|
+
},
|
17
|
+
"engines": {
|
18
|
+
"node": "=20.x"
|
19
|
+
},
|
20
|
+
"prisma": {
|
21
|
+
"seed": "yarn rw exec seed"
|
22
|
+
},
|
23
|
+
"packageManager": "yarn@4.6.0",
|
24
|
+
"resolutions": {
|
25
|
+
"@storybook/react-dom-shim@npm:7.6.20": "https://verdaccio.tobbe.dev/@storybook/react-dom-shim/-/react-dom-shim-8.0.8.tgz",
|
26
|
+
"react-is": "19.0.0-rc-f2df5694-20240916"
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// https://prettier.io/docs/en/options.html
|
2
|
+
/** @type {import('prettier').RequiredOptions} */
|
3
|
+
module.exports = {
|
4
|
+
trailingComma: 'es5',
|
5
|
+
bracketSpacing: true,
|
6
|
+
tabWidth: 2,
|
7
|
+
semi: false,
|
8
|
+
singleQuote: true,
|
9
|
+
arrowParens: 'always',
|
10
|
+
overrides: [
|
11
|
+
{
|
12
|
+
files: 'Routes.*',
|
13
|
+
options: {
|
14
|
+
printWidth: 999,
|
15
|
+
},
|
16
|
+
},
|
17
|
+
],
|
18
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# This file contains the configuration settings for your Redwood app.
|
2
|
+
# This file is also what makes your Redwood app a Redwood app.
|
3
|
+
# If you remove it and try to run `yarn rw dev`, you'll get an error.
|
4
|
+
#
|
5
|
+
# For the full list of options, see the "App Configuration: redwood.toml" doc:
|
6
|
+
# https://redwoodjs.com/docs/app-configuration-redwood-toml
|
7
|
+
|
8
|
+
[web]
|
9
|
+
title = "Redwood App"
|
10
|
+
port = 8910
|
11
|
+
apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
|
12
|
+
includeEnvironmentVariables = [
|
13
|
+
# Add any ENV vars that should be available to the web side to this array
|
14
|
+
# See https://redwoodjs.com/docs/environment-variables#web
|
15
|
+
]
|
16
|
+
[api]
|
17
|
+
port = 8911
|
18
|
+
[browser]
|
19
|
+
open = true
|
20
|
+
[notifications]
|
21
|
+
versionUpdates = ["latest"]
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// import { db } from 'api/src/lib/db'
|
2
|
+
|
3
|
+
// Manually apply seeds via the `yarn rw prisma db seed` command.
|
4
|
+
//
|
5
|
+
// Seeds automatically run the first time you run the `yarn rw prisma migrate dev`
|
6
|
+
// command and every time you run the `yarn rw prisma migrate reset` command.
|
7
|
+
//
|
8
|
+
// See https://redwoodjs.com/docs/database-seeds for more info
|
9
|
+
|
10
|
+
export default async () => {
|
11
|
+
try {
|
12
|
+
// Create your database records here! For example, seed some users:
|
13
|
+
//
|
14
|
+
// const users = [
|
15
|
+
// { name: 'Alice', email: 'alice@redmix.com' },
|
16
|
+
// { name: 'Bob', email: 'bob@redmix.com' },
|
17
|
+
// ]
|
18
|
+
//
|
19
|
+
// await db.user.createMany({ data: users })
|
20
|
+
|
21
|
+
console.info(
|
22
|
+
'\n No seed data, skipping. See scripts/seed.ts to start seeding your database!\n'
|
23
|
+
)
|
24
|
+
} catch (error) {
|
25
|
+
console.error(error)
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"noEmit": true,
|
4
|
+
"allowJs": true,
|
5
|
+
"esModuleInterop": true,
|
6
|
+
"target": "ES2023",
|
7
|
+
"module": "Node16",
|
8
|
+
"moduleResolution": "Node16",
|
9
|
+
"paths": {
|
10
|
+
"$api/*": ["../api/*"],
|
11
|
+
"api/*": ["../api/*"],
|
12
|
+
"$api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
|
13
|
+
"api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
|
14
|
+
"$web/*": ["../web/*"],
|
15
|
+
"web/*": ["../web/*"],
|
16
|
+
"$web/src/*": ["../web/src/*", "../.redwood/types/mirror/web/src/*"],
|
17
|
+
"web/src/*": ["../web/src/*", "../.redwood/types/mirror/web/src/*"],
|
18
|
+
"types/*": ["../types/*", "../web/types/*", "../api/types/*"]
|
19
|
+
},
|
20
|
+
"typeRoots": ["../node_modules/@types"],
|
21
|
+
"jsx": "preserve"
|
22
|
+
},
|
23
|
+
"include": [
|
24
|
+
".",
|
25
|
+
"../.redwood/types/includes/all-*",
|
26
|
+
"../.redwood/types/includes/web-*",
|
27
|
+
"../types"
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"name": "web",
|
3
|
+
"version": "0.0.0",
|
4
|
+
"private": true,
|
5
|
+
"browserslist": {
|
6
|
+
"development": [
|
7
|
+
"last 1 version"
|
8
|
+
],
|
9
|
+
"production": [
|
10
|
+
"defaults"
|
11
|
+
]
|
12
|
+
},
|
13
|
+
"dependencies": {
|
14
|
+
"@redmix/forms": "0.0.1",
|
15
|
+
"@redmix/router": "0.0.1",
|
16
|
+
"@redmix/web": "0.0.1",
|
17
|
+
"react": "19.0.0-rc-f2df5694-20240916",
|
18
|
+
"react-dom": "19.0.0-rc-f2df5694-20240916"
|
19
|
+
},
|
20
|
+
"devDependencies": {
|
21
|
+
"@redmix/vite": "0.0.1",
|
22
|
+
"@types/react": "^18.2.55",
|
23
|
+
"@types/react-dom": "^18.2.19"
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Static Assets
|
2
|
+
|
3
|
+
Use this folder to add static files directly to your app. All included files and folders will be copied directly into the `/dist` folder (created when Vite builds for production). They will also be available during development when you run `yarn rw dev`.
|
4
|
+
|
5
|
+
> Note: files will _not_ hot reload while the development server is running. You'll need to manually stop/start to access file changes.
|
6
|
+
|
7
|
+
### Example Use
|
8
|
+
|
9
|
+
A file like `favicon.png` will be copied to `/dist/favicon.png`. A folder containing a file such as `static-files/my-logo.jpg` will be copied to `/dist/static-files/my-logo.jpg`. These can be referenced in your code directly without any special handling, e.g.
|
10
|
+
|
11
|
+
```
|
12
|
+
<link rel="icon" type="image/png" href="/favicon.png" />
|
13
|
+
```
|
14
|
+
|
15
|
+
and
|
16
|
+
|
17
|
+
```
|
18
|
+
<img src="/static-files/my-logo.jpg"> alt="Logo" />
|
19
|
+
```
|
20
|
+
|
21
|
+
## Best Practices
|
22
|
+
|
23
|
+
Because assets in this folder are bypassing the javascript module system, **this folder should be used sparingly** for assets such as favicons, robots.txt, manifests, libraries incompatible with Vite, etc.
|
24
|
+
|
25
|
+
In general, it's best to import files directly into a template, page, or component. This allows Vite to include that file in the bundle when small enough, or to copy it over to the `dist` folder with a hash.
|
26
|
+
|
27
|
+
### Example Asset Import with Vite
|
28
|
+
|
29
|
+
Instead of handling our logo image as a static file per the example above, we can do the following:
|
30
|
+
|
31
|
+
```
|
32
|
+
import React from "react"
|
33
|
+
import logo from "./my-logo.jpg"
|
34
|
+
|
35
|
+
|
36
|
+
function Header() {
|
37
|
+
return <img src={logo} alt="Logo" />
|
38
|
+
}
|
39
|
+
|
40
|
+
export default Header
|
41
|
+
```
|
42
|
+
|
43
|
+
See Vite's docs for [static asset handling](https://vitejs.dev/guide/assets.html)
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import type { ReactNode } from 'react'
|
2
|
+
|
3
|
+
import { FatalErrorBoundary, RedwoodProvider } from '@redmix/web'
|
4
|
+
import { RedwoodApolloProvider } from '@redmix/web/apollo'
|
5
|
+
|
6
|
+
import FatalErrorPage from 'src/pages/FatalErrorPage'
|
7
|
+
|
8
|
+
import './index.css'
|
9
|
+
|
10
|
+
interface AppProps {
|
11
|
+
children?: ReactNode
|
12
|
+
}
|
13
|
+
|
14
|
+
const App = ({ children }: AppProps) => (
|
15
|
+
<FatalErrorBoundary page={FatalErrorPage}>
|
16
|
+
<RedwoodProvider titleTemplate="%PageTitle | %AppTitle">
|
17
|
+
<RedwoodApolloProvider>{children}</RedwoodApolloProvider>
|
18
|
+
</RedwoodProvider>
|
19
|
+
</FatalErrorBoundary>
|
20
|
+
)
|
21
|
+
|
22
|
+
export default App
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// In this file, all Page components from 'src/pages` are auto-imported. Nested
|
2
|
+
// directories are supported, and should be uppercase. Each subdirectory will be
|
3
|
+
// prepended onto the component name.
|
4
|
+
//
|
5
|
+
// Examples:
|
6
|
+
//
|
7
|
+
// 'src/pages/HomePage/HomePage.js' -> HomePage
|
8
|
+
// 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage
|
9
|
+
|
10
|
+
import { Router, Route } from '@redmix/router'
|
11
|
+
|
12
|
+
const Routes = () => {
|
13
|
+
return (
|
14
|
+
<Router>
|
15
|
+
<Route notfound page={NotFoundPage} />
|
16
|
+
</Router>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
|
20
|
+
export default Routes
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { hydrateRoot, createRoot } from 'react-dom/client'
|
2
|
+
|
3
|
+
import App from './App'
|
4
|
+
import Routes from './Routes'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* When `#redwood-app` isn't empty then it's very likely that you're using
|
8
|
+
* prerendering. So React attaches event listeners to the existing markup
|
9
|
+
* rather than replacing it.
|
10
|
+
* https://react.dev/reference/react-dom/client/hydrateRoot
|
11
|
+
*/
|
12
|
+
const redwoodAppElement = document.getElementById('redwood-app')
|
13
|
+
|
14
|
+
if (!redwoodAppElement) {
|
15
|
+
throw new Error(
|
16
|
+
"Could not find an element with ID 'redwood-app'. Please ensure it " +
|
17
|
+
"exists in your 'web/src/index.html' file."
|
18
|
+
)
|
19
|
+
}
|
20
|
+
|
21
|
+
if (redwoodAppElement.children?.length > 0) {
|
22
|
+
hydrateRoot(
|
23
|
+
redwoodAppElement,
|
24
|
+
<App>
|
25
|
+
<Routes />
|
26
|
+
</App>
|
27
|
+
)
|
28
|
+
} else {
|
29
|
+
const root = createRoot(redwoodAppElement)
|
30
|
+
root.render(
|
31
|
+
<App>
|
32
|
+
<Routes />
|
33
|
+
</App>
|
34
|
+
)
|
35
|
+
}
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<link rel="icon" type="image/png" href="/favicon.png" />
|
8
|
+
</head>
|
9
|
+
|
10
|
+
<body>
|
11
|
+
<!-- Please keep this div empty -->
|
12
|
+
<div id="redwood-app"></div>
|
13
|
+
</body>
|
14
|
+
|
15
|
+
</html>
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// This page will be rendered when an error makes it all the way to the top of the
|
2
|
+
// application without being handled by a Javascript catch statement or React error
|
3
|
+
// boundary.
|
4
|
+
//
|
5
|
+
// You can modify this page as you wish, but it is important to keep things simple to
|
6
|
+
// avoid the possibility that it will cause its own error. If it does, Redwood will
|
7
|
+
// still render a generic error page, but your users will prefer something a bit more
|
8
|
+
// thoughtful :)
|
9
|
+
|
10
|
+
// This import will be automatically removed when building for production
|
11
|
+
import { DevFatalErrorPage } from '@redmix/web/dist/components/DevFatalErrorPage'
|
12
|
+
|
13
|
+
export default DevFatalErrorPage ||
|
14
|
+
(() => (
|
15
|
+
<main>
|
16
|
+
<style
|
17
|
+
dangerouslySetInnerHTML={{
|
18
|
+
__html: `
|
19
|
+
html, body {
|
20
|
+
margin: 0;
|
21
|
+
}
|
22
|
+
html * {
|
23
|
+
box-sizing: border-box;
|
24
|
+
}
|
25
|
+
main {
|
26
|
+
display: flex;
|
27
|
+
align-items: center;
|
28
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
|
29
|
+
text-align: center;
|
30
|
+
background-color: #E2E8F0;
|
31
|
+
height: 100vh;
|
32
|
+
}
|
33
|
+
section {
|
34
|
+
background-color: white;
|
35
|
+
border-radius: 0.25rem;
|
36
|
+
width: 32rem;
|
37
|
+
padding: 1rem;
|
38
|
+
margin: 0 auto;
|
39
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
40
|
+
}
|
41
|
+
h1 {
|
42
|
+
font-size: 2rem;
|
43
|
+
margin: 0;
|
44
|
+
font-weight: 500;
|
45
|
+
line-height: 1;
|
46
|
+
color: #2D3748;
|
47
|
+
}
|
48
|
+
`,
|
49
|
+
}}
|
50
|
+
/>
|
51
|
+
<section>
|
52
|
+
<h1>
|
53
|
+
<span>Something went wrong</span>
|
54
|
+
</h1>
|
55
|
+
</section>
|
56
|
+
</main>
|
57
|
+
))
|
@@ -0,0 +1,44 @@
|
|
1
|
+
export default () => (
|
2
|
+
<main>
|
3
|
+
<style
|
4
|
+
dangerouslySetInnerHTML={{
|
5
|
+
__html: `
|
6
|
+
html, body {
|
7
|
+
margin: 0;
|
8
|
+
}
|
9
|
+
html * {
|
10
|
+
box-sizing: border-box;
|
11
|
+
}
|
12
|
+
main {
|
13
|
+
display: flex;
|
14
|
+
align-items: center;
|
15
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
|
16
|
+
text-align: center;
|
17
|
+
background-color: #E2E8F0;
|
18
|
+
height: 100vh;
|
19
|
+
}
|
20
|
+
section {
|
21
|
+
background-color: white;
|
22
|
+
border-radius: 0.25rem;
|
23
|
+
width: 32rem;
|
24
|
+
padding: 1rem;
|
25
|
+
margin: 0 auto;
|
26
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
27
|
+
}
|
28
|
+
h1 {
|
29
|
+
font-size: 2rem;
|
30
|
+
margin: 0;
|
31
|
+
font-weight: 500;
|
32
|
+
line-height: 1;
|
33
|
+
color: #2D3748;
|
34
|
+
}
|
35
|
+
`,
|
36
|
+
}}
|
37
|
+
/>
|
38
|
+
<section>
|
39
|
+
<h1>
|
40
|
+
<span>404 Page Not Found</span>
|
41
|
+
</h1>
|
42
|
+
</section>
|
43
|
+
</main>
|
44
|
+
)
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"noEmit": true,
|
4
|
+
"allowJs": true,
|
5
|
+
"esModuleInterop": true,
|
6
|
+
"target": "ES2022",
|
7
|
+
"module": "ESNext",
|
8
|
+
"moduleResolution": "Bundler",
|
9
|
+
"skipLibCheck": false,
|
10
|
+
"rootDirs": [
|
11
|
+
"./src",
|
12
|
+
"../.redwood/types/mirror/web/src",
|
13
|
+
"../api/src",
|
14
|
+
"../.redwood/types/mirror/api/src"
|
15
|
+
],
|
16
|
+
"paths": {
|
17
|
+
"src/*": [
|
18
|
+
"./src/*",
|
19
|
+
"../.redwood/types/mirror/web/src/*",
|
20
|
+
"../api/src/*",
|
21
|
+
"../.redwood/types/mirror/api/src/*"
|
22
|
+
],
|
23
|
+
"$api/*": ["../api/*"],
|
24
|
+
"types/*": ["./types/*", "../types/*"],
|
25
|
+
"@redmix/testing": ["../node_modules/@redmix/testing/web"]
|
26
|
+
},
|
27
|
+
"typeRoots": [
|
28
|
+
"../node_modules/@types",
|
29
|
+
"./node_modules/@types",
|
30
|
+
"../node_modules/@testing-library"
|
31
|
+
],
|
32
|
+
"types": ["jest", "jest-dom"],
|
33
|
+
"jsx": "preserve"
|
34
|
+
},
|
35
|
+
"include": [
|
36
|
+
"src",
|
37
|
+
"config",
|
38
|
+
".storybook/**/*",
|
39
|
+
"../.redwood/types/includes/all-*",
|
40
|
+
"../.redwood/types/includes/web-*",
|
41
|
+
"../types",
|
42
|
+
"./types"
|
43
|
+
]
|
44
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import dns from 'dns'
|
2
|
+
|
3
|
+
import type { UserConfig } from 'vite'
|
4
|
+
import { defineConfig } from 'vite'
|
5
|
+
|
6
|
+
import redwood from '@redmix/vite'
|
7
|
+
|
8
|
+
// So that Vite will load on localhost instead of `127.0.0.1`.
|
9
|
+
// See: https://vitejs.dev/config/server-options.html#server-host.
|
10
|
+
dns.setDefaultResultOrder('verbatim')
|
11
|
+
|
12
|
+
const viteConfig: UserConfig = {
|
13
|
+
plugins: [redwood()],
|
14
|
+
}
|
15
|
+
|
16
|
+
export default defineConfig(viteConfig)
|