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

@storybook/core-webpack

Package Overview
Dependencies
Maintainers
0
Versions
956
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/core-webpack - npm Package Compare versions

Comparing version 0.0.0-pr-28585-sha-af48f0d6 to 0.0.0-pr-28607-sha-54ec63fe

8

dist/index.d.ts

@@ -26,9 +26,7 @@ import { StorybookConfig as StorybookConfig$1, Options, NormalizedStoriesSpecifier } from 'storybook/internal/types';

/**
* Modify or return a custom Webpack config after the Storybook's default configuration
* has run (mostly used by addons).
* Modify or return a custom Webpack config after the Storybook's default configuration has run
* (mostly used by addons).
*/
webpack?: (config: TWebpackConfiguration, options: Options) => TWebpackConfiguration | Promise<TWebpackConfiguration>;
/**
* Modify or return a custom Webpack config after every addon has run.
*/
/** Modify or return a custom Webpack config after every addon has run. */
webpackFinal?: (config: TWebpackConfiguration, options: Options) => TWebpackConfiguration | Promise<TWebpackConfiguration>;

@@ -35,0 +33,0 @@ };

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

"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 src_exports={};__export(src_exports,{checkWebpackVersion:()=>checkWebpackVersion,loadCustomWebpackConfig:()=>loadCustomWebpackConfig,mergeConfigs:()=>mergeConfigs,toImportFn:()=>toImportFn,toImportFnPart:()=>toImportFnPart,toRequireContext:()=>toRequireContext,toRequireContextString:()=>toRequireContextString,webpackIncludeRegexp:()=>webpackIncludeRegexp});module.exports=__toCommonJS(src_exports);var import_path=__toESM(require("path")),import_common=require("storybook/internal/common"),webpackConfigs=["webpack.config","webpackfile"],loadCustomWebpackConfig=configDir=>(0,import_common.serverRequire)(webpackConfigs.map(configName=>import_path.default.resolve(configDir,configName)));var import_node_logger=require("storybook/internal/node-logger"),import_ts_dedent=require("ts-dedent"),checkWebpackVersion=(webpack,specifier,caption)=>{if(!webpack.version){import_node_logger.logger.info("Skipping webpack version check, no version available");return}webpack.version!==specifier&&import_node_logger.logger.warn(import_ts_dedent.dedent`
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __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 __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{checkWebpackVersion:()=>checkWebpackVersion,loadCustomWebpackConfig:()=>loadCustomWebpackConfig,mergeConfigs:()=>mergeConfigs,toImportFn:()=>toImportFn,toImportFnPart:()=>toImportFnPart,toRequireContext:()=>toRequireContext,toRequireContextString:()=>toRequireContextString,webpackIncludeRegexp:()=>webpackIncludeRegexp});module.exports=__toCommonJS(src_exports);var import_node_path=require("path"),import_common=require("storybook/internal/common"),webpackConfigs=["webpack.config","webpackfile"],loadCustomWebpackConfig=configDir=>(0,import_common.serverRequire)(webpackConfigs.map(configName=>(0,import_node_path.resolve)(configDir,configName)));var import_node_logger=require("storybook/internal/node-logger"),import_ts_dedent=require("ts-dedent"),checkWebpackVersion=(webpack,specifier,caption)=>{if(!webpack.version){import_node_logger.logger.info("Skipping webpack version check, no version available");return}webpack.version!==specifier&&import_node_logger.logger.warn(import_ts_dedent.dedent`
Unexpected webpack version in ${caption}:

@@ -9,3 +9,3 @@ - Received '${webpack.version}'

For more info about Webpack 5 support: https://gist.github.com/shilman/8856ea1786dcd247139b47b270912324#troubleshooting
`)};function mergePluginsField(defaultPlugins=[],customPlugins=[]){return[...defaultPlugins,...customPlugins]}function mergeRulesField(defaultRules=[],customRules=[]){return[...defaultRules,...customRules]}function mergeExtensionsField({extensions:defaultExtensions=[]},{extensions:customExtensions=[]}){return[...defaultExtensions,...customExtensions]}function mergeAliasField({alias:defaultAlias={}},{alias:customAlias={}}){return{...defaultAlias,...customAlias}}function mergeModuleField(a,b){return{...a,...b,rules:mergeRulesField(a.rules||[],b.rules||[])}}function mergeResolveField({resolve:defaultResolve={}},{resolve:customResolve={}}){return{...defaultResolve,...customResolve,alias:mergeAliasField(defaultResolve,customResolve),extensions:mergeExtensionsField(defaultResolve,customResolve)}}function mergeOptimizationField({optimization:defaultOptimization={}},{optimization:customOptimization={}}){return{...defaultOptimization,...customOptimization}}function mergeConfigs(config,customConfig){return{...customConfig,...config,devtool:customConfig.devtool||config.devtool,plugins:mergePluginsField(config.plugins,customConfig.plugins),module:mergeModuleField(config.module||{},customConfig.module||{}),resolve:mergeResolveField(config,customConfig),optimization:mergeOptimizationField(config,customConfig)}}var import_ts_dedent2=require("ts-dedent"),import_common2=require("storybook/internal/common");function importPipeline(){let importGate=Promise.resolve();return async importFn=>{await importGate;let moduleExportsPromise=importFn();return importGate=importGate.then(async()=>{await moduleExportsPromise}),moduleExportsPromise}}function adjustRegexToExcludeNodeModules(originalRegex){let originalRegexString=originalRegex.source,startsWithCaret=originalRegexString.startsWith("^"),excludeNodeModulesPattern=startsWithCaret?"(?!.*node_modules)":"^(?!.*node_modules)",adjustedRegexString=startsWithCaret?`^${excludeNodeModulesPattern}${originalRegexString.substring(1)}`:excludeNodeModulesPattern+originalRegexString;return new RegExp(adjustedRegexString)}function webpackIncludeRegexp(specifier){let{directory,files}=specifier,directoryWithoutLeadingDots=directory.replace(/^(\.+\/)+/,"/"),webpackIncludeGlob=[".",".."].includes(directory)?files:`${directoryWithoutLeadingDots}/${files}`,webpackIncludeRegexpWithCaret=webpackIncludeGlob.includes("node_modules")?(0,import_common2.globToRegexp)(webpackIncludeGlob):adjustRegexToExcludeNodeModules((0,import_common2.globToRegexp)(webpackIncludeGlob));return new RegExp(webpackIncludeRegexpWithCaret.source.replace(/^\^/,""))}function toImportFnPart(specifier){let{directory,importPathMatcher}=specifier;return import_ts_dedent2.dedent`
`)};function mergePluginsField(defaultPlugins=[],customPlugins=[]){return[...defaultPlugins,...customPlugins]}function mergeRulesField(defaultRules=[],customRules=[]){return[...defaultRules,...customRules]}function mergeExtensionsField({extensions:defaultExtensions=[]},{extensions:customExtensions=[]}){return[...defaultExtensions,...customExtensions]}function mergeAliasField({alias:defaultAlias={}},{alias:customAlias={}}){return{...defaultAlias,...customAlias}}function mergeModuleField(a,b){return{...a,...b,rules:mergeRulesField(a.rules||[],b.rules||[])}}function mergeResolveField({resolve:defaultResolve={}},{resolve:customResolve={}}){return{...defaultResolve,...customResolve,alias:mergeAliasField(defaultResolve,customResolve),extensions:mergeExtensionsField(defaultResolve,customResolve)}}function mergeOptimizationField({optimization:defaultOptimization={}},{optimization:customOptimization={}}){return{...defaultOptimization,...customOptimization}}function mergeConfigs(config,customConfig){return{...customConfig,...config,devtool:customConfig.devtool||config.devtool,plugins:mergePluginsField(config.plugins,customConfig.plugins),module:mergeModuleField(config.module||{},customConfig.module||{}),resolve:mergeResolveField(config,customConfig),optimization:mergeOptimizationField(config,customConfig)}}var import_common2=require("storybook/internal/common"),import_ts_dedent2=require("ts-dedent");function importPipeline(){let importGate=Promise.resolve();return async importFn=>{await importGate;let moduleExportsPromise=importFn();return importGate=importGate.then(async()=>{await moduleExportsPromise}),moduleExportsPromise}}function adjustRegexToExcludeNodeModules(originalRegex){let originalRegexString=originalRegex.source,startsWithCaret=originalRegexString.startsWith("^"),excludeNodeModulesPattern=startsWithCaret?"(?!.*node_modules)":"^(?!.*node_modules)",adjustedRegexString=startsWithCaret?`^${excludeNodeModulesPattern}${originalRegexString.substring(1)}`:excludeNodeModulesPattern+originalRegexString;return new RegExp(adjustedRegexString)}function webpackIncludeRegexp(specifier){let{directory,files}=specifier,directoryWithoutLeadingDots=directory.replace(/^(\.+\/)+/,"/"),webpackIncludeGlob=[".",".."].includes(directory)?files:`${directoryWithoutLeadingDots}/${files}`,webpackIncludeRegexpWithCaret=webpackIncludeGlob.includes("node_modules")?(0,import_common2.globToRegexp)(webpackIncludeGlob):adjustRegexToExcludeNodeModules((0,import_common2.globToRegexp)(webpackIncludeGlob));return new RegExp(webpackIncludeRegexpWithCaret.source.replace(/^\^/,""))}function toImportFnPart(specifier){let{directory,importPathMatcher}=specifier;return import_ts_dedent2.dedent`
async (path) => {

@@ -12,0 +12,0 @@ if (!${importPathMatcher}.exec(path)) {

{
"name": "@storybook/core-webpack",
"version": "0.0.0-pr-28585-sha-af48f0d6",
"version": "0.0.0-pr-28607-sha-54ec63fe",
"description": "Storybook framework-agnostic API",

@@ -43,7 +43,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": {
"@types/node": "^18.0.0",
"@types/node": "^22.0.0",
"ts-dedent": "^2.0.0"

@@ -57,3 +57,3 @@ },

"peerDependencies": {
"storybook": "^0.0.0-pr-28585-sha-af48f0d6"
"storybook": "^0.0.0-pr-28607-sha-54ec63fe"
},

@@ -60,0 +60,0 @@ "publishConfig": {

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