@purview-dev/astroc4 1.0.0-prerelease.5 → 1.0.0-prerelease.6

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.
@@ -1,37 +1,27 @@
1
1
  import type { AstroIntegration } from 'astro';
2
2
  import { LikeC4VitePlugin } from 'likec4/vite-plugin';
3
- /**
4
- * The published package name. Scoped because npm refuses the unscoped
5
- * `astroc4` — "too similar to existing package astro" — and because the scope
6
- * makes the specifiers this plugin writes into a site's pages unambiguous.
7
- */
3
+ /** Scoped because npm refuses the unscoped `astroc4` as too similar to `astro`. */
8
4
  export declare const PACKAGE_NAME = "@purview-dev/astroc4";
9
5
  export interface LikeC4IntegrationOptions {
10
6
  /**
11
- * Passed through to `LikeC4VitePlugin` — e.g. `{ workspace: 'diagrams' }` to
12
- * look for .c4 files somewhere other than the site root.
7
+ * Passed through to `LikeC4VitePlugin`. Setting `workspace` or
8
+ * `languageServices` takes project discovery over, and `projects` is ignored.
13
9
  */
14
10
  vitePlugin?: Parameters<typeof LikeC4VitePlugin>[0];
15
- /** Render ```likec4 fences in .mdx pages as diagrams. Defaults to `true`. */
11
+ /**
12
+ * Named LikeC4 projects, compiled alongside those discovered under the site
13
+ * root: `{ architecture: '../../docs/architecture/likec4' }`. Folders are
14
+ * relative to the site root or absolute.
15
+ */
16
+ projects?: Record<string, string>;
17
+ /** Render ```likec4 fences in .md and .mdx pages as diagrams. Defaults to `true`. */
16
18
  fences?: boolean;
17
19
  }
18
20
  /**
19
- * The `optimizeDeps.include` entries a site still needs for the island to
20
- * hydrate.
21
- *
22
- * Only the missing ones are returned: Astro merges the `vite` option with
23
- * Vite's `mergeConfig`, which concatenates arrays, so re-sending a site's own
24
- * entries would duplicate them. An entry that does not resolve is left out —
25
- * a site without React cannot render the island anyway, and naming a package
26
- * Vite cannot find breaks the optimizer with a less useful error.
27
- *
28
- * @param include The site's existing `vite.optimizeDeps.include`.
29
- * @param root The site root, where the dependency has to resolve from.
21
+ * The `optimizeDeps.include` entries the site still lacks. Only missing ones:
22
+ * Vite's `mergeConfig` concatenates arrays. Unresolvable ones are skipped, since
23
+ * naming a package Vite cannot find breaks the optimizer.
30
24
  */
31
25
  export declare function missingOptimizedDependencies(include: unknown, root: string): string[];
32
- /**
33
- * The integration both entry points install: LikeC4's Vite plugin, the fence
34
- * transform, and the dev-only bits that keep the islands hydrating.
35
- */
36
- export declare function likec4Integration({ vitePlugin, fences, }?: LikeC4IntegrationOptions): AstroIntegration;
26
+ export declare function likec4Integration({ vitePlugin, projects, fences, }?: LikeC4IntegrationOptions): AstroIntegration;
37
27
  export default likec4Integration;