@wasp.sh/wasp-cli-darwin-arm64-unknown 0.20.2 → 0.21.0-rc.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/data/Cli/starters/basic/README.md +1 -1
- package/data/Cli/starters/basic/package.json +10 -7
- package/data/Cli/starters/basic/src/App.css +30 -12
- package/data/Cli/starters/basic/src/App.tsx +1 -1
- package/data/Cli/starters/basic/src/auth/AuthLayout.tsx +3 -1
- package/data/Cli/starters/basic/src/auth/email/EmailVerificationPage.tsx +2 -2
- package/data/Cli/starters/basic/src/auth/email/LoginPage.tsx +3 -3
- package/data/Cli/starters/basic/src/auth/email/PasswordResetPage.tsx +2 -2
- package/data/Cli/starters/basic/src/auth/email/SignupPage.tsx +2 -2
- package/data/Cli/starters/basic/src/shared/components/Button.tsx +3 -2
- package/data/Cli/starters/basic/src/shared/components/Dialog.tsx +23 -41
- package/data/Cli/starters/basic/src/shared/components/Header.tsx +2 -2
- package/data/Cli/starters/basic/src/shared/components/Input.tsx +25 -28
- package/data/Cli/starters/basic/src/tags/components/ColorRadioButton.tsx +8 -9
- package/data/Cli/starters/basic/src/tags/components/CreateTagDialog.tsx +29 -29
- package/data/Cli/starters/basic/src/tags/components/CreateTagForm.tsx +6 -8
- package/data/Cli/starters/basic/src/tasks/components/CreateTaskForm.tsx +2 -2
- package/data/Cli/starters/basic/src/tasks/components/TaskListItem.tsx +3 -2
- package/data/Cli/starters/basic/vite.config.ts +3 -0
- package/data/Cli/starters/minimal/package.json +2 -3
- package/data/Cli/starters/minimal/vite.config.ts +2 -0
- package/data/Cli/starters/skeleton/src/vite-env.d.ts +2 -6
- package/data/Generator/libs/auth/wasp.sh-lib-auth-0.21.0.tgz +0 -0
- package/data/Generator/templates/Dockerfile +13 -12
- package/data/Generator/templates/sdk/wasp/auth/forms/Auth.tsx +2 -11
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +10 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ForgotPasswordForm.tsx +4 -3
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ResetPasswordForm.tsx +4 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/VerifyEmailForm.tsx +3 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx +11 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/types.ts +0 -6
- package/data/Generator/templates/sdk/wasp/auth/jwt.ts +9 -16
- package/data/Generator/templates/sdk/wasp/auth/password.ts +1 -36
- package/data/Generator/templates/sdk/wasp/auth/utils.ts +2 -0
- package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/DefaultRootErrorBoundary.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/client/app/components/WaspApp.tsx +45 -0
- package/data/Generator/templates/sdk/wasp/client/app/index.tsx +26 -0
- package/data/Generator/templates/{react-app/src/auth → sdk/wasp/client/app}/pages/OAuthCallback.tsx +9 -8
- package/data/Generator/templates/{react-app/src/auth → sdk/wasp/client/app}/pages/createAuthRequiredPage.jsx +7 -9
- package/data/Generator/templates/sdk/wasp/client/app/router/router.tsx +47 -0
- package/data/Generator/templates/sdk/wasp/client/auth/index.ts +3 -0
- package/data/Generator/templates/sdk/wasp/client/auth/microsoft.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/ui.ts +3 -0
- package/data/Generator/templates/sdk/wasp/client/router/Link.tsx +2 -2
- package/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx +10 -12
- package/data/Generator/templates/sdk/wasp/client/vite/index.ts +1 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/detectServerImports.ts +50 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/envFile.ts +112 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/html/build.ts +38 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/html/dev.ts +35 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/typescriptCheck.ts +32 -0
- package/data/Generator/templates/{react-app/vite → sdk/wasp/client/vite/plugins}/validateEnv.ts +17 -7
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/virtualModules.ts +29 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/wasp.ts +36 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/waspConfig.ts +56 -0
- package/data/Generator/templates/{react-app → sdk/wasp/client/vite/virtual-files/files}/index.html +1 -2
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/index.tsx +34 -0
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/routes.tsx +17 -0
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/index.ts +20 -0
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/resolver.ts +28 -0
- package/data/Generator/templates/sdk/wasp/package.json +6 -4
- package/data/Generator/templates/sdk/wasp/scripts/copy-assets.js +67 -7
- package/data/Generator/templates/sdk/wasp/server/auth/hooks.ts +3 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/index.ts +4 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/microsoft.ts +23 -0
- package/data/Generator/templates/sdk/wasp/server/auth/user.ts +6 -0
- package/data/Generator/templates/sdk/wasp/server/env.ts +11 -0
- package/data/Generator/templates/sdk/wasp/tsconfig.json +5 -1
- package/data/Generator/templates/server/src/auth/providers/config/microsoft.ts +65 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts +1 -1
- package/data/packages/deploy/dist/common/clientApp.js +4 -11
- package/data/packages/deploy/dist/common/terminal.js +7 -0
- package/data/packages/deploy/dist/common/waspProject.js +11 -7
- package/data/packages/deploy/dist/providers/fly/CommonOps.js +3 -3
- package/data/packages/deploy/dist/providers/fly/commands/cmd/cmd.js +1 -1
- package/data/packages/deploy/dist/providers/fly/commands/deploy/deploy.js +6 -5
- package/data/packages/deploy/dist/providers/fly/commands/setup/setup.js +3 -3
- package/data/packages/deploy/dist/providers/fly/index.js +5 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/client.js +2 -1
- package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +21 -10
- package/data/packages/deploy/dist/providers/railway/index.js +5 -0
- package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +9 -3
- package/data/packages/deploy/dist/providers/railway/railwayService/url.js +8 -1
- package/data/packages/studio/dist/public/assets/Flow-_d98T2dd.js +26 -0
- package/data/packages/studio/dist/public/assets/index-B6X8EdJH.js +21 -0
- package/data/packages/studio/dist/public/assets/index-CXlD_bzV.js +1 -0
- package/data/packages/studio/dist/public/assets/index-IWX3d-Jz.css +1 -0
- package/data/packages/studio/dist/public/index.html +2 -3
- package/package.json +1 -1
- package/wasp-bin +0 -0
- package/data/Cli/starters/basic/postcss.config.js +0 -6
- package/data/Cli/starters/basic/src/shared/components/Portal.tsx +0 -26
- package/data/Cli/starters/basic/tailwind.config.js +0 -30
- package/data/Generator/templates/react-app/README.md +0 -21
- package/data/Generator/templates/react-app/gitignore +0 -23
- package/data/Generator/templates/react-app/netlify.toml +0 -8
- package/data/Generator/templates/react-app/npmrc +0 -1
- package/data/Generator/templates/react-app/package.json +0 -31
- package/data/Generator/templates/react-app/public/manifest.json +0 -15
- package/data/Generator/templates/react-app/src/index.tsx +0 -47
- package/data/Generator/templates/react-app/src/logo.png +0 -0
- package/data/Generator/templates/react-app/src/router.tsx +0 -59
- package/data/Generator/templates/react-app/src/utils.js +0 -3
- package/data/Generator/templates/react-app/src/vite-env.d.ts +0 -1
- package/data/Generator/templates/react-app/tsconfig.app.json +0 -28
- package/data/Generator/templates/react-app/tsconfig.json +0 -11
- package/data/Generator/templates/react-app/tsconfig.vite.json +0 -16
- package/data/Generator/templates/react-app/vite/detectServerImports.ts +0 -53
- package/data/Generator/templates/react-app/vite.config.ts +0 -74
- package/data/Generator/templates/sdk/wasp/dev/index.ts +0 -19
- package/data/packages/studio/dist/public/assets/Flow-b5112d3d.js +0 -26
- package/data/packages/studio/dist/public/assets/index-17ce6ed4.css +0 -1
- package/data/packages/studio/dist/public/assets/index-62a9d21a.js +0 -120
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/FullPageWrapper.tsx +0 -0
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/Loader.module.css +0 -0
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/Loader.tsx +0 -0
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/Message.tsx +0 -0
- /package/data/Generator/templates/{react-app/src/test/vitest → sdk/wasp/client/test}/setup.ts +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ReactDOM from "react-dom";
|
|
3
|
-
|
|
4
|
-
interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
container?: Element | null;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Inspired by Radix UI's Portal component.
|
|
10
|
-
* @see https://github.com/radix-ui/primitives/blob/main/packages/react/portal/src/portal.tsx
|
|
11
|
-
*/
|
|
12
|
-
export const Portal = React.forwardRef<HTMLDivElement, PortalProps>(
|
|
13
|
-
function Portal({ container: containerProp, ...portalProps }, forwardRef) {
|
|
14
|
-
const [mounted, setMounted] = React.useState(false);
|
|
15
|
-
React.useLayoutEffect(() => setMounted(true), []);
|
|
16
|
-
|
|
17
|
-
const container = containerProp || (mounted && globalThis?.document?.body);
|
|
18
|
-
|
|
19
|
-
return container
|
|
20
|
-
? ReactDOM.createPortal(
|
|
21
|
-
<div {...portalProps} ref={forwardRef} />,
|
|
22
|
-
container,
|
|
23
|
-
)
|
|
24
|
-
: null;
|
|
25
|
-
},
|
|
26
|
-
);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { resolveProjectPath } from "wasp/dev";
|
|
2
|
-
|
|
3
|
-
/** @type {import('tailwindcss').Config} */
|
|
4
|
-
export default {
|
|
5
|
-
content: [resolveProjectPath("./src/**/*.{js,jsx,ts,tsx}")],
|
|
6
|
-
theme: {
|
|
7
|
-
extend: {
|
|
8
|
-
fontSize: {
|
|
9
|
-
"tiny": ["0.625rem", "1rem"], // 10px
|
|
10
|
-
},
|
|
11
|
-
colors: {
|
|
12
|
-
// Created using https://www.tints.dev
|
|
13
|
-
primary: {
|
|
14
|
-
50: "#FFFBEB",
|
|
15
|
-
100: "#FFF7D6",
|
|
16
|
-
200: "#FFEFAD",
|
|
17
|
-
300: "#FFE680",
|
|
18
|
-
400: "#FFDA47",
|
|
19
|
-
500: "#FFCC00",
|
|
20
|
-
600: "#E6B800",
|
|
21
|
-
700: "#CCA300",
|
|
22
|
-
800: "#A88700",
|
|
23
|
-
900: "#7A6200",
|
|
24
|
-
950: "#574500"
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
plugins: [],
|
|
30
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
This project was bootstrapped with [Vite's React TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts).
|
|
2
|
-
|
|
3
|
-
## Available Scripts
|
|
4
|
-
|
|
5
|
-
In the project directory, you can run:
|
|
6
|
-
|
|
7
|
-
### `npm start`
|
|
8
|
-
|
|
9
|
-
Runs the app in development mode.<br>
|
|
10
|
-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
11
|
-
|
|
12
|
-
The page will reload if you make edits.<br>
|
|
13
|
-
You will also see any lint errors in the console.
|
|
14
|
-
|
|
15
|
-
### `npm run build`
|
|
16
|
-
|
|
17
|
-
Builds the app for production to the `build` folder.<br>
|
|
18
|
-
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
19
|
-
|
|
20
|
-
The build is minified and the filenames include the hashes.<br>
|
|
21
|
-
Your app is ready to be deployed!
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/.pnp
|
|
6
|
-
.pnp.js
|
|
7
|
-
|
|
8
|
-
# testing
|
|
9
|
-
/coverage
|
|
10
|
-
|
|
11
|
-
# production
|
|
12
|
-
/build
|
|
13
|
-
|
|
14
|
-
# misc
|
|
15
|
-
.DS_Store
|
|
16
|
-
.env.local
|
|
17
|
-
.env.development.local
|
|
18
|
-
.env.test.local
|
|
19
|
-
.env.production.local
|
|
20
|
-
|
|
21
|
-
npm-debug.log*
|
|
22
|
-
yarn-debug.log*
|
|
23
|
-
yarn-error.log*
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
engine-strict=true
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
{
|
|
3
|
-
"name": "{= packageName =}",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"type": "module",
|
|
7
|
-
{=& depsChunk =},
|
|
8
|
-
{=& devDepsChunk =},
|
|
9
|
-
{=& overridesChunk =},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"start": "vite",
|
|
12
|
-
"build": "tsc --build && vite build",
|
|
13
|
-
"preview": "vite preview"
|
|
14
|
-
},
|
|
15
|
-
"engineStrict": true,
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": "{=& nodeVersionRange =}"
|
|
18
|
-
},
|
|
19
|
-
"browserslist": {
|
|
20
|
-
"production": [
|
|
21
|
-
">0.2%",
|
|
22
|
-
"not dead",
|
|
23
|
-
"not op_mini all"
|
|
24
|
-
],
|
|
25
|
-
"development": [
|
|
26
|
-
"last 1 chrome version",
|
|
27
|
-
"last 1 firefox version",
|
|
28
|
-
"last 1 safari version"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
{
|
|
3
|
-
"name": "{= appName =}",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"start_url": ".",
|
|
12
|
-
"display": "standalone",
|
|
13
|
-
"theme_color": "#000000",
|
|
14
|
-
"background_color": "#ffffff"
|
|
15
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import ReactDOM from 'react-dom/client'
|
|
4
|
-
import { QueryClientProvider } from '@tanstack/react-query'
|
|
5
|
-
|
|
6
|
-
import { router } from './router'
|
|
7
|
-
import {
|
|
8
|
-
initializeQueryClient,
|
|
9
|
-
queryClientInitialized,
|
|
10
|
-
} from 'wasp/client/operations'
|
|
11
|
-
|
|
12
|
-
{=# setupFn.isDefined =}
|
|
13
|
-
{=& setupFn.importStatement =}
|
|
14
|
-
{=/ setupFn.isDefined =}
|
|
15
|
-
|
|
16
|
-
{=# areWebSocketsUsed =}
|
|
17
|
-
import { WebSocketProvider } from 'wasp/client/webSocket/WebSocketProvider'
|
|
18
|
-
{=/ areWebSocketsUsed =}
|
|
19
|
-
|
|
20
|
-
startApp()
|
|
21
|
-
|
|
22
|
-
async function startApp() {
|
|
23
|
-
{=# setupFn.isDefined =}
|
|
24
|
-
await {= setupFn.importIdentifier =}()
|
|
25
|
-
{=/ setupFn.isDefined =}
|
|
26
|
-
initializeQueryClient()
|
|
27
|
-
|
|
28
|
-
await render()
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async function render() {
|
|
32
|
-
const queryClient = await queryClientInitialized
|
|
33
|
-
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
|
34
|
-
<React.StrictMode>
|
|
35
|
-
<QueryClientProvider client={queryClient}>
|
|
36
|
-
{=# areWebSocketsUsed =}
|
|
37
|
-
<WebSocketProvider>
|
|
38
|
-
{router}
|
|
39
|
-
</WebSocketProvider>
|
|
40
|
-
{=/ areWebSocketsUsed =}
|
|
41
|
-
{=^ areWebSocketsUsed =}
|
|
42
|
-
{router}
|
|
43
|
-
{=/ areWebSocketsUsed =}
|
|
44
|
-
</QueryClientProvider>
|
|
45
|
-
</React.StrictMode>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
Binary file
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
|
4
|
-
{=# rootComponent.isDefined =}
|
|
5
|
-
{=& rootComponent.importStatement =}
|
|
6
|
-
{=/ rootComponent.isDefined =}
|
|
7
|
-
|
|
8
|
-
{=# isAuthEnabled =}
|
|
9
|
-
import createAuthRequiredPage from "./auth/pages/createAuthRequiredPage"
|
|
10
|
-
{=/ isAuthEnabled =}
|
|
11
|
-
|
|
12
|
-
{=# pagesToImport =}
|
|
13
|
-
{=& importStatement =}
|
|
14
|
-
{=/ pagesToImport =}
|
|
15
|
-
|
|
16
|
-
{=# isExternalAuthEnabled =}
|
|
17
|
-
import { OAuthCallbackPage } from "./auth/pages/OAuthCallback"
|
|
18
|
-
{=/ isExternalAuthEnabled =}
|
|
19
|
-
|
|
20
|
-
import { DefaultRootErrorBoundary } from './components/DefaultRootErrorBoundary'
|
|
21
|
-
|
|
22
|
-
import { routes } from 'wasp/client/router'
|
|
23
|
-
|
|
24
|
-
export const routeNameToRouteComponent = {
|
|
25
|
-
{=# routes =}
|
|
26
|
-
{= name =}: {= targetComponent =},
|
|
27
|
-
{=/ routes =}
|
|
28
|
-
} as const;
|
|
29
|
-
|
|
30
|
-
const waspDefinedRoutes = [
|
|
31
|
-
{=# isExternalAuthEnabled =}
|
|
32
|
-
{
|
|
33
|
-
path: "{= oAuthCallbackPath =}",
|
|
34
|
-
Component: OAuthCallbackPage,
|
|
35
|
-
},
|
|
36
|
-
{=/ isExternalAuthEnabled =}
|
|
37
|
-
]
|
|
38
|
-
const userDefinedRoutes = Object.entries(routes).map(([routeKey, route]) => {
|
|
39
|
-
return {
|
|
40
|
-
path: route.to,
|
|
41
|
-
Component: routeNameToRouteComponent[routeKey],
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const browserRouter = createBrowserRouter([{
|
|
46
|
-
path: '/',
|
|
47
|
-
{=# rootComponent.isDefined =}
|
|
48
|
-
element: <{= rootComponent.importIdentifier =} />,
|
|
49
|
-
{=/ rootComponent.isDefined =}
|
|
50
|
-
ErrorBoundary: DefaultRootErrorBoundary,
|
|
51
|
-
children: [
|
|
52
|
-
...waspDefinedRoutes,
|
|
53
|
-
...userDefinedRoutes,
|
|
54
|
-
],
|
|
55
|
-
}], {
|
|
56
|
-
basename: '{= baseDir =}',
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
export const router = <RouterProvider router={browserRouter} />
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
{
|
|
3
|
-
"extends": "@tsconfig/vite-react/tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
// Temporary loosen the type checking until we can address all the errors.
|
|
6
|
-
"jsx": "preserve",
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
// Allow importing pages with the .tsx extension.
|
|
10
|
-
"allowImportingTsExtensions": true,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
// Overriding Vite 7 linting-focused options to be less strict since we
|
|
13
|
-
// don't want to block web-app builds on linting errors.
|
|
14
|
-
// We'll tackle it when we do: https://github.com/wasp-lang/wasp/issues/2777
|
|
15
|
-
"strict": false,
|
|
16
|
-
"noUnusedLocals": false,
|
|
17
|
-
"noUnusedParameters": false,
|
|
18
|
-
"erasableSyntaxOnly": false,
|
|
19
|
-
"noFallthroughCasesInSwitch": false,
|
|
20
|
-
"noUncheckedSideEffectImports": false
|
|
21
|
-
},
|
|
22
|
-
"include": [
|
|
23
|
-
"src"
|
|
24
|
-
],
|
|
25
|
-
"references": [
|
|
26
|
-
{ "path": "{= srcTsConfigPath =}" }
|
|
27
|
-
]
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Wasp's TS config arrangement is based on Vite's tsconfig arrangement, but
|
|
3
|
-
// we have an extra top-level file because the two projects are independent.
|
|
4
|
-
// The empty files array is necessary to allow `noEmit` in referenced
|
|
5
|
-
// projects.
|
|
6
|
-
"files": [],
|
|
7
|
-
"references": [
|
|
8
|
-
{ "path": "./tsconfig.app.json" },
|
|
9
|
-
{ "path": "./tsconfig.vite.json" },
|
|
10
|
-
]
|
|
11
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
{
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"noEmit": true,
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"moduleResolution": "bundler",
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
},
|
|
11
|
-
"include": [
|
|
12
|
-
{=# includePaths =}
|
|
13
|
-
"{= . =}",
|
|
14
|
-
{=/ includePaths =}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
import { type Plugin } from 'vite'
|
|
3
|
-
import path from 'path'
|
|
4
|
-
import { resolveProjectPath } from 'wasp/dev'
|
|
5
|
-
|
|
6
|
-
export function detectServerImports(): Plugin {
|
|
7
|
-
return {
|
|
8
|
-
name: 'wasp-detect-server-imports',
|
|
9
|
-
enforce: 'pre',
|
|
10
|
-
resolveId(source, importer) {
|
|
11
|
-
if (!importer) {
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const pathToUserCode = parsePathToUserCode(importer)
|
|
16
|
-
if (!pathToUserCode) {
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (isServerImport(source)) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
`Server code cannot be imported in the client code. Import from "${source}" in "${pathToUserCode}" is not allowed.`
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function isServerImport(moduleName: string): boolean {
|
|
30
|
-
return moduleName.startsWith('wasp/server')
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type RelativePathToUserCode = string & { _brand: 'relativePathToUserCode' }
|
|
34
|
-
|
|
35
|
-
function parsePathToUserCode(
|
|
36
|
-
importerPath: string
|
|
37
|
-
): RelativePathToUserCode | null {
|
|
38
|
-
const importerPathRelativeToWaspProjectDir = path.relative(
|
|
39
|
-
getWaspProjectDirAbsPathWhileInWebAppDir(),
|
|
40
|
-
importerPath
|
|
41
|
-
)
|
|
42
|
-
return importerPathRelativeToWaspProjectDir.startsWith('{= srcDirInWaspProjectDir =}')
|
|
43
|
-
? (importerPathRelativeToWaspProjectDir as RelativePathToUserCode)
|
|
44
|
-
: null
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// We can't pass the "waspProjectDir" path from Haskell because we need the absolute path:
|
|
48
|
-
// e.g. /Users/{username}/dev/wasp/waspc/examples/todoApp
|
|
49
|
-
// which contains machine specific info like the username which is different in the CI and locally.
|
|
50
|
-
// This breaks our e2e tests in the CI because the path is different.
|
|
51
|
-
function getWaspProjectDirAbsPathWhileInWebAppDir(): string {
|
|
52
|
-
return path.resolve(resolveProjectPath('./'))
|
|
53
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
/// <reference types="vitest" />
|
|
3
|
-
import { mergeConfig } from "vite";
|
|
4
|
-
import react from "@vitejs/plugin-react";
|
|
5
|
-
import { defaultExclude } from "vitest/config"
|
|
6
|
-
import { detectServerImports } from "./vite/detectServerImports"
|
|
7
|
-
import { validateEnv } from "./vite/validateEnv.js";
|
|
8
|
-
import path from "node:path"
|
|
9
|
-
|
|
10
|
-
{=# customViteConfig.isDefined =}
|
|
11
|
-
// Ignoring the TS error because we are importing a file outside of TS root dir.
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
{=& customViteConfig.importStatement =}
|
|
14
|
-
const _waspUserProvidedConfig = {=& customViteConfig.importIdentifier =}
|
|
15
|
-
{=/ customViteConfig.isDefined =}
|
|
16
|
-
{=^ customViteConfig.isDefined =}
|
|
17
|
-
const _waspUserProvidedConfig = {};
|
|
18
|
-
{=/ customViteConfig.isDefined =}
|
|
19
|
-
|
|
20
|
-
const defaultViteConfig = {
|
|
21
|
-
base: "{= baseDir =}",
|
|
22
|
-
plugins: [
|
|
23
|
-
validateEnv(),
|
|
24
|
-
react(),
|
|
25
|
-
detectServerImports(),
|
|
26
|
-
],
|
|
27
|
-
optimizeDeps: {
|
|
28
|
-
exclude: ['wasp']
|
|
29
|
-
},
|
|
30
|
-
server: {
|
|
31
|
-
port: {= defaultClientPort =},
|
|
32
|
-
host: "0.0.0.0",
|
|
33
|
-
open: true,
|
|
34
|
-
},
|
|
35
|
-
envPrefix: "REACT_APP_",
|
|
36
|
-
build: {
|
|
37
|
-
outDir: "build",
|
|
38
|
-
},
|
|
39
|
-
resolve: {
|
|
40
|
-
// These packages rely on a single instance per page. Not deduping them
|
|
41
|
-
// causes runtime errors (e.g., hook rule violation in react, QueryClient
|
|
42
|
-
// instance error in react-query, Invariant Error in react-router-dom).
|
|
43
|
-
dedupe: ["react", "react-dom", "@tanstack/react-query", "react-router-dom"],
|
|
44
|
-
alias: [
|
|
45
|
-
{
|
|
46
|
-
// Vite doesn't look for `.prisma/client` imports in the `node_modules`
|
|
47
|
-
// folder. We point it to the correct place here.
|
|
48
|
-
// TODO: Check if we can remove when updating Prisma (#2504)
|
|
49
|
-
find: /^\.prisma\/(.+)$/,
|
|
50
|
-
replacement: path.join(
|
|
51
|
-
"{= projectDir =}",
|
|
52
|
-
"node_modules/.prisma/$1"
|
|
53
|
-
),
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
test: {
|
|
58
|
-
globals: true,
|
|
59
|
-
environment: "jsdom",
|
|
60
|
-
// Since Vitest is running from the root of the project, we need
|
|
61
|
-
// to specify the path to the setup file relative to the root.
|
|
62
|
-
setupFiles: {=& vitest.setupFilesArray =},
|
|
63
|
-
exclude: [
|
|
64
|
-
...defaultExclude,
|
|
65
|
-
"{= vitest.excludeWaspArtefactsPattern =}",
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// https://vitejs.dev/config/
|
|
71
|
-
export default mergeConfig(
|
|
72
|
-
defaultViteConfig,
|
|
73
|
-
_waspUserProvidedConfig
|
|
74
|
-
);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{{={= =}=}}
|
|
2
|
-
/**
|
|
3
|
-
* Code found in this module is not meant to be used in user's server or client
|
|
4
|
-
* code. It is used by the Wasp tooling e.g. in the Tailwind config to resolve
|
|
5
|
-
* paths to the project root directory.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { join as joinPaths } from 'path'
|
|
9
|
-
|
|
10
|
-
// PUBLIC API
|
|
11
|
-
/**
|
|
12
|
-
* Wasp runs the client code in the `web-app` directory which is nested in the
|
|
13
|
-
* .wasp/out/web-app directory. This function resolves a project root dir path
|
|
14
|
-
* to be relative to the `web-app` directory i.e. `../../../projectDirPath`.
|
|
15
|
-
*/
|
|
16
|
-
export function resolveProjectPath(path: string): string {
|
|
17
|
-
const waspProjectDirFromWebAppDir = '{= waspProjectDirFromWebAppDir =}'
|
|
18
|
-
return joinPaths(waspProjectDirFromWebAppDir, path)
|
|
19
|
-
}
|