Skip to content

Commit

Permalink
chore: clear the clutter, rename files, move files
Browse files Browse the repository at this point in the history
Changes:

- cleared out the unnecessary files
- move files to appropriate location
- rename files to be more meaningful
  • Loading branch information
AnimeshKumar923 committed Jun 16, 2024
1 parent 8534ae3 commit 9c82ffa
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 1,818 deletions.
File renamed without changes.
576 changes: 0 additions & 576 deletions scripts/validation/base-document.json

This file was deleted.

336 changes: 0 additions & 336 deletions scripts/validation/base-document.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { Parser } = require('@asyncapi/parser');
const parser = new Parser();

// Read the markdown file
const markdownContent = fs.readFileSync('../../../spec/asyncapi.md', 'utf8');
const markdownContent = fs.readFileSync('../../spec/asyncapi.md', 'utf8');

// Function to extract comments with example metadata
function extractComments(content) {
Expand Down Expand Up @@ -148,7 +148,7 @@ const validationPromises = []; // Array to store all validation promises
combinedData.forEach((item, index) => {
const baseDocPath = item.name && item.name.includes("Security Scheme Object")
? 'base-doc-security-scheme-object.json'
: 'ex-base-doc.json';
: 'base-doc.json';
// use this line for final version
// const outputPath = `./updated-docs/${item.name}.json`;

Expand Down Expand Up @@ -254,7 +254,7 @@ async function deleteFolderRecursive(dir) {
// console.log(JSON.stringify(combinedData, null, 2));
console.log(`\nNumber of examples extracted: ${combinedData.length}`);

fs.writeFileSync(`extracted-examples.json`, JSON.stringify(combinedData, null, 2), 'utf8');
// fs.writeFileSync(`extracted-examples.json`, JSON.stringify(combinedData, null, 2), 'utf8');

let num = 43;
const currentExample = JSON.stringify(combinedData[num-1], null, 2);
Expand All @@ -265,7 +265,7 @@ console.log(`\nexample ${num} = ${currentExample} `)
Promise.all(validationPromises)
.then(() => {
// All validations are complete, delete the folder
// deleteFolderRecursive(outputDir);
deleteFolderRecursive(outputDir);
})
.catch((error) => {
console.error('Error during validations:', error);
Expand Down
Loading

0 comments on commit 9c82ffa

Please sign in to comment.