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