Socket
Socket
Sign inDemoInstall

@takuma-ru/auto-story-generator

Package Overview
Dependencies
47
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.10 to 0.2.11

134

dist/index.js

@@ -47,2 +47,6 @@ var __defProp = Object.defineProperty;

// Common
EC00: {
title: "Unknown error",
isCustomDetail: true
},
EC01: {

@@ -92,2 +96,7 @@ title: "Not yet supported",

},
EC11: {
title: "File is defective.",
detail: "An error occurred during abstract syntax tree parsing.\nPlease check your file for problems.",
isCustomDetail: false
},
// Lit

@@ -105,5 +114,7 @@ EL01: {

consola.error(
`\x1B[41m ${errorCode} \x1B[0m
`\x1B[41m ASG:${errorCode} \x1B[0m
${errorDefinition[errorCode].title}
\x1B[90m${detailText}\x1B[0m`
\x1B[90m${detailText}
Detail: https://auto-story-generator.takumaru.dev/errors.html \x1B[0m`
);

@@ -928,59 +939,66 @@ };

} = getComponentInfo(id);
const mod = await loadFile(id);
const project = new Project2();
const sourceFile = project.createSourceFile(fileBase || "", mod.$code);
consola3.start(`${componentName} Story file is being generated ....`);
switch (options.preset) {
case "lit": {
await genLitStoryFile({
componentName,
fileBase,
fileName,
path: id,
fileExt,
filePrefixExt,
relativeSourceFilePath,
sourceFile,
prettierConfigPath: options.prettierConfigPath
});
break;
try {
const mod = await loadFile(id);
const project = new Project2();
const sourceFile = project.createSourceFile(fileBase || "", mod.$code);
consola3.start(`${componentName} Story file is being generated ....`);
switch (options.preset) {
case "lit": {
await genLitStoryFile({
componentName,
fileBase,
fileName,
path: id,
fileExt,
filePrefixExt,
relativeSourceFilePath,
sourceFile,
prettierConfigPath: options.prettierConfigPath
});
break;
}
case "react": {
await genReactStoryFile({
componentName,
fileBase,
fileName,
path: id,
fileExt,
filePrefixExt,
relativeSourceFilePath,
sourceFile,
prettierConfigPath: options.prettierConfigPath
});
break;
}
case "vue": {
throwErr({
errorCode: "EC01"
});
break;
}
case "angular": {
throwErr({
errorCode: "EC01"
});
break;
}
case "custom": {
throwErr({
errorCode: "EC01"
});
break;
}
default: {
throwErr({
errorCode: "EC02",
detail: `Preset ${options.preset} is not supported. Please use one of the following: lit, react, vue, angular, custom`
});
}
}
case "react": {
await genReactStoryFile({
componentName,
fileBase,
fileName,
path: id,
fileExt,
filePrefixExt,
relativeSourceFilePath,
sourceFile,
prettierConfigPath: options.prettierConfigPath
});
break;
}
case "vue": {
throwErr({
errorCode: "EC01"
});
break;
}
case "angular": {
throwErr({
errorCode: "EC01"
});
break;
}
case "custom": {
throwErr({
errorCode: "EC01"
});
break;
}
default: {
throwErr({
errorCode: "EC02",
detail: `Preset ${options.preset} is not supported. Please use one of the following: lit, react, vue, angular, custom`
});
}
} catch (err) {
throwErr({
errorCode: "EC11"
});
return;
}

@@ -987,0 +1005,0 @@ },

@@ -5,3 +5,3 @@ {

"private": false,
"version": "0.2.10",
"version": "0.2.11",
"main": "./dist/index.js",

@@ -8,0 +8,0 @@ "module": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc