Home / File/ index.ts — astro Source File

index.ts — astro Source File

Architecture documentation for index.ts, a typescript file in the astro codebase. 5 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 5 imports 5 functions

Entity Profile

Dependency Diagram

graph LR
  6ef7bfdb_4b52_2205_aa0f_e41748222587["index.ts"]
  46a926a7_35c2_52c9_2708_c9852e3cd744["./schema.js"]
  6ef7bfdb_4b52_2205_aa0f_e41748222587 --> 46a926a7_35c2_52c9_2708_c9852e3cd744
  897f1cb1_b125_052a_8618_b8a9d6d68310["./util.js"]
  6ef7bfdb_4b52_2205_aa0f_e41748222587 --> 897f1cb1_b125_052a_8618_b8a9d6d68310
  f8c9251e_f535_6281_2118_9e79a4155212["v4"]
  6ef7bfdb_4b52_2205_aa0f_e41748222587 --> f8c9251e_f535_6281_2118_9e79a4155212
  d2e96012_db7a_940d_31f2_59a0f9c5ab9f["fast-xml-parser"]
  6ef7bfdb_4b52_2205_aa0f_e41748222587 --> d2e96012_db7a_940d_31f2_59a0f9c5ab9f
  10250468_0e83_bd69_43e9_3bcef2294a91["piccolore"]
  6ef7bfdb_4b52_2205_aa0f_e41748222587 --> 10250468_0e83_bd69_43e9_3bcef2294a91
  style 6ef7bfdb_4b52_2205_aa0f_e41748222587 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as z from 'zod/v4';
import { XMLBuilder, XMLParser } from 'fast-xml-parser';
import colors from 'piccolore';
import { rssSchema } from './schema.js';
import { createCanonicalURL, isValidURL } from './util.js';

export { rssSchema };

export type RSSOptions = {
	/** Title of the RSS Feed */
	title: z.infer<typeof rssOptionsValidator>['title'];
	/** Description of the RSS Feed */
	description: z.infer<typeof rssOptionsValidator>['description'];
	/**
	 * Specify the base URL to use for RSS feed links.
	 * We recommend using the [endpoint context object](https://docs.astro.build/en/reference/api-reference/#site),
	 * which includes the `site` configured in your project's `astro.config.*`
	 */
	site: z.infer<typeof rssOptionsValidator>['site'] | URL;
	/** List of RSS feed items to render. */
	items: RSSFeedItem[] | GlobResult;
	/** Specify arbitrary metadata on opening <xml> tag */
	xmlns?: z.infer<typeof rssOptionsValidator>['xmlns'];
	/**
	 * Specifies a local custom XSL stylesheet. Ex. '/public/custom-feed.xsl'
	 */
	stylesheet?: z.infer<typeof rssOptionsValidator>['stylesheet'];
	/** Specify custom data in opening of file */
	customData?: z.infer<typeof rssOptionsValidator>['customData'];
	trailingSlash?: z.infer<typeof rssOptionsValidator>['trailingSlash'];
};

export type RSSFeedItem = {
	/** Link to item */
	link?: z.infer<typeof rssSchema>['link'];
	/** Full content of the item. Should be valid HTML */
	content?: z.infer<typeof rssSchema>['content'];
	/** Title of item */
	title?: z.infer<typeof rssSchema>['title'];
	/** Publication date of item */
	pubDate?: z.infer<typeof rssSchema>['pubDate'];
	/** Item description */
	description?: z.infer<typeof rssSchema>['description'];
	/** Append some other XML-valid data to this item */
	customData?: z.infer<typeof rssSchema>['customData'];
	/** Categories or tags related to the item */
	categories?: z.infer<typeof rssSchema>['categories'];
	/** The item author's email address */
	author?: z.infer<typeof rssSchema>['author'];
	/** A URL of a page for comments related to the item */
	commentsUrl?: z.infer<typeof rssSchema>['commentsUrl'];
	/** The RSS channel that the item came from */
	source?: z.infer<typeof rssSchema>['source'];
	/** A media object that belongs to the item */
	enclosure?: z.infer<typeof rssSchema>['enclosure'];
};

type ValidatedRSSFeedItem = z.infer<typeof rssSchema>;
type ValidatedRSSOptions = z.infer<typeof rssOptionsValidator>;
type GlobResult = z.infer<typeof globResultValidator>;
// ... (211 more lines)

Domain

Subdomains

Dependencies

  • ./schema.js
  • ./util.js
  • fast-xml-parser
  • piccolore
  • v4

Frequently Asked Questions

What does index.ts do?
index.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in index.ts?
index.ts defines 5 function(s): generateRSS, getRssResponse, getRssString, pagesGlobToRssItems, validateRssOptions.
What does index.ts depend on?
index.ts imports 5 module(s): ./schema.js, ./util.js, fast-xml-parser, piccolore, v4.
Where is index.ts in the architecture?
index.ts is located at packages/astro-rss/src/index.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro-rss/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free