@dogsbay/format-astro 0.2.0-beta.3 → 0.2.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-path.d.ts +86 -0
- package/dist/base-path.d.ts.map +1 -1
- package/dist/base-path.js +117 -0
- package/dist/base-path.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/llms-txt.d.ts +13 -2
- package/dist/llms-txt.d.ts.map +1 -1
- package/dist/llms-txt.js +79 -12
- package/dist/llms-txt.js.map +1 -1
- package/dist/project.d.ts +103 -5
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +748 -96
- package/dist/project.js.map +1 -1
- package/dist/serialize.d.ts +22 -0
- package/dist/serialize.d.ts.map +1 -1
- package/dist/serialize.js +146 -17
- package/dist/serialize.js.map +1 -1
- package/dist/sitemap.d.ts +57 -0
- package/dist/sitemap.d.ts.map +1 -0
- package/dist/sitemap.js +126 -0
- package/dist/sitemap.js.map +1 -0
- package/dist/taxonomy.d.ts +37 -0
- package/dist/taxonomy.d.ts.map +1 -1
- package/dist/taxonomy.js +60 -19
- package/dist/taxonomy.js.map +1 -1
- package/package.json +4 -4
package/dist/project.d.ts
CHANGED
|
@@ -11,6 +11,20 @@ export interface AstroProjectOptions {
|
|
|
11
11
|
* so the `seo/h1-brand-keyword` audit rule can read them.
|
|
12
12
|
*/
|
|
13
13
|
brandKeywords?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Site-wide noindex. When true, every emitted page passes
|
|
16
|
+
* `noindex={true}` to DocsLayout regardless of frontmatter, and
|
|
17
|
+
* the sitemap emits zero `<url>` entries. Pages can ESCALATE
|
|
18
|
+
* (frontmatter `noindex: true` still works) but not opt out.
|
|
19
|
+
* See plans/site-level-robots-meta.md.
|
|
20
|
+
*/
|
|
21
|
+
noindex?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Site-wide nofollow. Same one-way semantics as `noindex` — site
|
|
24
|
+
* forces, page frontmatter `nofollow: true` can escalate but
|
|
25
|
+
* cannot opt out. Independent of `noindex`.
|
|
26
|
+
*/
|
|
27
|
+
nofollow?: boolean;
|
|
14
28
|
/** Source project directory (for copying extra_css, assets, etc.) */
|
|
15
29
|
sourceDir?: string;
|
|
16
30
|
/** Custom CSS files from mkdocs.yml extra_css */
|
|
@@ -112,12 +126,45 @@ export interface AstroProjectOptions {
|
|
|
112
126
|
*/
|
|
113
127
|
defaultLocale?: string;
|
|
114
128
|
/**
|
|
115
|
-
* When set, emit
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
129
|
+
* When set, emit deploy artifacts for the named platform.
|
|
130
|
+
*
|
|
131
|
+
* - `"cloudflare-workers"` — `wrangler.jsonc` + `wrangler` devDep +
|
|
132
|
+
* `deploy` script.
|
|
133
|
+
* - `"github-pages"` — `.github/workflows/deploy.yml` (Astro →
|
|
134
|
+
* `actions/deploy-pages` workflow) + `public/.nojekyll`.
|
|
135
|
+
*
|
|
136
|
+
* Both targets scaffold their files write-if-missing — re-running
|
|
137
|
+
* the build never clobbers an author-edited workflow YAML or
|
|
138
|
+
* wrangler config.
|
|
139
|
+
*/
|
|
140
|
+
deploy?: "cloudflare-workers" | "github-pages";
|
|
141
|
+
/**
|
|
142
|
+
* Astro `build.inlineStylesheets` policy.
|
|
143
|
+
*
|
|
144
|
+
* - `"auto"` (default): inline only stylesheets below 4 KB,
|
|
145
|
+
* externalize the rest. Best for multi-page sites.
|
|
146
|
+
* - `"always"`: inline every stylesheet. Best for single-page
|
|
147
|
+
* sites where first-paint latency dominates.
|
|
148
|
+
* - `"never"`: always externalize. Maximizes cache reuse.
|
|
149
|
+
*
|
|
150
|
+
* Mirrors `dogsbay.config.yml`'s `build.inlineStylesheets`. Flows
|
|
151
|
+
* through `astro.config.dogsbay.mjs` so changes propagate without
|
|
152
|
+
* a scaffold rebuild. See docs/perf-tuning.md.
|
|
153
|
+
*/
|
|
154
|
+
inlineStylesheets?: "auto" | "always" | "never";
|
|
155
|
+
/**
|
|
156
|
+
* Repo root — the directory containing `dogsbay.config.yml`. The
|
|
157
|
+
* Astro project (`outputDir`) is typically a subdirectory like
|
|
158
|
+
* `<projectDir>/astro/`. Deploy artifacts that GitHub Actions
|
|
159
|
+
* needs at the repo root (`.github/workflows/deploy.yml`) are
|
|
160
|
+
* written here, while artifacts that ship inside the Astro build
|
|
161
|
+
* (e.g. `public/.nojekyll`) stay under `outputDir`.
|
|
162
|
+
*
|
|
163
|
+
* When unset, defaults to `outputDir` — covers flat-layout flows
|
|
164
|
+
* (`dogsbay convert --to astro`) where the Astro project IS the
|
|
165
|
+
* repo. site-init and site-build always pass it explicitly.
|
|
119
166
|
*/
|
|
120
|
-
|
|
167
|
+
projectDir?: string;
|
|
121
168
|
/**
|
|
122
169
|
* Overwrite all files including maintainer-customizable scaffold
|
|
123
170
|
* files (theme.css, astro.config.mjs, package.json, site.json,
|
|
@@ -214,7 +261,36 @@ export declare function emitSiteScaffold(outputDir: string, siteName: string, op
|
|
|
214
261
|
export declare function emitAstroPages(pages: ExportPage[], nav: NavItem[], outputDir: string, options: AstroProjectOptions): Promise<{
|
|
215
262
|
generated: number;
|
|
216
263
|
outputNav: NavItem[];
|
|
264
|
+
/**
|
|
265
|
+
* Output paths (relative to outputDir, OS-native separators) of the
|
|
266
|
+
* `.astro` files just written. Used by passthrough emit to detect
|
|
267
|
+
* collisions with hand-authored `.astro` files declared in nav.yml
|
|
268
|
+
* — see plans/passthrough-astro-pages.md.
|
|
269
|
+
*/
|
|
270
|
+
generatedPaths: Set<string>;
|
|
217
271
|
}>;
|
|
272
|
+
/** Passthrough source → destination pair, computed by the CLI's collector. */
|
|
273
|
+
export interface PassthroughCopy {
|
|
274
|
+
/** Absolute path to the source file (under contentDir). */
|
|
275
|
+
sourceAbs: string;
|
|
276
|
+
/**
|
|
277
|
+
* Output path relative to outputDir, OS-native separators. Same
|
|
278
|
+
* shape as `emitAstroPages` `generatedPaths` so the collision
|
|
279
|
+
* check can use a plain `Set.has`.
|
|
280
|
+
*/
|
|
281
|
+
outputRelPath: string;
|
|
282
|
+
/** Source path relative to contentDir, for error messages. */
|
|
283
|
+
source: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Copy each passthrough `.astro` source to its computed output path.
|
|
287
|
+
* Aborts with a clear error if the destination is already in
|
|
288
|
+
* `generatedPaths` (a generated page from `emitAstroPages` would
|
|
289
|
+
* silently overwrite the hand-authored file otherwise).
|
|
290
|
+
*/
|
|
291
|
+
export declare function emitPassthroughAstroPages(copies: PassthroughCopy[], outputDir: string, generatedPaths: Set<string>): {
|
|
292
|
+
copied: number;
|
|
293
|
+
};
|
|
218
294
|
/**
|
|
219
295
|
* Emit `public/robots.txt` with `Content-Signal` directives + sitemap
|
|
220
296
|
* link. Always overwrites — the file's contents are pure derivation
|
|
@@ -222,6 +298,28 @@ export declare function emitAstroPages(pages: ExportPage[], nav: NavItem[], outp
|
|
|
222
298
|
* them at the CDN level.
|
|
223
299
|
*/
|
|
224
300
|
export declare function emitConfigDerivedFiles(outputDir: string, options: AstroProjectOptions): void;
|
|
301
|
+
/**
|
|
302
|
+
* Per-deploy-target artifact emission.
|
|
303
|
+
*
|
|
304
|
+
* Called from `emitSiteScaffold` (with `forceOverwrite=writeScaffold`
|
|
305
|
+
* so `--force` regenerates from template) and from `dogsbay site
|
|
306
|
+
* build` (with `forceOverwrite=false` so an existing site can adopt
|
|
307
|
+
* a deploy target by editing config and rebuilding — the missing
|
|
308
|
+
* artifact gets created on the next build).
|
|
309
|
+
*
|
|
310
|
+
* Emit policy is the union: write when forced OR when the file is
|
|
311
|
+
* missing. Author edits to e.g. the workflow YAML survive every
|
|
312
|
+
* regular build.
|
|
313
|
+
*
|
|
314
|
+
* Currently handles `github-pages` (workflow + .nojekyll). The
|
|
315
|
+
* existing `cloudflare-workers` artifacts (wrangler.jsonc + package
|
|
316
|
+
* scripts) stay in the scaffold-only path because they overlap with
|
|
317
|
+
* scaffold-only files (package.json scripts, devDependencies). A
|
|
318
|
+
* future refactor could fold them in here too.
|
|
319
|
+
*/
|
|
320
|
+
export declare function emitDeployArtifacts(outputDir: string, options: AstroProjectOptions, opts?: {
|
|
321
|
+
forceOverwrite: boolean;
|
|
322
|
+
}): void;
|
|
225
323
|
/**
|
|
226
324
|
* Shape of the emitted `src/data/switcherMap.json` file.
|
|
227
325
|
* Switcher components import this JSON directly, so the shape
|
package/dist/project.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAwB,MAAM,gBAAgB,CAAC;AA6ahF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,8GAA8G;IAC9G,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,gFAAgF;IAChF,OAA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