@tinacms/graphql 0.0.0-20231016210313 → 0.0.0-20231017141104
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/index.js +38 -34
- package/dist/index.mjs +38 -34
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3347,40 +3347,44 @@ ${$_body}`,
|
|
|
3347
3347
|
};
|
|
3348
3348
|
var parseFile = (content, format, yupSchema, markdownParseConfig) => {
|
|
3349
3349
|
var _a, _b;
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3350
|
+
try {
|
|
3351
|
+
switch (format) {
|
|
3352
|
+
case ".markdown":
|
|
3353
|
+
case ".mdx":
|
|
3354
|
+
case ".md":
|
|
3355
|
+
const contentJSON = (0, import_gray_matter.default)(content || "", {
|
|
3356
|
+
language: (_a = markdownParseConfig == null ? void 0 : markdownParseConfig.frontmatterFormat) != null ? _a : "yaml",
|
|
3357
|
+
delimiters: (_b = markdownParseConfig == null ? void 0 : markdownParseConfig.frontmatterDelimiters) != null ? _b : "---",
|
|
3358
|
+
engines: matterEngines
|
|
3359
|
+
});
|
|
3360
|
+
const markdownData = {
|
|
3361
|
+
...contentJSON.data,
|
|
3362
|
+
$_body: contentJSON.content
|
|
3363
|
+
};
|
|
3364
|
+
assertShape(markdownData, yupSchema);
|
|
3365
|
+
return markdownData;
|
|
3366
|
+
case ".json":
|
|
3367
|
+
if (!content) {
|
|
3368
|
+
return {};
|
|
3369
|
+
}
|
|
3370
|
+
return JSON.parse(content);
|
|
3371
|
+
case ".toml":
|
|
3372
|
+
if (!content) {
|
|
3373
|
+
return {};
|
|
3374
|
+
}
|
|
3375
|
+
return import_toml.default.parse(content);
|
|
3376
|
+
case ".yaml":
|
|
3377
|
+
case ".yml":
|
|
3378
|
+
if (!content) {
|
|
3379
|
+
return {};
|
|
3380
|
+
}
|
|
3381
|
+
return import_js_yaml.default.safeLoad(content);
|
|
3382
|
+
}
|
|
3383
|
+
} catch (e) {
|
|
3384
|
+
console.error(e);
|
|
3385
|
+
throw e;
|
|
3383
3386
|
}
|
|
3387
|
+
throw new Error(`Must specify a valid format, got ${format}`);
|
|
3384
3388
|
};
|
|
3385
3389
|
var scanAllContent = async (tinaSchema, bridge, callback) => {
|
|
3386
3390
|
const warnings = [];
|
|
@@ -6004,7 +6008,7 @@ var _indexContent = async (database, level, documentPaths, enqueueOps, collectio
|
|
|
6004
6008
|
const tinaSchema = await database.getSchema();
|
|
6005
6009
|
let templateInfo = null;
|
|
6006
6010
|
if (collection) {
|
|
6007
|
-
templateInfo =
|
|
6011
|
+
templateInfo = tinaSchema.getTemplatesForCollectable(collection);
|
|
6008
6012
|
}
|
|
6009
6013
|
const folderTreeBuilder = new FolderTreeBuilder();
|
|
6010
6014
|
await sequential(documentPaths, async (filepath) => {
|
package/dist/index.mjs
CHANGED
|
@@ -3283,40 +3283,44 @@ ${$_body}`,
|
|
|
3283
3283
|
}
|
|
3284
3284
|
};
|
|
3285
3285
|
var parseFile = (content, format, yupSchema, markdownParseConfig) => {
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3286
|
+
try {
|
|
3287
|
+
switch (format) {
|
|
3288
|
+
case ".markdown":
|
|
3289
|
+
case ".mdx":
|
|
3290
|
+
case ".md":
|
|
3291
|
+
const contentJSON = matter(content || "", {
|
|
3292
|
+
language: markdownParseConfig?.frontmatterFormat ?? "yaml",
|
|
3293
|
+
delimiters: markdownParseConfig?.frontmatterDelimiters ?? "---",
|
|
3294
|
+
engines: matterEngines
|
|
3295
|
+
});
|
|
3296
|
+
const markdownData = {
|
|
3297
|
+
...contentJSON.data,
|
|
3298
|
+
$_body: contentJSON.content
|
|
3299
|
+
};
|
|
3300
|
+
assertShape(markdownData, yupSchema);
|
|
3301
|
+
return markdownData;
|
|
3302
|
+
case ".json":
|
|
3303
|
+
if (!content) {
|
|
3304
|
+
return {};
|
|
3305
|
+
}
|
|
3306
|
+
return JSON.parse(content);
|
|
3307
|
+
case ".toml":
|
|
3308
|
+
if (!content) {
|
|
3309
|
+
return {};
|
|
3310
|
+
}
|
|
3311
|
+
return toml.parse(content);
|
|
3312
|
+
case ".yaml":
|
|
3313
|
+
case ".yml":
|
|
3314
|
+
if (!content) {
|
|
3315
|
+
return {};
|
|
3316
|
+
}
|
|
3317
|
+
return yaml.safeLoad(content);
|
|
3318
|
+
}
|
|
3319
|
+
} catch (e) {
|
|
3320
|
+
console.error(e);
|
|
3321
|
+
throw e;
|
|
3319
3322
|
}
|
|
3323
|
+
throw new Error(`Must specify a valid format, got ${format}`);
|
|
3320
3324
|
};
|
|
3321
3325
|
var scanAllContent = async (tinaSchema, bridge, callback) => {
|
|
3322
3326
|
const warnings = [];
|
|
@@ -5932,7 +5936,7 @@ var _indexContent = async (database, level, documentPaths, enqueueOps, collectio
|
|
|
5932
5936
|
const tinaSchema = await database.getSchema();
|
|
5933
5937
|
let templateInfo = null;
|
|
5934
5938
|
if (collection) {
|
|
5935
|
-
templateInfo =
|
|
5939
|
+
templateInfo = tinaSchema.getTemplatesForCollectable(collection);
|
|
5936
5940
|
}
|
|
5937
5941
|
const folderTreeBuilder = new FolderTreeBuilder();
|
|
5938
5942
|
await sequential(documentPaths, async (filepath) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/graphql",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20231017141104",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@iarna/toml": "^2.2.5",
|
|
27
|
-
"@tinacms/mdx": "0.0.0-
|
|
28
|
-
"@tinacms/schema-tools": "0.0.0-
|
|
27
|
+
"@tinacms/mdx": "0.0.0-20231017141104",
|
|
28
|
+
"@tinacms/schema-tools": "0.0.0-20231017141104",
|
|
29
29
|
"abstract-level": "^1.0.3",
|
|
30
30
|
"body-parser": "^1.19.0",
|
|
31
31
|
"cors": "^2.8.5",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"directory": "packages/tina-graphql"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@tinacms/schema-tools": "0.0.0-
|
|
60
|
+
"@tinacms/schema-tools": "0.0.0-20231017141104",
|
|
61
61
|
"@tinacms/scripts": "1.1.2",
|
|
62
62
|
"@types/cors": "^2.8.7",
|
|
63
63
|
"@types/estree": "^0.0.50",
|