Zum Inhalt springen

@studiocms/devapps

Eine Sammlung nützlicher Werkzeuge, die im Entwicklungsmodus von Astro verfügbar sind.

  1. Installiere das Paket und füge es mit dem folgenden Befehl zu deiner Astro-Konfiguration hinzu:

    Terminal-Fenster
    npx astro add @studiocms/devapps
  2. Aktualisiere deine Konfigurationsdatei wie unter der Beispielkonfiguration unten gezeigt.

Alle Tools sind nur während der Entwicklungsphase (astro dev) verfügbar und nicht während der Produktionsphase!

astro.config.mjs
import {
function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never>(config: AstroUserConfig<TLocales, TDriver>): AstroUserConfig<TLocales, TDriver>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
} from 'astro/config';
import
function db(): AstroIntegration[]
db
from '@astrojs/db';
import
function devApps(opts?: StudioCMSDevAppsOptions): AstroIntegration

Integrates StudioCMS development applications with Astro.

@paramopts - Optional configuration options for StudioCMS DevApps.

@returnsThe Astro integration object for StudioCMS DevApps.

@example

import { studioCMSDevApps } from '@studiocms/devapps';
export default {
integrations: [
studioCMSDevApps({
endpoint: '/api',
appsConfig: {
wpImporter: {
enabled: true,
endpoint: '/wp-import',
},
libSQLViewer: {
enabled: true,
},
},
verbose: true,
}),
],
};

devApps
from '@studiocms/devapps';
export default
defineConfig<never, never>(config: AstroUserConfig<never, never>): AstroUserConfig<never, never>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
({
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.site?: string

@namesite

@type{string}

@description

Your final, deployed URL. Astro uses this full URL to generate your sitemap and canonical URLs in your final build. It is strongly recommended that you set this configuration to get the most out of Astro.

{
site: 'https://www.my-site.dev'
}

site
: "https://example.com",
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]

@nameintegrations

@description

Extend Astro with custom integrations. Integrations are your one-stop-shop for adding framework support (like Solid.js), new features (like sitemaps), and new libraries (like Partytown).

Read our Integrations Guide for help getting started with Astro Integrations.

import react from '@astrojs/react';
import mdx from '@astrojs/mdx';
{
// Example: Add React + MDX support to Astro
integrations: [react(), mdx()]
}

integrations
: [
function db(): AstroIntegration[]
db
(), // ERFORDERLICH
function devApps(opts?: StudioCMSDevAppsOptions): AstroIntegration

Integrates StudioCMS development applications with Astro.

@paramopts - Optional configuration options for StudioCMS DevApps.

@returnsThe Astro integration object for StudioCMS DevApps.

@example

import { studioCMSDevApps } from '@studiocms/devapps';
export default {
integrations: [
studioCMSDevApps({
endpoint: '/api',
appsConfig: {
wpImporter: {
enabled: true,
endpoint: '/wp-import',
},
libSQLViewer: {
enabled: true,
},
},
verbose: true,
}),
],
};

devApps
(/* Siehe Konfigurationsoptionen unten */),
],
});

Vollständige Liste der Optionen, die für die devApps-Integration verfügbar sind, mit Angabe der Standardwerte. Alle Optionen sind optional.

endpoint?: string | undefined
endpoint
: '_studiocms-devapps',
verbose?: boolean | undefined
verbose
: false,
appsConfig?: {
libSQLViewer: boolean | {
endpoint?: string | undefined;
};
wpImporter: boolean | {
endpoint?: string | undefined;
};
} | undefined
appsConfig
: {
libSQLViewer: boolean | {
endpoint?: string | undefined;
}
libSQLViewer
: true,
wpImporter: boolean | {
endpoint?: string | undefined;
}
wpImporter
: true,
},

Entwicklungswerkzeug, um die SQL-Tabellen in der libSQL-Datenbank im Browser anzuzeigen. Das Tool benötigt die Anmeldeinformationen für die libSQL-Remote-Datenbankverbindung @astrojs/db.

Die folgenden Umgebungsvariablen werden gesetzt (auch für @astrojs/db verwendet):

  • ASTRO_DB_REMOTE_URL
  • ASTRO_DB_APP_TOKEN
  • Symbolleisten-App (geschlossen)

Astro DevToolbarApp

  • Symbolleiste (Erweitert)

Astro DevToolbarApp (Erweitert)

Entwicklungstool zum Importieren von WordPress-Beiträgen und -Seiten in die StudioCMS-Datenbank.

  • StudioCMS-Integration
  • WordPress installieren
  • @studiocms/blog (Optional: für den Import von Posts unter einem Blog)
  • Symbolleisten-App

Astro DevToolbarApp