@storybook/core-common 6.4.9 → 6.4.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.
@@ -71,10 +71,14 @@ var stringifyProcessEnvs = function (raw) {
71
71
  }, {
72
72
  // Default fallback
73
73
  'process.env.XSTORYBOOK_EXAMPLE_APP': '""'
74
- }); // support destructuring like
74
+ }); // FIXME: something like this is necessary to support destructuring like:
75
+ //
75
76
  // const { foo } = process.env;
77
+ //
78
+ // However, it also means that process.env.foo = 'bar' will fail, so removing this:
79
+ //
80
+ // envs['process.env'] = JSON.stringify(raw);
76
81
 
77
- envs['process.env'] = JSON.stringify(raw);
78
82
  return envs;
79
83
  };
80
84
 
@@ -50,9 +50,9 @@ var nodePathsToArray = function (nodePath) {
50
50
  };
51
51
 
52
52
  exports.nodePathsToArray = nodePathsToArray;
53
- var relativePattern = /^\.{1,2}[/\\]/;
53
+ var relativePattern = /^\.{1,2}([/\\]|$)/;
54
54
  /**
55
- * Ensures that a path starts with `./` or `../`
55
+ * Ensures that a path starts with `./` or `../`, or is entirely `.` or `..`
56
56
  */
57
57
 
58
58
  function normalizeStoryPath(filename) {
@@ -15,7 +15,7 @@ var toRequireContext = function (specifier) {
15
15
  var match = (0, _globToRegexp.globToRegexp)(`./${files}`);
16
16
  return {
17
17
  path: directory,
18
- recursive: !!files.match(/^\*{1,2}\//),
18
+ recursive: files.includes('**') || files.split('/').length > 1,
19
19
  match: match
20
20
  };
21
21
  };
@@ -57,9 +57,13 @@ export var stringifyProcessEnvs = function (raw) {
57
57
  }, {
58
58
  // Default fallback
59
59
  'process.env.XSTORYBOOK_EXAMPLE_APP': '""'
60
- }); // support destructuring like
60
+ }); // FIXME: something like this is necessary to support destructuring like:
61
+ //
61
62
  // const { foo } = process.env;
63
+ //
64
+ // However, it also means that process.env.foo = 'bar' will fail, so removing this:
65
+ //
66
+ // envs['process.env'] = JSON.stringify(raw);
62
67
 
63
- envs['process.env'] = JSON.stringify(raw);
64
68
  return envs;
65
69
  };
@@ -30,9 +30,9 @@ export var nodePathsToArray = function (nodePath) {
30
30
  return path.resolve('./', p);
31
31
  });
32
32
  };
33
- var relativePattern = /^\.{1,2}[/\\]/;
33
+ var relativePattern = /^\.{1,2}([/\\]|$)/;
34
34
  /**
35
- * Ensures that a path starts with `./` or `../`
35
+ * Ensures that a path starts with `./` or `../`, or is entirely `.` or `..`
36
36
  */
37
37
 
38
38
  export function normalizeStoryPath(filename) {
@@ -7,7 +7,7 @@ export var toRequireContext = function (specifier) {
7
7
  var match = globToRegexp(`./${files}`);
8
8
  return {
9
9
  path: directory,
10
- recursive: !!files.match(/^\*{1,2}\//),
10
+ recursive: files.includes('**') || files.split('/').length > 1,
11
11
  match: match
12
12
  };
13
13
  };
@@ -57,9 +57,13 @@ export var stringifyProcessEnvs = function (raw) {
57
57
  }, {
58
58
  // Default fallback
59
59
  'process.env.XSTORYBOOK_EXAMPLE_APP': '""'
60
- }); // support destructuring like
60
+ }); // FIXME: something like this is necessary to support destructuring like:
61
+ //
61
62
  // const { foo } = process.env;
63
+ //
64
+ // However, it also means that process.env.foo = 'bar' will fail, so removing this:
65
+ //
66
+ // envs['process.env'] = JSON.stringify(raw);
62
67
 
63
- envs['process.env'] = JSON.stringify(raw);
64
68
  return envs;
65
69
  };
@@ -30,9 +30,9 @@ export var nodePathsToArray = function (nodePath) {
30
30
  return path.resolve('./', p);
31
31
  });
32
32
  };
33
- var relativePattern = /^\.{1,2}[/\\]/;
33
+ var relativePattern = /^\.{1,2}([/\\]|$)/;
34
34
  /**
35
- * Ensures that a path starts with `./` or `../`
35
+ * Ensures that a path starts with `./` or `../`, or is entirely `.` or `..`
36
36
  */
37
37
 
38
38
  export function normalizeStoryPath(filename) {
@@ -7,7 +7,7 @@ export var toRequireContext = function (specifier) {
7
7
  var match = globToRegexp(`./${files}`);
8
8
  return {
9
9
  path: directory,
10
- recursive: !!files.match(/^\*{1,2}\//),
10
+ recursive: files.includes('**') || files.split('/').length > 1,
11
11
  match: match
12
12
  };
13
13
  };
@@ -2,6 +2,6 @@ export declare const getProjectRoot: () => string;
2
2
  export declare const nodeModulesPaths: string;
3
3
  export declare const nodePathsToArray: (nodePath: string) => string[];
4
4
  /**
5
- * Ensures that a path starts with `./` or `../`
5
+ * Ensures that a path starts with `./` or `../`, or is entirely `.` or `..`
6
6
  */
7
7
  export declare function normalizeStoryPath(filename: string): string;
@@ -2,6 +2,6 @@ export declare const getProjectRoot: () => string;
2
2
  export declare const nodeModulesPaths: string;
3
3
  export declare const nodePathsToArray: (nodePath: string) => string[];
4
4
  /**
5
- * Ensures that a path starts with `./` or `../`
5
+ * Ensures that a path starts with `./` or `../`, or is entirely `.` or `..`
6
6
  */
7
7
  export declare function normalizeStoryPath(filename: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/core-common",
3
- "version": "6.4.9",
3
+ "version": "6.4.14",
4
4
  "description": "Storybook framework-agnostic API",
5
5
  "keywords": [
6
6
  "storybook"
@@ -61,7 +61,7 @@
61
61
  "@babel/preset-react": "^7.12.10",
62
62
  "@babel/preset-typescript": "^7.12.7",
63
63
  "@babel/register": "^7.12.1",
64
- "@storybook/node-logger": "6.4.9",
64
+ "@storybook/node-logger": "6.4.14",
65
65
  "@storybook/semver": "^7.3.2",
66
66
  "@types/node": "^14.0.10",
67
67
  "@types/pretty-hrtime": "^1.0.0",
@@ -110,6 +110,6 @@
110
110
  "publishConfig": {
111
111
  "access": "public"
112
112
  },
113
- "gitHead": "7d354c89322080b241454eff2cd3adf9c11306cd",
113
+ "gitHead": "cf71c9f2b86e71f39c0d452174d84f34f86879b0",
114
114
  "sbmodern": "dist/modern/index.js"
115
115
  }