docusaurus-plugin-openapi-docs 0.0.0-beta.722 → 0.0.0-beta.724

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/lib/index.js CHANGED
@@ -333,11 +333,7 @@ custom_edit_url: null
333
333
  cwd: path_1.default.resolve(apiDir),
334
334
  deep: 1,
335
335
  });
336
- const schemaMdxFiles = await (0, utils_1.Globby)(["*.schema.mdx"], {
337
- cwd: path_1.default.resolve(apiDir, "schemas"),
338
- deep: 1,
339
- });
340
- const sidebarFile = await (0, utils_1.Globby)(["sidebar.js"], {
336
+ const sidebarFile = await (0, utils_1.Globby)(["sidebar.js", "sidebar.ts"], {
341
337
  cwd: path_1.default.resolve(apiDir),
342
338
  deep: 1,
343
339
  });
@@ -349,14 +345,15 @@ custom_edit_url: null
349
345
  console.log(chalk_1.default.green(`Cleanup succeeded for "${apiDir}/${mdx}"`));
350
346
  }
351
347
  }));
352
- schemaMdxFiles.map((mdx) => fs_1.default.unlink(`${apiDir}/schemas/${mdx}`, (err) => {
353
- if (err) {
354
- console.error(chalk_1.default.red(`Cleanup failed for "${apiDir}/schemas/${mdx}"`), chalk_1.default.yellow(err));
355
- }
356
- else {
357
- console.log(chalk_1.default.green(`Cleanup succeeded for "${apiDir}/schemas/${mdx}"`));
348
+ try {
349
+ fs_1.default.rmSync(`${apiDir}/schemas`, { recursive: true });
350
+ console.log(chalk_1.default.green(`Cleanup succeeded for "${apiDir}/schemas"`));
351
+ }
352
+ catch (err) {
353
+ if (err.code !== "ENOENT") {
354
+ console.error(chalk_1.default.red(`Cleanup failed for "${apiDir}/schemas"`), chalk_1.default.yellow(err));
358
355
  }
359
- }));
356
+ }
360
357
  sidebarFile.map((sidebar) => fs_1.default.unlink(`${apiDir}/${sidebar}`, (err) => {
361
358
  if (err) {
362
359
  console.error(chalk_1.default.red(`Cleanup failed for "${apiDir}/${sidebar}"`), chalk_1.default.yellow(err));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-openapi-docs",
3
3
  "description": "OpenAPI plugin for Docusaurus.",
4
- "version": "0.0.0-beta.722",
4
+ "version": "0.0.0-beta.724",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=14"
64
64
  },
65
- "gitHead": "cae8c487b81918ef2cab2c7338deaae407b4dc2b"
65
+ "gitHead": "76903beba80972a5bcd88c74a33dc5e4bbbaa631"
66
66
  }
package/src/index.ts CHANGED
@@ -476,11 +476,7 @@ custom_edit_url: null
476
476
  cwd: path.resolve(apiDir),
477
477
  deep: 1,
478
478
  });
479
- const schemaMdxFiles = await Globby(["*.schema.mdx"], {
480
- cwd: path.resolve(apiDir, "schemas"),
481
- deep: 1,
482
- });
483
- const sidebarFile = await Globby(["sidebar.js"], {
479
+ const sidebarFile = await Globby(["sidebar.js", "sidebar.ts"], {
484
480
  cwd: path.resolve(apiDir),
485
481
  deep: 1,
486
482
  });
@@ -497,20 +493,17 @@ custom_edit_url: null
497
493
  })
498
494
  );
499
495
 
500
- schemaMdxFiles.map((mdx) =>
501
- fs.unlink(`${apiDir}/schemas/${mdx}`, (err) => {
502
- if (err) {
503
- console.error(
504
- chalk.red(`Cleanup failed for "${apiDir}/schemas/${mdx}"`),
505
- chalk.yellow(err)
506
- );
507
- } else {
508
- console.log(
509
- chalk.green(`Cleanup succeeded for "${apiDir}/schemas/${mdx}"`)
510
- );
511
- }
512
- })
513
- );
496
+ try {
497
+ fs.rmSync(`${apiDir}/schemas`, { recursive: true });
498
+ console.log(chalk.green(`Cleanup succeeded for "${apiDir}/schemas"`));
499
+ } catch (err: any) {
500
+ if (err.code !== "ENOENT") {
501
+ console.error(
502
+ chalk.red(`Cleanup failed for "${apiDir}/schemas"`),
503
+ chalk.yellow(err)
504
+ );
505
+ }
506
+ }
514
507
 
515
508
  sidebarFile.map((sidebar) =>
516
509
  fs.unlink(`${apiDir}/${sidebar}`, (err) => {