tinacms 0.0.0-b370466-20241010070714 → 0.0.0-bcdf830-20241023064032
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
CHANGED
|
@@ -106,19 +106,29 @@
|
|
|
106
106
|
return client;
|
|
107
107
|
}
|
|
108
108
|
const makeCacheDir = async (dir, fs) => {
|
|
109
|
-
const path =
|
|
110
|
-
const os =
|
|
111
|
-
|
|
109
|
+
const path = require("node:path");
|
|
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 =
|
|
121
|
-
|
|
129
|
+
const fs = require("node:fs");
|
|
130
|
+
console.log("fs", JSON.stringify(fs));
|
|
131
|
+
const { createHash } = require("node:crypto");
|
|
122
132
|
const cacheDir = await makeCacheDir(dir, fs);
|
|
123
133
|
return {
|
|
124
134
|
makeKey: (key) => {
|
|
@@ -149,11 +159,6 @@
|
|
|
149
159
|
__proto__: null,
|
|
150
160
|
NodeCache
|
|
151
161
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
152
|
-
const __viteBrowserExternal = {};
|
|
153
|
-
const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
154
|
-
__proto__: null,
|
|
155
|
-
default: __viteBrowserExternal
|
|
156
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
157
162
|
exports2.TINA_HOST = TINA_HOST;
|
|
158
163
|
exports2.TinaClient = TinaClient;
|
|
159
164
|
exports2.createClient = createClient;
|
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-eefc24a7.mjs");
|
|
28
28
|
this.cache = await NodeCache(this.cacheDir);
|
|
29
29
|
}
|
|
30
30
|
} catch (e) {
|
package/dist/index.js
CHANGED
|
@@ -1321,7 +1321,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1321
1321
|
React.useEffect(() => {
|
|
1322
1322
|
if (mermaidRef.current) {
|
|
1323
1323
|
mermaid.initialize({ startOnLoad: true });
|
|
1324
|
-
mermaid.
|
|
1324
|
+
mermaid.init();
|
|
1325
1325
|
}
|
|
1326
1326
|
}, [config]);
|
|
1327
1327
|
return /* @__PURE__ */ React.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
@@ -1348,7 +1348,7 @@ flowchart TD
|
|
|
1348
1348
|
--> id2(modify me to see changes!)
|
|
1349
1349
|
id2
|
|
1350
1350
|
--> id3(Click the top button to preview the changes)
|
|
1351
|
-
--> id4(Learn about mermaid diagrams
|
|
1351
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1352
1352
|
const MermaidElement = cn$1.withRef(
|
|
1353
1353
|
({ children, nodeProps, element, ...props }, ref) => {
|
|
1354
1354
|
const [mermaidConfig, setMermaidConfig] = React.useState(
|
|
@@ -1364,7 +1364,7 @@ flowchart TD
|
|
|
1364
1364
|
children: [{ type: "text", text: "" }]
|
|
1365
1365
|
};
|
|
1366
1366
|
React.useEffect(() => {
|
|
1367
|
-
if (mermaid.parse(mermaidConfig
|
|
1367
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1368
1368
|
setMermaidError(null);
|
|
1369
1369
|
}
|
|
1370
1370
|
}, [mermaidConfig]);
|
|
@@ -10308,7 +10308,7 @@ flowchart TD
|
|
|
10308
10308
|
"Event Log"
|
|
10309
10309
|
));
|
|
10310
10310
|
};
|
|
10311
|
-
const version = "2.
|
|
10311
|
+
const version = "2.3.0";
|
|
10312
10312
|
const Nav = ({
|
|
10313
10313
|
isLocalMode,
|
|
10314
10314
|
className = "",
|
|
@@ -13827,6 +13827,7 @@ flowchart TD
|
|
|
13827
13827
|
"Unordered List",
|
|
13828
13828
|
"Ordered List",
|
|
13829
13829
|
"Quote",
|
|
13830
|
+
"Mermaid",
|
|
13830
13831
|
"Heading 1",
|
|
13831
13832
|
"Heading 2",
|
|
13832
13833
|
"Heading 3",
|
package/dist/index.mjs
CHANGED
|
@@ -1348,7 +1348,7 @@ const MermaidElementWithRef = ({ config }) => {
|
|
|
1348
1348
|
useEffect(() => {
|
|
1349
1349
|
if (mermaidRef.current) {
|
|
1350
1350
|
mermaid.initialize({ startOnLoad: true });
|
|
1351
|
-
mermaid.
|
|
1351
|
+
mermaid.init();
|
|
1352
1352
|
}
|
|
1353
1353
|
}, [config]);
|
|
1354
1354
|
return /* @__PURE__ */ React__default.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React__default.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React__default.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
@@ -1375,7 +1375,7 @@ flowchart TD
|
|
|
1375
1375
|
--> id2(modify me to see changes!)
|
|
1376
1376
|
id2
|
|
1377
1377
|
--> id3(Click the top button to preview the changes)
|
|
1378
|
-
--> id4(Learn about mermaid diagrams
|
|
1378
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1379
1379
|
const MermaidElement = withRef(
|
|
1380
1380
|
({ children, nodeProps, element, ...props }, ref) => {
|
|
1381
1381
|
const [mermaidConfig, setMermaidConfig] = useState(
|
|
@@ -1391,7 +1391,7 @@ const MermaidElement = withRef(
|
|
|
1391
1391
|
children: [{ type: "text", text: "" }]
|
|
1392
1392
|
};
|
|
1393
1393
|
useEffect(() => {
|
|
1394
|
-
if (mermaid.parse(mermaidConfig
|
|
1394
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1395
1395
|
setMermaidError(null);
|
|
1396
1396
|
}
|
|
1397
1397
|
}, [mermaidConfig]);
|
|
@@ -10335,7 +10335,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10335
10335
|
"Event Log"
|
|
10336
10336
|
));
|
|
10337
10337
|
};
|
|
10338
|
-
const version = "2.
|
|
10338
|
+
const version = "2.3.0";
|
|
10339
10339
|
const Nav = ({
|
|
10340
10340
|
isLocalMode,
|
|
10341
10341
|
className = "",
|
|
@@ -13854,6 +13854,7 @@ const unsupportedItemsInTable = /* @__PURE__ */ new Set([
|
|
|
13854
13854
|
"Unordered List",
|
|
13855
13855
|
"Ordered List",
|
|
13856
13856
|
"Quote",
|
|
13857
|
+
"Mermaid",
|
|
13857
13858
|
"Heading 1",
|
|
13858
13859
|
"Heading 2",
|
|
13859
13860
|
"Heading 3",
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
const makeCacheDir = async (dir, fs) => {
|
|
2
|
-
const path =
|
|
3
|
-
const os =
|
|
4
|
-
|
|
2
|
+
const path = require("node:path");
|
|
3
|
+
const os = require("node:os");
|
|
4
|
+
if (typeof dir !== "string" || !dir.trim()) {
|
|
5
|
+
throw new Error("Invalid directory path");
|
|
6
|
+
}
|
|
7
|
+
console.log("Path sep", path.sep);
|
|
8
|
+
const pathParts = dir.split(path.sep);
|
|
9
|
+
const cacheHash = pathParts[pathParts.length - 1];
|
|
5
10
|
let cacheDir = dir;
|
|
6
|
-
if (!fs.existsSync(
|
|
7
|
-
cacheDir = path.join(os.tmpdir(),
|
|
11
|
+
if (!fs.existsSync(dir)) {
|
|
12
|
+
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
16
|
+
} catch (error) {
|
|
17
|
+
throw new Error(`Failed to create cache directory: ${error.message}`);
|
|
8
18
|
}
|
|
9
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
10
19
|
return cacheDir;
|
|
11
20
|
};
|
|
12
21
|
const NodeCache = async (dir) => {
|
|
13
|
-
const fs =
|
|
14
|
-
|
|
22
|
+
const fs = require("node:fs");
|
|
23
|
+
console.log("fs", JSON.stringify(fs));
|
|
24
|
+
const { createHash } = require("node:crypto");
|
|
15
25
|
const cacheDir = await makeCacheDir(dir, fs);
|
|
16
26
|
return {
|
|
17
27
|
makeKey: (key) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-bcdf830-20241023064032",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"lodash.get": "^4.4.2",
|
|
109
109
|
"lodash.set": "^4.3.2",
|
|
110
110
|
"lucide-react": "^0.424.0",
|
|
111
|
-
"mermaid": "
|
|
111
|
+
"mermaid": "9.3.0",
|
|
112
112
|
"moment": "2.29.4",
|
|
113
113
|
"monaco-editor": "0.31.0",
|
|
114
114
|
"prism-react-renderer": "^2.4.0",
|
|
@@ -129,9 +129,9 @@
|
|
|
129
129
|
"webfontloader": "1.6.28",
|
|
130
130
|
"yup": "^1.4.0",
|
|
131
131
|
"zod": "^3.23.8",
|
|
132
|
-
"@tinacms/mdx": "
|
|
133
|
-
"@tinacms/
|
|
134
|
-
"@tinacms/
|
|
132
|
+
"@tinacms/mdx": "1.5.0",
|
|
133
|
+
"@tinacms/search": "1.0.33",
|
|
134
|
+
"@tinacms/schema-tools": "1.6.6"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@graphql-tools/utils": "^10.5.4",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"typescript": "^5.6.2",
|
|
165
165
|
"vite": "^5.4.8",
|
|
166
166
|
"vitest": "^2.1.1",
|
|
167
|
-
"@tinacms/scripts": "
|
|
167
|
+
"@tinacms/scripts": "1.3.0"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"react": ">=16.14.0",
|