Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mintlify/prebuild

Package Overview
Dependencies
Maintainers
3
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mintlify/prebuild - npm Package Compare versions

Comparing version 1.0.100 to 1.0.101

23

dist/prebuild/categorizeFiles.js
import { openApiCheck } from '@mintlify/common';
import { readFile } from 'fs/promises';
import yaml from 'js-yaml';
import * as path from 'path';

@@ -30,11 +32,16 @@ import { getFileList } from '../fs/index.js';

case 'yml':
const doc = await openApiCheck(path.join(contentDirectoryPath, filename));
if (!doc) {
break;
try {
// we need to read from the fs so we can store the original spec
const str = await readFile(path.join(contentDirectoryPath, filename), 'utf8');
const obj = extension === 'json' ? JSON.parse(str) : yaml.load(str);
// openApiCheck modifies the spec in place - copy before
if (!(await openApiCheck(structuredClone(obj))))
break;
const fileName = path.parse(filename).base;
openApiFiles.push({
filename: fileName.substring(0, fileName.lastIndexOf('.')),
spec: obj,
});
}
const fileName = path.parse(filename).base;
openApiFiles.push({
filename: fileName.substring(0, fileName.lastIndexOf('.')),
spec: doc,
});
catch { } // not an openapi spec
break;

@@ -41,0 +48,0 @@ default:

@@ -1,3 +0,2 @@

import SwaggerParser from '@apidevtools/swagger-parser';
import { hasImports, findAndRemoveImports } from '@mintlify/common';
import { hasImports, findAndRemoveImports, openApiCheck } from '@mintlify/common';
import { promises as _promises } from 'fs';

@@ -101,4 +100,4 @@ import { outputFile } from 'fs-extra';

mintConfig.openapi.startsWith('http')) {
try {
const specFromUrl = await SwaggerParser.validate(mintConfig.openapi);
const specFromUrl = await openApiCheck(mintConfig.openapi, true);
if (specFromUrl) {
this.openApiFiles.push({

@@ -109,4 +108,4 @@ filename: 'openapi-from-url',

}
catch (e) {
console.log("OpenApi file couldn't be downloaded from url.", e);
else {
console.log("OpenApi file couldn't be downloaded from url.");
}

@@ -113,0 +112,0 @@ }

{
"name": "@mintlify/prebuild",
"type": "module",
"version": "1.0.100",
"version": "1.0.101",
"description": "Helpful functions for Mintlify's prebuild step",

@@ -45,3 +45,3 @@ "author": "Mintlify, Inc.",

"@apidevtools/swagger-parser": "10.x",
"@mintlify/common": "1.0.34",
"@mintlify/common": "1.0.35",
"@mintlify/validation": "0.1.113",

@@ -52,2 +52,3 @@ "favicons": "^7.0.2",

"is-absolute-url": "^4.0.1",
"js-yaml": "^4.1.0",
"openapi-types": "12.x",

@@ -76,3 +77,3 @@ "unist-util-visit": "^4.1.1"

},
"gitHead": "313ee51ddee037b95d495b16bd3df1c8d309143a"
"gitHead": "fbfceeb3e1431daa3d192dd980436fa8aa3f1716"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc