Format all files with prettier: npm run format
This commit is contained in:
2
vendor/README.md
vendored
2
vendor/README.md
vendored
@@ -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**
|
||||
|
18
vendor/integration/index.mjs
vendored
18
vendor/integration/index.mjs
vendored
@@ -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;
|
||||
|
12
vendor/integration/types.d.ts
vendored
12
vendor/integration/types.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
2
vendor/integration/utils/loadConfig.ts
vendored
2
vendor/integration/utils/loadConfig.ts
vendored
@@ -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;
|
||||
|
Reference in New Issue
Block a user