@storybook/preset-create-react-app 10.0.0-beta.6 → 10.0.0-beta.8

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.
Files changed (2) hide show
  1. package/dist/index.js +314 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_2lnxhmaabhb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_2lnxhmaabhb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_2lnxhmaabhb from "node:module";
1
+ import CJS_COMPAT_NODE_URL_fju1bv2e4j from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_fju1bv2e4j from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_fju1bv2e4j from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_2lnxhmaabhb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_2lnxhmaabhb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_2lnxhmaabhb.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_fju1bv2e4j.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_fju1bv2e4j.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_fju1bv2e4j.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -65,6 +65,314 @@ import { join as join3 } from "node:path";
65
65
  // ../../core/src/shared/utils/module.ts
66
66
  import { fileURLToPath, pathToFileURL } from "node:url";
67
67
 
68
+ // ../../node_modules/exsolve/dist/index.mjs
69
+ import assert from "node:assert";
70
+ import v8 from "node:v8";
71
+ import { format, inspect } from "node:util";
72
+ var own$1 = {}.hasOwnProperty;
73
+ var classRegExp = /^([A-Z][a-z\d]*)+$/;
74
+ var kTypes = /* @__PURE__ */ new Set([
75
+ "string",
76
+ "function",
77
+ "number",
78
+ "object",
79
+ // Accept 'Function' and 'Object' as alternative to the lower cased version.
80
+ "Function",
81
+ "Object",
82
+ "boolean",
83
+ "bigint",
84
+ "symbol"
85
+ ]);
86
+ var messages = /* @__PURE__ */ new Map();
87
+ var nodeInternalPrefix = "__node_internal_";
88
+ var userStackTraceLimit;
89
+ function formatList(array, type = "and") {
90
+ return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
91
+ }
92
+ __name(formatList, "formatList");
93
+ function createError(sym, value, constructor) {
94
+ messages.set(sym, value);
95
+ return makeNodeErrorWithCode(constructor, sym);
96
+ }
97
+ __name(createError, "createError");
98
+ function makeNodeErrorWithCode(Base, key) {
99
+ return /* @__PURE__ */ __name(function NodeError(...parameters) {
100
+ const limit = Error.stackTraceLimit;
101
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
102
+ const error = new Base();
103
+ if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
104
+ const message = getMessage(key, parameters, error);
105
+ Object.defineProperties(error, {
106
+ // Note: no need to implement `kIsNodeError` symbol, would be hard,
107
+ // probably.
108
+ message: {
109
+ value: message,
110
+ enumerable: false,
111
+ writable: true,
112
+ configurable: true
113
+ },
114
+ toString: {
115
+ /** @this {Error} */
116
+ value() {
117
+ return `${this.name} [${key}]: ${this.message}`;
118
+ },
119
+ enumerable: false,
120
+ writable: true,
121
+ configurable: true
122
+ }
123
+ });
124
+ captureLargerStackTrace(error);
125
+ error.code = key;
126
+ return error;
127
+ }, "NodeError");
128
+ }
129
+ __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
130
+ function isErrorStackTraceLimitWritable() {
131
+ try {
132
+ if (v8.startupSnapshot.isBuildingSnapshot()) {
133
+ return false;
134
+ }
135
+ } catch {
136
+ }
137
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
138
+ if (desc === void 0) {
139
+ return Object.isExtensible(Error);
140
+ }
141
+ return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
142
+ }
143
+ __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
144
+ function hideStackFrames(wrappedFunction) {
145
+ const hidden = nodeInternalPrefix + wrappedFunction.name;
146
+ Object.defineProperty(wrappedFunction, "name", { value: hidden });
147
+ return wrappedFunction;
148
+ }
149
+ __name(hideStackFrames, "hideStackFrames");
150
+ var captureLargerStackTrace = hideStackFrames(function(error) {
151
+ const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
152
+ if (stackTraceLimitIsWritable) {
153
+ userStackTraceLimit = Error.stackTraceLimit;
154
+ Error.stackTraceLimit = Number.POSITIVE_INFINITY;
155
+ }
156
+ Error.captureStackTrace(error);
157
+ if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
158
+ return error;
159
+ });
160
+ function getMessage(key, parameters, self) {
161
+ const message = messages.get(key);
162
+ assert(message !== void 0, "expected `message` to be found");
163
+ if (typeof message === "function") {
164
+ assert(
165
+ message.length <= parameters.length,
166
+ // Default options do not count.
167
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
168
+ );
169
+ return Reflect.apply(message, self, parameters);
170
+ }
171
+ const regex = /%[dfijoOs]/g;
172
+ let expectedLength = 0;
173
+ while (regex.exec(message) !== null) expectedLength++;
174
+ assert(
175
+ expectedLength === parameters.length,
176
+ `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
177
+ );
178
+ if (parameters.length === 0) return message;
179
+ parameters.unshift(message);
180
+ return Reflect.apply(format, null, parameters);
181
+ }
182
+ __name(getMessage, "getMessage");
183
+ function determineSpecificType(value) {
184
+ if (value === null || value === void 0) {
185
+ return String(value);
186
+ }
187
+ if (typeof value === "function" && value.name) {
188
+ return `function ${value.name}`;
189
+ }
190
+ if (typeof value === "object") {
191
+ if (value.constructor && value.constructor.name) {
192
+ return `an instance of ${value.constructor.name}`;
193
+ }
194
+ return `${inspect(value, { depth: -1 })}`;
195
+ }
196
+ let inspected = inspect(value, { colors: false });
197
+ if (inspected.length > 28) {
198
+ inspected = `${inspected.slice(0, 25)}...`;
199
+ }
200
+ return `type ${typeof value} (${inspected})`;
201
+ }
202
+ __name(determineSpecificType, "determineSpecificType");
203
+ createError(
204
+ "ERR_INVALID_ARG_TYPE",
205
+ (name, expected, actual) => {
206
+ assert(typeof name === "string", "'name' must be a string");
207
+ if (!Array.isArray(expected)) {
208
+ expected = [expected];
209
+ }
210
+ let message = "The ";
211
+ if (name.endsWith(" argument")) {
212
+ message += `${name} `;
213
+ } else {
214
+ const type = name.includes(".") ? "property" : "argument";
215
+ message += `"${name}" ${type} `;
216
+ }
217
+ message += "must be ";
218
+ const types = [];
219
+ const instances = [];
220
+ const other = [];
221
+ for (const value of expected) {
222
+ assert(
223
+ typeof value === "string",
224
+ "All expected entries have to be of type string"
225
+ );
226
+ if (kTypes.has(value)) {
227
+ types.push(value.toLowerCase());
228
+ } else if (classRegExp.exec(value) === null) {
229
+ assert(
230
+ value !== "object",
231
+ 'The value "object" should be written as "Object"'
232
+ );
233
+ other.push(value);
234
+ } else {
235
+ instances.push(value);
236
+ }
237
+ }
238
+ if (instances.length > 0) {
239
+ const pos = types.indexOf("object");
240
+ if (pos !== -1) {
241
+ types.slice(pos, 1);
242
+ instances.push("Object");
243
+ }
244
+ }
245
+ if (types.length > 0) {
246
+ message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
247
+ types,
248
+ "or"
249
+ )}`;
250
+ if (instances.length > 0 || other.length > 0) message += " or ";
251
+ }
252
+ if (instances.length > 0) {
253
+ message += `an instance of ${formatList(instances, "or")}`;
254
+ if (other.length > 0) message += " or ";
255
+ }
256
+ if (other.length > 0) {
257
+ if (other.length > 1) {
258
+ message += `one of ${formatList(other, "or")}`;
259
+ } else {
260
+ if (other[0]?.toLowerCase() !== other[0]) message += "an ";
261
+ message += `${other[0]}`;
262
+ }
263
+ }
264
+ message += `. Received ${determineSpecificType(actual)}`;
265
+ return message;
266
+ },
267
+ TypeError
268
+ );
269
+ var ERR_INVALID_MODULE_SPECIFIER = createError(
270
+ "ERR_INVALID_MODULE_SPECIFIER",
271
+ /**
272
+ * @param {string} request
273
+ * @param {string} reason
274
+ * @param {string} [base]
275
+ */
276
+ (request, reason, base) => {
277
+ return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
278
+ },
279
+ TypeError
280
+ );
281
+ var ERR_INVALID_PACKAGE_CONFIG = createError(
282
+ "ERR_INVALID_PACKAGE_CONFIG",
283
+ (path2, base, message) => {
284
+ return `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
285
+ },
286
+ Error
287
+ );
288
+ var ERR_INVALID_PACKAGE_TARGET = createError(
289
+ "ERR_INVALID_PACKAGE_TARGET",
290
+ (packagePath, key, target, isImport = false, base) => {
291
+ const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
292
+ if (key === ".") {
293
+ assert(isImport === false);
294
+ return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
295
+ }
296
+ return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
297
+ target
298
+ )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
299
+ },
300
+ Error
301
+ );
302
+ var ERR_MODULE_NOT_FOUND = createError(
303
+ "ERR_MODULE_NOT_FOUND",
304
+ (path2, base, exactUrl = false) => {
305
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
306
+ },
307
+ Error
308
+ );
309
+ createError(
310
+ "ERR_NETWORK_IMPORT_DISALLOWED",
311
+ "import of '%s' by %s is not supported: %s",
312
+ Error
313
+ );
314
+ var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
315
+ "ERR_PACKAGE_IMPORT_NOT_DEFINED",
316
+ (specifier, packagePath, base) => {
317
+ return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
318
+ },
319
+ TypeError
320
+ );
321
+ var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
322
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
323
+ /**
324
+ * @param {string} packagePath
325
+ * @param {string} subpath
326
+ * @param {string} [base]
327
+ */
328
+ (packagePath, subpath, base) => {
329
+ if (subpath === ".")
330
+ return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
331
+ return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
332
+ },
333
+ Error
334
+ );
335
+ var ERR_UNSUPPORTED_DIR_IMPORT = createError(
336
+ "ERR_UNSUPPORTED_DIR_IMPORT",
337
+ "Directory import '%s' is not supported resolving ES modules imported from %s",
338
+ Error
339
+ );
340
+ var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
341
+ "ERR_UNSUPPORTED_RESOLVE_REQUEST",
342
+ 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
343
+ TypeError
344
+ );
345
+ var ERR_UNKNOWN_FILE_EXTENSION = createError(
346
+ "ERR_UNKNOWN_FILE_EXTENSION",
347
+ (extension, path2) => {
348
+ return `Unknown file extension "${extension}" for ${path2}`;
349
+ },
350
+ TypeError
351
+ );
352
+ createError(
353
+ "ERR_INVALID_ARG_VALUE",
354
+ (name, value, reason = "is invalid") => {
355
+ let inspected = inspect(value);
356
+ if (inspected.length > 128) {
357
+ inspected = `${inspected.slice(0, 128)}...`;
358
+ }
359
+ const type = name.includes(".") ? "property" : "argument";
360
+ return `The ${type} '${name}' ${reason}. Received ${inspected}`;
361
+ },
362
+ TypeError
363
+ // Note: extra classes have been shaken out.
364
+ // , RangeError
365
+ );
366
+ var hasOwnProperty$1 = {}.hasOwnProperty;
367
+ var hasOwnProperty = {}.hasOwnProperty;
368
+ var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
369
+ var own = {}.hasOwnProperty;
370
+ var isWindows = (() => process.platform === "win32")();
371
+ var globalCache = (() => (
372
+ // eslint-disable-next-line unicorn/no-unreadable-iife
373
+ globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
374
+ ))();
375
+
68
376
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
69
377
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
70
378
  function normalizeWindowsPath(input = "") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/preset-create-react-app",
3
- "version": "10.0.0-beta.6",
3
+ "version": "10.0.0-beta.8",
4
4
  "description": "Storybook for Create React App preset",
5
5
  "keywords": [
6
6
  "storybook"
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react-scripts": ">=5.0.0",
51
- "storybook": "^10.0.0-beta.6"
51
+ "storybook": "^10.0.0-beta.8"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"