Revert "refactor: use --env CLI arg" (#2212)
Reverts denoland/fresh#2204 The `--env` flag cannot be used by default because it fails when no `.env` file is present. Therefore this PR accidentally introduced a breaking change.
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../",
|
"$fresh/": "../",
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ Here's what the diff of `deno.json` looks like:
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
- "start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
- "start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
+ "start": "deno run -A --watch=src/static/,src/routes/ --env src/dev.ts"
|
+ "start": "deno run -A --watch=src/static/,src/routes/ src/dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "file:///Users/reed/code/fresh/",
|
"$fresh/": "file:///Users/reed/code/fresh/",
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ you'll end up with a `main.ts` like the following:
|
|||||||
/// <reference lib="dom.asynciterable" />
|
/// <reference lib="dom.asynciterable" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
|
|
||||||
|
import "$std/dotenv/load.ts";
|
||||||
|
|
||||||
import { start } from "$fresh/server.ts";
|
import { start } from "$fresh/server.ts";
|
||||||
import manifest from "./fresh.gen.ts";
|
import manifest from "./fresh.gen.ts";
|
||||||
import config from "./fresh.config.ts";
|
import config from "./fresh.config.ts";
|
||||||
|
|||||||
@@ -523,6 +523,8 @@ let MAIN_TS = `/// <reference no-default-lib="true" />
|
|||||||
/// <reference lib="dom.asynciterable" />
|
/// <reference lib="dom.asynciterable" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
|
|
||||||
|
import "$std/dotenv/load.ts";
|
||||||
|
|
||||||
import { start } from "$fresh/server.ts";
|
import { start } from "$fresh/server.ts";
|
||||||
import manifest from "./fresh.gen.ts";
|
import manifest from "./fresh.gen.ts";
|
||||||
import config from "./fresh.config.ts";
|
import config from "./fresh.config.ts";
|
||||||
@@ -538,6 +540,8 @@ const DEV_TS = `#!/usr/bin/env -S deno run -A --watch=static/,routes/
|
|||||||
import dev from "$fresh/dev.ts";
|
import dev from "$fresh/dev.ts";
|
||||||
import config from "./fresh.config.ts";
|
import config from "./fresh.config.ts";
|
||||||
|
|
||||||
|
import "$std/dotenv/load.ts";
|
||||||
|
|
||||||
await dev(import.meta.url, "./main.ts", config);
|
await dev(import.meta.url, "./main.ts", config);
|
||||||
`;
|
`;
|
||||||
const DEV_TS_PATH = join(resolvedDirectory, "dev.ts");
|
const DEV_TS_PATH = join(resolvedDirectory, "dev.ts");
|
||||||
@@ -555,7 +559,7 @@ const config = {
|
|||||||
"deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
|
"deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
|
||||||
cli: "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
|
cli: "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
|
||||||
manifest: "deno task cli manifest $(pwd)",
|
manifest: "deno task cli manifest $(pwd)",
|
||||||
start: "deno run -A --watch=static/,routes/ --env dev.ts",
|
start: "deno run -A --watch=static/,routes/ dev.ts",
|
||||||
build: "deno run -A dev.ts build",
|
build: "deno run -A dev.ts build",
|
||||||
preview: "deno run -A main.ts",
|
preview: "deno run -A main.ts",
|
||||||
update: "deno run -A -r https://fresh.deno.dev/update .",
|
update: "deno run -A -r https://fresh.deno.dev/update .",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../../",
|
"$fresh/": "../../",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../../",
|
"$fresh/": "../../",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../../",
|
"$fresh/": "../../",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts",
|
"start": "deno run -A --watch=static/,routes/ dev.ts",
|
||||||
"update": "deno run -A -r https://fresh.deno.dev/update ."
|
"update": "deno run -A -r https://fresh.deno.dev/update ."
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
/// <reference lib="dom.asynciterable" />
|
/// <reference lib="dom.asynciterable" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
|
|
||||||
|
import "$std/dotenv/load.ts";
|
||||||
|
|
||||||
import { start } from "$fresh/server.ts";
|
import { start } from "$fresh/server.ts";
|
||||||
import manifest from "./fresh.gen.ts";
|
import manifest from "./fresh.gen.ts";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../../",
|
"$fresh/": "../../",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../../",
|
"$fresh/": "../../",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/ --env dev.ts"
|
"start": "deno run -A --watch=static/,routes/ dev.ts"
|
||||||
},
|
},
|
||||||
"imports": {
|
"imports": {
|
||||||
"$fresh/": "../../",
|
"$fresh/": "../../",
|
||||||
|
|||||||
+2
-2
@@ -406,7 +406,7 @@ Deno.test({
|
|||||||
|
|
||||||
await t.step("start up the server", async () => {
|
await t.step("start up the server", async () => {
|
||||||
const { serverProcess, lines, address } = await startFreshServer({
|
const { serverProcess, lines, address } = await startFreshServer({
|
||||||
args: ["run", "-A", "--no-check", "--env", "dev.ts"],
|
args: ["run", "-A", "--no-check", "dev.ts"],
|
||||||
cwd: tmpDirName,
|
cwd: tmpDirName,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -433,7 +433,7 @@ Deno.test({
|
|||||||
}).output();
|
}).output();
|
||||||
|
|
||||||
const { serverProcess, lines, address, output } = await startFreshServer({
|
const { serverProcess, lines, address, output } = await startFreshServer({
|
||||||
args: ["run", "-A", "--no-check", "--env", "main.ts"],
|
args: ["run", "-A", "--no-check", "main.ts"],
|
||||||
cwd: tmpDirName,
|
cwd: tmpDirName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"lock": false,
|
"lock": false,
|
||||||
"nodeModulesDir": true,
|
"nodeModulesDir": true,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/,../src,../docs --env dev.ts",
|
"start": "deno run -A --watch=static/,routes/,../src,../docs dev.ts",
|
||||||
"build": "deno run -A dev.ts build",
|
"build": "deno run -A dev.ts build",
|
||||||
"preview": "deno run -A main.ts"
|
"preview": "deno run -A main.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user