New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More →
Socket
Sign inDemoInstall
Socket

create-vitebook

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-vitebook - npm Package Compare versions

Comparing version 0.22.0 to 0.23.0

45

bin/create-vitebook.js

@@ -81,4 +81,2 @@ #!/usr/bin/env node

console.log(targetDir);
const builder = new ProjectBuilder({

@@ -223,2 +221,45 @@ targetDir,

if (builder.hasFeature('markdown')) {
let ext = '.js';
let viteFileContent = builder.dirs.dest.root.readFile('vite.config.js');
if (viteFileContent.length === 0) {
ext = '.ts';
viteFileContent = builder.dirs.dest.root.readFile('vite.config.ts');
}
let frameworkPluginName = '@sveltejs/vite-plugin-svelte';
let includeStatement = `\n{\n ${kleur.bold(
"extensions: ['.svelte', '.md']",
)}\n}`;
switch (builder.framework) {
case 'vue':
frameworkPluginName = '@vitejs/plugin-vue';
includeStatement = `\n{\n ${kleur.bold('include: /\\.(md|vue)$/')}\n}`;
break;
case 'preact':
frameworkPluginName = '@preact/preset-vite';
includeStatement = `\n{\n ${kleur.bold(
'include: /\\.([j|t]sx?|md)$/',
)}\n}`;
break;
}
const hasOwnFrameworkPlugin = viteFileContent.includes(frameworkPluginName);
if (hasOwnFrameworkPlugin) {
console.warn(
kleur.yellow(
`\nDetected ${kleur.bold(frameworkPluginName)} in ${kleur.bold(
`vite.config${ext}`,
)}`,
),
'\n\nTo complete adding markdown support, add the following line to the plugin options:\n',
includeStatement,
'\n\n',
);
}
}
// -------------------------------------------------------------------------------------------

@@ -225,0 +266,0 @@ // Configuration File

2

package.json
{
"name": "create-vitebook",
"version": "0.22.0",
"version": "0.23.0",
"keywords": [

@@ -5,0 +5,0 @@ "alternative",

@@ -46,2 +46,10 @@ // @ts-check

* @param {string} filePath
*/
readFile(filePath) {
const path = this.resolve(filePath);
return fs.existsSync(path) ? fs.readFileSync(path).toString() : '';
}
/**
* @param {string} filePath
* @param {string} content

@@ -48,0 +56,0 @@ * @param {{ overwrite?: boolean }} [options]

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