@storybook/core-server 6.5.0-alpha.44 → 6.5.0-alpha.47

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.
@@ -108,7 +108,8 @@ exports.typescript = typescript;
108
108
  var features = async function (existing) {
109
109
  return _objectSpread(_objectSpread({}, existing), {}, {
110
110
  postcss: true,
111
- emotionAlias: true,
111
+ emotionAlias: false,
112
+ // TODO remove in 7.0, this no longer does anything
112
113
  warnOnLegacyHierarchySeparator: true
113
114
  });
114
115
  };
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -28,18 +26,6 @@ var _tsDedent = _interopRequireDefault(require("ts-dedent"));
28
26
 
29
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
28
 
31
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
32
-
33
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
34
-
35
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
36
-
37
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
38
-
39
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
40
-
41
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
42
-
43
29
  var defaultFavIcon = require.resolve('@storybook/core-server/public/favicon.ico');
44
30
 
45
31
  async function useStatics(router, options) {
@@ -100,19 +86,24 @@ async function useStatics(router, options) {
100
86
  }
101
87
 
102
88
  var parseStaticDir = async function (arg) {
103
- // Split on ':' only if not followed by '\', for Windows compatibility (e.g. 'C:\some\dir')
104
- var _arg$split = arg.split(/:(?!\\)/),
105
- _arg$split2 = _slicedToArray(_arg$split, 2),
106
- rawDir = _arg$split2[0],
107
- _arg$split2$ = _arg$split2[1],
108
- target = _arg$split2$ === void 0 ? '/' : _arg$split2$;
89
+ // Split on last index of ':', for Windows compatibility (e.g. 'C:\some\dir:\foo')
90
+ var lastColonIndex = arg.lastIndexOf(':');
91
+
92
+ var isWindowsAbsolute = _path.default.win32.isAbsolute(arg);
93
+
94
+ var isWindowsRawDirOnly = isWindowsAbsolute && lastColonIndex === 1; // e.g. 'C:\some\dir'
95
+
96
+ var splitIndex = lastColonIndex !== -1 && !isWindowsRawDirOnly ? lastColonIndex : arg.length;
97
+ var targetRaw = arg.substring(splitIndex + 1) || '/';
98
+ var target = targetRaw.split(_path.default.sep).join(_path.default.posix.sep); // Ensure target has forward-slash path
109
99
 
100
+ var rawDir = arg.substring(0, splitIndex);
110
101
  var staticDir = _path.default.isAbsolute(rawDir) ? rawDir : `./${rawDir}`;
111
102
 
112
103
  var staticPath = _path.default.resolve(staticDir);
113
104
 
114
105
  var targetDir = target.replace(/^\/?/, './');
115
- var targetEndpoint = targetDir.substr(1);
106
+ var targetEndpoint = targetDir.substring(1);
116
107
 
117
108
  if (!(await (0, _fsExtra.pathExists)(staticPath))) {
118
109
  throw new Error((0, _tsDedent.default)((0, _chalk.default)`
@@ -72,7 +72,8 @@ export var typescript = function () {
72
72
  export var features = async function (existing) {
73
73
  return _objectSpread(_objectSpread({}, existing), {}, {
74
74
  postcss: true,
75
- emotionAlias: true,
75
+ emotionAlias: false,
76
+ // TODO remove in 7.0, this no longer does anything
76
77
  warnOnLegacyHierarchySeparator: true
77
78
  });
78
79
  };
@@ -1,17 +1,4 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
1
  import "core-js/modules/es.promise.js";
14
- import "core-js/modules/es.symbol.description.js";
15
2
  import { logger } from '@storybook/node-logger';
16
3
  import { getDirectoryFromWorkingDir } from '@storybook/core-common';
17
4
  import chalk from 'chalk';
@@ -79,17 +66,20 @@ export async function useStatics(router, options) {
79
66
  }
80
67
  }
81
68
  export var parseStaticDir = async function (arg) {
82
- // Split on ':' only if not followed by '\', for Windows compatibility (e.g. 'C:\some\dir')
83
- var _arg$split = arg.split(/:(?!\\)/),
84
- _arg$split2 = _slicedToArray(_arg$split, 2),
85
- rawDir = _arg$split2[0],
86
- _arg$split2$ = _arg$split2[1],
87
- target = _arg$split2$ === void 0 ? '/' : _arg$split2$;
69
+ // Split on last index of ':', for Windows compatibility (e.g. 'C:\some\dir:\foo')
70
+ var lastColonIndex = arg.lastIndexOf(':');
71
+ var isWindowsAbsolute = path.win32.isAbsolute(arg);
72
+ var isWindowsRawDirOnly = isWindowsAbsolute && lastColonIndex === 1; // e.g. 'C:\some\dir'
73
+
74
+ var splitIndex = lastColonIndex !== -1 && !isWindowsRawDirOnly ? lastColonIndex : arg.length;
75
+ var targetRaw = arg.substring(splitIndex + 1) || '/';
76
+ var target = targetRaw.split(path.sep).join(path.posix.sep); // Ensure target has forward-slash path
88
77
 
78
+ var rawDir = arg.substring(0, splitIndex);
89
79
  var staticDir = path.isAbsolute(rawDir) ? rawDir : `./${rawDir}`;
90
80
  var staticPath = path.resolve(staticDir);
91
81
  var targetDir = target.replace(/^\/?/, './');
92
- var targetEndpoint = targetDir.substr(1);
82
+ var targetEndpoint = targetDir.substring(1);
93
83
 
94
84
  if (!(await pathExists(staticPath))) {
95
85
  throw new Error(dedent(chalk`
@@ -72,7 +72,8 @@ export var typescript = function () {
72
72
  export var features = async function (existing) {
73
73
  return _objectSpread(_objectSpread({}, existing), {}, {
74
74
  postcss: true,
75
- emotionAlias: true,
75
+ emotionAlias: false,
76
+ // TODO remove in 7.0, this no longer does anything
76
77
  warnOnLegacyHierarchySeparator: true
77
78
  });
78
79
  };
@@ -1,17 +1,4 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
1
  import "core-js/modules/es.promise.js";
14
- import "core-js/modules/es.symbol.description.js";
15
2
  import { logger } from '@storybook/node-logger';
16
3
  import { getDirectoryFromWorkingDir } from '@storybook/core-common';
17
4
  import chalk from 'chalk';
@@ -79,17 +66,20 @@ export async function useStatics(router, options) {
79
66
  }
80
67
  }
81
68
  export var parseStaticDir = async function (arg) {
82
- // Split on ':' only if not followed by '\', for Windows compatibility (e.g. 'C:\some\dir')
83
- var _arg$split = arg.split(/:(?!\\)/),
84
- _arg$split2 = _slicedToArray(_arg$split, 2),
85
- rawDir = _arg$split2[0],
86
- _arg$split2$ = _arg$split2[1],
87
- target = _arg$split2$ === void 0 ? '/' : _arg$split2$;
69
+ // Split on last index of ':', for Windows compatibility (e.g. 'C:\some\dir:\foo')
70
+ var lastColonIndex = arg.lastIndexOf(':');
71
+ var isWindowsAbsolute = path.win32.isAbsolute(arg);
72
+ var isWindowsRawDirOnly = isWindowsAbsolute && lastColonIndex === 1; // e.g. 'C:\some\dir'
73
+
74
+ var splitIndex = lastColonIndex !== -1 && !isWindowsRawDirOnly ? lastColonIndex : arg.length;
75
+ var targetRaw = arg.substring(splitIndex + 1) || '/';
76
+ var target = targetRaw.split(path.sep).join(path.posix.sep); // Ensure target has forward-slash path
88
77
 
78
+ var rawDir = arg.substring(0, splitIndex);
89
79
  var staticDir = path.isAbsolute(rawDir) ? rawDir : `./${rawDir}`;
90
80
  var staticPath = path.resolve(staticDir);
91
81
  var targetDir = target.replace(/^\/?/, './');
92
- var targetEndpoint = targetDir.substr(1);
82
+ var targetEndpoint = targetDir.substring(1);
93
83
 
94
84
  if (!(await pathExists(staticPath))) {
95
85
  throw new Error(dedent(chalk`
@@ -1,3 +1,3 @@
1
- import { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
1
+ import type { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
2
2
  export declare function buildDevStandalone(options: CLIOptions & LoadOptions & BuilderOptions): Promise<void>;
3
3
  export declare function buildDev(loadOptions: LoadOptions): Promise<void>;
@@ -1,3 +1,3 @@
1
- import { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/core-common';
1
+ import type { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/core-common';
2
2
  export declare function buildStaticStandalone(options: CLIOptions & LoadOptions & BuilderOptions): Promise<void>;
3
3
  export declare function buildStatic({ packageJson, ...loadOptions }: LoadOptions): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { CommanderStatic } from 'commander';
2
- import { CLIOptions } from '@storybook/core-common';
2
+ import type { CLIOptions } from '@storybook/core-common';
3
3
  export declare function getDevCli(packageJson: {
4
4
  version: string;
5
5
  name: string;
@@ -1,5 +1,5 @@
1
1
  import { Router } from 'express';
2
- import { Options } from '@storybook/core-common';
2
+ import type { Options } from '@storybook/core-common';
3
3
  export declare const router: Router;
4
4
  export declare function storybookDevServer(options: Options): Promise<{
5
5
  previewResult: void | {
@@ -1,4 +1,4 @@
1
- import { Options } from '@storybook/core-common';
1
+ import type { Options } from '@storybook/core-common';
2
2
  export declare const babel: (_: unknown, options: Options) => Promise<{}>;
3
3
  export declare const logLevel: (previous: any, options: Options) => any;
4
4
  export declare const previewHead: (base: any, { configDir, presets }: Options) => Promise<string>;
@@ -1,5 +1,5 @@
1
- import { Path, StoryIndex } from '@storybook/store';
2
- import { NormalizedStoriesSpecifier } from '@storybook/core-common';
1
+ import type { Path, StoryIndex } from '@storybook/store';
2
+ import type { NormalizedStoriesSpecifier } from '@storybook/core-common';
3
3
  export declare class StoryIndexGenerator {
4
4
  readonly specifiers: NormalizedStoriesSpecifier[];
5
5
  readonly options: {
@@ -1,2 +1,2 @@
1
- import { Options } from '@storybook/core-common';
1
+ import type { Options } from '@storybook/core-common';
2
2
  export declare function getManagerBuilder(configDir: Options['configDir']): Promise<any>;
@@ -1,2 +1,2 @@
1
- import { Options } from '@storybook/core-common';
1
+ import type { Options } from '@storybook/core-common';
2
2
  export declare function getPreviewBuilder(configDir: Options['configDir']): Promise<any>;
@@ -1,4 +1,4 @@
1
- import { VersionCheck } from '@storybook/core-common';
1
+ import type { VersionCheck } from '@storybook/core-common';
2
2
  export declare function outputStartupInformation(options: {
3
3
  updateInfo: VersionCheck;
4
4
  version: string;
@@ -1,4 +1,4 @@
1
- import { ReleaseNotesData } from '@storybook/core-common';
1
+ import type { ReleaseNotesData } from '@storybook/core-common';
2
2
  export declare const getReleaseNotesFailedState: (version: string) => {
3
3
  success: boolean;
4
4
  currentVersion: string;
@@ -1,5 +1,5 @@
1
1
  import { Router } from 'express';
2
- import { Options, NormalizedStoriesSpecifier } from '@storybook/core-common';
2
+ import type { Options, NormalizedStoriesSpecifier } from '@storybook/core-common';
3
3
  import { ServerChannel } from './get-server-channel';
4
4
  export declare const DEBOUNCE = 100;
5
5
  export declare function extractStoriesJson(outputFile: string, normalizedStories: NormalizedStoriesSpecifier[], options: {
@@ -1,3 +1,3 @@
1
- import { VersionCheck } from '@storybook/core-common';
1
+ import type { VersionCheck } from '@storybook/core-common';
2
2
  export declare const updateCheck: (version: string) => Promise<VersionCheck>;
3
3
  export declare function createUpdateMessage(updateInfo: VersionCheck, version: string): string;
@@ -1,5 +1,5 @@
1
- import { NormalizedStoriesSpecifier } from '@storybook/core-common';
2
- import { Path } from '@storybook/store';
1
+ import type { NormalizedStoriesSpecifier } from '@storybook/core-common';
2
+ import type { Path } from '@storybook/store';
3
3
  export declare function watchStorySpecifiers(specifiers: NormalizedStoriesSpecifier[], options: {
4
4
  workingDir: Path;
5
5
  }, onInvalidate: (specifier: NormalizedStoriesSpecifier, path: Path, removed: boolean) => void): () => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/core-server",
3
- "version": "6.5.0-alpha.44",
3
+ "version": "6.5.0-alpha.47",
4
4
  "description": "Storybook framework-agnostic API",
5
5
  "keywords": [
6
6
  "storybook"
@@ -40,16 +40,16 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@discoveryjs/json-ext": "^0.5.3",
43
- "@storybook/builder-webpack4": "6.5.0-alpha.44",
44
- "@storybook/core-client": "6.5.0-alpha.44",
45
- "@storybook/core-common": "6.5.0-alpha.44",
46
- "@storybook/core-events": "6.5.0-alpha.44",
43
+ "@storybook/builder-webpack4": "6.5.0-alpha.47",
44
+ "@storybook/core-client": "6.5.0-alpha.47",
45
+ "@storybook/core-common": "6.5.0-alpha.47",
46
+ "@storybook/core-events": "6.5.0-alpha.47",
47
47
  "@storybook/csf": "0.0.2--canary.87bc651.0",
48
- "@storybook/csf-tools": "6.5.0-alpha.44",
49
- "@storybook/manager-webpack4": "6.5.0-alpha.44",
50
- "@storybook/node-logger": "6.5.0-alpha.44",
48
+ "@storybook/csf-tools": "6.5.0-alpha.47",
49
+ "@storybook/manager-webpack4": "6.5.0-alpha.47",
50
+ "@storybook/node-logger": "6.5.0-alpha.47",
51
51
  "@storybook/semver": "^7.3.2",
52
- "@storybook/store": "6.5.0-alpha.44",
52
+ "@storybook/store": "6.5.0-alpha.47",
53
53
  "@types/node": "^14.0.10 || ^16.0.0",
54
54
  "@types/node-fetch": "^2.5.7",
55
55
  "@types/pretty-hrtime": "^1.0.0",
@@ -85,7 +85,7 @@
85
85
  "x-default-browser": "^0.4.0"
86
86
  },
87
87
  "devDependencies": {
88
- "@storybook/builder-webpack5": "6.5.0-alpha.44",
88
+ "@storybook/builder-webpack5": "6.5.0-alpha.47",
89
89
  "@types/compression": "^1.7.0",
90
90
  "@types/ip": "^1.1.0",
91
91
  "@types/serve-favicon": "^2.5.2",
@@ -110,6 +110,6 @@
110
110
  "publishConfig": {
111
111
  "access": "public"
112
112
  },
113
- "gitHead": "0125cb2b688dc1acca71a7fbf2795466fd55c0e3",
113
+ "gitHead": "e848de5c5d389fcb452d85f7ebdfc27f1e3c10c4",
114
114
  "sbmodern": "dist/modern/index.js"
115
115
  }