tinacms 0.0.0-8eeb2df-20241010045955 → 0.0.0-9b91b31-20241023063504
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/client.js +16 -6
- package/dist/client.mjs +1 -1
- package/dist/index.js +1659 -1492
- package/dist/index.mjs +1492 -1324
- package/dist/{node-cache-7fa2452c.mjs → node-cache-2dadfb7c.mjs} +16 -6
- package/dist/rich-text/index.d.ts +3 -0
- package/dist/rich-text/index.js +3 -1
- package/dist/rich-text/index.mjs +3 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +11 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/text-area.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +4 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +10 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +1 -1
- package/package.json +6 -5
package/dist/client.js
CHANGED
|
@@ -107,17 +107,27 @@
|
|
|
107
107
|
}
|
|
108
108
|
const makeCacheDir = async (dir, fs) => {
|
|
109
109
|
const path = await Promise.resolve().then(() => __viteBrowserExternal$1);
|
|
110
|
-
const os =
|
|
111
|
-
|
|
110
|
+
const os = require("node:os");
|
|
111
|
+
if (typeof dir !== "string" || !dir.trim()) {
|
|
112
|
+
throw new Error("Invalid directory path");
|
|
113
|
+
}
|
|
114
|
+
console.log("Path sep", path.sep);
|
|
115
|
+
const pathParts = dir.split(path.sep);
|
|
116
|
+
const cacheHash = pathParts[pathParts.length - 1];
|
|
112
117
|
let cacheDir = dir;
|
|
113
|
-
if (!fs.existsSync(
|
|
114
|
-
cacheDir = path.join(os.tmpdir(),
|
|
118
|
+
if (!fs.existsSync(dir)) {
|
|
119
|
+
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
123
|
+
} catch (error) {
|
|
124
|
+
throw new Error(`Failed to create cache directory: ${error.message}`);
|
|
115
125
|
}
|
|
116
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
117
126
|
return cacheDir;
|
|
118
127
|
};
|
|
119
128
|
const NodeCache = async (dir) => {
|
|
120
|
-
const fs =
|
|
129
|
+
const fs = require("node:fs");
|
|
130
|
+
console.log("fs", JSON.stringify(fs));
|
|
121
131
|
const { createHash } = await Promise.resolve().then(() => __viteBrowserExternal$1);
|
|
122
132
|
const cacheDir = await makeCacheDir(dir, fs);
|
|
123
133
|
return {
|
package/dist/client.mjs
CHANGED
|
@@ -24,7 +24,7 @@ class TinaClient {
|
|
|
24
24
|
}
|
|
25
25
|
try {
|
|
26
26
|
if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
|
|
27
|
-
const { NodeCache } = await import("./node-cache-
|
|
27
|
+
const { NodeCache } = await import("./node-cache-2dadfb7c.mjs");
|
|
28
28
|
this.cache = await NodeCache(this.cacheDir);
|
|
29
29
|
}
|
|
30
30
|
} catch (e) {
|