refactor: use --env CLI arg (#2204)

This change replaces the use of the Standard Library's `dotenv.load()`
with the native `--env` CLI flag.

The benefits include:
* One less dependency
* More obvious consumption of the `.env` file in the CLI output
This commit is contained in:
Asher Gomez
2023-12-29 10:47:15 +01:00
committed by GitHub
parent 1016e7f9a1
commit 99eb5435bb
14 changed files with 14 additions and 22 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
},
"imports": {
"$fresh/": "../../",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
},
"imports": {
"$fresh/": "../../",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
},
"imports": {
"$fresh/": "../../",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts",
"start": "deno run -A --watch=static/,routes/ --env dev.ts",
"update": "deno run -A -r https://fresh.deno.dev/update ."
},
"imports": {
-2
View File
@@ -4,8 +4,6 @@
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
import "$std/dotenv/load.ts";
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
},
"imports": {
"$fresh/": "../../",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
},
"imports": {
"$fresh/": "../../",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"lock": false,
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
},
"imports": {
"$fresh/": "../../",
+2 -2
View File
@@ -406,7 +406,7 @@ Deno.test({
await t.step("start up the server", async () => {
const { serverProcess, lines, address } = await startFreshServer({
args: ["run", "-A", "--no-check", "dev.ts"],
args: ["run", "-A", "--no-check", "--env", "dev.ts"],
cwd: tmpDirName,
});
@@ -433,7 +433,7 @@ Deno.test({
}).output();
const { serverProcess, lines, address, output } = await startFreshServer({
args: ["run", "-A", "--no-check", "main.ts"],
args: ["run", "-A", "--no-check", "--env", "main.ts"],
cwd: tmpDirName,
});