index.js — svelte Source File
Architecture documentation for index.js, a javascript file in the svelte codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f3ceb1d6_5cc2_9e87_74da_ca4939313091["index.js"] 1e87bdd2_077b_eeb5_2d65_2e3fa5e0d403["node:process"] f3ceb1d6_5cc2_9e87_74da_ca4939313091 --> 1e87bdd2_077b_eeb5_2d65_2e3fa5e0d403 f596e027_a951_36c9_7695_83acc4f0d6b9["node:fs"] f3ceb1d6_5cc2_9e87_74da_ca4939313091 --> f596e027_a951_36c9_7695_83acc4f0d6b9 ddbd69fe_bca5_b6ae_d174_765ac7fa34f7["acorn"] f3ceb1d6_5cc2_9e87_74da_ca4939313091 --> ddbd69fe_bca5_b6ae_d174_765ac7fa34f7 c49ac9f8_b355_57a2_8d10_b5fd945c6144["zimmerframe"] f3ceb1d6_5cc2_9e87_74da_ca4939313091 --> c49ac9f8_b355_57a2_8d10_b5fd945c6144 16640ae7_e3c7_97fb_f758_13b5051448f7["esrap"] f3ceb1d6_5cc2_9e87_74da_ca4939313091 --> 16640ae7_e3c7_97fb_f758_13b5051448f7 3e77edba_57e8_d5f4_66c6_80c999e42f8a["ts"] f3ceb1d6_5cc2_9e87_74da_ca4939313091 --> 3e77edba_57e8_d5f4_66c6_80c999e42f8a style f3ceb1d6_5cc2_9e87_74da_ca4939313091 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/** @import { Node } from 'esrap/languages/ts' */
/** @import * as ESTree from 'estree' */
/** @import { AST } from 'svelte/compiler' */
// @ts-check
import process from 'node:process';
import fs from 'node:fs';
import * as acorn from 'acorn';
import { walk } from 'zimmerframe';
import * as esrap from 'esrap';
import ts from 'esrap/languages/ts';
const DIR = '../../documentation/docs/98-reference/.generated';
const watch = process.argv.includes('-w');
function run() {
/** @type {Record<string, Record<string, { messages: string[], details: string | null }>>} */
const messages = {};
const seen = new Set();
fs.rmSync(DIR, { force: true, recursive: true });
fs.mkdirSync(DIR);
for (const category of fs.readdirSync('messages')) {
if (category.startsWith('.')) continue;
messages[category] = {};
for (const file of fs.readdirSync(`messages/${category}`)) {
if (!file.endsWith('.md')) continue;
const markdown = fs
.readFileSync(`messages/${category}/${file}`, 'utf-8')
.replace(/\r\n/g, '\n');
const sorted = [];
for (const match of markdown.matchAll(/## ([\w]+)\n\n([^]+?)(?=$|\n\n## )/g)) {
const [_, code, text] = match;
if (seen.has(code)) {
throw new Error(`Duplicate message code ${category}/${code}`);
}
sorted.push({ code, _ });
const sections = text.trim().split('\n\n');
const details = [];
while (!sections[sections.length - 1].startsWith('> ')) {
details.unshift(/** @type {string} */ (sections.pop()));
}
if (sections.length === 0) {
throw new Error('No message text');
}
seen.add(code);
messages[category][code] = {
// ... (371 more lines)
Domain
Subdomains
Functions
Dependencies
- acorn
- esrap
- node:fs
- node:process
- ts
- zimmerframe
Source
Frequently Asked Questions
What does index.js do?
index.js is a source file in the svelte codebase, written in javascript. It belongs to the BuildSystem domain, QualityControl subdomain.
What functions are defined in index.js?
index.js defines 1 function(s): run.
What does index.js depend on?
index.js imports 6 module(s): acorn, esrap, node:fs, node:process, ts, zimmerframe.
Where is index.js in the architecture?
index.js is located at packages/svelte/scripts/process-messages/index.js (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte/scripts/process-messages).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free