Format all files with prettier: npm run format

This commit is contained in:
prototypa
2024-04-29 17:51:55 -04:00
parent 2b8672612e
commit a606b34a19
47 changed files with 298 additions and 340 deletions

2
vendor/README.md vendored
View File

@@ -1,4 +1,4 @@
This folder will become an integration for **AstroWind**.
We are working to allow updates to template instances.
These are changes on the way to new **AstroWind v2**
These are changes on the way to new **AstroWind v2**

View File

@@ -1,7 +1,7 @@
import fs from 'node:fs';
import os from 'node:os';
import configBuilder from "./utils/configBuilder"
import configBuilder from './utils/configBuilder';
import loadConfig from './utils/loadConfig';
const tasksIntegration = ({ config: _themeConfig = 'src/config.yaml' } = {}) => {
@@ -17,10 +17,9 @@ const tasksIntegration = ({ config: _themeConfig = 'src/config.yaml' } = {}) =>
// isRestart,
logger,
updateConfig,
addWatchFile
addWatchFile,
}) => {
const buildLogger = logger.fork("astrowind");
const buildLogger = logger.fork('astrowind');
const virtualModuleId = 'astrowind:config';
const resolvedVirtualModuleId = '\0' + virtualModuleId;
@@ -60,12 +59,12 @@ const tasksIntegration = ({ config: _themeConfig = 'src/config.yaml' } = {}) =>
},
});
if (typeof _themeConfig === "string") {
if (typeof _themeConfig === 'string') {
addWatchFile(new URL(_themeConfig, config.root));
buildLogger.info(`Astrowind \`${_themeConfig}\` has been loaded.`)
buildLogger.info(`Astrowind \`${_themeConfig}\` has been loaded.`);
} else {
buildLogger.info(`Astrowind config has been loaded.`)
buildLogger.info(`Astrowind config has been loaded.`);
}
},
'astro:config:done': async ({ config }) => {
@@ -73,9 +72,8 @@ const tasksIntegration = ({ config: _themeConfig = 'src/config.yaml' } = {}) =>
},
'astro:build:done': async ({ logger }) => {
const buildLogger = logger.fork("astrowind");
buildLogger.info("Updating `robots.txt` with `sitemap-index.xml` ...")
const buildLogger = logger.fork('astrowind');
buildLogger.info('Updating `robots.txt` with `sitemap-index.xml` ...');
try {
const outDir = cfg.outDir;

View File

@@ -1,10 +1,10 @@
declare module 'astrowind:config' {
import type { SiteConfig, I18NConfig, MetaDataConfig, AppBlogConfig, UIConfig, AnalyticsConfig } from "./config"
import type { SiteConfig, I18NConfig, MetaDataConfig, AppBlogConfig, UIConfig, AnalyticsConfig } from './config';
export const SITE: SiteConfig;
export const I18N : I18NConfig;
export const I18N: I18NConfig;
export const METADATA: MetaDataConfig;
export const APP_BLOG : AppBlogConfig;
export const UI : UIConfig;
export const ANALYTICS : AnalyticsConfig;
}
export const APP_BLOG: AppBlogConfig;
export const UI: UIConfig;
export const ANALYTICS: AnalyticsConfig;
}

View File

@@ -4,7 +4,7 @@ import yaml from 'js-yaml';
const loadConfig = async (configPathOrData: string | object) => {
if (typeof configPathOrData === 'string') {
const content = fs.readFileSync(configPathOrData, 'utf8');
if (configPathOrData.endsWith(".yaml") || configPathOrData.endsWith(".yml")) {
if (configPathOrData.endsWith('.yaml') || configPathOrData.endsWith('.yml')) {
return yaml.load(content);
}
return content;