tinacms 3.8.4 → 3.9.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/dist/client.js CHANGED
@@ -126,6 +126,15 @@ function replaceGithubPathSplit(url, replacement) {
126
126
  return url;
127
127
  }
128
128
  }
129
+ function isEdgeRuntimeWithoutFs() {
130
+ if (typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers") {
131
+ return true;
132
+ }
133
+ if (typeof globalThis.EdgeRuntime !== "undefined") {
134
+ return true;
135
+ }
136
+ return false;
137
+ }
129
138
  var TinaClient = class {
130
139
  apiUrl;
131
140
  readonlyToken;
@@ -135,25 +144,28 @@ var TinaClient = class {
135
144
  cacheLock;
136
145
  cacheDir;
137
146
  cache;
147
+ cacheEnabled;
138
148
  constructor({
139
149
  token,
140
150
  url,
141
151
  queries,
142
152
  errorPolicy,
143
- cacheDir
153
+ cacheDir,
154
+ cache
144
155
  }) {
145
156
  this.apiUrl = url;
146
157
  this.readonlyToken = token?.trim();
147
158
  this.queries = queries(this);
148
159
  this.errorPolicy = errorPolicy || "throw";
149
160
  this.cacheDir = cacheDir || "";
161
+ this.cacheEnabled = cache !== false;
150
162
  }
151
163
  async init() {
152
164
  if (this.initialized) {
153
165
  return;
154
166
  }
155
167
  try {
156
- if (this.cacheDir && typeof window === "undefined") {
168
+ if (this.cacheEnabled && this.cacheDir && typeof window === "undefined" && !isEdgeRuntimeWithoutFs()) {
157
169
  const { NodeCache: NodeCache2 } = await Promise.resolve().then(() => (init_node_cache(), node_cache_exports));
158
170
  this.cache = await NodeCache2(this.cacheDir);
159
171
  if (this.cache) {
package/dist/index.d.ts CHANGED
@@ -23,10 +23,6 @@ export { NAMER, resolveField } from '@tinacms/schema-tools';
23
23
  export type { LoginScreenProps, LoginStrategy } from '@tinacms/schema-tools';
24
24
  import { TinaSchema, TinaField, Config, Schema, Collection, Template } from '@tinacms/schema-tools';
25
25
  export type { Config, Schema, Collection, Template, TinaField, TinaSchema };
26
- /**
27
- * @deprecated use `TinaField` instead
28
- */
29
- export type TinaFieldEnriched = TinaField;
30
26
  /**
31
27
  * @deprecated use `TinaField` instead
32
28
  */