@storybook/preset-svelte-webpack
Advanced tools
Comparing version 0.0.0-pr-28768-sha-9b4d61ce to 0.0.0-pr-28768-sha-be894e9d
@@ -1,3 +0,3 @@ | ||
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var svelte_docgen_loader_exports={};__export(svelte_docgen_loader_exports,{default:()=>svelteDocgen});module.exports=__toCommonJS(svelte_docgen_loader_exports);var import_sveltedoc_parser=__toESM(require("sveltedoc-parser")),import_ts_dedent=require("ts-dedent"),path=__toESM(require("path")),fs=__toESM(require("fs")),import_compiler=require("svelte/compiler"),import_node_logger=require("storybook/internal/node-logger"),svelteDocParserOptions=require("sveltedoc-parser/lib/options.js");svelteDocParserOptions.getAstDefaultOptions=()=>({range:!0,loc:!0,comment:!0,tokens:!0,ecmaVersion:12,sourceType:"module",ecmaFeatures:{}});function getNameFromFilename(filename){if(!filename)return null;let parts=filename.split(/[/\\]/).map(encodeURI);if(parts.length>1){let index_match=parts[parts.length-1].match(/^index(\.\w+)/);index_match&&(parts.pop(),parts[parts.length-1]+=index_match[1])}let value=parts.pop();if(!value)throw new Error(`Could not derive component name from file ${filename}`);let base=value.replace(/%/g,"u").replace(/\.[^.]+$/,"").replace(/[^a-zA-Z_$0-9]+/g,"_").replace(/^_/,"").replace(/_$/,"").replace(/^(\d)/,"_$1");if(!base)throw new Error(`Could not derive component name from file ${filename}`);return base[0].toUpperCase()+base.slice(1)}async function svelteDocgen(source){let{resource}=this._module,svelteOptions=this.getOptions(),{preprocess:preprocessOptions,logDocgen=!1}=svelteOptions,docOptions;if(preprocessOptions){let src=fs.readFileSync(resource).toString(),{code:fileContent}=await(0,import_compiler.preprocess)(src,preprocessOptions);docOptions={fileContent}}else docOptions={filename:resource};let options={...docOptions,version:3},docgen="",componentDoc;try{componentDoc=await import_sveltedoc_parser.default.parse(options)}catch(error){componentDoc={keywords:[],data:[]},logDocgen&&import_node_logger.logger.error(error)}let file=path.basename(resource);componentDoc.name=path.basename(file);let componentName=getNameFromFilename(resource);return docgen=import_ts_dedent.dedent` | ||
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var svelte_docgen_loader_exports={};__export(svelte_docgen_loader_exports,{default:()=>svelteDocgen});module.exports=__toCommonJS(svelte_docgen_loader_exports);var import_node_logger=require("storybook/internal/node-logger"),fs=__toESM(require("fs")),path=__toESM(require("path")),import_compiler=require("svelte/compiler"),import_sveltedoc_parser=__toESM(require("sveltedoc-parser")),import_ts_dedent=require("ts-dedent"),svelteDocParserOptions=require("sveltedoc-parser/lib/options.js");svelteDocParserOptions.getAstDefaultOptions=()=>({range:!0,loc:!0,comment:!0,tokens:!0,ecmaVersion:12,sourceType:"module",ecmaFeatures:{}});function getNameFromFilename(filename){if(!filename)return null;let parts=filename.split(/[/\\]/).map(encodeURI);if(parts.length>1){let index_match=parts[parts.length-1].match(/^index(\.\w+)/);index_match&&(parts.pop(),parts[parts.length-1]+=index_match[1])}let value=parts.pop();if(!value)throw new Error(`Could not derive component name from file ${filename}`);let base=value.replace(/%/g,"u").replace(/\.[^.]+$/,"").replace(/[^a-zA-Z_$0-9]+/g,"_").replace(/^_/,"").replace(/_$/,"").replace(/^(\d)/,"_$1");if(!base)throw new Error(`Could not derive component name from file ${filename}`);return base[0].toUpperCase()+base.slice(1)}async function svelteDocgen(source){let{resource}=this._module,svelteOptions=this.getOptions(),{preprocess:preprocessOptions,logDocgen=!1}=svelteOptions,docOptions;if(preprocessOptions){let src=fs.readFileSync(resource).toString(),{code:fileContent}=await(0,import_compiler.preprocess)(src,preprocessOptions);docOptions={fileContent}}else docOptions={filename:resource};let options={...docOptions,version:3},docgen="",componentDoc;try{componentDoc=await import_sveltedoc_parser.default.parse(options)}catch(error){componentDoc={keywords:[],data:[]},logDocgen&&import_node_logger.logger.error(error)}let file=path.basename(resource);componentDoc.name=path.basename(file);let componentName=getNameFromFilename(resource);return docgen=import_ts_dedent.dedent` | ||
${componentName}.__docgen = ${JSON.stringify(componentDoc)}; | ||
`,source+docgen} |
{ | ||
"name": "@storybook/preset-svelte-webpack", | ||
"version": "0.0.0-pr-28768-sha-9b4d61ce", | ||
"version": "0.0.0-pr-28768-sha-be894e9d", | ||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", | ||
@@ -63,7 +63,7 @@ "keywords": [ | ||
"scripts": { | ||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts", | ||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts" | ||
"check": "jiti ../../../scripts/prepare/check.ts", | ||
"prep": "jiti ../../../scripts/prepare/bundle.ts" | ||
}, | ||
"dependencies": { | ||
"@storybook/core-webpack": "0.0.0-pr-28768-sha-9b4d61ce", | ||
"@storybook/core-webpack": "0.0.0-pr-28768-sha-be894e9d", | ||
"sveltedoc-parser": "^4.2.1", | ||
@@ -78,3 +78,3 @@ "ts-dedent": "^2.0.0" | ||
"peerDependencies": { | ||
"storybook": "^0.0.0-pr-28768-sha-9b4d61ce", | ||
"storybook": "^0.0.0-pr-28768-sha-be894e9d", | ||
"svelte": "^4.0.0 || ^5.0.0-next.65", | ||
@@ -81,0 +81,0 @@ "svelte-loader": "*" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13887
+ Added@storybook/core-webpack@0.0.0-pr-28768-sha-be894e9d(transitive)
+ Added@types/node@22.5.4(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@storybook/core-webpack@0.0.0-pr-28768-sha-9b4d61ce(transitive)
- Removed@types/node@18.19.50(transitive)
- Removedundici-types@5.26.5(transitive)