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