Skip to content

Commit e90f571

Browse files
committed
fixes & enhancements
1 parent 752a1b8 commit e90f571

6 files changed

Lines changed: 2389 additions & 63 deletions

File tree

astro-demo/astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ import deno from "@deno/astro-adapter";
55
// https://astro.build/config
66
export default defineConfig({
77
output: "server",
8+
server: {
9+
allowedHosts: ["deploy-subcommand-testing--local.deno.deno.net"],
10+
},
811
adapter: deno(),
912
});

config.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import {
44
modify as modifyJSONC,
55
parse as parseJSONC,
66
} from "jsonc-parser";
7-
import { resolve_config_with_deploy_config } from "./lib/rs_lib.js";
7+
import {
8+
resolve_config,
9+
resolve_config_with_deploy_config,
10+
} from "./lib/rs_lib.js";
811

912
export interface Config {
1013
path: string;
@@ -20,6 +23,10 @@ export async function readConfig(
2023
return { path: maybeConfigPath, content };
2124
}
2225

26+
// we prefer the configs with the deploy key. then we fallback to a general
27+
// config, so when we set the values, it uses existing config files instead
28+
// of trying to create a new one (which will still happen if no config file is found)
29+
2330
const configUrl = resolve_config_with_deploy_config(rootPath);
2431

2532
if (configUrl) {
@@ -28,6 +35,14 @@ export async function readConfig(
2835
return { path, content };
2936
}
3037

38+
const configUrlWithoutDeployConfig = resolve_config(rootPath);
39+
40+
if (configUrlWithoutDeployConfig) {
41+
const path = fromFileUrl(configUrlWithoutDeployConfig);
42+
const content = await Deno.readTextFile(path);
43+
return { path, content };
44+
}
45+
3146
return null;
3247
}
3348

deno.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"nodeModulesDir": "auto",
3+
"workspace": [
4+
"astro-demo"
5+
],
26
"name": "@deno/deploy",
37
"license": "MIT",
48
"tasks": {
@@ -31,5 +35,7 @@
3135
"@deno/framework-detect": "jsr:@deno/framework-detect@^0",
3236
"temporal-polyfill": "npm:temporal-polyfill@^0.3.0"
3337
},
34-
"exclude": ["astro-demo"]
38+
"exclude": [
39+
"astro-demo"
40+
]
3541
}

0 commit comments

Comments
 (0)