code cleanup and fixes
This commit is contained in:
parent
2901524b8a
commit
3192714355
|
@ -38,7 +38,9 @@
|
|||
},
|
||||
"files": [
|
||||
"src",
|
||||
"index.ts"
|
||||
"CHANGELOG.md",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
|
|
|
@ -4,18 +4,22 @@ import type { Page, Post } from "../schemas/api";
|
|||
// LOAD ENVIRONMENT VARIABLES
|
||||
import { loadEnv } from "vite";
|
||||
|
||||
import config from "virtual:@matthiesenxyz/astro-ghostcms/config";
|
||||
|
||||
const CONF_URL = config.ghostURL;
|
||||
|
||||
const { CONTENT_API_KEY, CONTENT_API_URL } = loadEnv(
|
||||
const {
|
||||
CONTENT_API_KEY,
|
||||
CONTENT_API_URL
|
||||
} = loadEnv(
|
||||
"all",
|
||||
process.cwd(),
|
||||
"CONTENT_",
|
||||
);
|
||||
|
||||
const ghostApiKey = CONTENT_API_KEY;
|
||||
const ghostUrl = CONF_URL ? CONF_URL : CONTENT_API_URL;
|
||||
// LOAD CONFIG
|
||||
import config from "virtual:@matthiesenxyz/astro-ghostcms/config";
|
||||
const CONF_URL = config.ghostURL;
|
||||
|
||||
// SETUP GHOST API
|
||||
const ghostApiKey = CONTENT_API_KEY || "";
|
||||
const ghostUrl = CONF_URL || CONTENT_API_URL || "";
|
||||
const version = "v5.0";
|
||||
const api = new TSGhostContentAPI(ghostUrl, ghostApiKey, version);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ export default defineIntegration({
|
|||
if ( !options.disableThemeProvider ) {
|
||||
addIntegration(
|
||||
ghostThemeProvider({
|
||||
theme: options.ThemeProvider.theme,
|
||||
theme: options.ThemeProvider?.theme,
|
||||
verbose
|
||||
})
|
||||
)
|
||||
|
@ -164,7 +164,6 @@ export default defineIntegration({
|
|||
"astro:server:start": async ({ logger }) => {
|
||||
const GhostLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.bold(c.green('DEV'))}`);
|
||||
const GhostUpdateLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.bold(c.green('VERSION CHECK'))}`);
|
||||
const verbose = options.fullConsoleLogs;
|
||||
|
||||
// Start the DEV server
|
||||
GhostLogger.info(c.bold(c.magenta('Running Astro-GhostCMS in Deveopment mode 🚀')))
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/strictest",
|
||||
"compilerOptions": {
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
declare module "virtual:@matthiesenxyz/astro-ghostcms/config" {
|
||||
const Config: import("./src/schemas/userconfig").GhostUserConfig;
|
||||
export default Config;
|
||||
}
|
Loading…
Reference in New Issue