denoland / denoland/tutorial-with-vue

Watch in the wrong script

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7
Forks
5
PR merge metrics
No merged PRs in 30d

Description

The watch is now placed in the `server:start` script which in my undearstanding is the script that is run in the production.
On the other hand, there is no watch in the `dev:api` (`dev:vite` watch is handled by Vite.)

```json
"scripts": {
"dev": "deno task dev:api & deno task dev:vite",
"dev:api": "deno run --allow-env --allow-net api/main.ts",
"dev:vite": "deno run -A npm:vite",
"build": "deno run -A npm:vite build",
"server:start": "deno run -A --watch ./api/main.ts",
"serve": "deno run build && deno run server:start",
"preview": "vite preview"
},
```

Also, from security point-of-view, it looks dangerous that production run is run with all rights (`-A`).
Perhaps the two scripts are just mixed?

Suggest switching the scripts `dev:api` and `server:start`:

```json
"scripts": {
"dev:api": "deno run --allow-env --allow-net --allow-read --watch ./api/main.ts",
"server:start": "deno run --allow-env --allow-net --allow-read api/main.ts",
},
```

(EDIT: `server:start` requires ` --allow-read`, so that is added above. Also reduced the required permissions on `dev-api`).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.