specra 0.2.61 → 0.2.62
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/mdx-cache.js +10 -4
- package/package.json +5 -1
package/dist/mdx-cache.js
CHANGED
|
@@ -7,8 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { getVersions, getAllDocs, getDocBySlug } from './mdx';
|
|
9
9
|
import { clearProductCaches } from './config.server';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Default imports (member access) rather than named imports: under a
|
|
11
|
+
// browser/static build these node builtins are externalized, and named imports
|
|
12
|
+
// (`{ join }`) fail the client bundle with "not exported by
|
|
13
|
+
// __vite-browser-external". Member access (`path.join`) defers to runtime and
|
|
14
|
+
// is dead code client-side, since these caches only run server-side. Matches
|
|
15
|
+
// the import style in mdx.ts / config.server.ts / category.ts.
|
|
16
|
+
import fs from 'fs';
|
|
17
|
+
import path from 'path';
|
|
12
18
|
import { PerfTimer, logCacheOperation } from './dev-utils';
|
|
13
19
|
const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';
|
|
14
20
|
// Cache stores
|
|
@@ -30,9 +36,9 @@ function initializeWatchers() {
|
|
|
30
36
|
if (!isDevelopment || watchersInitialized)
|
|
31
37
|
return;
|
|
32
38
|
watchersInitialized = true;
|
|
33
|
-
const docsPath = join(process.cwd(), 'docs');
|
|
39
|
+
const docsPath = path.join(process.cwd(), 'docs');
|
|
34
40
|
try {
|
|
35
|
-
watch(docsPath, { recursive: true }, (eventType, filename) => {
|
|
41
|
+
fs.watch(docsPath, { recursive: true }, (eventType, filename) => {
|
|
36
42
|
if (!filename)
|
|
37
43
|
return;
|
|
38
44
|
// Invalidate relevant caches when MDX or JSON files change
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specra",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.62",
|
|
4
4
|
"description": "A modern documentation library for SvelteKit with built-in versioning, API reference generation, full-text search, and MDX support",
|
|
5
5
|
"svelte": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css",
|
|
10
|
+
"**/*.svelte"
|
|
11
|
+
],
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"types": "./dist/index.d.ts",
|