@terra-symposium/docs 0.1.78 → 0.1.80
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/lib-dist/components/StaticWorkspace.d.ts +11 -1
- package/lib-dist/components/StaticWorkspace.d.ts.map +1 -1
- package/lib-dist/components/StaticWorkspace.js +163 -52
- package/lib-dist/components/StaticWorkspace.js.map +1 -1
- package/lib-dist/components/terra/pages/docs/_sidebar.d.ts +8 -18
- package/lib-dist/components/terra/pages/docs/_sidebar.d.ts.map +1 -1
- package/lib-dist/components/terra/pages/docs/_sidebar.js +199 -136
- package/lib-dist/components/terra/pages/docs/_sidebar.js.map +1 -1
- package/lib-dist/components/terra/pages/docs/_toolbar.d.ts +2 -4
- package/lib-dist/components/terra/pages/docs/_toolbar.d.ts.map +1 -1
- package/lib-dist/components/terra/pages/docs/_toolbar.js +85 -66
- package/lib-dist/components/terra/pages/docs/_toolbar.js.map +1 -1
- package/lib-dist/components/terra/ui.d.ts +42 -11
- package/lib-dist/components/terra/ui.d.ts.map +1 -1
- package/lib-dist/components/terra/ui.js +55 -14
- package/lib-dist/components/terra/ui.js.map +1 -1
- package/lib-dist/lib/astro.d.ts +1 -0
- package/lib-dist/lib/astro.d.ts.map +1 -1
- package/lib-dist/lib/astro.js +1 -0
- package/lib-dist/lib/astro.js.map +1 -1
- package/lib-dist/style.css +1 -1
- package/package.json +2 -2
- package/site/astro.config.mjs +84 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terra-symposium/docs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.80",
|
|
4
4
|
"description": "Terra Docs workspace and Markdown site generator.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@changesets/cli": "^3.0.3",
|
|
70
70
|
"@eslint/js": "10.0.1",
|
|
71
71
|
"@playwright/test": "^1.64.1",
|
|
72
|
-
"@terra-symposium/standards-quality": "2.1.
|
|
72
|
+
"@terra-symposium/standards-quality": "2.1.3",
|
|
73
73
|
"@terra-symposium/standards-reporting": "0.6.2",
|
|
74
74
|
"@types/katex": "^0.16.8",
|
|
75
75
|
"@types/node": "^24.19.2",
|
package/site/astro.config.mjs
CHANGED
|
@@ -15,6 +15,9 @@ const packageRoot = fileURLToPath(new URL('../', import.meta.url));
|
|
|
15
15
|
const requireFromPackage = createRequire(import.meta.url);
|
|
16
16
|
const stylingEntry = requireFromPackage.resolve('@terra-symposium/styling');
|
|
17
17
|
const requireFromStyling = createRequire(stylingEntry);
|
|
18
|
+
const astroManifest = JSON.parse(
|
|
19
|
+
readFileSync(requireFromPackage.resolve('astro/package.json'), 'utf8'),
|
|
20
|
+
);
|
|
18
21
|
const docsManifest = JSON.parse(readFileSync(resolve(packageRoot, 'package.json'), 'utf8'));
|
|
19
22
|
const projectRoot = process.env.TERRA_DOCS_ROOT ?? process.cwd();
|
|
20
23
|
const publicDir = resolve(projectRoot, '.terra-docs/public');
|
|
@@ -28,6 +31,7 @@ const projectManifest = (() => {
|
|
|
28
31
|
return {};
|
|
29
32
|
}
|
|
30
33
|
})();
|
|
34
|
+
const requireFromProject = createRequire(resolve(projectRoot, 'package.json'));
|
|
31
35
|
|
|
32
36
|
function packageExportAliases() {
|
|
33
37
|
if (!projectManifest.name || !projectManifest.exports) return [];
|
|
@@ -46,6 +50,72 @@ function packageExportAliases() {
|
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
function astroPackageExportAliases() {
|
|
54
|
+
return Object.keys(astroManifest.exports)
|
|
55
|
+
.filter((key) => key.startsWith('./') && !key.includes('*'))
|
|
56
|
+
.map((key) => {
|
|
57
|
+
const specifier = `astro${key.slice(1)}`;
|
|
58
|
+
try {
|
|
59
|
+
requireFromProject.resolve(specifier);
|
|
60
|
+
return null;
|
|
61
|
+
} catch {
|
|
62
|
+
// Package-owned Astro installation is the fallback for content-only repos.
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
find: new RegExp(`^${specifier.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')}$`),
|
|
66
|
+
replacement: requireFromPackage.resolve(specifier),
|
|
67
|
+
};
|
|
68
|
+
})
|
|
69
|
+
.filter(Boolean);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function packageDependencyAliases() {
|
|
73
|
+
return Object.keys(docsManifest.dependencies ?? {})
|
|
74
|
+
.filter((name) => name !== 'astro')
|
|
75
|
+
.flatMap((name) => {
|
|
76
|
+
const manifestPath = resolve(packageRoot, 'node_modules', name, 'package.json');
|
|
77
|
+
let dependencyManifest;
|
|
78
|
+
try {
|
|
79
|
+
dependencyManifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
80
|
+
} catch {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
const subpaths = Object.keys(dependencyManifest.exports ?? {}).filter(
|
|
84
|
+
(key) => key.startsWith('./') && !key.includes('*'),
|
|
85
|
+
);
|
|
86
|
+
return [name, ...subpaths.map((key) => `${name}${key.slice(1)}`)].flatMap((specifier) => {
|
|
87
|
+
try {
|
|
88
|
+
return [
|
|
89
|
+
{
|
|
90
|
+
find: new RegExp(`^${specifier.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')}$`),
|
|
91
|
+
replacement: requireFromPackage.resolve(specifier),
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
} catch {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function sharedReactAliases() {
|
|
102
|
+
const specifiers = [
|
|
103
|
+
'react',
|
|
104
|
+
'react/compiler-runtime',
|
|
105
|
+
'react/jsx-dev-runtime',
|
|
106
|
+
'react/jsx-runtime',
|
|
107
|
+
'react-dom',
|
|
108
|
+
'react-dom/client',
|
|
109
|
+
'react-dom/server',
|
|
110
|
+
];
|
|
111
|
+
return specifiers.map((specifier) => {
|
|
112
|
+
return {
|
|
113
|
+
find: new RegExp(`^${specifier.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')}$`),
|
|
114
|
+
replacement: requireFromPackage.resolve(specifier),
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
49
119
|
export default defineConfig({
|
|
50
120
|
root: projectRoot,
|
|
51
121
|
srcDir: resolve(packageRoot, 'site/src'),
|
|
@@ -61,9 +131,22 @@ export default defineConfig({
|
|
|
61
131
|
plugins: [docsContentPlugin({ root: projectRoot, base })],
|
|
62
132
|
optimizeDeps: { include: [...DOCS_VITE_OPTIMIZE_DEPS] },
|
|
63
133
|
resolve: {
|
|
64
|
-
|
|
134
|
+
// Astro's virtual build entries are resolved from the consumer project
|
|
135
|
+
// root. Consumers only need the Docs package, so map Astro's exported
|
|
136
|
+
// subpaths to the installation shipped with Docs.
|
|
137
|
+
alias: [
|
|
138
|
+
...packageExportAliases(),
|
|
139
|
+
...sharedReactAliases(),
|
|
140
|
+
...astroPackageExportAliases(),
|
|
141
|
+
...packageDependencyAliases(),
|
|
142
|
+
],
|
|
65
143
|
dedupe: ['react', 'react-dom'],
|
|
66
144
|
},
|
|
145
|
+
ssr: {
|
|
146
|
+
// Bundle React peer consumers with the package-owned React runtime so
|
|
147
|
+
// static rendering does not load two copies across pnpm virtual stores.
|
|
148
|
+
noExternal: ['@terra-symposium/styling', '@terra-symposium/standards-error-boundaries'],
|
|
149
|
+
},
|
|
67
150
|
server: { fs: { allow: [projectRoot, packageRoot] } },
|
|
68
151
|
},
|
|
69
152
|
});
|