mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
b1eda3dc5c
commit
5f5176b244
3 changed files with 6 additions and 7 deletions
|
@ -1,10 +1,10 @@
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import type { AstroConfig } from 'astro';
|
||||||
import { normalizePath } from 'vite';
|
import { normalizePath } from 'vite';
|
||||||
import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js';
|
import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js';
|
||||||
import { DB_PATH, RUNTIME_CONFIG_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js';
|
import { DB_PATH, RUNTIME_CONFIG_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js';
|
||||||
import type { DBTables } from '../types.js';
|
import type { DBTables } from '../types.js';
|
||||||
import { type VitePlugin, getDbDirectoryUrl, getRemoteDatabaseUrl } from '../utils.js';
|
import { type VitePlugin, getDbDirectoryUrl, getRemoteDatabaseUrl } from '../utils.js';
|
||||||
import type { AstroConfig } from 'astro';
|
|
||||||
|
|
||||||
const WITH_SEED_VIRTUAL_MODULE_ID = 'astro:db:seed';
|
const WITH_SEED_VIRTUAL_MODULE_ID = 'astro:db:seed';
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ export function getStudioVirtualModContents({
|
||||||
}) {
|
}) {
|
||||||
function appTokenArg() {
|
function appTokenArg() {
|
||||||
if (isBuild) {
|
if (isBuild) {
|
||||||
if(output === 'server') {
|
if (output === 'server') {
|
||||||
// In production build, always read the runtime environment variable.
|
// In production build, always read the runtime environment variable.
|
||||||
return 'process.env.ASTRO_STUDIO_APP_TOKEN';
|
return 'process.env.ASTRO_STUDIO_APP_TOKEN';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { User, db } from 'astro:db';
|
||||||
export default async function () {
|
export default async function () {
|
||||||
await db.insert(User).values([
|
await db.insert(User).values([
|
||||||
{
|
{
|
||||||
name: 'Houston'
|
name: 'Houston',
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { User, db } from 'astro:db';
|
||||||
|
|
||||||
const users = await db.select().from(User);
|
const users = await db.select().from(User);
|
||||||
---
|
---
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Testing</title>
|
<title>Testing</title>
|
||||||
|
@ -12,9 +13,7 @@ const users = await db.select().from(User);
|
||||||
|
|
||||||
<h2>Users</h2>
|
<h2>Users</h2>
|
||||||
<ul>
|
<ul>
|
||||||
{users.map(user => (
|
{users.map((user) => <li>{user.name}</li>)}
|
||||||
<li>{user.name}</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue