@storybook/preset-create-react-app 10.1.0-alpha.12 → 10.1.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0qtdcfabcrir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0qtdcfabcrir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0qtdcfabcrir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0qtdcfabcrir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0qtdcfabcrir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0qtdcfabcrir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -240,7 +240,13 @@ var dirname = function(p) {
|
|
|
240
240
|
// ../../core/src/shared/utils/module.ts
|
|
241
241
|
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
242
242
|
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
243
|
-
), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) =>
|
|
243
|
+
), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
|
|
244
|
+
try {
|
|
245
|
+
return dirname(fileURLToPath(importMetaResolve(join2(pkg, "package.json"), parent)));
|
|
246
|
+
} catch {
|
|
247
|
+
return dirname(fileURLToPath(importMetaResolve(join2(pkg, "package.json"))));
|
|
248
|
+
}
|
|
249
|
+
};
|
|
244
250
|
|
|
245
251
|
// src/helpers/getReactScriptsPath.ts
|
|
246
252
|
var getReactScriptsPath = () => {
|
|
@@ -387,14 +393,14 @@ var resolveLoader = {
|
|
|
387
393
|
}
|
|
388
394
|
if (!scriptsPath)
|
|
389
395
|
return logger2.error("Failed to resolve a `react-scripts` package."), webpackConfig;
|
|
390
|
-
logger2.
|
|
396
|
+
logger2.step(`Loading Webpack configuration from \`${relative2(CWD, scriptsPath)}\``), logger2.step("Removing existing JavaScript and TypeScript rules.");
|
|
391
397
|
let filteredRules = webpackConfig.module?.rules?.filter((rule) => {
|
|
392
398
|
if (typeof rule == "string")
|
|
393
399
|
return !1;
|
|
394
400
|
let { test } = rule;
|
|
395
401
|
return !(test instanceof RegExp && (test?.test(".js") || test?.test(".ts")));
|
|
396
402
|
}), craWebpackConfigPath = join4(scriptsPath, "config", "webpack.config"), craWebpackConfig = __require(craWebpackConfigPath)(webpackConfig.mode);
|
|
397
|
-
logger2.
|
|
403
|
+
logger2.step("Modifying Create React App rules.");
|
|
398
404
|
let craRules = await processCraConfig(craWebpackConfig, options), isProd = webpackConfig.mode !== "development", builder = (await options.presets.apply("core"))?.builder, builderOptions = typeof builder == "string" ? {} : builder?.options, cacheConfig = builderOptions?.fsCache ? { cache: { type: "filesystem" } } : {}, lazyCompilationConfig = builderOptions?.lazyCompilation && !isProd ? { experiments: { lazyCompilation: { entries: !1 } } } : {};
|
|
399
405
|
return {
|
|
400
406
|
...webpackConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preset-create-react-app",
|
|
3
|
-
"version": "10.1.0-alpha.
|
|
3
|
+
"version": "10.1.0-alpha.14",
|
|
4
4
|
"description": "Storybook for Create React App preset",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react-scripts": ">=5.0.0",
|
|
52
|
-
"storybook": "^10.1.0-alpha.
|
|
52
|
+
"storybook": "^10.1.0-alpha.14"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|