"src/routes/blogs.ts" import {BLOG_INIT_BLOGS_PATH} from '@fuzdev/fuz_blog/blog_init.js'; Plans wiring fuz_blog into a SvelteKit project, for init.task.ts: from the
project's state, the files to create, the existing files to leave alone, and
the edits to existing files to suggest. Pure and free of node, gro, and Svelte
imports - load_blog_init_state reads the state and write_blog_init_files
writes the planned files.
11 declarations
"src/routes/blogs.ts" import {BLOG_INIT_BLOGS_PATH} from '@fuzdev/fuz_blog/blog_init.js'; "src/routes/+layout.svelte" import {BLOG_INIT_ROOT_LAYOUT_PATH} from '@fuzdev/fuz_blog/blog_init.js'; BlogInitAction type { kind: "create"; path: string; content: string; } | { kind: "exists"; path: string; } | { kind: "suggest"; path: string; message: string; snippet: string; }
import type {BlogInitAction} from '@fuzdev/fuz_blog/blog_init.js'; One planned step of plan_blog_init: create a missing file, leave an existing one alone, or suggest an edit the user makes by hand.
BlogInitOptions import type {BlogInitOptions} from '@fuzdev/fuz_blog/blog_init.js'; The options of init.task.ts, before defaults from package.json.
dirnameThe new blog's dirname.
type string
url?The site URL including any deploy base path, defaulting to package.json homepage.
type string
title?The feed title, defaulting to <package name> <dirname>.
type string
description?The feed description, defaulting to package.json description, then the title.
type string
author?The feed author as Name <email> (url), defaulting to package.json author.
type string
icon?The feed's icon and favicon URL, defaulting to <url>/favicon.png.
type string
BlogInitPackageJson import type {BlogInitPackageJson} from '@fuzdev/fuz_blog/blog_init.js'; The package.json fields plan_blog_init reads.
name?type string
description?type string
homepage?type string
author?type unknown
BlogInitPaths import type {BlogInitPaths} from '@fuzdev/fuz_blog/blog_init.js'; blogstype string
gentype string
post_tasktype string
update_post_tasktype string
layouttype string
pagetype string
BlogInitPlan import type {BlogInitPlan} from '@fuzdev/fuz_blog/blog_init.js'; configThe new blog's config, validated, written to or suggested for blogs.ts.
type BlogConfig
actionstype BlogInitAction[]
blog_registeredWhether the registry includes the blog after the plan is applied, so gro gen
can write its feed.ts - false when the entry is only suggested, in which case
the blog's routes, which import that feed.ts, wait for the next run.
type boolean
warningsLikely mistakes that don't stop the plan, like a repo URL as the site URL.
type string[]
BlogInitState import type {BlogInitState} from '@fuzdev/fuz_blog/blog_init.js'; The project's state as plan_blog_init needs it, read by load_blog_init_state. Paths are relative to the project root.
package_jsontype BlogInitPackageJson
routes_pathSvelteKit's files.routes, which fuz_blog requires to be src/routes.
type string
routes_dir_existstype boolean
existing_pathsThe paths from to_blog_init_paths that exist.
type ReadonlySet<string>
blogsThe existing src/routes/blogs.ts registry's blogs, validated, or null when missing.
type BlogConfig[] | null
params_pathThe existing param matchers module, or the one to create, e.g. src/params.ts.
type string
params_contentThe param matchers module's content, null when missing.
type string | null
root_layout_contentThe root +layout.svelte's content, null when missing.
type string | null
(author: unknown): { name: string; url?: string | undefined; email?: string | undefined; } | null import {parse_blog_init_author} from '@fuzdev/fuz_blog/blog_init.js'; Parses an npm author, a Name <email> (url) string or a {name, email, url}
object, into feed author metadata. Returns null for a missing or nameless author.
authorunknown{ name: string; url?: string | undefined; email?: string | undefined; } | null
(options: BlogInitOptions, state: BlogInitState): BlogInitPlan import {plan_blog_init} from '@fuzdev/fuz_blog/blog_init.js'; Plans init.task.ts: resolves the new blog's config from options and
package.json, validates it with validate_blog_configs, and lists an action
for each file - creating only missing files and suggesting edits to existing
ones, so running it again changes nothing. Generated files import from
@fuzdev/fuz_blog and are unformatted.
optionsstateBlogInitPlan Error - when run in fuz_blog itself, without a `src/routes` directory,
without a site URL or author, or when the resolved config is invalid(dirname: string): BlogInitPaths import {to_blog_init_paths} from '@fuzdev/fuz_blog/blog_init.js'; The project files plan_blog_init creates when missing, by role.
dirnamestringBlogInitPaths