@eqtylab/docs 0.3.0 → 0.3.1
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/LICENSE +190 -0
- package/README.md +52 -10
- package/dist/config.js +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/runtime/chrome/GlobalSearch.module.css +0 -26
- package/dist/runtime/chrome/GlobalSearch.tsx +0 -422
- package/dist/runtime/chrome/Header.astro +0 -105
- package/dist/runtime/chrome/LinkIcon.astro +0 -35
- package/dist/runtime/chrome/NavDrawer.astro +0 -60
- package/dist/runtime/chrome/NavTree.astro +0 -112
- package/dist/runtime/chrome/NotFoundBody.tsx +0 -12
- package/dist/runtime/chrome/PageFooter.astro +0 -80
- package/dist/runtime/chrome/Prose.astro +0 -169
- package/dist/runtime/chrome/Sidebar.astro +0 -21
- package/dist/runtime/chrome/TableOfContents.astro +0 -86
- package/dist/runtime/chrome/ThemeToggle.tsx +0 -85
- package/dist/runtime/chrome/TocElbow.astro +0 -30
- package/dist/runtime/chrome/TocList.astro +0 -43
- package/dist/runtime/components/AlertBridge.astro +0 -16
- package/dist/runtime/components/CodeFence.astro +0 -38
- package/dist/runtime/components/CodeFenceBridge.astro +0 -20
- package/dist/runtime/components/Link.astro +0 -21
- package/dist/runtime/components/TableBridge.astro +0 -18
- package/dist/runtime/components/index.ts +0 -2
- package/dist/runtime/layouts/DocsPage.astro +0 -50
- package/dist/runtime/layouts/DocsShell.astro +0 -92
- package/dist/runtime/lib/mdx-components.ts +0 -43
- package/dist/runtime/lib/nav-data.ts +0 -74
- package/dist/runtime/lib/summary.ts +0 -57
- package/dist/runtime/lib/theme.ts +0 -84
- package/dist/runtime/routes/docs-md.ts +0 -33
- package/dist/runtime/routes/docs.astro +0 -92
- package/dist/runtime/routes/llms-txt.ts +0 -38
- package/dist/runtime/routes/not-found.astro +0 -16
- package/dist/runtime/scripts/eq-copy.ts +0 -27
- package/dist/runtime/scripts/eq-highlight.ts +0 -24
- package/dist/runtime/scripts/eq-nav-drawer.ts +0 -31
- package/dist/runtime/scripts/eq-nav-group.ts +0 -52
- package/dist/runtime/scripts/eq-toc.ts +0 -166
- package/dist/runtime/styles/chrome.css +0 -30
- package/dist/runtime/styles/prose.css +0 -102
- package/dist/runtime/styles/theme.css +0 -2
- package/dist/runtime/styles/utilities.css +0 -38
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright
|
|
52
|
+
owner or by an individual or Legal Entity authorized to submit on behalf
|
|
53
|
+
of the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 EQTY Lab
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -56,13 +56,24 @@ collapsed: false
|
|
|
56
56
|
- A typo in `order` produces a build **warning naming the file and the token** rather than silently
|
|
57
57
|
reordering, and the schema is `.strict()` so an unknown key fails the build.
|
|
58
58
|
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
## Three conventions worth knowing
|
|
60
|
+
|
|
61
|
+
**Styling is inline Tailwind, and one `@source` line is what makes it work.** The chrome is styled
|
|
62
|
+
with utility classes written in the markup. That only compiles because `runtime/styles/docs.css`
|
|
63
|
+
names this package's own files in an explicit `@source`: Tailwind v4's automatic source detection
|
|
64
|
+
skips `node_modules`, which is exactly where this markup sits in a consumer's build. Drop that line
|
|
65
|
+
and every utility here produces nothing, with no error anywhere. `pnpm run check:source` enforces
|
|
66
|
+
that the glob still covers all shipped markup, and runs as part of `build`. Recipes used by more
|
|
67
|
+
than one component are `@utility` definitions in `runtime/styles/utilities.css`; a co-located
|
|
68
|
+
`*.module.css` is the escape hatch for rules that cannot live on an element, which today means
|
|
69
|
+
only `GlobalSearch.module.css`.
|
|
70
|
+
|
|
71
|
+
**Overruling an Equality component takes `!`.** `packages/ui` ships unlayered CSS, Tailwind
|
|
72
|
+
utilities live in `@layer utilities`, and an unlayered declaration beats a layered one whatever its
|
|
73
|
+
specificity. So where this markup has to overrule a value an Equality class already sets on the
|
|
74
|
+
same element — `CodeBlock`'s `max-height`, `CommandList`'s — the utility carries `!`. Properties
|
|
75
|
+
Equality leaves alone need nothing. Getting this wrong fails silently: the class is in the HTML and
|
|
76
|
+
the rule is in the bundle, it just loses.
|
|
66
77
|
|
|
67
78
|
**Route-level MDX components override page-level ones.** `@astrojs/mdx` builds the map as
|
|
68
79
|
`{ Fragment, ...fileComponents, ...props.components }`, so the route's `<Content components={…} />`
|
|
@@ -96,6 +107,7 @@ product surfaces cannot drift:
|
|
|
96
107
|
| Code fences | `CodeBlock` |
|
|
97
108
|
| Markdown tables | `TableContainer` / `TableHeader` / `TableBody` / `TableRow` / `TableHead` / `TableCell` |
|
|
98
109
|
| `<Alert>` | `Alert`, as an `aside` |
|
|
110
|
+
| `<Tabs>` | `Tabs`, server-rendered |
|
|
99
111
|
| Links | base-aware `a` override |
|
|
100
112
|
|
|
101
113
|
**Authors write Equality's own components, with no imports.** The route-level component map
|
|
@@ -123,15 +135,45 @@ whose parts all use `subgrid`, so it needs an explicit track list or the table c
|
|
|
123
135
|
to one column. Markdown has no syntax for that, so `rehypeTableColumns` derives the count
|
|
124
136
|
from the first row at build time.
|
|
125
137
|
|
|
138
|
+
Tabs are authored the same way, with no imports:
|
|
139
|
+
|
|
140
|
+
```mdx
|
|
141
|
+
<Tabs syncKey="platform">
|
|
142
|
+
<TabItem label="Linux">Anything, including fences and tables.</TabItem>
|
|
143
|
+
<TabItem label="macOS">
|
|
144
|
+
Sets sharing a `syncKey` switch together, and the choice is remembered.
|
|
145
|
+
</TabItem>
|
|
146
|
+
</Tabs>
|
|
147
|
+
```
|
|
148
|
+
|
|
126
149
|
This is also why content is MDX-only — these overrides are the mechanism, and Astro's
|
|
127
150
|
plain-Markdown pipeline has no component substitution at all.
|
|
128
151
|
|
|
129
|
-
##
|
|
152
|
+
## Bringing your own CSS and scripts
|
|
153
|
+
|
|
154
|
+
`customCss` and `clientScripts` attach a consumer's own assets to every docs page:
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
docs({
|
|
158
|
+
title: 'My Docs',
|
|
159
|
+
customCss: ['./src/styles/site.css'],
|
|
160
|
+
clientScripts: ['./src/scripts/glossary.ts'],
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Both resolve project-relative paths against the project root, so they mean the same thing in
|
|
165
|
+
dev and in a build. `clientScripts` entries are **bundled** rather than served as-is, which is
|
|
166
|
+
what a script that rewrites rendered text needs: it has to import `scheduleHighlight` from
|
|
167
|
+
`@eqtylab/equality` and call it afterwards, or the code blocks it touched lose their
|
|
168
|
+
highlighting. (`CodeBlock` paints through the CSS Custom Highlight API over `Range`s into those
|
|
169
|
+
very text nodes.) A plain `<script src>` in `public/` cannot import anything.
|
|
170
|
+
|
|
171
|
+
## Building the Search Index
|
|
130
172
|
|
|
131
|
-
|
|
173
|
+
Full-text search uses the built HTML, via [Pagefind](https://pagefind.app). The integration
|
|
132
174
|
runs it in `astro:build:done` and writes the index to `dist/pagefind/`.
|
|
133
175
|
|
|
134
|
-
|
|
176
|
+
RUn `pnpm run build` to make search work in `pnpm run dev`. Dev serves `dist/pagefind/` off disk,
|
|
135
177
|
so results describe the last build; rebuild while dev runs and the next search picks it up. Until
|
|
136
178
|
that first build the palette says search needs one.
|
|
137
179
|
|
package/dist/config.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './chunk-55J6XMHW.js';
|
|
2
2
|
import { rehypeBaseUrl } from './chunk-GSSSQTEV.js';
|
|
3
|
-
import { resolveConfig } from './chunk-
|
|
4
|
-
export { resolveConfig } from './chunk-
|
|
3
|
+
import { resolveConfig } from './chunk-K7PJRTK3.js';
|
|
4
|
+
export { resolveConfig } from './chunk-K7PJRTK3.js';
|
|
5
5
|
import { resolveDocsEnv } from './chunk-ZZ45WAVR.js';
|
|
6
6
|
export { resolveDocsEnv } from './chunk-ZZ45WAVR.js';
|
|
7
7
|
export { badgeSchema, docsSchema, groupSchema } from './chunk-IWKZQ4CW.js';
|
|
8
|
-
import path3 from 'path';
|
|
9
8
|
import { fileURLToPath } from 'url';
|
|
9
|
+
import path3 from 'path';
|
|
10
10
|
import { globSync } from 'tinyglobby';
|
|
11
11
|
import fs, { readdirSync, readFileSync } from 'fs';
|
|
12
12
|
import { createRequire } from 'module';
|
|
@@ -176,10 +176,14 @@ function isComponent(node) {
|
|
|
176
176
|
const name = node.name;
|
|
177
177
|
return typeof name === "string" && (/^[A-Z]/.test(name) || name.includes("."));
|
|
178
178
|
}
|
|
179
|
+
var CONTAINERS = /* @__PURE__ */ new Set(["Tabs", "TabItem"]);
|
|
180
|
+
function isContainer(node) {
|
|
181
|
+
return typeof node.name === "string" && CONTAINERS.has(node.name);
|
|
182
|
+
}
|
|
179
183
|
function rehypeProseScope() {
|
|
180
184
|
return function transformer(tree) {
|
|
181
185
|
visit(tree, (node) => {
|
|
182
|
-
if (isComponent(node)) return SKIP;
|
|
186
|
+
if (isComponent(node)) return isContainer(node) ? void 0 : SKIP;
|
|
183
187
|
if (node.type === "element") {
|
|
184
188
|
node.properties = { ...node.properties, dataEqMd: "" };
|
|
185
189
|
return void 0;
|
|
@@ -309,7 +313,7 @@ function docs(options = {}) {
|
|
|
309
313
|
name: "@eqtylab/docs",
|
|
310
314
|
hooks: {
|
|
311
315
|
async "astro:config:setup"(params) {
|
|
312
|
-
const { config, injectRoute, updateConfig, addWatchFile, logger, command } = params;
|
|
316
|
+
const { config, injectRoute, injectScript, updateConfig, addWatchFile, logger, command } = params;
|
|
313
317
|
assertMdxOnly(new URL(`./${cfg.contentDir}/`, config.srcDir));
|
|
314
318
|
const consumer = scanConsumerPages(config.srcDir);
|
|
315
319
|
for (const route of plannedRoutes(cfg)) {
|
|
@@ -376,6 +380,13 @@ function docs(options = {}) {
|
|
|
376
380
|
rehypeTableColumns,
|
|
377
381
|
...cfg.code.highlighter === "codeblock" ? [rehypeCodeFence] : []
|
|
378
382
|
];
|
|
383
|
+
const resolveAsset = (spec) => spec.startsWith(".") ? fileURLToPath(new URL(spec, config.root)) : spec;
|
|
384
|
+
for (const href of cfg.customCss) {
|
|
385
|
+
injectScript("page-ssr", `import ${JSON.stringify(resolveAsset(href))};`);
|
|
386
|
+
}
|
|
387
|
+
for (const src of cfg.clientScripts) {
|
|
388
|
+
injectScript("page", `import ${JSON.stringify(resolveAsset(src))};`);
|
|
389
|
+
}
|
|
379
390
|
updateConfig({
|
|
380
391
|
integrations: added,
|
|
381
392
|
vite: { plugins: vitePlugins },
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/assert-mdx-only.ts","../src/internal/microlighter-grammars.ts","../src/internal/pagefind.ts","../src/internal/rehype-code-fence.ts","../src/internal/rehype-prose-scope.ts","../src/internal/rehype-table-columns.ts","../src/internal/scan-consumer-pages.ts","../src/internal/virtual-config.ts","../src/index.ts"],"names":["path","fileURLToPath","visit","globSync"],"mappings":";;;;;;;;;;;;;;AAQO,SAAS,cAAc,UAAA,EAAuB;AACnD,EAAA,MAAM,GAAA,GAAM,cAAc,UAAU,CAAA;AAEpC,EAAA,IAAI,SAAmB,EAAC;AACxB,EAAA,IAAI;AACF,IAAA,MAAA,GAAS,QAAA,CAAS,CAAC,SAAS,CAAA,EAAG,EAAE,GAAA,EAAK,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,CAAA;AAAA,EAC9D,CAAA,CAAA,MAAQ;AACN,IAAA;AAAA,EACF;AACA,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG;AAEzB,EAAA,MAAM,OAAO,MAAA,CACV,IAAA,GACA,GAAA,CAAI,CAAC,SAAS,CAAA,IAAA,EAAO,IAAI,CAAA,MAAA,EAAS,IAAA,CAAK,QAAQ,QAAA,EAAU,MAAM,CAAC,CAAA,CAAE,CAAA,CAClE,KAAK,IAAI,CAAA;AAEZ,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,yBAAyB,MAAA,CAAO,MAAM,CAAA,cAAA,EAAiB,MAAA,CAAO,SAAS,CAAA,GAAI,GAAA,GAAM,EAAE,CAAA,IAAA,EAC9EA,MAAK,QAAA,CAAS,OAAA,CAAQ,KA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A,UACd,IAAA,EAAM,EAAE,OAAA,EAAS,WAAA,EAAqB;AAAA,UACtC;AAAA,SACQ,CAAA;AAAA,MACZ,CAAA;AAAA,MAEA,mBAAA,CAAoB,EAAE,WAAA,EAAY,EAAG;AACnC,QAAA,WAAA,CAAY;AAAA,UACV,QAAA,EAAU,YAAA;AAAA,UACV,OAAA,EAAS;AAAA,YACP,CAAA,2CAAA,CAAA;AAAA,YACA,CAAA,sDAAA,CAAA;AAAA,YACA,CAAA,yCAAA,CAAA;AAAA,YACA,CAAA,8BAAA,CAAA;AAAA,YACA,CAAA,IAAA,CAAA;AAAA,YACA,CAAA,wBAAA,CAAA;AAAA,YACA,CAAA,CAAA,CAAA;AAAA,YACA;AAAA,WACF,CAAE,KAAK,IAAI;AAAA,SACZ,CAAA;AAAA,MACH,CAAA;AAAA,MAEA,uBAAA,CAAwB,EAAE,MAAA,EAAQ,MAAA,EAAO,EAAG;AAE1C,QAAA,MAAM,IAAA,uBAAW,GAAA,EAAoB;AACrC,QAAA,KAAA,MAAW,SAAS,MAAA,EAA0D;AAC5E,UAAA,MAAM,QAAA,GAAW,IAAA,CAAK,GAAA,CAAI,KAAA,CAAM,OAAO,CAAA;AACvC,UAAA,IAAI,QAAA,IAAY,QAAA,KAAa,KAAA,CAAM,UAAA,EAAY;AAC7C,YAAA,MAAA,CAAO,IAAA;AAAA,cACL,CAAA,MAAA,EAAS,MAAM,OAAO,CAAA;AAAA,EAAA,EAAyB,QAAQ;AAAA,EAAA,EAAO,MAAM,UAAU;AAAA,oDAAA;AAAA,aAEhF;AAAA,UACF;AACA,UAAA,IAAA,CAAK,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C;AAAA,MACF;AAAA;AACF,GACF;AACF","file":"index.js","sourcesContent":["/**\n * Only MDX supports the component overrides and the loader globs `.mdx` only,\n * so a stray `.md` would be silently absent from the site. Fail loudly instead.\n */\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { globSync } from 'tinyglobby';\n\nexport function assertMdxOnly(contentDir: URL): void {\n const dir = fileURLToPath(contentDir);\n\n let strays: string[] = [];\n try {\n strays = globSync(['**/*.md'], { cwd: dir, absolute: false });\n } catch {\n return;\n }\n if (strays.length === 0) return;\n\n const list = strays\n .sort()\n .map((file) => ` - ${file} -> ${file.replace(/\\.md$/i, '.mdx')}`)\n .join('\\n');\n\n throw new Error(\n `[@eqtylab/docs] Found ${strays.length} Markdown file${strays.length > 1 ? 's' : ''} in ` +\n `${path.relative(process.cwd(), dir) || dir}:\\n${list}\\n\\n` +\n `Docs content must be .mdx. Only MDX supports the component overrides that render\\n` +\n `tables, code fences and callouts through Equality, so a .md page would look\\n` +\n `different from every other page. Renaming is usually the only change needed --\\n` +\n `MDX is a superset of Markdown.`\n );\n}\n","/**\n * Emits microlighter's grammar modules beside the chunks that ask for them.\n * CodeBlock loads grammars with `import('./grammars/' + language)`, which no\n * bundler can expand; without this the build succeeds and code renders unhighlighted.\n */\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport type { AstroIntegrationLogger } from 'astro';\nimport type { Plugin } from 'vite';\n\n/** Residue of the dynamic import in the emitted chunk. */\nconst GRAMMAR_IMPORT = 'grammars/${';\n\n/** Two hops from the consumer: microlighter is a dependency of @eqtylab/equality, which is only a peer here. */\nfunction findGrammarDir(projectRoot: URL): string {\n const requireFromProject = createRequire(new URL('package.json', projectRoot));\n const equalityEntry = requireFromProject.resolve('@eqtylab/equality');\n const requireFromEquality = createRequire(equalityEntry);\n return path.resolve(path.dirname(requireFromEquality.resolve('microlighter')), 'grammars');\n}\n\nexport function microlighterGrammarsPlugin(\n projectRoot: URL,\n logger: AstroIntegrationLogger\n): Plugin {\n return {\n name: 'eqty-docs:microlighter-grammars',\n apply: 'build',\n generateBundle(_options, bundle) {\n const directories = new Set(\n Object.values(bundle)\n .filter((output) => output.type === 'chunk' && output.code.includes(GRAMMAR_IMPORT))\n .map((output) => path.posix.dirname(output.fileName))\n );\n if (directories.size === 0) return;\n\n let grammarDir: string;\n let grammars: string[];\n try {\n grammarDir = findGrammarDir(projectRoot);\n grammars = readdirSync(grammarDir).filter((file) => file.endsWith('.js'));\n } catch (error) {\n // Warn rather than fail the build over highlighting.\n logger.warn(\n 'Code blocks ask for microlighter grammars, but they could not be resolved. ' +\n 'Fenced code will render unhighlighted. Check that @eqtylab/equality is ' +\n `installed in this project.\\n ${String(error)}`\n );\n return;\n }\n\n for (const directory of directories) {\n for (const grammar of grammars) {\n this.emitFile({\n type: 'asset',\n fileName:\n directory === '.' ? `grammars/${grammar}` : `${directory}/grammars/${grammar}`,\n source: readFileSync(path.resolve(grammarDir, grammar), 'utf8'),\n });\n }\n }\n },\n };\n}\n","/**\n * Not `astro-pagefind`: it ships TypeScript, and Node will not compile that under\n * node_modules when this integration reaches it from its own bundle.\n *\n * The build writes the index; dev serves that same index off disk, so it always\n * describes the last build.\n */\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { AstroIntegration } from 'astro';\n\nconst INDEX_DIR = 'pagefind';\n\n/** Everything else Pagefind fetches is read as bytes, so the type never reaches a parser. */\nconst MIME: Record<string, string> = {\n '.js': 'text/javascript',\n '.css': 'text/css',\n '.json': 'application/json',\n '.wasm': 'application/wasm',\n};\n\n/** Pagefind collects errors per step and carries on; any of them means no usable index. */\nfunction failOn(\n errors: string[],\n logger: { error: (message: string) => void },\n what: string\n): void {\n if (!errors.length) return;\n errors.forEach((error) => logger.error(error));\n throw new Error(`[@eqtylab/docs] Pagefind could not ${what}.`);\n}\n\nfunction indexRequest(url: string | undefined, base: string): string | null {\n if (!url) return null;\n const pathname = decodeURIComponent(url.split(/[?#]/)[0]);\n const prefix = `${base.replace(/\\/+$/, '')}/${INDEX_DIR}/`;\n return pathname.startsWith(prefix) ? pathname.slice(prefix.length) : null;\n}\n\nexport function pagefindIntegration(): AstroIntegration {\n let indexDir = '';\n\n return {\n name: '@eqtylab/docs/pagefind',\n hooks: {\n 'astro:config:setup'({ config, logger }) {\n indexDir = path.join(fileURLToPath(config.outDir), INDEX_DIR);\n\n if (config.output === 'server') {\n logger.warn(\n 'Output \"server\" emits no static HTML, so there is nothing for Pagefind to index.'\n );\n }\n },\n\n /** Runs ahead of Vite's static middleware and Astro's handler; move it and `/pagefind/*` 404s. */\n 'astro:server:setup'({ server, logger }) {\n const base = server.config.base ?? '/';\n\n logger.info(\n fs.existsSync(indexDir)\n ? 'serving the search index from the last build; rebuild to pick up edits'\n : 'no search index yet — run `astro build` once to search in dev'\n );\n\n server.middlewares.use((req, res, next) => {\n const requested = indexRequest(req.url, base);\n if (requested === null) return next();\n\n const file = path.join(indexDir, requested);\n // The prefix check is what stops `..` climbing out of the index directory.\n if (!file.startsWith(indexDir + path.sep) || !fs.existsSync(file)) return next();\n\n res.setHeader('Content-Type', MIME[path.extname(file)] ?? 'application/octet-stream');\n // The next build rewrites these in place, and a cached fragment would outlive it.\n res.setHeader('Cache-Control', 'no-store');\n fs.createReadStream(file).pipe(res);\n });\n },\n\n /** The last hook of the build, and the first moment every page exists on disk to read. */\n async 'astro:build:done'({ dir, logger }) {\n const outDir = fileURLToPath(dir);\n const { createIndex } = await import('pagefind');\n\n const { index, errors } = await createIndex();\n failOn(errors, logger, 'create an index');\n if (!index) throw new Error('[@eqtylab/docs] Pagefind returned no index.');\n\n const { page_count, errors: addErrors } = await index.addDirectory({ path: outDir });\n failOn(addErrors, logger, 'index the built output');\n\n const { outputPath, errors: writeErrors } = await index.writeFiles({\n outputPath: path.join(outDir, INDEX_DIR),\n });\n failOn(writeErrors, logger, 'write the index');\n\n logger.info(`indexed ${page_count} pages to ${outputPath}`);\n },\n },\n };\n}\n","/**\n * Lifts each fence's source, language and title onto its `<pre>`. Do not recover\n * the source from the rendered slot: `Astro.slots.render()` escapes in dev but not in build.\n */\nimport { visit } from 'unist-util-visit';\n\ninterface Node {\n type: string;\n tagName?: string;\n value?: string;\n properties?: Record<string, unknown>;\n children?: Node[];\n data?: { meta?: string };\n}\n\nfunction textOf(node: Node): string {\n if (node.type === 'text') return node.value ?? '';\n return (node.children ?? []).map(textOf).join('');\n}\n\nfunction classNames(props: Record<string, unknown> | undefined): string[] {\n const raw = props?.className ?? props?.class;\n if (Array.isArray(raw)) return raw.map(String);\n if (typeof raw === 'string') return raw.split(/\\s+/);\n return [];\n}\n\n/** ```ts title=\"button.tsx\" -> \"button.tsx\" */\nfunction titleFromMeta(meta: string | undefined): string | undefined {\n const match = meta?.match(/(?:^|\\s)title=(?:\"([^\"]*)\"|'([^']*)'|(\\S+))/);\n return match ? (match[1] ?? match[2] ?? match[3]) : undefined;\n}\n\nexport function rehypeCodeFence() {\n return function transformer(tree: unknown) {\n visit(tree as never, 'element', (node: Node) => {\n if (node.tagName !== 'pre') return;\n\n const code = (node.children ?? []).find(\n (child) => child.type === 'element' && child.tagName === 'code'\n );\n if (!code) return;\n\n const language = classNames(code.properties)\n .find((name) => name.startsWith('language-'))\n ?.slice('language-'.length);\n\n const title = titleFromMeta(code.data?.meta);\n\n node.properties = {\n ...node.properties,\n dataCode: textOf(code).replace(/\\n$/, ''),\n ...(language ? { dataLanguage: language } : {}),\n ...(title ? { dataTitle: title } : {}),\n };\n });\n };\n}\n","/**\n * Marks the content a page authored as markdown or as plain HTML, so\n * `prose.css` can typeset it without reaching inside a component.\n *\n * MDX parses a component's children as markdown whenever they sit on their own\n * lines, so `<Badge icon=\"Shield\">\\n Primary\\n</Badge>` renders a `<p>` inside\n * the badge — and prettier puts them there. Authoring discipline cannot fix it;\n * the boundary has to be drawn here. Everything below a capitalised JSX tag is\n * that component's business, `<div>` and friends are the page's own.\n */\nimport { SKIP, visit } from 'unist-util-visit';\n\nconst MARKER = 'data-eq-md';\n\ninterface Attribute {\n type: string;\n name?: string | null;\n}\n\ninterface Node {\n type: string;\n name?: string | null;\n properties?: Record<string, unknown>;\n attributes?: Attribute[];\n}\n\n/** Capitalised or dotted JSX names are components; `div`, `span` and friends are not. */\nfunction isComponent(node: Node): boolean {\n if (node.type !== 'mdxJsxFlowElement' && node.type !== 'mdxJsxTextElement') return false;\n const name = node.name;\n return typeof name === 'string' && (/^[A-Z]/.test(name) || name.includes('.'));\n}\n\nexport function rehypeProseScope() {\n return function transformer(tree: unknown) {\n visit(tree as never, (node: Node) => {\n if (isComponent(node)) return SKIP;\n\n if (node.type === 'element') {\n node.properties = { ...node.properties, dataEqMd: '' };\n return undefined;\n }\n\n // Authored HTML. A JSX fragment has no name and nothing to mark.\n if ((node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') && node.name) {\n const attributes = node.attributes ?? [];\n if (!attributes.some((a) => a.type === 'mdxJsxAttribute' && a.name === MARKER)) {\n attributes.push({ type: 'mdxJsxAttribute', name: MARKER, value: '' } as Attribute);\n }\n node.attributes = attributes;\n }\n\n return undefined;\n });\n };\n}\n","/**\n * Annotates each markdown table with its column count. Equality's `TableContainer`\n * is a CSS grid and collapses to one column without an explicit track list.\n */\nimport { visit } from 'unist-util-visit';\n\ninterface ElementNode {\n type: string;\n tagName?: string;\n properties?: Record<string, unknown>;\n children?: ElementNode[];\n}\n\n/** First `tr` in document order, searching thead before tbody. */\nfunction firstRow(table: ElementNode): ElementNode | undefined {\n let found: ElementNode | undefined;\n visit(table as never, 'element', (node: ElementNode) => {\n if (found) return false;\n if (node.tagName === 'tr') {\n found = node;\n return false;\n }\n return undefined;\n });\n return found;\n}\n\nfunction countCells(row: ElementNode): number {\n return (row.children ?? []).reduce((total, child) => {\n if (child.type !== 'element') return total;\n if (child.tagName !== 'th' && child.tagName !== 'td') return total;\n const span = Number(child.properties?.colSpan ?? child.properties?.colspan ?? 1);\n return total + (Number.isFinite(span) && span > 0 ? span : 1);\n }, 0);\n}\n\nexport function rehypeTableColumns() {\n return function transformer(tree: unknown) {\n visit(tree as never, 'element', (node: ElementNode) => {\n if (node.tagName !== 'table') return;\n const row = firstRow(node);\n const count = row ? countCells(row) : 0;\n if (count <= 0) return;\n node.properties = { ...node.properties, dataColumnCount: String(count) };\n });\n };\n}\n","/**\n * Routes the consumer's own `src/pages` already claim. Astro does NOT de-duplicate\n * injected routes against file-based ones: a path claimed by both is emitted\n * twice and the winner is write order, so yielding has to be explicit here.\n */\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { globSync } from 'tinyglobby';\n\nconst PAGE_EXTENSIONS = ['astro', 'md', 'mdx', 'html', 'ts', 'js'];\n\nexport interface ConsumerPages {\n /** Concrete route paths the consumer's pages generate, normalised without trailing slash. */\n ownedPaths: string[];\n /** Route patterns claimed by consumer pages, e.g. '/[...slug]' or '/404'. */\n claimedPatterns: Set<string>;\n}\n\n/** `index.astro` -> '', `a/b.astro` -> '/a/b', `[...slug].astro` -> '/[...slug]' */\nfunction toRoutePath(relative: string): string {\n const withoutExt = relative.replace(/\\.[^./]+$/, '');\n const segments = withoutExt.split(path.sep).join('/').split('/').filter(Boolean);\n if (segments.at(-1) === 'index') segments.pop();\n return '/' + segments.join('/');\n}\n\nexport function scanConsumerPages(srcDir: URL): ConsumerPages {\n const pagesDir = fileURLToPath(new URL('./pages/', srcDir));\n\n let files: string[] = [];\n try {\n files = globSync([`**/*.{${PAGE_EXTENSIONS.join(',')}}`], {\n cwd: pagesDir,\n absolute: false,\n });\n } catch {\n // No src/pages: a docs-only site.\n return { ownedPaths: [], claimedPatterns: new Set() };\n }\n\n const ownedPaths: string[] = [];\n const claimedPatterns = new Set<string>();\n\n for (const file of files) {\n // Astro ignores files and directories prefixed with `_`.\n if (file.split(path.sep).some((segment) => segment.startsWith('_'))) continue;\n\n const routePath = toRoutePath(file);\n claimedPatterns.add(routePath === '' ? '/' : routePath);\n\n if (!/[[\\]]/.test(file)) {\n ownedPaths.push(routePath.replace(/\\/+$/, '') || '/');\n }\n }\n\n return { ownedPaths, claimedPatterns };\n}\n","/** Serves the resolved config to runtime components, which ship from node_modules and cannot reach the consumer's project by path. */\nimport type { Plugin } from 'vite';\n\nconst MODULE_ID = 'virtual:eqty-docs/config';\nconst RESOLVED_ID = '\\0' + MODULE_ID;\n\nexport function virtualConfigPlugin(getPayload: () => Record<string, unknown>): Plugin {\n return {\n name: 'eqty-docs:virtual-config',\n resolveId(id) {\n return id === MODULE_ID ? RESOLVED_ID : null;\n },\n load(id) {\n if (id !== RESOLVED_ID) return null;\n return `export default ${JSON.stringify(getPayload())};`;\n },\n };\n}\n","import type { AstroIntegration } from 'astro';\n\nimport { resolveConfig, type DocsConfig, type DocsUserConfig } from './config.ts';\nimport { resolveDocsEnv, type DocsEnv } from './env.ts';\nimport { assertMdxOnly } from './internal/assert-mdx-only.ts';\nimport { microlighterGrammarsPlugin } from './internal/microlighter-grammars.ts';\nimport { pagefindIntegration } from './internal/pagefind.ts';\nimport { rehypeBaseUrl } from './internal/rehype-base-url.ts';\nimport { rehypeCodeFence } from './internal/rehype-code-fence.ts';\nimport { rehypeProseScope } from './internal/rehype-prose-scope.ts';\nimport { rehypeTableColumns } from './internal/rehype-table-columns.ts';\nimport { scanConsumerPages } from './internal/scan-consumer-pages.ts';\nimport { virtualConfigPlugin } from './internal/virtual-config.ts';\n\nexport { resolveConfig, type DocsConfig, type DocsUserConfig } from './config.ts';\nexport { resolveDocsEnv, type DocsEnv } from './env.ts';\n// Do not re-export the loaders: this entry runs in Node when astro.config loads,\n// and they import `astro:content`, which only exists in the Vite graph.\nexport { docsSchema, groupSchema, badgeSchema } from './schema.ts';\nexport * from './types.ts';\n\nexport interface DocsIntegrationOptions extends DocsUserConfig {\n /** Build environment for versioned deploys. Defaults to `resolveDocsEnv()`. */\n env?: Partial<DocsEnv>;\n}\n\n/** Route patterns the integration would like to own, paired with their entrypoints. */\nfunction plannedRoutes(cfg: DocsConfig) {\n const prefix = cfg.pathPrefix ? `/${cfg.pathPrefix.replace(/^\\/|\\/$/g, '')}` : '';\n const routes: Array<{ pattern: string; entrypoint: string; enabled: boolean }> = [\n {\n pattern: `${prefix}/[...slug]`,\n entrypoint: '@eqtylab/docs/routes/docs.astro',\n enabled: cfg.routing.injectPages,\n },\n {\n pattern: `${prefix}/[...slug].md`,\n entrypoint: '@eqtylab/docs/routes/docs-md.ts',\n enabled: cfg.routing.markdownTwins,\n },\n {\n pattern: '/llms.txt',\n entrypoint: '@eqtylab/docs/routes/llms-txt.ts',\n enabled: cfg.routing.markdownTwins,\n },\n {\n pattern: '/404',\n entrypoint: '@eqtylab/docs/routes/not-found.astro',\n enabled: cfg.routing.notFound,\n },\n ];\n return routes.filter((r) => r.enabled);\n}\n\nexport default function docs(\n options: DocsIntegrationOptions = {} as DocsIntegrationOptions\n): AstroIntegration {\n const { env: envOverrides, ...userConfig } = options;\n const cfg = resolveConfig(userConfig);\n const env = resolveDocsEnv(envOverrides);\n\n let payload: Record<string, unknown> = {};\n\n return {\n name: '@eqtylab/docs',\n hooks: {\n async 'astro:config:setup'(params) {\n const { config, injectRoute, updateConfig, addWatchFile, logger, command } = params;\n\n assertMdxOnly(new URL(`./${cfg.contentDir}/`, config.srcDir));\n\n const consumer = scanConsumerPages(config.srcDir);\n\n for (const route of plannedRoutes(cfg)) {\n if (consumer.claimedPatterns.has(route.pattern)) {\n logger.info(\n `yielding ${route.pattern} to your own src/pages file (docs route not injected)`\n );\n continue;\n }\n injectRoute({ pattern: route.pattern, entrypoint: route.entrypoint, prerender: true });\n }\n\n payload = {\n ...cfg,\n env,\n // Read by the catch-all's getStaticPaths so no path is emitted twice.\n ownedByConsumer: consumer.ownedPaths,\n };\n\n // So `_group.yaml` edits reload in dev.\n if (command === 'dev') {\n addWatchFile(new URL(`./${cfg.contentDir}/`, config.srcDir));\n }\n\n const integrationNames = new Set(config.integrations.map((i) => i.name));\n const added: AstroIntegration[] = [];\n\n if (cfg.autoIntegrations) {\n if (!integrationNames.has('@astrojs/mdx')) {\n const { default: mdx } = await import('@astrojs/mdx');\n added.push(mdx());\n }\n if (!integrationNames.has('@astrojs/react')) {\n const { default: react } = await import('@astrojs/react');\n added.push(react());\n }\n if (cfg.search.provider === 'pagefind' && !integrationNames.has('pagefind')) {\n added.push(pagefindIntegration());\n }\n }\n\n const vitePlugins: unknown[] = [virtualConfigPlugin(() => payload)];\n\n // Shiki tokenises at build time and needs no grammars emitted.\n if (cfg.code.highlighter === 'codeblock') {\n vitePlugins.push(microlighterGrammarsPlugin(config.root, logger));\n }\n\n if (cfg.autoIntegrations) {\n // Cast first: `.flat(Infinity)` over Vite's recursive PluginOption hits TS2589.\n const existing = (config.vite?.plugins ?? []) as unknown[];\n const hasTailwind = existing\n .flat(Infinity as 1)\n .some(\n (p) =>\n typeof (p as { name?: string })?.name === 'string' &&\n (p as { name: string }).name.includes('tailwind')\n );\n if (!hasTailwind) {\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n vitePlugins.push(tailwindcss());\n }\n }\n\n // Typed loosely on purpose: inlining this hits \"type instantiation is excessively deep\".\n const markdown: Record<string, unknown> =\n cfg.code.highlighter === 'codeblock'\n ? {\n // Shiki must be off so the `pre` override receives raw source.\n syntaxHighlight: false,\n }\n : {\n shikiConfig: {\n themes: cfg.code.themes,\n defaultColor: false,\n wrap: cfg.code.wrap,\n ...(cfg.code.langs.length ? { langs: cfg.code.langs } : {}),\n },\n };\n\n // Astro does not apply `base` to authored markdown links. MDX inherits these via extendMarkdownConfig.\n markdown.rehypePlugins = [\n [rehypeBaseUrl, { base: config.base }],\n rehypeProseScope,\n rehypeTableColumns,\n ...(cfg.code.highlighter === 'codeblock' ? [rehypeCodeFence] : []),\n ];\n\n updateConfig({\n integrations: added,\n vite: { plugins: vitePlugins as never },\n markdown,\n } as never);\n },\n\n 'astro:config:done'({ injectTypes }) {\n injectTypes({\n filename: 'types.d.ts',\n content: [\n `declare module 'virtual:eqty-docs/config' {`,\n ` const config: import('@eqtylab/docs').DocsConfig & {`,\n ` env: import('@eqtylab/docs').DocsEnv;`,\n ` ownedByConsumer: string[];`,\n ` };`,\n ` export default config;`,\n `}`,\n '',\n ].join('\\n'),\n });\n },\n\n 'astro:routes:resolved'({ routes, logger }) {\n // Catches collisions the filesystem scan cannot see.\n const seen = new Map<string, string>();\n for (const route of routes as Array<{ pattern: string; entrypoint: string }>) {\n const previous = seen.get(route.pattern);\n if (previous && previous !== route.entrypoint) {\n logger.warn(\n `Route ${route.pattern} is claimed twice:\\n ${previous}\\n ${route.entrypoint}\\n` +\n `One of them will be overwritten in the static build.`\n );\n }\n seen.set(route.pattern, route.entrypoint);\n }\n },\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/internal/assert-mdx-only.ts","../src/internal/microlighter-grammars.ts","../src/internal/pagefind.ts","../src/internal/rehype-code-fence.ts","../src/internal/rehype-prose-scope.ts","../src/internal/rehype-table-columns.ts","../src/internal/scan-consumer-pages.ts","../src/internal/virtual-config.ts","../src/index.ts"],"names":["path","fileURLToPath","visit","globSync"],"mappings":";;;;;;;;;;;;;;AAQO,SAAS,cAAc,UAAA,EAAuB;AACnD,EAAA,MAAM,GAAA,GAAM,cAAc,UAAU,CAAA;AAEpC,EAAA,IAAI,SAAmB,EAAC;AACxB,EAAA,IAAI;AACF,IAAA,MAAA,GAAS,QAAA,CAAS,CAAC,SAAS,CAAA,EAAG,EAAE,GAAA,EAAK,GAAA,EAAK,QAAA,EAAU,KAAA,EAAO,CAAA;AAAA,EAC9D,CAAA,CAAA,MAAQ;AACN,IAAA;AAAA,EACF;AACA,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG;AAEzB,EAAA,MAAM,OAAO,MAAA,CACV,IAAA,GACA,GAAA,CAAI,CAAC,SAAS,CAAA,IAAA,EAAO,IAAI,CAAA,MAAA,EAAS,IAAA,CAAK,QAAQ,QAAA,EAAU,MAAM,CAAC,CAAA,CAAE,CAAA,CAClE,KAAK,IAAI,CAAA;AAEZ,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,yBAAyB,MAAA,CAAO,MAAM,CAAA,cAAA,EAAiB,MAAA,CAAO,SAAS,CAAA,GAAI,GAAA,GAAM,EAAE,CAAA,IAAA,E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AA,CAAA,CAAA;AAAA,YACA;AAAA,WACF,CAAE,KAAK,IAAI;AAAA,SACZ,CAAA;AAAA,MACH,CAAA;AAAA,MAEA,uBAAA,CAAwB,EAAE,MAAA,EAAQ,MAAA,EAAO,EAAG;AAE1C,QAAA,MAAM,IAAA,uBAAW,GAAA,EAAoB;AACrC,QAAA,KAAA,MAAW,SAAS,MAAA,EAA0D;AAC5E,UAAA,MAAM,QAAA,GAAW,IAAA,CAAK,GAAA,CAAI,KAAA,CAAM,OAAO,CAAA;AACvC,UAAA,IAAI,QAAA,IAAY,QAAA,KAAa,KAAA,CAAM,UAAA,EAAY;AAC7C,YAAA,MAAA,CAAO,IAAA;AAAA,cACL,CAAA,MAAA,EAAS,MAAM,OAAO,CAAA;AAAA,EAAA,EAAyB,QAAQ;AAAA,EAAA,EAAO,MAAM,UAAU;AAAA,oDAAA;AAAA,aAEhF;AAAA,UACF;AACA,UAAA,IAAA,CAAK,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C;AAAA,MACF;AAAA;AACF,GACF;AACF","file":"index.js","sourcesContent":["/**\n * Only MDX supports the component overrides and the loader globs `.mdx` only,\n * so a stray `.md` would be silently absent from the site. Fail loudly instead.\n */\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { globSync } from 'tinyglobby';\n\nexport function assertMdxOnly(contentDir: URL): void {\n const dir = fileURLToPath(contentDir);\n\n let strays: string[] = [];\n try {\n strays = globSync(['**/*.md'], { cwd: dir, absolute: false });\n } catch {\n return;\n }\n if (strays.length === 0) return;\n\n const list = strays\n .sort()\n .map((file) => ` - ${file} -> ${file.replace(/\\.md$/i, '.mdx')}`)\n .join('\\n');\n\n throw new Error(\n `[@eqtylab/docs] Found ${strays.length} Markdown file${strays.length > 1 ? 's' : ''} in ` +\n `${path.relative(process.cwd(), dir) || dir}:\\n${list}\\n\\n` +\n `Docs content must be .mdx. Only MDX supports the component overrides that render\\n` +\n `tables, code fences and callouts through Equality, so a .md page would look\\n` +\n `different from every other page. Renaming is usually the only change needed --\\n` +\n `MDX is a superset of Markdown.`\n );\n}\n","/**\n * Emits microlighter's grammar modules beside the chunks that ask for them.\n * CodeBlock loads grammars with `import('./grammars/' + language)`, which no\n * bundler can expand; without this the build succeeds and code renders unhighlighted.\n */\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport type { AstroIntegrationLogger } from 'astro';\nimport type { Plugin } from 'vite';\n\n/** Residue of the dynamic import in the emitted chunk. */\nconst GRAMMAR_IMPORT = 'grammars/${';\n\n/** Two hops from the consumer: microlighter is a dependency of @eqtylab/equality, which is only a peer here. */\nfunction findGrammarDir(projectRoot: URL): string {\n const requireFromProject = createRequire(new URL('package.json', projectRoot));\n const equalityEntry = requireFromProject.resolve('@eqtylab/equality');\n const requireFromEquality = createRequire(equalityEntry);\n return path.resolve(path.dirname(requireFromEquality.resolve('microlighter')), 'grammars');\n}\n\nexport function microlighterGrammarsPlugin(\n projectRoot: URL,\n logger: AstroIntegrationLogger\n): Plugin {\n return {\n name: 'eqty-docs:microlighter-grammars',\n apply: 'build',\n generateBundle(_options, bundle) {\n const directories = new Set(\n Object.values(bundle)\n .filter((output) => output.type === 'chunk' && output.code.includes(GRAMMAR_IMPORT))\n .map((output) => path.posix.dirname(output.fileName))\n );\n if (directories.size === 0) return;\n\n let grammarDir: string;\n let grammars: string[];\n try {\n grammarDir = findGrammarDir(projectRoot);\n grammars = readdirSync(grammarDir).filter((file) => file.endsWith('.js'));\n } catch (error) {\n // Warn rather than fail the build over highlighting.\n logger.warn(\n 'Code blocks ask for microlighter grammars, but they could not be resolved. ' +\n 'Fenced code will render unhighlighted. Check that @eqtylab/equality is ' +\n `installed in this project.\\n ${String(error)}`\n );\n return;\n }\n\n for (const directory of directories) {\n for (const grammar of grammars) {\n this.emitFile({\n type: 'asset',\n fileName:\n directory === '.' ? `grammars/${grammar}` : `${directory}/grammars/${grammar}`,\n source: readFileSync(path.resolve(grammarDir, grammar), 'utf8'),\n });\n }\n }\n },\n };\n}\n","/**\n * Not `astro-pagefind`: it ships TypeScript, and Node will not compile that under\n * node_modules when this integration reaches it from its own bundle.\n *\n * The build writes the index; dev serves that same index off disk, so it always\n * describes the last build.\n */\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { AstroIntegration } from 'astro';\n\nconst INDEX_DIR = 'pagefind';\n\n/** Everything else Pagefind fetches is read as bytes, so the type never reaches a parser. */\nconst MIME: Record<string, string> = {\n '.js': 'text/javascript',\n '.css': 'text/css',\n '.json': 'application/json',\n '.wasm': 'application/wasm',\n};\n\n/** Pagefind collects errors per step and carries on; any of them means no usable index. */\nfunction failOn(\n errors: string[],\n logger: { error: (message: string) => void },\n what: string\n): void {\n if (!errors.length) return;\n errors.forEach((error) => logger.error(error));\n throw new Error(`[@eqtylab/docs] Pagefind could not ${what}.`);\n}\n\nfunction indexRequest(url: string | undefined, base: string): string | null {\n if (!url) return null;\n const pathname = decodeURIComponent(url.split(/[?#]/)[0]);\n const prefix = `${base.replace(/\\/+$/, '')}/${INDEX_DIR}/`;\n return pathname.startsWith(prefix) ? pathname.slice(prefix.length) : null;\n}\n\nexport function pagefindIntegration(): AstroIntegration {\n let indexDir = '';\n\n return {\n name: '@eqtylab/docs/pagefind',\n hooks: {\n 'astro:config:setup'({ config, logger }) {\n indexDir = path.join(fileURLToPath(config.outDir), INDEX_DIR);\n\n if (config.output === 'server') {\n logger.warn(\n 'Output \"server\" emits no static HTML, so there is nothing for Pagefind to index.'\n );\n }\n },\n\n /** Runs ahead of Vite's static middleware and Astro's handler; move it and `/pagefind/*` 404s. */\n 'astro:server:setup'({ server, logger }) {\n const base = server.config.base ?? '/';\n\n logger.info(\n fs.existsSync(indexDir)\n ? 'serving the search index from the last build; rebuild to pick up edits'\n : 'no search index yet — run `astro build` once to search in dev'\n );\n\n server.middlewares.use((req, res, next) => {\n const requested = indexRequest(req.url, base);\n if (requested === null) return next();\n\n const file = path.join(indexDir, requested);\n // The prefix check is what stops `..` climbing out of the index directory.\n if (!file.startsWith(indexDir + path.sep) || !fs.existsSync(file)) return next();\n\n res.setHeader('Content-Type', MIME[path.extname(file)] ?? 'application/octet-stream');\n // The next build rewrites these in place, and a cached fragment would outlive it.\n res.setHeader('Cache-Control', 'no-store');\n fs.createReadStream(file).pipe(res);\n });\n },\n\n /** The last hook of the build, and the first moment every page exists on disk to read. */\n async 'astro:build:done'({ dir, logger }) {\n const outDir = fileURLToPath(dir);\n const { createIndex } = await import('pagefind');\n\n const { index, errors } = await createIndex();\n failOn(errors, logger, 'create an index');\n if (!index) throw new Error('[@eqtylab/docs] Pagefind returned no index.');\n\n const { page_count, errors: addErrors } = await index.addDirectory({ path: outDir });\n failOn(addErrors, logger, 'index the built output');\n\n const { outputPath, errors: writeErrors } = await index.writeFiles({\n outputPath: path.join(outDir, INDEX_DIR),\n });\n failOn(writeErrors, logger, 'write the index');\n\n logger.info(`indexed ${page_count} pages to ${outputPath}`);\n },\n },\n };\n}\n","/**\n * Lifts each fence's source, language and title onto its `<pre>`. Do not recover\n * the source from the rendered slot: `Astro.slots.render()` escapes in dev but not in build.\n */\nimport { visit } from 'unist-util-visit';\n\ninterface Node {\n type: string;\n tagName?: string;\n value?: string;\n properties?: Record<string, unknown>;\n children?: Node[];\n data?: { meta?: string };\n}\n\nfunction textOf(node: Node): string {\n if (node.type === 'text') return node.value ?? '';\n return (node.children ?? []).map(textOf).join('');\n}\n\nfunction classNames(props: Record<string, unknown> | undefined): string[] {\n const raw = props?.className ?? props?.class;\n if (Array.isArray(raw)) return raw.map(String);\n if (typeof raw === 'string') return raw.split(/\\s+/);\n return [];\n}\n\n/** ```ts title=\"button.tsx\" -> \"button.tsx\" */\nfunction titleFromMeta(meta: string | undefined): string | undefined {\n const match = meta?.match(/(?:^|\\s)title=(?:\"([^\"]*)\"|'([^']*)'|(\\S+))/);\n return match ? (match[1] ?? match[2] ?? match[3]) : undefined;\n}\n\nexport function rehypeCodeFence() {\n return function transformer(tree: unknown) {\n visit(tree as never, 'element', (node: Node) => {\n if (node.tagName !== 'pre') return;\n\n const code = (node.children ?? []).find(\n (child) => child.type === 'element' && child.tagName === 'code'\n );\n if (!code) return;\n\n const language = classNames(code.properties)\n .find((name) => name.startsWith('language-'))\n ?.slice('language-'.length);\n\n const title = titleFromMeta(code.data?.meta);\n\n node.properties = {\n ...node.properties,\n dataCode: textOf(code).replace(/\\n$/, ''),\n ...(language ? { dataLanguage: language } : {}),\n ...(title ? { dataTitle: title } : {}),\n };\n });\n };\n}\n","/**\n * Marks the content a page authored as markdown or as plain HTML, so\n * `prose.css` can typeset it without reaching inside a component.\n *\n * MDX parses a component's children as markdown whenever they sit on their own\n * lines, so `<Badge icon=\"Shield\">\\n Primary\\n</Badge>` renders a `<p>` inside\n * the badge — and prettier puts them there. Authoring discipline cannot fix it;\n * the boundary has to be drawn here. Everything below a capitalised JSX tag is\n * that component's business, `<div>` and friends are the page's own.\n */\nimport { SKIP, visit } from 'unist-util-visit';\n\nconst MARKER = 'data-eq-md';\n\ninterface Attribute {\n type: string;\n name?: string | null;\n}\n\ninterface Node {\n type: string;\n name?: string | null;\n properties?: Record<string, unknown>;\n attributes?: Attribute[];\n}\n\n/** Capitalised or dotted JSX names are components; `div`, `span` and friends are not. */\nfunction isComponent(node: Node): boolean {\n if (node.type !== 'mdxJsxFlowElement' && node.type !== 'mdxJsxTextElement') return false;\n const name = node.name;\n return typeof name === 'string' && (/^[A-Z]/.test(name) || name.includes('.'));\n}\n\n/**\n * Structural components that hold the page's own prose rather than content of their own.\n * Without this a heading or list inside a `<TabItem>` would render untypeset.\n */\nconst CONTAINERS = new Set(['Tabs', 'TabItem']);\n\nfunction isContainer(node: Node): boolean {\n return typeof node.name === 'string' && CONTAINERS.has(node.name);\n}\n\nexport function rehypeProseScope() {\n return function transformer(tree: unknown) {\n visit(tree as never, (node: Node) => {\n // A container's children are the page's own markup, so traversal continues into them.\n // The component tag itself is never page markup and never takes the marker.\n if (isComponent(node)) return isContainer(node) ? undefined : SKIP;\n\n if (node.type === 'element') {\n node.properties = { ...node.properties, dataEqMd: '' };\n return undefined;\n }\n\n // Authored HTML. A JSX fragment has no name and nothing to mark.\n if ((node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') && node.name) {\n const attributes = node.attributes ?? [];\n if (!attributes.some((a) => a.type === 'mdxJsxAttribute' && a.name === MARKER)) {\n attributes.push({ type: 'mdxJsxAttribute', name: MARKER, value: '' } as Attribute);\n }\n node.attributes = attributes;\n }\n\n return undefined;\n });\n };\n}\n","/**\n * Annotates each markdown table with its column count. Equality's `TableContainer`\n * is a CSS grid and collapses to one column without an explicit track list.\n */\nimport { visit } from 'unist-util-visit';\n\ninterface ElementNode {\n type: string;\n tagName?: string;\n properties?: Record<string, unknown>;\n children?: ElementNode[];\n}\n\n/** First `tr` in document order, searching thead before tbody. */\nfunction firstRow(table: ElementNode): ElementNode | undefined {\n let found: ElementNode | undefined;\n visit(table as never, 'element', (node: ElementNode) => {\n if (found) return false;\n if (node.tagName === 'tr') {\n found = node;\n return false;\n }\n return undefined;\n });\n return found;\n}\n\nfunction countCells(row: ElementNode): number {\n return (row.children ?? []).reduce((total, child) => {\n if (child.type !== 'element') return total;\n if (child.tagName !== 'th' && child.tagName !== 'td') return total;\n const span = Number(child.properties?.colSpan ?? child.properties?.colspan ?? 1);\n return total + (Number.isFinite(span) && span > 0 ? span : 1);\n }, 0);\n}\n\nexport function rehypeTableColumns() {\n return function transformer(tree: unknown) {\n visit(tree as never, 'element', (node: ElementNode) => {\n if (node.tagName !== 'table') return;\n const row = firstRow(node);\n const count = row ? countCells(row) : 0;\n if (count <= 0) return;\n node.properties = { ...node.properties, dataColumnCount: String(count) };\n });\n };\n}\n","/**\n * Routes the consumer's own `src/pages` already claim. Astro does NOT de-duplicate\n * injected routes against file-based ones: a path claimed by both is emitted\n * twice and the winner is write order, so yielding has to be explicit here.\n */\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { globSync } from 'tinyglobby';\n\nconst PAGE_EXTENSIONS = ['astro', 'md', 'mdx', 'html', 'ts', 'js'];\n\nexport interface ConsumerPages {\n /** Concrete route paths the consumer's pages generate, normalised without trailing slash. */\n ownedPaths: string[];\n /** Route patterns claimed by consumer pages, e.g. '/[...slug]' or '/404'. */\n claimedPatterns: Set<string>;\n}\n\n/** `index.astro` -> '', `a/b.astro` -> '/a/b', `[...slug].astro` -> '/[...slug]' */\nfunction toRoutePath(relative: string): string {\n const withoutExt = relative.replace(/\\.[^./]+$/, '');\n const segments = withoutExt.split(path.sep).join('/').split('/').filter(Boolean);\n if (segments.at(-1) === 'index') segments.pop();\n return '/' + segments.join('/');\n}\n\nexport function scanConsumerPages(srcDir: URL): ConsumerPages {\n const pagesDir = fileURLToPath(new URL('./pages/', srcDir));\n\n let files: string[] = [];\n try {\n files = globSync([`**/*.{${PAGE_EXTENSIONS.join(',')}}`], {\n cwd: pagesDir,\n absolute: false,\n });\n } catch {\n // No src/pages: a docs-only site.\n return { ownedPaths: [], claimedPatterns: new Set() };\n }\n\n const ownedPaths: string[] = [];\n const claimedPatterns = new Set<string>();\n\n for (const file of files) {\n // Astro ignores files and directories prefixed with `_`.\n if (file.split(path.sep).some((segment) => segment.startsWith('_'))) continue;\n\n const routePath = toRoutePath(file);\n claimedPatterns.add(routePath === '' ? '/' : routePath);\n\n if (!/[[\\]]/.test(file)) {\n ownedPaths.push(routePath.replace(/\\/+$/, '') || '/');\n }\n }\n\n return { ownedPaths, claimedPatterns };\n}\n","/** Serves the resolved config to runtime components, which ship from node_modules and cannot reach the consumer's project by path. */\nimport type { Plugin } from 'vite';\n\nconst MODULE_ID = 'virtual:eqty-docs/config';\nconst RESOLVED_ID = '\\0' + MODULE_ID;\n\nexport function virtualConfigPlugin(getPayload: () => Record<string, unknown>): Plugin {\n return {\n name: 'eqty-docs:virtual-config',\n resolveId(id) {\n return id === MODULE_ID ? RESOLVED_ID : null;\n },\n load(id) {\n if (id !== RESOLVED_ID) return null;\n return `export default ${JSON.stringify(getPayload())};`;\n },\n };\n}\n","import { fileURLToPath } from 'node:url';\nimport type { AstroIntegration } from 'astro';\n\nimport { resolveConfig, type DocsConfig, type DocsUserConfig } from './config.ts';\nimport { resolveDocsEnv, type DocsEnv } from './env.ts';\nimport { assertMdxOnly } from './internal/assert-mdx-only.ts';\nimport { microlighterGrammarsPlugin } from './internal/microlighter-grammars.ts';\nimport { pagefindIntegration } from './internal/pagefind.ts';\nimport { rehypeBaseUrl } from './internal/rehype-base-url.ts';\nimport { rehypeCodeFence } from './internal/rehype-code-fence.ts';\nimport { rehypeProseScope } from './internal/rehype-prose-scope.ts';\nimport { rehypeTableColumns } from './internal/rehype-table-columns.ts';\nimport { scanConsumerPages } from './internal/scan-consumer-pages.ts';\nimport { virtualConfigPlugin } from './internal/virtual-config.ts';\n\nexport { resolveConfig, type DocsConfig, type DocsUserConfig } from './config.ts';\nexport { resolveDocsEnv, type DocsEnv } from './env.ts';\n// Do not re-export the loaders: this entry runs in Node when astro.config loads,\n// and they import `astro:content`, which only exists in the Vite graph.\nexport { docsSchema, groupSchema, badgeSchema } from './schema.ts';\nexport * from './types.ts';\n\nexport interface DocsIntegrationOptions extends DocsUserConfig {\n /** Build environment for versioned deploys. Defaults to `resolveDocsEnv()`. */\n env?: Partial<DocsEnv>;\n}\n\n/** Route patterns the integration would like to own, paired with their entrypoints. */\nfunction plannedRoutes(cfg: DocsConfig) {\n const prefix = cfg.pathPrefix ? `/${cfg.pathPrefix.replace(/^\\/|\\/$/g, '')}` : '';\n const routes: Array<{ pattern: string; entrypoint: string; enabled: boolean }> = [\n {\n pattern: `${prefix}/[...slug]`,\n entrypoint: '@eqtylab/docs/routes/docs.astro',\n enabled: cfg.routing.injectPages,\n },\n {\n pattern: `${prefix}/[...slug].md`,\n entrypoint: '@eqtylab/docs/routes/docs-md.ts',\n enabled: cfg.routing.markdownTwins,\n },\n {\n pattern: '/llms.txt',\n entrypoint: '@eqtylab/docs/routes/llms-txt.ts',\n enabled: cfg.routing.markdownTwins,\n },\n {\n pattern: '/404',\n entrypoint: '@eqtylab/docs/routes/not-found.astro',\n enabled: cfg.routing.notFound,\n },\n ];\n return routes.filter((r) => r.enabled);\n}\n\nexport default function docs(\n options: DocsIntegrationOptions = {} as DocsIntegrationOptions\n): AstroIntegration {\n const { env: envOverrides, ...userConfig } = options;\n const cfg = resolveConfig(userConfig);\n const env = resolveDocsEnv(envOverrides);\n\n let payload: Record<string, unknown> = {};\n\n return {\n name: '@eqtylab/docs',\n hooks: {\n async 'astro:config:setup'(params) {\n const { config, injectRoute, injectScript, updateConfig, addWatchFile, logger, command } =\n params;\n\n assertMdxOnly(new URL(`./${cfg.contentDir}/`, config.srcDir));\n\n const consumer = scanConsumerPages(config.srcDir);\n\n for (const route of plannedRoutes(cfg)) {\n if (consumer.claimedPatterns.has(route.pattern)) {\n logger.info(\n `yielding ${route.pattern} to your own src/pages file (docs route not injected)`\n );\n continue;\n }\n injectRoute({ pattern: route.pattern, entrypoint: route.entrypoint, prerender: true });\n }\n\n payload = {\n ...cfg,\n env,\n // Read by the catch-all's getStaticPaths so no path is emitted twice.\n ownedByConsumer: consumer.ownedPaths,\n };\n\n // So `_group.yaml` edits reload in dev.\n if (command === 'dev') {\n addWatchFile(new URL(`./${cfg.contentDir}/`, config.srcDir));\n }\n\n const integrationNames = new Set(config.integrations.map((i) => i.name));\n const added: AstroIntegration[] = [];\n\n if (cfg.autoIntegrations) {\n if (!integrationNames.has('@astrojs/mdx')) {\n const { default: mdx } = await import('@astrojs/mdx');\n added.push(mdx());\n }\n if (!integrationNames.has('@astrojs/react')) {\n const { default: react } = await import('@astrojs/react');\n added.push(react());\n }\n if (cfg.search.provider === 'pagefind' && !integrationNames.has('pagefind')) {\n added.push(pagefindIntegration());\n }\n }\n\n const vitePlugins: unknown[] = [virtualConfigPlugin(() => payload)];\n\n // Shiki tokenises at build time and needs no grammars emitted.\n if (cfg.code.highlighter === 'codeblock') {\n vitePlugins.push(microlighterGrammarsPlugin(config.root, logger));\n }\n\n if (cfg.autoIntegrations) {\n // Cast first: `.flat(Infinity)` over Vite's recursive PluginOption hits TS2589.\n const existing = (config.vite?.plugins ?? []) as unknown[];\n const hasTailwind = existing\n .flat(Infinity as 1)\n .some(\n (p) =>\n typeof (p as { name?: string })?.name === 'string' &&\n (p as { name: string }).name.includes('tailwind')\n );\n if (!hasTailwind) {\n const { default: tailwindcss } = await import('@tailwindcss/vite');\n vitePlugins.push(tailwindcss());\n }\n }\n\n // Typed loosely on purpose: inlining this hits \"type instantiation is excessively deep\".\n const markdown: Record<string, unknown> =\n cfg.code.highlighter === 'codeblock'\n ? {\n // Shiki must be off so the `pre` override receives raw source.\n syntaxHighlight: false,\n }\n : {\n shikiConfig: {\n themes: cfg.code.themes,\n defaultColor: false,\n wrap: cfg.code.wrap,\n ...(cfg.code.langs.length ? { langs: cfg.code.langs } : {}),\n },\n };\n\n // Astro does not apply `base` to authored markdown links. MDX inherits these via extendMarkdownConfig.\n markdown.rehypePlugins = [\n [rehypeBaseUrl, { base: config.base }],\n rehypeProseScope,\n rehypeTableColumns,\n ...(cfg.code.highlighter === 'codeblock' ? [rehypeCodeFence] : []),\n ];\n\n // Resolve against the project root first, or a './...' path means different things\n // in dev and in a build.\n const resolveAsset = (spec: string) =>\n spec.startsWith('.') ? fileURLToPath(new URL(spec, config.root)) : spec;\n\n for (const href of cfg.customCss) {\n injectScript('page-ssr', `import ${JSON.stringify(resolveAsset(href))};`);\n }\n for (const src of cfg.clientScripts) {\n injectScript('page', `import ${JSON.stringify(resolveAsset(src))};`);\n }\n\n updateConfig({\n integrations: added,\n vite: { plugins: vitePlugins as never },\n markdown,\n } as never);\n },\n\n 'astro:config:done'({ injectTypes }) {\n injectTypes({\n filename: 'types.d.ts',\n content: [\n `declare module 'virtual:eqty-docs/config' {`,\n ` const config: import('@eqtylab/docs').DocsConfig & {`,\n ` env: import('@eqtylab/docs').DocsEnv;`,\n ` ownedByConsumer: string[];`,\n ` };`,\n ` export default config;`,\n `}`,\n '',\n ].join('\\n'),\n });\n },\n\n 'astro:routes:resolved'({ routes, logger }) {\n // Catches collisions the filesystem scan cannot see.\n const seen = new Map<string, string>();\n for (const route of routes as Array<{ pattern: string; entrypoint: string }>) {\n const previous = seen.get(route.pattern);\n if (previous && previous !== route.entrypoint) {\n logger.warn(\n `Route ${route.pattern} is claimed twice:\\n ${previous}\\n ${route.entrypoint}\\n` +\n `One of them will be overwritten in the static build.`\n );\n }\n seen.set(route.pattern, route.entrypoint);\n }\n },\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eqtylab/docs",
|
|
3
3
|
"description": "Astro documentation framework built on the Equality design system",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://equality.eqtylab.io/",
|
|
7
7
|
"repository": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@astrojs/mdx": "^5.0.2",
|
|
109
|
-
"@astrojs/react": "^5.0.1",
|
|
109
|
+
"@astrojs/react": "^5.0.1 || ^6.0.0",
|
|
110
110
|
"@eqtylab/equality": ">=3.2.6 <5",
|
|
111
111
|
"astro": "^6.0.0",
|
|
112
112
|
"react": "^18.2.0 || ^19.0.0",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
@reference '../styles/theme.css';
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* All that is left here are the two rules that fight another package's styling. Neither
|
|
5
|
-
* can move inline: one has to outrank Equality's own dialog class at equal specificity,
|
|
6
|
-
* and the other styles an element this component never renders.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/* Class doubled to beat Equality's centring, which sits at the same specificity.
|
|
10
|
-
* Never override `transform` here: the entrance animation uses it. */
|
|
11
|
-
.dialog.dialog {
|
|
12
|
-
@apply p-0;
|
|
13
|
-
top: 10vh;
|
|
14
|
-
translate: -50% 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Two assumptions nothing enforces: `packages/ui` still generates an overlay class containing
|
|
19
|
-
* `dialog-overlay`, and Radix still renders that overlay as the dialog's previous sibling. Either
|
|
20
|
-
* changes and the blur silently disappears. `:has` keeps it off every other dialog on the site.
|
|
21
|
-
*/
|
|
22
|
-
:global([class*='dialog-overlay']):has(+ .dialog) {
|
|
23
|
-
@apply bg-background/25;
|
|
24
|
-
-webkit-backdrop-filter: blur(18px);
|
|
25
|
-
backdrop-filter: blur(6px);
|
|
26
|
-
}
|