create-cedar-app 7.1.0 → 7.1.1-next.468
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 +9 -11
- package/templates/js/api/jsconfig.json +3 -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 +2 -2
- package/templates/js/web/jsconfig.json +2 -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 +9 -9
- package/templates/overlays/{esm/pnpm → pnpm}/package.json +8 -8
- package/templates/overlays/{cjs/pnpm → pnpm}/pnpm-workspace.yaml +2 -1
- package/templates/overlays/{esm/yarn → yarn}/package.json +9 -9
- 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 +4 -4
- package/templates/ts/api/src/lib/db.ts +3 -1
- package/templates/ts/api/tsconfig.json +2 -0
- package/templates/ts/eslint.config.js +11 -0
- package/templates/ts/package.json +12 -7
- package/templates/ts/scripts/tsconfig.json +1 -1
- package/templates/ts/web/package.json +13 -9
- package/templates/ts/web/tsconfig.json +1 -0
- 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 -29136
- 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 -18425
- package/templates/overlays/cjs/yarn/package.json +0 -73
- package/templates/overlays/cjs/yarn/yarn.lock +0 -19126
- package/templates/overlays/esm/npm/package-lock.json +0 -29524
- package/templates/overlays/esm/pnpm/pnpm-lock.yaml +0 -18904
- package/templates/overlays/esm/pnpm/pnpm-workspace.yaml +0 -24
- package/templates/overlays/esm/yarn/.yarnrc.yml +0 -17
- package/templates/overlays/esm/yarn/yarn.lock +0 -19411
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cedar-app",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1-next.468",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -25,16 +25,14 @@
|
|
|
25
25
|
"ts-to-js": "yarn node ./scripts/tsToJS.js"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@cedarjs/
|
|
31
|
-
"@cedarjs/tui": "7.1.0",
|
|
28
|
+
"@cedarjs/cli-helpers": "7.1.1-next.468",
|
|
29
|
+
"@cedarjs/framework-tools": "7.1.1-next.468",
|
|
30
|
+
"@cedarjs/tui": "7.1.1-next.468",
|
|
32
31
|
"@opentelemetry/api": "1.9.1",
|
|
33
|
-
"@opentelemetry/exporter-trace-otlp-http": "0.
|
|
34
|
-
"@opentelemetry/resources": "2.
|
|
35
|
-
"@opentelemetry/sdk-trace-node": "2.
|
|
32
|
+
"@opentelemetry/exporter-trace-otlp-http": "0.223.0",
|
|
33
|
+
"@opentelemetry/resources": "2.12.0",
|
|
34
|
+
"@opentelemetry/sdk-trace-node": "2.12.0",
|
|
36
35
|
"@opentelemetry/semantic-conventions": "1.43.0",
|
|
37
|
-
"@types/babel__core": "7.20.5",
|
|
38
36
|
"@types/klaw-sync": "6.0.5",
|
|
39
37
|
"ansis": "4.4.0",
|
|
40
38
|
"ci-info": "4.4.0",
|
|
@@ -42,11 +40,11 @@
|
|
|
42
40
|
"execa": "5.1.1",
|
|
43
41
|
"gradient-string": "3.0.0",
|
|
44
42
|
"klaw-sync": "7.0.0",
|
|
45
|
-
"
|
|
46
|
-
"systeminformation": "5.33.13",
|
|
43
|
+
"systeminformation": "5.33.15",
|
|
47
44
|
"termi-link": "1.1.0",
|
|
48
45
|
"untildify": "4.0.0",
|
|
49
46
|
"uuid": "11.1.1",
|
|
47
|
+
"verkit": "0.5.0",
|
|
50
48
|
"vitest": "4.1.11",
|
|
51
49
|
"yargs": "17.7.3"
|
|
52
50
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"noEmit": true,
|
|
4
|
+
"strict": true,
|
|
4
5
|
"esModuleInterop": true,
|
|
5
6
|
"target": "es2023",
|
|
6
7
|
"module": "ESNext",
|
|
7
8
|
"moduleResolution": "Bundler",
|
|
8
|
-
"allowImportingTsExtensions": true,
|
|
9
9
|
"skipLibCheck": false,
|
|
10
10
|
"rootDirs": [
|
|
11
11
|
"./src",
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"include": [
|
|
37
37
|
"src",
|
|
38
|
+
"db",
|
|
38
39
|
"../.cedar/types/includes/all-*",
|
|
39
40
|
"../.cedar/types/includes/api-*",
|
|
40
41
|
"../types"
|
|
41
42
|
]
|
|
42
|
-
}
|
|
43
|
+
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "api",
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@
|
|
8
|
-
"@
|
|
9
|
-
"@
|
|
10
|
-
"@
|
|
11
|
-
"better-sqlite3": "12.11.1"
|
|
7
|
+
"@prisma/adapter-better-sqlite3": "7.10.0",
|
|
8
|
+
"@prisma/client": "7.10.0",
|
|
9
|
+
"@cedarjs/api": "7.1.1-next.468",
|
|
10
|
+
"@cedarjs/graphql-server": "7.1.1-next.468",
|
|
11
|
+
"better-sqlite3": "12.11.1",
|
|
12
|
+
"@cedarjs/context": "7.1.1-next.468",
|
|
13
|
+
"graphql-tag": "2.12.7"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@cedarjs/vite": "7.1.1-next.468",
|
|
17
|
+
"vitest": "4.1.11"
|
|
12
18
|
}
|
|
13
19
|
}
|
|
@@ -26,7 +26,7 @@ export const requireAuth = ({ roles }) => {
|
|
|
26
26
|
|
|
27
27
|
export const getCurrentUser = async () => {
|
|
28
28
|
throw new Error(
|
|
29
|
-
'Auth is not set up yet. See https://cedarjs.com/docs/authentication ' +
|
|
30
|
-
'
|
|
29
|
+
'Auth is not set up yet. See https://cedarjs.com/docs/authentication to ' +
|
|
30
|
+
'get started'
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -18,7 +18,9 @@ const resolveSqliteUrl = (url = 'file:./db/dev.db') => {
|
|
|
18
18
|
return url
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const apiDir = getPaths().api.base
|
|
22
|
+
|
|
23
|
+
return `file:${path.resolve(apiDir, url.slice('file:'.length))}`
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const adapter = new PrismaBetterSqlite3({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "module",
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"api",
|
|
6
6
|
"web"
|
|
@@ -13,16 +13,21 @@
|
|
|
13
13
|
"start:web": "cedarjs-server web"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@cedarjs/api-server": "7.1.
|
|
16
|
+
"@cedarjs/api-server": "7.1.1-next.468"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@cedarjs/core": "7.1.
|
|
20
|
-
"@cedarjs/eslint-config": "7.1.
|
|
21
|
-
"@cedarjs/project-config": "7.1.
|
|
22
|
-
"@cedarjs/testing": "7.1.
|
|
19
|
+
"@cedarjs/core": "7.1.1-next.468",
|
|
20
|
+
"@cedarjs/eslint-config": "7.1.1-next.468",
|
|
21
|
+
"@cedarjs/project-config": "7.1.1-next.468",
|
|
22
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
23
|
+
"vitest": "4.1.11"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": "24.x"
|
|
26
27
|
},
|
|
27
|
-
"packageManager": "yarn@4.14.1"
|
|
28
|
+
"packageManager": "yarn@4.14.1",
|
|
29
|
+
"resolutions": {
|
|
30
|
+
"react-is": "19.3.0",
|
|
31
|
+
"vite": "7.3.7"
|
|
32
|
+
}
|
|
28
33
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"noEmit": true,
|
|
4
|
+
"strict": true,
|
|
4
5
|
"esModuleInterop": true,
|
|
5
6
|
"target": "es2023",
|
|
6
7
|
"module": "node20",
|
|
7
8
|
"moduleResolution": "node16",
|
|
8
|
-
"allowImportingTsExtensions": true,
|
|
9
9
|
"rootDirs": [
|
|
10
10
|
"../api/src",
|
|
11
11
|
"../.cedar/types/mirror/api/src",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"../.cedar/types/includes/web-*",
|
|
59
59
|
"../types"
|
|
60
60
|
]
|
|
61
|
-
}
|
|
61
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"noEmit": true,
|
|
4
|
+
"strict": true,
|
|
4
5
|
"esModuleInterop": true,
|
|
5
6
|
"target": "ES2022",
|
|
6
7
|
"module": "ESNext",
|
|
7
8
|
"moduleResolution": "Bundler",
|
|
8
|
-
"allowImportingTsExtensions": true,
|
|
9
9
|
"skipLibCheck": false,
|
|
10
10
|
"rootDirs": [
|
|
11
11
|
"./src",
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
"../types",
|
|
52
52
|
"./types"
|
|
53
53
|
]
|
|
54
|
-
}
|
|
54
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web",
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"browserslist": {
|
|
@@ -12,15 +12,19 @@
|
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@cedarjs/forms": "7.1.
|
|
16
|
-
"@cedarjs/router": "7.1.
|
|
17
|
-
"@cedarjs/web": "7.1.
|
|
18
|
-
"react": "
|
|
19
|
-
"react-dom": "
|
|
15
|
+
"@cedarjs/forms": "7.1.1-next.468",
|
|
16
|
+
"@cedarjs/router": "7.1.1-next.468",
|
|
17
|
+
"@cedarjs/web": "7.1.1-next.468",
|
|
18
|
+
"react": "19.3.0",
|
|
19
|
+
"react-dom": "19.3.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@cedarjs/vite": "7.1.
|
|
23
|
-
"@types/react": "^
|
|
24
|
-
"@types/react-dom": "^
|
|
22
|
+
"@cedarjs/vite": "7.1.1-next.468",
|
|
23
|
+
"@types/react": "^19.2.0",
|
|
24
|
+
"@types/react-dom": "^19.2.0",
|
|
25
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
26
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
27
|
+
"@testing-library/react": "16.3.3",
|
|
28
|
+
"vite": "7.3.7"
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
|
|
1
3
|
import { defineConfig } from 'vite'
|
|
2
4
|
|
|
3
5
|
import { cedar } from '@cedarjs/vite'
|
|
4
6
|
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [cedar()],
|
|
7
|
-
|
|
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
|
+
}))
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
"start:web": "cedarjs-server web"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@cedarjs/api-server": "7.1.
|
|
16
|
+
"@cedarjs/api-server": "7.1.1-next.468"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"@cedarjs/
|
|
21
|
-
"@cedarjs/
|
|
22
|
-
"@cedarjs/
|
|
23
|
-
"
|
|
24
|
-
"vitest": "4.1.
|
|
19
|
+
"prisma": "7.10.0",
|
|
20
|
+
"@cedarjs/core": "7.1.1-next.468",
|
|
21
|
+
"@cedarjs/eslint-config": "7.1.1-next.468",
|
|
22
|
+
"@cedarjs/project-config": "7.1.1-next.468",
|
|
23
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
24
|
+
"vitest": "4.1.11"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": "24.x"
|
|
28
28
|
},
|
|
29
29
|
"overrides": {
|
|
30
|
-
"react-is": "19.
|
|
31
|
-
"vite": "7.3.
|
|
30
|
+
"react-is": "19.3.0",
|
|
31
|
+
"vite": "7.3.7"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"start:web": "cedarjs-server web"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@cedarjs/api-server": "7.1.
|
|
12
|
+
"@cedarjs/api-server": "7.1.1-next.468"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"
|
|
16
|
-
"@cedarjs/
|
|
17
|
-
"@cedarjs/
|
|
18
|
-
"@cedarjs/
|
|
19
|
-
"
|
|
20
|
-
"vitest": "4.1.
|
|
15
|
+
"prisma": "7.10.0",
|
|
16
|
+
"@cedarjs/core": "7.1.1-next.468",
|
|
17
|
+
"@cedarjs/eslint-config": "7.1.1-next.468",
|
|
18
|
+
"@cedarjs/project-config": "7.1.1-next.468",
|
|
19
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
20
|
+
"vitest": "4.1.11"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": "24.x",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devEngines": {
|
|
27
27
|
"packageManager": {
|
|
28
28
|
"name": "pnpm",
|
|
29
|
-
"version": "11.
|
|
29
|
+
"version": "11.28.5",
|
|
30
30
|
"onFail": "download"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -13,23 +13,23 @@
|
|
|
13
13
|
"start:web": "cedarjs-server web"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@cedarjs/api-server": "7.1.
|
|
16
|
+
"@cedarjs/api-server": "7.1.1-next.468"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"@cedarjs/
|
|
21
|
-
"@cedarjs/
|
|
22
|
-
"@cedarjs/
|
|
23
|
-
"
|
|
24
|
-
"vitest": "4.1.
|
|
19
|
+
"prisma": "7.10.0",
|
|
20
|
+
"@cedarjs/core": "7.1.1-next.468",
|
|
21
|
+
"@cedarjs/eslint-config": "7.1.1-next.468",
|
|
22
|
+
"@cedarjs/project-config": "7.1.1-next.468",
|
|
23
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
24
|
+
"vitest": "4.1.11"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": "24.x"
|
|
28
28
|
},
|
|
29
29
|
"packageManager": "yarn@4.14.1",
|
|
30
30
|
"resolutions": {
|
|
31
|
-
"react-is": "19.
|
|
32
|
-
"vite": "7.3.
|
|
31
|
+
"react-is": "19.3.0",
|
|
32
|
+
"vite": "7.3.7"
|
|
33
33
|
},
|
|
34
34
|
"dependenciesMeta": {
|
|
35
35
|
"@clerk/shared": {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "api",
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@
|
|
8
|
-
"@
|
|
9
|
-
"@
|
|
10
|
-
"@
|
|
11
|
-
"better-sqlite3": "12.11.1"
|
|
7
|
+
"@prisma/adapter-better-sqlite3": "7.10.0",
|
|
8
|
+
"@prisma/client": "7.10.0",
|
|
9
|
+
"@cedarjs/api": "7.1.1-next.468",
|
|
10
|
+
"@cedarjs/graphql-server": "7.1.1-next.468",
|
|
11
|
+
"better-sqlite3": "12.11.1",
|
|
12
|
+
"@cedarjs/context": "7.1.1-next.468",
|
|
13
|
+
"graphql-tag": "2.12.7"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@cedarjs/vite": "7.1.1-next.468",
|
|
17
|
+
"vitest": "4.1.11"
|
|
12
18
|
}
|
|
13
19
|
}
|
|
@@ -11,7 +11,7 @@ export const isAuthenticated = () => {
|
|
|
11
11
|
return true
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const hasRole = ({ roles }) => {
|
|
14
|
+
export const hasRole = ({ roles }: { roles?: string | string[] }) => {
|
|
15
15
|
return roles !== undefined
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -20,13 +20,13 @@ export const hasRole = ({ roles }) => {
|
|
|
20
20
|
|
|
21
21
|
// Roles are passed in by the requireAuth directive if you have auth setup
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
-
export const requireAuth = ({ roles }) => {
|
|
23
|
+
export const requireAuth = ({ roles }: { roles?: string | string[] }) => {
|
|
24
24
|
return isAuthenticated()
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export const getCurrentUser = async () => {
|
|
28
28
|
throw new Error(
|
|
29
|
-
'Auth is not set up yet. See https://cedarjs.com/docs/authentication ' +
|
|
30
|
-
'
|
|
29
|
+
'Auth is not set up yet. See https://cedarjs.com/docs/authentication to ' +
|
|
30
|
+
'get started'
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -18,7 +18,9 @@ const resolveSqliteUrl = (url = 'file:./db/dev.db') => {
|
|
|
18
18
|
return url
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const apiDir = getPaths().api.base
|
|
22
|
+
|
|
23
|
+
return `file:${path.resolve(apiDir, url.slice('file:'.length))}`
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const adapter = new PrismaBetterSqlite3({
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"noEmit": true,
|
|
4
4
|
"allowJs": true,
|
|
5
|
+
"strict": true,
|
|
5
6
|
"esModuleInterop": true,
|
|
6
7
|
"target": "es2023",
|
|
7
8
|
"module": "ESNext",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
},
|
|
21
22
|
"include": [
|
|
22
23
|
"src",
|
|
24
|
+
"db",
|
|
23
25
|
"../.cedar/types/includes/all-*",
|
|
24
26
|
"../.cedar/types/includes/api-*",
|
|
25
27
|
"../types"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": true,
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "module",
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"api",
|
|
6
6
|
"web"
|
|
@@ -13,16 +13,21 @@
|
|
|
13
13
|
"start:web": "cedarjs-server web"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@cedarjs/api-server": "7.1.
|
|
16
|
+
"@cedarjs/api-server": "7.1.1-next.468"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@cedarjs/core": "7.1.
|
|
20
|
-
"@cedarjs/eslint-config": "7.1.
|
|
21
|
-
"@cedarjs/project-config": "7.1.
|
|
22
|
-
"@cedarjs/testing": "7.1.
|
|
19
|
+
"@cedarjs/core": "7.1.1-next.468",
|
|
20
|
+
"@cedarjs/eslint-config": "7.1.1-next.468",
|
|
21
|
+
"@cedarjs/project-config": "7.1.1-next.468",
|
|
22
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
23
|
+
"vitest": "4.1.11"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|
|
25
26
|
"node": "24.x"
|
|
26
27
|
},
|
|
27
|
-
"packageManager": "yarn@4.14.1"
|
|
28
|
+
"packageManager": "yarn@4.14.1",
|
|
29
|
+
"resolutions": {
|
|
30
|
+
"react-is": "19.3.0",
|
|
31
|
+
"vite": "7.3.7"
|
|
32
|
+
}
|
|
28
33
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"noEmit": true,
|
|
4
4
|
"allowJs": true,
|
|
5
|
+
"strict": true,
|
|
5
6
|
"esModuleInterop": true,
|
|
6
7
|
"target": "es2023",
|
|
7
8
|
"module": "node20",
|
|
8
9
|
"moduleResolution": "node16",
|
|
9
|
-
"allowImportingTsExtensions": true,
|
|
10
10
|
"rootDirs": [
|
|
11
11
|
"../api/src",
|
|
12
12
|
"../.cedar/types/mirror/api/src",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web",
|
|
3
|
-
"type": "
|
|
3
|
+
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"browserslist": {
|
|
@@ -12,15 +12,19 @@
|
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@cedarjs/forms": "7.1.
|
|
16
|
-
"@cedarjs/router": "7.1.
|
|
17
|
-
"@cedarjs/web": "7.1.
|
|
18
|
-
"react": "
|
|
19
|
-
"react-dom": "
|
|
15
|
+
"@cedarjs/forms": "7.1.1-next.468",
|
|
16
|
+
"@cedarjs/router": "7.1.1-next.468",
|
|
17
|
+
"@cedarjs/web": "7.1.1-next.468",
|
|
18
|
+
"react": "19.3.0",
|
|
19
|
+
"react-dom": "19.3.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@cedarjs/vite": "7.1.
|
|
23
|
-
"@types/react": "^
|
|
24
|
-
"@types/react-dom": "^
|
|
22
|
+
"@cedarjs/vite": "7.1.1-next.468",
|
|
23
|
+
"@types/react": "^19.2.0",
|
|
24
|
+
"@types/react-dom": "^19.2.0",
|
|
25
|
+
"@cedarjs/testing": "7.1.1-next.468",
|
|
26
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
27
|
+
"@testing-library/react": "16.3.3",
|
|
28
|
+
"vite": "7.3.7"
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
|
|
1
3
|
import { defineConfig } from 'vite'
|
|
2
4
|
|
|
3
5
|
import { cedar } from '@cedarjs/vite'
|
|
4
6
|
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [cedar()],
|
|
7
|
-
|
|
7
|
+
export default defineConfig(({ mode }) => ({
|
|
8
|
+
plugins: [cedar({ mode })],
|
|
9
|
+
test: {
|
|
10
|
+
environment: 'jsdom',
|
|
11
|
+
setupFiles: ['./vitest.setup.ts'],
|
|
12
|
+
// Enables global test APIs like describe, it, expect
|
|
13
|
+
globals: true,
|
|
14
|
+
},
|
|
15
|
+
}))
|