create-cedar-app 0.15.0 → 0.15.1-next.23
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/README.md +2 -2
- package/dist/create-cedar-app.js +202 -202
- package/package.json +3 -3
- package/templates/esm-js/.env.defaults +1 -1
- package/templates/esm-js/.redwood/README.md +9 -9
- package/templates/esm-js/.vscode/launch.json +4 -4
- package/templates/esm-js/.yarnrc.yml +1 -1
- package/templates/esm-js/README.md +1 -1
- package/templates/esm-js/api/db/schema.prisma +1 -1
- package/templates/esm-js/api/src/lib/auth.js +3 -3
- package/templates/esm-js/redwood.toml +5 -5
- package/templates/esm-js/scripts/seed.js +1 -1
- package/templates/esm-js/web/public/README.md +1 -1
- package/templates/esm-js/web/src/pages/FatalErrorPage/FatalErrorPage.jsx +1 -1
- package/templates/esm-ts/.env.defaults +1 -1
- package/templates/esm-ts/.redwood/README.md +9 -9
- package/templates/esm-ts/.vscode/launch.json +4 -4
- package/templates/esm-ts/.yarnrc.yml +1 -1
- package/templates/esm-ts/README.md +1 -1
- package/templates/esm-ts/api/db/schema.prisma +1 -1
- package/templates/esm-ts/api/src/lib/auth.ts +4 -4
- package/templates/esm-ts/redwood.toml +5 -5
- package/templates/esm-ts/scripts/seed.ts +1 -1
- package/templates/esm-ts/web/public/README.md +1 -1
- package/templates/esm-ts/web/src/pages/FatalErrorPage/FatalErrorPage.tsx +1 -1
- package/templates/js/.env.defaults +1 -1
- package/templates/js/.redwood/README.md +9 -9
- package/templates/js/.vscode/launch.json +4 -4
- package/templates/js/.yarnrc.yml +1 -1
- package/templates/js/README.md +1 -1
- package/templates/js/api/db/schema.prisma +1 -1
- package/templates/js/api/jest.config.js +1 -1
- package/templates/js/api/package.json +2 -2
- package/templates/js/api/src/lib/auth.js +4 -4
- package/templates/js/jest.config.js +2 -2
- package/templates/js/package.json +3 -3
- package/templates/js/redwood.toml +5 -5
- package/templates/js/scripts/seed.js +1 -1
- package/templates/js/web/jest.config.js +1 -1
- package/templates/js/web/package.json +4 -4
- package/templates/js/web/public/README.md +1 -1
- package/templates/js/web/src/pages/FatalErrorPage/FatalErrorPage.jsx +1 -1
- package/templates/ts/.env.defaults +1 -1
- package/templates/ts/.redwood/README.md +9 -9
- package/templates/ts/.vscode/launch.json +4 -4
- package/templates/ts/.yarnrc.yml +1 -1
- package/templates/ts/README.md +1 -1
- package/templates/ts/api/db/schema.prisma +1 -1
- package/templates/ts/api/jest.config.js +1 -1
- package/templates/ts/api/package.json +2 -2
- package/templates/ts/api/src/lib/auth.ts +3 -3
- package/templates/ts/jest.config.js +2 -2
- package/templates/ts/package.json +3 -3
- package/templates/ts/redwood.toml +5 -5
- package/templates/ts/scripts/seed.ts +1 -1
- package/templates/ts/web/jest.config.js +1 -1
- package/templates/ts/web/package.json +4 -4
- package/templates/ts/web/public/README.md +1 -1
- package/templates/ts/web/src/pages/FatalErrorPage/FatalErrorPage.tsx +1 -1
- package/templates/esm-js/.yarn/install-state.gz +0 -0
- package/templates/esm-ts/.yarn/install-state.gz +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cedar-app",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1-next.23+0753a9ca2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@babel/core": "^7.26.10",
|
|
28
28
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
29
29
|
"@cedarjs/framework-tools": "0.15.0",
|
|
30
|
-
"@cedarjs/tui": "0.15.
|
|
30
|
+
"@cedarjs/tui": "0.15.1-next.23+0753a9ca2",
|
|
31
31
|
"@opentelemetry/api": "1.8.0",
|
|
32
32
|
"@opentelemetry/exporter-trace-otlp-http": "0.49.1",
|
|
33
33
|
"@opentelemetry/resources": "1.22.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "0753a9ca25ba21702aed57f7f5e8b49db9957984"
|
|
59
59
|
}
|
|
@@ -13,7 +13,7 @@ DATABASE_URL=file:./dev.db
|
|
|
13
13
|
PRISMA_HIDE_UPDATE_MESSAGE=true
|
|
14
14
|
|
|
15
15
|
# Option to override the current environment's default api-side log level
|
|
16
|
-
# See: https://
|
|
16
|
+
# See: https://cedarjs.com/docs/logger for level options, defaults to "trace" otherwise.
|
|
17
17
|
# Most applications want "debug" or "info" during dev, "trace" when you have issues and "warn" in production.
|
|
18
18
|
# Ordered by how verbose they are: trace | debug | info | warn | error | silent
|
|
19
19
|
# LOG_LEVEL=debug
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## What is this directory?
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Cedar uses this `.redwood` directory to store transitory data that aids in the smooth and convenient operation of your Cedar project.
|
|
6
6
|
|
|
7
7
|
## Do I need to do anything with this directory?
|
|
8
8
|
|
|
9
|
-
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with
|
|
9
|
+
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with Cedar.
|
|
10
10
|
|
|
11
11
|
You don't need to commit any other contents of this directory to your version control system. It's ignored by default.
|
|
12
12
|
|
|
@@ -16,8 +16,8 @@ You don't need to commit any other contents of this directory to your version co
|
|
|
16
16
|
|
|
17
17
|
| Name | Description |
|
|
18
18
|
| :---------------- | :----------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| commandCache.json | This file contains mappings to assist the
|
|
20
|
-
| schema.graphql | This is the GraphQL schema which has been automatically generated from your
|
|
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
21
|
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
|
|
22
22
|
| test.db | The sqlite database used when running tests. |
|
|
23
23
|
|
|
@@ -25,19 +25,19 @@ You don't need to commit any other contents of this directory to your version co
|
|
|
25
25
|
|
|
26
26
|
| Name | Description |
|
|
27
27
|
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| locks | Stores temporary files that
|
|
28
|
+
| locks | Stores temporary files that Cedar uses to keep track of the execution of async/background tasks between processes. |
|
|
29
29
|
| logs | Stores log files for background tasks such as update checking. |
|
|
30
|
-
| prebuild | Stores transpiled JavaScript that is generated as part of
|
|
31
|
-
| telemetry | Stores the recent telemetry that the
|
|
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
32
|
| types | Stores the results of type generation. |
|
|
33
|
-
| updateCheck | Stores a file which contains the results of checking for
|
|
33
|
+
| updateCheck | Stores a file which contains the results of checking for Cedar updates. |
|
|
34
34
|
| studio | Used to store data for `rw studio` |
|
|
35
35
|
|
|
36
36
|
We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` 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
37
|
|
|
38
38
|
### Telemetry
|
|
39
39
|
|
|
40
|
-
|
|
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
41
|
|
|
42
42
|
### Have any questions?
|
|
43
43
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"version": "0.3.0",
|
|
3
3
|
"configurations": [
|
|
4
4
|
{
|
|
5
|
-
"command": "yarn
|
|
5
|
+
"command": "yarn cedar dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
|
|
6
6
|
"name": "Run Dev Server",
|
|
7
7
|
"request": "launch",
|
|
8
8
|
"type": "node-terminal"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"name": "Attach API debugger",
|
|
12
|
-
"port": 18911, // you can change this port, see https://
|
|
12
|
+
"port": 18911, // you can change this port, see https://cedarjs.com/docs/project-configuration-dev-test-build#debugger-configuration
|
|
13
13
|
"request": "attach",
|
|
14
14
|
"skipFiles": [
|
|
15
15
|
"<node_internals>/**"
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"preLaunchTask": "WaitForDevServer",
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"command": "yarn
|
|
33
|
+
"command": "yarn cedar test api",
|
|
34
34
|
"name": "Test api",
|
|
35
35
|
"request": "launch",
|
|
36
36
|
"type": "node-terminal"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"command": "yarn
|
|
39
|
+
"command": "yarn cedar test web",
|
|
40
40
|
"name": "Test web",
|
|
41
41
|
"request": "launch",
|
|
42
42
|
"type": "node-terminal"
|
|
@@ -11,7 +11,7 @@ yarn install
|
|
|
11
11
|
Then start the development server:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
yarn
|
|
14
|
+
yarn cedar dev
|
|
15
15
|
```
|
|
16
16
|
|
|
17
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.
|
|
@@ -14,7 +14,7 @@ generator client {
|
|
|
14
14
|
binaryTargets = "native"
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// Define your own datamodels here and run `yarn
|
|
17
|
+
// Define your own datamodels here and run `yarn cedar prisma migrate dev`
|
|
18
18
|
// to create migrations for them and apply to your dev DB.
|
|
19
19
|
// TODO: Please remove the following example:
|
|
20
20
|
model UserExample {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* have something to check against, simulating a logged
|
|
6
6
|
* in user that is allowed to access that service.
|
|
7
7
|
*
|
|
8
|
-
* See https://
|
|
8
|
+
* See https://cedarjs.com/docs/authentication for more info.
|
|
9
9
|
*/
|
|
10
10
|
export const isAuthenticated = () => {
|
|
11
11
|
return true
|
|
@@ -15,7 +15,7 @@ export const hasRole = ({ roles }) => {
|
|
|
15
15
|
return roles !== undefined
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// This is used by the
|
|
18
|
+
// This is used by the cedar directive
|
|
19
19
|
// in ./api/src/directives/requireAuth
|
|
20
20
|
|
|
21
21
|
// Roles are passed in by the requireAuth directive if you have auth setup
|
|
@@ -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://
|
|
29
|
+
'Auth is not set up yet. See https://cedarjs.com/docs/authentication ' +
|
|
30
30
|
'to get started'
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# This file contains the configuration settings for your
|
|
2
|
-
# This file is also what makes your
|
|
3
|
-
# If you remove it and try to run `yarn
|
|
1
|
+
# This file contains the configuration settings for your Cedar app.
|
|
2
|
+
# This file is also what makes your Cedar app a Cedar app.
|
|
3
|
+
# If you remove it and try to run `yarn cedar dev`, you'll get an error.
|
|
4
4
|
#
|
|
5
5
|
# For the full list of options, see the "App Configuration: redwood.toml" doc:
|
|
6
|
-
# https://
|
|
6
|
+
# https://cedarjs.com/docs/app-configuration-redwood-toml
|
|
7
7
|
|
|
8
8
|
[web]
|
|
9
9
|
title = "Cedar App"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
apiUrl = "/.redwood/functions"
|
|
12
12
|
includeEnvironmentVariables = [
|
|
13
13
|
# Add any ENV vars that should be available to the web side to this array
|
|
14
|
-
# See https://
|
|
14
|
+
# See https://cedarjs.com/docs/environment-variables#web
|
|
15
15
|
]
|
|
16
16
|
[api]
|
|
17
17
|
port = 8911
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Seeds automatically run the first time you run the `yarn rw prisma migrate dev`
|
|
6
6
|
// command and every time you run the `yarn rw prisma migrate reset` command.
|
|
7
7
|
//
|
|
8
|
-
// See https://
|
|
8
|
+
// See https://cedarjs.com/docs/database-seeds for more info
|
|
9
9
|
|
|
10
10
|
export default async () => {
|
|
11
11
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Static Assets
|
|
2
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
|
|
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
4
|
|
|
5
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
6
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// boundary.
|
|
4
4
|
//
|
|
5
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,
|
|
6
|
+
// avoid the possibility that it will cause its own error. If it does, Cedar will
|
|
7
7
|
// still render a generic error page, but your users will prefer something a bit more
|
|
8
8
|
// thoughtful :)
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ DATABASE_URL=file:./dev.db
|
|
|
13
13
|
PRISMA_HIDE_UPDATE_MESSAGE=true
|
|
14
14
|
|
|
15
15
|
# Option to override the current environment's default api-side log level
|
|
16
|
-
# See: https://
|
|
16
|
+
# See: https://cedarjs.com/docs/logger for level options, defaults to "trace" otherwise.
|
|
17
17
|
# Most applications want "debug" or "info" during dev, "trace" when you have issues and "warn" in production.
|
|
18
18
|
# Ordered by how verbose they are: trace | debug | info | warn | error | silent
|
|
19
19
|
# LOG_LEVEL=debug
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## What is this directory?
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Cedar uses this `.redwood` directory to store transitory data that aids in the smooth and convenient operation of your Cedar project.
|
|
6
6
|
|
|
7
7
|
## Do I need to do anything with this directory?
|
|
8
8
|
|
|
9
|
-
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with
|
|
9
|
+
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with Cedar.
|
|
10
10
|
|
|
11
11
|
You don't need to commit any other contents of this directory to your version control system. It's ignored by default.
|
|
12
12
|
|
|
@@ -16,8 +16,8 @@ You don't need to commit any other contents of this directory to your version co
|
|
|
16
16
|
|
|
17
17
|
| Name | Description |
|
|
18
18
|
| :---------------- | :----------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| commandCache.json | This file contains mappings to assist the
|
|
20
|
-
| schema.graphql | This is the GraphQL schema which has been automatically generated from your
|
|
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
21
|
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
|
|
22
22
|
| test.db | The sqlite database used when running tests. |
|
|
23
23
|
|
|
@@ -25,19 +25,19 @@ You don't need to commit any other contents of this directory to your version co
|
|
|
25
25
|
|
|
26
26
|
| Name | Description |
|
|
27
27
|
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| locks | Stores temporary files that
|
|
28
|
+
| locks | Stores temporary files that Cedar uses to keep track of the execution of async/background tasks between processes. |
|
|
29
29
|
| logs | Stores log files for background tasks such as update checking. |
|
|
30
|
-
| prebuild | Stores transpiled JavaScript that is generated as part of
|
|
31
|
-
| telemetry | Stores the recent telemetry that the
|
|
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
32
|
| types | Stores the results of type generation. |
|
|
33
|
-
| updateCheck | Stores a file which contains the results of checking for
|
|
33
|
+
| updateCheck | Stores a file which contains the results of checking for Cedar updates. |
|
|
34
34
|
| studio | Used to store data for `rw studio` |
|
|
35
35
|
|
|
36
36
|
We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` 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
37
|
|
|
38
38
|
### Telemetry
|
|
39
39
|
|
|
40
|
-
|
|
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
41
|
|
|
42
42
|
### Have any questions?
|
|
43
43
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"version": "0.3.0",
|
|
3
3
|
"configurations": [
|
|
4
4
|
{
|
|
5
|
-
"command": "yarn
|
|
5
|
+
"command": "yarn cedar dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
|
|
6
6
|
"name": "Run Dev Server",
|
|
7
7
|
"request": "launch",
|
|
8
8
|
"type": "node-terminal"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"name": "Attach API debugger",
|
|
12
|
-
"port": 18911, // you can change this port, see https://
|
|
12
|
+
"port": 18911, // you can change this port, see https://cedarjs.com/docs/project-configuration-dev-test-build#debugger-configuration
|
|
13
13
|
"request": "attach",
|
|
14
14
|
"skipFiles": [
|
|
15
15
|
"<node_internals>/**"
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"preLaunchTask": "WaitForDevServer",
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"command": "yarn
|
|
33
|
+
"command": "yarn cedar test api",
|
|
34
34
|
"name": "Test api",
|
|
35
35
|
"request": "launch",
|
|
36
36
|
"type": "node-terminal"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"command": "yarn
|
|
39
|
+
"command": "yarn cedar test web",
|
|
40
40
|
"name": "Test web",
|
|
41
41
|
"request": "launch",
|
|
42
42
|
"type": "node-terminal"
|
|
@@ -11,7 +11,7 @@ yarn install
|
|
|
11
11
|
Then start the development server:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
yarn
|
|
14
|
+
yarn cedar dev
|
|
15
15
|
```
|
|
16
16
|
|
|
17
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.
|
|
@@ -14,7 +14,7 @@ generator client {
|
|
|
14
14
|
binaryTargets = "native"
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// Define your own datamodels here and run `yarn
|
|
17
|
+
// Define your own datamodels here and run `yarn cedar prisma migrate dev`
|
|
18
18
|
// to create migrations for them and apply to your dev DB.
|
|
19
19
|
// TODO: Please remove the following example:
|
|
20
20
|
model UserExample {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* have something to check against, simulating a logged
|
|
6
6
|
* in user that is allowed to access that service.
|
|
7
7
|
*
|
|
8
|
-
* See https://
|
|
8
|
+
* See https://cedarjs.com/docs/authentication for more info.
|
|
9
9
|
*/
|
|
10
10
|
export const isAuthenticated = () => {
|
|
11
11
|
return true
|
|
@@ -15,7 +15,7 @@ export const hasRole = ({ roles }) => {
|
|
|
15
15
|
return roles !== undefined
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// This is used by the
|
|
18
|
+
// This is used by the cedar directive
|
|
19
19
|
// in ./api/src/directives/requireAuth
|
|
20
20
|
|
|
21
21
|
// Roles are passed in by the requireAuth directive if you have auth setup
|
|
@@ -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://
|
|
30
|
-
'
|
|
29
|
+
'Auth is not set up yet. See https://cedarjs.com/docs/authentication to ' +
|
|
30
|
+
'get started'
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# This file contains the configuration settings for your
|
|
2
|
-
# This file is also what makes your
|
|
3
|
-
# If you remove it and try to run `yarn
|
|
1
|
+
# This file contains the configuration settings for your Cedar app.
|
|
2
|
+
# This file is also what makes your Cedar app a Cedar app.
|
|
3
|
+
# If you remove it and try to run `yarn cedar dev`, you'll get an error.
|
|
4
4
|
#
|
|
5
5
|
# For the full list of options, see the "App Configuration: redwood.toml" doc:
|
|
6
|
-
# https://
|
|
6
|
+
# https://cedarjs.com/docs/app-configuration-redwood-toml
|
|
7
7
|
|
|
8
8
|
[web]
|
|
9
9
|
title = "Cedar App"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
apiUrl = "/.redwood/functions"
|
|
12
12
|
includeEnvironmentVariables = [
|
|
13
13
|
# Add any ENV vars that should be available to the web side to this array
|
|
14
|
-
# See https://
|
|
14
|
+
# See https://cedarjs.com/docs/environment-variables#web
|
|
15
15
|
]
|
|
16
16
|
[api]
|
|
17
17
|
port = 8911
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Seeds automatically run the first time you run the `yarn rw prisma migrate dev`
|
|
6
6
|
// command and every time you run the `yarn rw prisma migrate reset` command.
|
|
7
7
|
//
|
|
8
|
-
// See https://
|
|
8
|
+
// See https://cedarjs.com/docs/database-seeds for more info
|
|
9
9
|
|
|
10
10
|
export default async () => {
|
|
11
11
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Static Assets
|
|
2
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
|
|
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
4
|
|
|
5
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
6
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// boundary.
|
|
4
4
|
//
|
|
5
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,
|
|
6
|
+
// avoid the possibility that it will cause its own error. If it does, Cedar will
|
|
7
7
|
// still render a generic error page, but your users will prefer something a bit more
|
|
8
8
|
// thoughtful :)
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ DATABASE_URL=file:./dev.db
|
|
|
13
13
|
PRISMA_HIDE_UPDATE_MESSAGE=true
|
|
14
14
|
|
|
15
15
|
# Option to override the current environment's default api-side log level
|
|
16
|
-
# See: https://
|
|
16
|
+
# See: https://cedarjs.com/docs/logger for level options, defaults to "trace" otherwise.
|
|
17
17
|
# Most applications want "debug" or "info" during dev, "trace" when you have issues and "warn" in production.
|
|
18
18
|
# Ordered by how verbose they are: trace | debug | info | warn | error | silent
|
|
19
19
|
# LOG_LEVEL=debug
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## What is this directory?
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Cedar uses this `.redwood` directory to store transitory data that aids in the smooth and convenient operation of your Cedar project.
|
|
6
6
|
|
|
7
7
|
## Do I need to do anything with this directory?
|
|
8
8
|
|
|
9
|
-
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with
|
|
9
|
+
No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with Cedar.
|
|
10
10
|
|
|
11
11
|
You don't need to commit any other contents of this directory to your version control system. It's ignored by default.
|
|
12
12
|
|
|
@@ -16,8 +16,8 @@ You don't need to commit any other contents of this directory to your version co
|
|
|
16
16
|
|
|
17
17
|
| Name | Description |
|
|
18
18
|
| :---------------- | :----------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| commandCache.json | This file contains mappings to assist the
|
|
20
|
-
| schema.graphql | This is the GraphQL schema which has been automatically generated from your
|
|
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
21
|
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
|
|
22
22
|
| test.db | The sqlite database used when running tests. |
|
|
23
23
|
|
|
@@ -25,19 +25,19 @@ You don't need to commit any other contents of this directory to your version co
|
|
|
25
25
|
|
|
26
26
|
| Name | Description |
|
|
27
27
|
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| locks | Stores temporary files that
|
|
28
|
+
| locks | Stores temporary files that Cedar uses to keep track of the execution of async/background tasks between processes. |
|
|
29
29
|
| logs | Stores log files for background tasks such as update checking. |
|
|
30
|
-
| prebuild | Stores transpiled JavaScript that is generated as part of
|
|
31
|
-
| telemetry | Stores the recent telemetry that the
|
|
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
32
|
| types | Stores the results of type generation. |
|
|
33
|
-
| updateCheck | Stores a file which contains the results of checking for
|
|
33
|
+
| updateCheck | Stores a file which contains the results of checking for Cedar updates. |
|
|
34
34
|
| studio | Used to store data for `rw studio` |
|
|
35
35
|
|
|
36
36
|
We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` 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
37
|
|
|
38
38
|
### Telemetry
|
|
39
39
|
|
|
40
|
-
|
|
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
41
|
|
|
42
42
|
### Have any questions?
|
|
43
43
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"version": "0.3.0",
|
|
3
3
|
"configurations": [
|
|
4
4
|
{
|
|
5
|
-
"command": "yarn
|
|
5
|
+
"command": "yarn cedar dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
|
|
6
6
|
"name": "Run Dev Server",
|
|
7
7
|
"request": "launch",
|
|
8
8
|
"type": "node-terminal"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"name": "Attach API debugger",
|
|
12
|
-
"port": 18911, // you can change this port, see https://
|
|
12
|
+
"port": 18911, // you can change this port, see https://cedarjs.com/docs/project-configuration-dev-test-build#debugger-configuration
|
|
13
13
|
"request": "attach",
|
|
14
14
|
"skipFiles": [
|
|
15
15
|
"<node_internals>/**"
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"preLaunchTask": "WaitForDevServer",
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"command": "yarn
|
|
33
|
+
"command": "yarn cedar test api",
|
|
34
34
|
"name": "Test api",
|
|
35
35
|
"request": "launch",
|
|
36
36
|
"type": "node-terminal"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"command": "yarn
|
|
39
|
+
"command": "yarn cedar test web",
|
|
40
40
|
"name": "Test web",
|
|
41
41
|
"request": "launch",
|
|
42
42
|
"type": "node-terminal"
|
package/templates/js/.yarnrc.yml
CHANGED
package/templates/js/README.md
CHANGED
|
@@ -11,7 +11,7 @@ yarn install
|
|
|
11
11
|
Then start the development server:
|
|
12
12
|
|
|
13
13
|
```
|
|
14
|
-
yarn
|
|
14
|
+
yarn cedar dev
|
|
15
15
|
```
|
|
16
16
|
|
|
17
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.
|
|
@@ -14,7 +14,7 @@ generator client {
|
|
|
14
14
|
binaryTargets = "native"
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// Define your own datamodels here and run `yarn
|
|
17
|
+
// Define your own datamodels here and run `yarn cedar prisma migrate dev`
|
|
18
18
|
// to create migrations for them and apply to your dev DB.
|
|
19
19
|
// TODO: Please remove the following example:
|
|
20
20
|
model UserExample {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* have something to check against, simulating a logged
|
|
6
6
|
* in user that is allowed to access that service.
|
|
7
7
|
*
|
|
8
|
-
* See https://
|
|
8
|
+
* See https://cedarjs.com/docs/authentication for more info.
|
|
9
9
|
*/
|
|
10
10
|
export const isAuthenticated = () => {
|
|
11
11
|
return true
|
|
@@ -15,7 +15,7 @@ export const hasRole = ({ roles }) => {
|
|
|
15
15
|
return roles !== undefined
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// This is used by the
|
|
18
|
+
// This is used by the cedar directive
|
|
19
19
|
// in ./api/src/directives/requireAuth
|
|
20
20
|
|
|
21
21
|
// Roles are passed in by the requireAuth directive if you have auth setup
|
|
@@ -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://
|
|
30
|
-
'
|
|
29
|
+
'Auth is not set up yet. See https://cedarjs.com/docs/authentication to ' +
|
|
30
|
+
'get started'
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// This the
|
|
1
|
+
// This the Cedar root jest config
|
|
2
2
|
// Each side, e.g. ./web/ and ./api/ has specific config that references this root
|
|
3
|
-
// More info at https://
|
|
3
|
+
// More info at https://cedarjs.com/docs/project-configuration-dev-test-build
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
rootDir: '.',
|