create-cedar-app 7.0.0 → 7.0.1-next.307
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/database-overlays/neon-postgres/api/package.json +3 -3
- package/database-overlays/pglite/api/package.json +3 -3
- package/dist/create-cedar-app.js +366 -368
- package/package.json +5 -7
- package/templates/js/api/jsconfig.json +2 -2
- package/templates/js/api/package.json +12 -6
- package/templates/js/api/src/directives/requireAuth/requireAuth.js +1 -1
- package/templates/js/api/src/directives/skipAuth/skipAuth.js +1 -1
- package/templates/js/api/src/lib/auth.js +2 -2
- package/templates/js/api/src/lib/db.js +3 -1
- package/templates/js/package.json +12 -7
- package/templates/js/scripts/jsconfig.json +1 -2
- package/templates/js/web/jsconfig.json +1 -2
- package/templates/js/web/package.json +13 -9
- package/templates/js/web/src/pages/FatalErrorPage/FatalErrorPage.jsx +0 -1
- package/templates/js/web/src/pages/NotFoundPage/NotFoundPage.jsx +0 -1
- package/templates/js/web/vite.config.js +11 -3
- package/templates/overlays/{esm/npm → npm}/package.json +8 -8
- package/templates/overlays/{esm/pnpm → pnpm}/package.json +7 -7
- package/templates/overlays/{esm/pnpm → pnpm}/pnpm-workspace.yaml +1 -1
- package/templates/overlays/{esm/yarn → yarn}/package.json +8 -8
- package/templates/ts/api/package.json +12 -6
- package/templates/ts/api/src/directives/requireAuth/requireAuth.ts +1 -1
- package/templates/ts/api/src/directives/skipAuth/skipAuth.ts +1 -1
- package/templates/ts/api/src/lib/auth.ts +2 -2
- package/templates/ts/api/src/lib/db.ts +3 -1
- package/templates/ts/api/tsconfig.json +1 -0
- package/templates/ts/eslint.config.js +11 -0
- package/templates/ts/package.json +12 -7
- package/templates/ts/scripts/tsconfig.json +0 -1
- package/templates/ts/web/package.json +13 -9
- package/templates/ts/web/vite.config.ts +11 -3
- package/templates/esm-js/.cedar/README.md +0 -44
- package/templates/esm-js/.editorconfig +0 -10
- package/templates/esm-js/.env +0 -15
- package/templates/esm-js/.env.defaults +0 -19
- package/templates/esm-js/.env.example +0 -4
- package/templates/esm-js/.vscode/extensions.json +0 -14
- package/templates/esm-js/.vscode/launch.json +0 -56
- package/templates/esm-js/.vscode/settings.json +0 -11
- package/templates/esm-js/.vscode/tasks.json +0 -29
- package/templates/esm-js/README.md +0 -17
- package/templates/esm-js/api/db/schema.prisma +0 -29
- package/templates/esm-js/api/jsconfig.json +0 -41
- package/templates/esm-js/api/package.json +0 -19
- package/templates/esm-js/api/prisma.config.cjs +0 -12
- package/templates/esm-js/api/src/directives/requireAuth/requireAuth.js +0 -22
- package/templates/esm-js/api/src/directives/requireAuth/requireAuth.test.js +0 -18
- package/templates/esm-js/api/src/directives/skipAuth/skipAuth.js +0 -16
- package/templates/esm-js/api/src/directives/skipAuth/skipAuth.test.js +0 -10
- package/templates/esm-js/api/src/functions/graphql.js +0 -19
- package/templates/esm-js/api/src/graphql/.keep +0 -0
- package/templates/esm-js/api/src/lib/auth.js +0 -32
- package/templates/esm-js/api/src/lib/db.js +0 -46
- package/templates/esm-js/api/src/lib/logger.js +0 -17
- package/templates/esm-js/api/src/services/.keep +0 -0
- package/templates/esm-js/cedar.toml +0 -26
- package/templates/esm-js/gitignore.template +0 -27
- package/templates/esm-js/graphql.config.cjs +0 -11
- package/templates/esm-js/package.json +0 -33
- package/templates/esm-js/prettier.config.cjs +0 -18
- package/templates/esm-js/scripts/.keep +0 -0
- package/templates/esm-js/scripts/jsconfig.json +0 -60
- package/templates/esm-js/scripts/seed.js +0 -27
- package/templates/esm-js/web/index.html +0 -15
- package/templates/esm-js/web/jsconfig.json +0 -53
- package/templates/esm-js/web/package.json +0 -30
- package/templates/esm-js/web/public/README.md +0 -43
- package/templates/esm-js/web/public/favicon.png +0 -0
- package/templates/esm-js/web/public/robots.txt +0 -2
- package/templates/esm-js/web/src/App.jsx +0 -16
- package/templates/esm-js/web/src/Routes.jsx +0 -20
- package/templates/esm-js/web/src/components/.keep +0 -0
- package/templates/esm-js/web/src/entry.client.jsx +0 -35
- package/templates/esm-js/web/src/index.css +0 -0
- package/templates/esm-js/web/src/layouts/.keep +0 -0
- package/templates/esm-js/web/src/pages/FatalErrorPage/FatalErrorPage.jsx +0 -58
- package/templates/esm-js/web/src/pages/NotFoundPage/NotFoundPage.jsx +0 -45
- package/templates/esm-js/web/vite.config.js +0 -15
- package/templates/esm-ts/.cedar/README.md +0 -44
- package/templates/esm-ts/.editorconfig +0 -10
- package/templates/esm-ts/.env +0 -15
- package/templates/esm-ts/.env.defaults +0 -19
- package/templates/esm-ts/.env.example +0 -4
- package/templates/esm-ts/.vscode/extensions.json +0 -14
- package/templates/esm-ts/.vscode/launch.json +0 -56
- package/templates/esm-ts/.vscode/settings.json +0 -11
- package/templates/esm-ts/.vscode/tasks.json +0 -29
- package/templates/esm-ts/README.md +0 -17
- package/templates/esm-ts/api/db/schema.prisma +0 -29
- package/templates/esm-ts/api/package.json +0 -19
- package/templates/esm-ts/api/prisma.config.cjs +0 -12
- package/templates/esm-ts/api/src/directives/requireAuth/requireAuth.test.ts +0 -18
- package/templates/esm-ts/api/src/directives/requireAuth/requireAuth.ts +0 -25
- package/templates/esm-ts/api/src/directives/skipAuth/skipAuth.test.ts +0 -10
- package/templates/esm-ts/api/src/directives/skipAuth/skipAuth.ts +0 -16
- package/templates/esm-ts/api/src/functions/graphql.ts +0 -19
- package/templates/esm-ts/api/src/graphql/.keep +0 -0
- package/templates/esm-ts/api/src/lib/auth.ts +0 -32
- package/templates/esm-ts/api/src/lib/db.ts +0 -46
- package/templates/esm-ts/api/src/lib/logger.ts +0 -17
- package/templates/esm-ts/api/src/services/.keep +0 -0
- package/templates/esm-ts/api/tsconfig.json +0 -27
- package/templates/esm-ts/cedar.toml +0 -26
- package/templates/esm-ts/eslint.config.js +0 -3
- package/templates/esm-ts/gitignore.template +0 -27
- package/templates/esm-ts/graphql.config.cjs +0 -11
- package/templates/esm-ts/package.json +0 -33
- package/templates/esm-ts/prettier.config.cjs +0 -18
- package/templates/esm-ts/scripts/.keep +0 -0
- package/templates/esm-ts/scripts/seed.ts +0 -27
- package/templates/esm-ts/scripts/tsconfig.json +0 -35
- package/templates/esm-ts/web/index.html +0 -15
- package/templates/esm-ts/web/package.json +0 -30
- package/templates/esm-ts/web/public/README.md +0 -43
- package/templates/esm-ts/web/public/favicon.png +0 -0
- package/templates/esm-ts/web/public/robots.txt +0 -2
- package/templates/esm-ts/web/src/App.tsx +0 -22
- package/templates/esm-ts/web/src/Routes.tsx +0 -20
- package/templates/esm-ts/web/src/components/.keep +0 -0
- package/templates/esm-ts/web/src/entry.client.tsx +0 -35
- package/templates/esm-ts/web/src/index.css +0 -0
- package/templates/esm-ts/web/src/layouts/.keep +0 -0
- package/templates/esm-ts/web/src/pages/FatalErrorPage/FatalErrorPage.tsx +0 -57
- package/templates/esm-ts/web/src/pages/NotFoundPage/NotFoundPage.tsx +0 -44
- package/templates/esm-ts/web/tsconfig.json +0 -45
- package/templates/esm-ts/web/vite.config.ts +0 -15
- package/templates/js/api/jest.config.js +0 -8
- package/templates/js/eslint.config.mjs +0 -3
- package/templates/js/jest.config.js +0 -8
- package/templates/js/web/jest.config.js +0 -8
- package/templates/overlays/cjs/npm/package-lock.json +0 -28868
- package/templates/overlays/cjs/npm/package.json +0 -31
- package/templates/overlays/cjs/pnpm/package.json +0 -32
- package/templates/overlays/cjs/pnpm/pnpm-lock.yaml +0 -18204
- package/templates/overlays/cjs/pnpm/pnpm-workspace.yaml +0 -23
- package/templates/overlays/cjs/yarn/package.json +0 -73
- package/templates/overlays/cjs/yarn/yarn.lock +0 -18896
- package/templates/overlays/esm/npm/package-lock.json +0 -29256
- package/templates/overlays/esm/pnpm/pnpm-lock.yaml +0 -18683
- package/templates/overlays/esm/yarn/.yarnrc.yml +0 -17
- package/templates/overlays/esm/yarn/yarn.lock +0 -19181
- package/templates/ts/api/jest.config.js +0 -8
- package/templates/ts/eslint.config.mjs +0 -3
- package/templates/ts/jest.config.js +0 -8
- package/templates/ts/web/jest.config.js +0 -8
- /package/templates/{esm-js → js}/api/vitest.config.js +0 -0
- /package/templates/{esm-js → js}/eslint.config.js +0 -0
- /package/templates/{esm-js → js}/vitest.config.mjs +0 -0
- /package/templates/{esm-js → js}/web/vitest.setup.js +0 -0
- /package/templates/overlays/{cjs/yarn → yarn}/.yarnrc.yml +0 -0
- /package/templates/{esm-ts → ts}/api/vitest.config.ts +0 -0
- /package/templates/{esm-ts → ts}/vitest.config.ts +0 -0
- /package/templates/{esm-ts → ts}/web/vitest.setup.ts +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"noEmit": true,
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "ES2022",
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleResolution": "Bundler",
|
|
8
|
-
"skipLibCheck": false,
|
|
9
|
-
"rootDirs": [
|
|
10
|
-
"./src",
|
|
11
|
-
"../.cedar/types/mirror/web/src",
|
|
12
|
-
"../api/src",
|
|
13
|
-
"../.cedar/types/mirror/api/src"
|
|
14
|
-
],
|
|
15
|
-
"paths": {
|
|
16
|
-
"src/*": [
|
|
17
|
-
"./src/*",
|
|
18
|
-
"../.cedar/types/mirror/web/src/*",
|
|
19
|
-
"../api/src/*",
|
|
20
|
-
"../.cedar/types/mirror/api/src/*"
|
|
21
|
-
],
|
|
22
|
-
"$api/*": [
|
|
23
|
-
"../api/*"
|
|
24
|
-
],
|
|
25
|
-
"types/*": [
|
|
26
|
-
"./types/*",
|
|
27
|
-
"../types/*"
|
|
28
|
-
],
|
|
29
|
-
"@cedarjs/testing": [
|
|
30
|
-
"../node_modules/@cedarjs/testing/web"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"typeRoots": [
|
|
34
|
-
"../node_modules/@types",
|
|
35
|
-
"./node_modules/@types",
|
|
36
|
-
"../node_modules/@testing-library"
|
|
37
|
-
],
|
|
38
|
-
"types": [
|
|
39
|
-
"jest",
|
|
40
|
-
"jest-dom"
|
|
41
|
-
],
|
|
42
|
-
"jsx": "preserve"
|
|
43
|
-
},
|
|
44
|
-
"include": [
|
|
45
|
-
"src",
|
|
46
|
-
"config",
|
|
47
|
-
".storybook/**/*",
|
|
48
|
-
"../.cedar/types/includes/all-*",
|
|
49
|
-
"../.cedar/types/includes/web-*",
|
|
50
|
-
"../types",
|
|
51
|
-
"./types"
|
|
52
|
-
]
|
|
53
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "web",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"browserslist": {
|
|
7
|
-
"development": [
|
|
8
|
-
"last 1 version"
|
|
9
|
-
],
|
|
10
|
-
"production": [
|
|
11
|
-
"defaults"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@cedarjs/forms": "7.0.0",
|
|
16
|
-
"@cedarjs/router": "7.0.0",
|
|
17
|
-
"@cedarjs/web": "7.0.0",
|
|
18
|
-
"react": "18.3.1",
|
|
19
|
-
"react-dom": "18.3.1"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@cedarjs/vite": "7.0.0",
|
|
23
|
-
"@types/react": "^18.2.55",
|
|
24
|
-
"@types/react-dom": "^18.2.19",
|
|
25
|
-
"@cedarjs/testing": "7.0.0",
|
|
26
|
-
"@testing-library/jest-dom": "6.9.1",
|
|
27
|
-
"@testing-library/react": "16.3.2",
|
|
28
|
-
"vite": "7.3.6"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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 cedar 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
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FatalErrorBoundary, CedarProvider } from '@cedarjs/web'
|
|
2
|
-
import { CedarApolloProvider } from '@cedarjs/web/apollo/CedarApolloProvider'
|
|
3
|
-
|
|
4
|
-
import FatalErrorPage from 'src/pages/FatalErrorPage'
|
|
5
|
-
|
|
6
|
-
import './index.css'
|
|
7
|
-
|
|
8
|
-
const App = ({ children }) => (
|
|
9
|
-
<FatalErrorBoundary page={FatalErrorPage}>
|
|
10
|
-
<CedarProvider titleTemplate="%PageTitle | %AppTitle">
|
|
11
|
-
<CedarApolloProvider>{children}</CedarApolloProvider>
|
|
12
|
-
</CedarProvider>
|
|
13
|
-
</FatalErrorBoundary>
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
export default App
|
|
@@ -1,20 +0,0 @@
|
|
|
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 '@cedarjs/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
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
2
|
-
|
|
3
|
-
import App from './App'
|
|
4
|
-
import Routes from './Routes'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* When `#cedar-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 cedarAppElement = document.getElementById('cedar-app')
|
|
13
|
-
|
|
14
|
-
if (!cedarAppElement) {
|
|
15
|
-
throw new Error(
|
|
16
|
-
'Could not find an element with ID "cedar-app". Please ensure it exists ' +
|
|
17
|
-
'in your `web/index.html` file.'
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (cedarAppElement.children?.length > 0) {
|
|
22
|
-
hydrateRoot(
|
|
23
|
-
cedarAppElement,
|
|
24
|
-
<App>
|
|
25
|
-
<Routes />
|
|
26
|
-
</App>
|
|
27
|
-
)
|
|
28
|
-
} else {
|
|
29
|
-
const root = createRoot(cedarAppElement)
|
|
30
|
-
root.render(
|
|
31
|
-
<App>
|
|
32
|
-
<Routes />
|
|
33
|
-
</App>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,58 +0,0 @@
|
|
|
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, Cedar 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 '@cedarjs/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
|
-
|
|
52
|
-
<section>
|
|
53
|
-
<h1>
|
|
54
|
-
<span>Something went wrong</span>
|
|
55
|
-
</h1>
|
|
56
|
-
</section>
|
|
57
|
-
</main>
|
|
58
|
-
))
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
|
|
39
|
-
<section>
|
|
40
|
-
<h1>
|
|
41
|
-
<span>404 Page Not Found</span>
|
|
42
|
-
</h1>
|
|
43
|
-
</section>
|
|
44
|
-
</main>
|
|
45
|
-
)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="vitest/config" />
|
|
2
|
-
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
4
|
-
|
|
5
|
-
import { cedar } from '@cedarjs/vite'
|
|
6
|
-
|
|
7
|
-
export default defineConfig(({ mode }) => ({
|
|
8
|
-
plugins: [cedar({ mode })],
|
|
9
|
-
test: {
|
|
10
|
-
environment: 'jsdom',
|
|
11
|
-
setupFiles: ['./vitest.setup.js'],
|
|
12
|
-
// Enables global test APIs like describe, it, expect
|
|
13
|
-
globals: true,
|
|
14
|
-
},
|
|
15
|
-
}))
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# .cedar
|
|
2
|
-
|
|
3
|
-
## What is this directory?
|
|
4
|
-
|
|
5
|
-
Cedar uses this `.cedar` directory to store transitory data that aids in the smooth and convenient operation of your Cedar project.
|
|
6
|
-
|
|
7
|
-
## Do I need to do anything with this directory?
|
|
8
|
-
|
|
9
|
-
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with Cedar.
|
|
10
|
-
|
|
11
|
-
You don't need to commit any other contents of this directory to your version control system. It's ignored by default.
|
|
12
|
-
|
|
13
|
-
## What's in this directory?
|
|
14
|
-
|
|
15
|
-
### Files
|
|
16
|
-
|
|
17
|
-
| Name | Description |
|
|
18
|
-
| :---------------- | :----------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| commandCache.json | This file contains mappings to assist the Cedar CLI in efficiently executing commands. |
|
|
20
|
-
| schema.graphql | This is the GraphQL schema which has been automatically generated from your Cedar project. |
|
|
21
|
-
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
|
|
22
|
-
| test.db | The sqlite database used when running tests. |
|
|
23
|
-
|
|
24
|
-
### Directories
|
|
25
|
-
|
|
26
|
-
| Name | Description |
|
|
27
|
-
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| locks | Stores temporary files that Cedar uses to keep track of the execution of async/background tasks between processes. |
|
|
29
|
-
| logs | Stores log files for background tasks such as update checking. |
|
|
30
|
-
| prebuild | Stores transpiled JavaScript that is generated as part of Cedar's build process. |
|
|
31
|
-
| telemetry | Stores the recent telemetry that the Cedar CLI has generated. You may inspect these files to see everything Cedar is anonymously collecting. |
|
|
32
|
-
| types | Stores the results of type generation. |
|
|
33
|
-
| updateCheck | Stores a file which contains the results of checking for Cedar updates. |
|
|
34
|
-
| studio | Used to store data for `cedar studio` |
|
|
35
|
-
|
|
36
|
-
We try to keep this README up to date but you may, from time to time, find other files or directories in this `.cedar` directory that have not yet been documented here. This is likely nothing to worry about but feel free to let us know and we'll update this list.
|
|
37
|
-
|
|
38
|
-
### Telemetry
|
|
39
|
-
|
|
40
|
-
CedarJS collects completely anonymous telemetry data about general usage. For transparency, that data is viewable in the respective directories and files. To learn more and manage your project's settings, visit [telemetry.redwoodjs.com](https://telemetry.redwoodjs.com).
|
|
41
|
-
|
|
42
|
-
### Have any questions?
|
|
43
|
-
|
|
44
|
-
Feel free to reach out to us on the [CedarJS Discord](https://cedarjs.com/discord) if you have any questions.
|
package/templates/esm-ts/.env
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# THIS FILE SHOULD NOT BE CHECKED INTO YOUR VERSION CONTROL SYSTEM
|
|
2
|
-
#
|
|
3
|
-
# Environment variables set here will override those in .env.defaults.
|
|
4
|
-
# Any environment variables you need in production you will need to setup with
|
|
5
|
-
# your hosting provider. For example in Netlify you can add environment
|
|
6
|
-
# variables in Settings > Build & Deploy > environment
|
|
7
|
-
#
|
|
8
|
-
# DATABASE_URL=postgres://user:pass@postgreshost.com:5432/database_name
|
|
9
|
-
# TEST_DATABASE_URL=postgres://user:pass@postgreshost.com:5432/test_database_name
|
|
10
|
-
#
|
|
11
|
-
# Sets an app-specific secret used to sign and verify your own app's webhooks.
|
|
12
|
-
# For example if you schedule a cron job with a signed payload that later will
|
|
13
|
-
# then invoke your api-side webhook function you will use this secret to sign and the verify.
|
|
14
|
-
# Important: Please change this default to a strong password or other secret
|
|
15
|
-
# WEBHOOK_SECRET=THIS_IS_NOT_SECRET_PLEASE_CHANGE
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# These environment variables will be used by default if you do not create any
|
|
2
|
-
# yourself in .env. This file should be safe to check into your version control
|
|
3
|
-
# system. Any custom values should go in .env and .env should *not* be checked
|
|
4
|
-
# into version control.
|
|
5
|
-
|
|
6
|
-
# schema.prisma defaults
|
|
7
|
-
DATABASE_URL=file:./db/dev.db
|
|
8
|
-
|
|
9
|
-
# location of the test database for api service scenarios (defaults to ./.cedar/test.db if not set)
|
|
10
|
-
# TEST_DATABASE_URL=file:./.cedar/test.db
|
|
11
|
-
|
|
12
|
-
# disables Prisma CLI update notifier
|
|
13
|
-
PRISMA_HIDE_UPDATE_MESSAGE=true
|
|
14
|
-
|
|
15
|
-
# Option to override the current environment's default api-side log level
|
|
16
|
-
# See: https://cedarjs.com/docs/logger for level options, defaults to "trace" otherwise.
|
|
17
|
-
# Most applications want "debug" or "info" during dev, "trace" when you have issues and "warn" in production.
|
|
18
|
-
# Ordered by how verbose they are: trace | debug | info | warn | error | silent
|
|
19
|
-
# LOG_LEVEL=debug
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"dbaeumer.vscode-eslint",
|
|
4
|
-
"eamodio.gitlens",
|
|
5
|
-
"ofhumanbondage.react-proptypes-intellisense",
|
|
6
|
-
"mgmcdermott.vscode-language-babel",
|
|
7
|
-
"wix.vscode-import-cost",
|
|
8
|
-
"pflannery.vscode-versionlens",
|
|
9
|
-
"editorconfig.editorconfig",
|
|
10
|
-
"prisma.prisma",
|
|
11
|
-
"graphql.vscode-graphql"
|
|
12
|
-
],
|
|
13
|
-
"unwantedRecommendations": []
|
|
14
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.3.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"command": "{{CEDAR_CLI}} dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
|
|
6
|
-
"name": "Run Dev Server",
|
|
7
|
-
"request": "launch",
|
|
8
|
-
"type": "node-terminal"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "Attach API debugger",
|
|
12
|
-
"port": 18911, // you can change this port, see https://cedarjs.com/docs/project-configuration-dev-test-build#debugger-configuration
|
|
13
|
-
"request": "attach",
|
|
14
|
-
"skipFiles": [
|
|
15
|
-
"<node_internals>/**"
|
|
16
|
-
],
|
|
17
|
-
"type": "node",
|
|
18
|
-
"localRoot": "${workspaceFolder}/node_modules/@cedarjs/api-server/dist",
|
|
19
|
-
"remoteRoot": "${workspaceFolder}/node_modules/@cedarjs/api-server/dist",
|
|
20
|
-
"sourceMaps": true,
|
|
21
|
-
"restart": true,
|
|
22
|
-
"preLaunchTask": "WaitForDevServer",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"name": "Launch Web debugger",
|
|
26
|
-
"type": "chrome",
|
|
27
|
-
"request": "launch",
|
|
28
|
-
"url": "http://localhost:8910",
|
|
29
|
-
"webRoot": "${workspaceRoot}/web/src",
|
|
30
|
-
"preLaunchTask": "WaitForDevServer",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"command": "{{CEDAR_CLI}} test api",
|
|
34
|
-
"name": "Test api",
|
|
35
|
-
"request": "launch",
|
|
36
|
-
"type": "node-terminal"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"command": "{{CEDAR_CLI}} test web",
|
|
40
|
-
"name": "Test web",
|
|
41
|
-
"request": "launch",
|
|
42
|
-
"type": "node-terminal"
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
"compounds": [
|
|
46
|
-
{
|
|
47
|
-
"name": "Start Debug",
|
|
48
|
-
"configurations": [
|
|
49
|
-
"Run Dev Server",
|
|
50
|
-
"Attach API debugger",
|
|
51
|
-
"Launch Web debugger"
|
|
52
|
-
],
|
|
53
|
-
"stopAll": true
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"label": "WaitForDevServer",
|
|
6
|
-
"group": "none",
|
|
7
|
-
"type": "shell",
|
|
8
|
-
"command": "bash",
|
|
9
|
-
"args": [
|
|
10
|
-
"-c",
|
|
11
|
-
"while ! echo -n > /dev/tcp/localhost/18911; do sleep 1; done;"
|
|
12
|
-
],
|
|
13
|
-
"windows": {
|
|
14
|
-
"command": "powershell",
|
|
15
|
-
"args": [
|
|
16
|
-
"-NoProfile",
|
|
17
|
-
"-ExecutionPolicy", "Bypass",
|
|
18
|
-
"while (-not (Test-NetConnection -ComputerName localhost -Port 18911)) { Start-Sleep -Seconds 1 };"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"presentation": {
|
|
22
|
-
"reveal": "silent",
|
|
23
|
-
"revealProblems": "onProblem",
|
|
24
|
-
"panel": "shared",
|
|
25
|
-
"close": true
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
]
|
|
29
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# README
|
|
2
|
-
|
|
3
|
-
Welcome to your new [CedarJS](https://cedarjs.com) project!
|
|
4
|
-
|
|
5
|
-
Start by installing dependencies:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
{{PM_INSTALL}}
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Then start the development server:
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
{{CEDAR_CLI}} dev
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Your browser should automatically open to [http://localhost:8910](http://localhost:8910) where you'll see the Welcome Page, which links out to many great resources.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Don't forget to tell Prisma about your edits to this file using
|
|
2
|
-
// `yarn cedar prisma migrate dev` or `yarn cedar prisma db push`.
|
|
3
|
-
// `migrate` is like committing while `push` is for prototyping.
|
|
4
|
-
// Read more about both here:
|
|
5
|
-
// https://www.prisma.io/docs/orm/prisma-migrate
|
|
6
|
-
|
|
7
|
-
datasource db {
|
|
8
|
-
provider = "sqlite"
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// This specific combination of settings is the only way to make Prisma 7 work
|
|
12
|
-
// in both CJS and ESM Cedar apps.
|
|
13
|
-
// See https://github.com/cedarjs/cedar/pull/1761 for more info
|
|
14
|
-
generator client {
|
|
15
|
-
provider = "prisma-client"
|
|
16
|
-
output = "./generated/prisma"
|
|
17
|
-
moduleFormat = "cjs"
|
|
18
|
-
generatedFileExtension = "mts"
|
|
19
|
-
importFileExtension = "mts"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Define your own datamodels here and run `yarn cedar prisma migrate dev`
|
|
23
|
-
// to create migrations for them and apply to your dev DB.
|
|
24
|
-
// TODO: Please remove the following example:
|
|
25
|
-
model UserExample {
|
|
26
|
-
id Int @id @default(autoincrement())
|
|
27
|
-
email String @unique
|
|
28
|
-
name String?
|
|
29
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "api",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@cedarjs/api": "7.0.0",
|
|
8
|
-
"@cedarjs/graphql-server": "7.0.0",
|
|
9
|
-
"@prisma/adapter-better-sqlite3": "7.8.0",
|
|
10
|
-
"@prisma/client": "7.8.0",
|
|
11
|
-
"better-sqlite3": "12.11.1",
|
|
12
|
-
"@cedarjs/context": "7.0.0",
|
|
13
|
-
"graphql-tag": "2.12.6"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@cedarjs/vite": "7.0.0",
|
|
17
|
-
"vitest": "4.1.10"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const { defineConfig, env } = require('prisma/config')
|
|
2
|
-
|
|
3
|
-
module.exports = defineConfig({
|
|
4
|
-
schema: 'db/schema.prisma',
|
|
5
|
-
migrations: {
|
|
6
|
-
path: 'db/migrations',
|
|
7
|
-
seed: '{{CEDAR_CLI}} exec seed',
|
|
8
|
-
},
|
|
9
|
-
datasource: {
|
|
10
|
-
url: env('DATABASE_URL'),
|
|
11
|
-
},
|
|
12
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { mockRedwoodDirective, getDirectiveName } from '@cedarjs/testing/api'
|
|
2
|
-
|
|
3
|
-
import requireAuth from './requireAuth.js'
|
|
4
|
-
|
|
5
|
-
describe('requireAuth directive', () => {
|
|
6
|
-
it('declares the directive sdl as schema, with the correct name', () => {
|
|
7
|
-
expect(requireAuth.schema).toBeTruthy()
|
|
8
|
-
expect(getDirectiveName(requireAuth.schema)).toBe('requireAuth')
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('requireAuth has stub implementation. Should not throw when current user', () => {
|
|
12
|
-
// If you want to set values in context, pass it through e.g.
|
|
13
|
-
// mockRedwoodDirective(requireAuth, { context: { currentUser: { id: 1, name: 'Lebron McGretzky' } }})
|
|
14
|
-
const mockExecution = mockRedwoodDirective(requireAuth, { context: {} })
|
|
15
|
-
|
|
16
|
-
expect(mockExecution).not.toThrowError()
|
|
17
|
-
})
|
|
18
|
-
})
|