@storybook/core-common 6.4.13 → 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.
@@ -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
  };
@@ -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
  };
@@ -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.13",
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.13",
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": "d0c1e8a2f33b515a945d1a1a83560ba7045f6a5e",
113
+ "gitHead": "cf71c9f2b86e71f39c0d452174d84f34f86879b0",
114
114
  "sbmodern": "dist/modern/index.js"
115
115
  }