@storybook/core-common 6.4.13 → 6.4.17
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.
- package/dist/cjs/utils/normalize-stories.js +17 -22
- package/dist/cjs/utils/paths.js +2 -2
- package/dist/cjs/utils/to-require-context.js +1 -1
- package/dist/esm/utils/normalize-stories.js +17 -22
- package/dist/esm/utils/paths.js +2 -2
- package/dist/esm/utils/to-require-context.js +1 -1
- package/dist/modern/utils/normalize-stories.js +17 -22
- package/dist/modern/utils/paths.js +2 -2
- package/dist/modern/utils/to-require-context.js +1 -1
- package/dist/ts3.4/utils/paths.d.ts +1 -1
- package/dist/ts3.9/utils/paths.d.ts +1 -1
- package/package.json +3 -3
|
@@ -79,35 +79,30 @@ var normalizeStoriesEntry = function (entry, {
|
|
|
79
79
|
var specifierWithoutMatcher;
|
|
80
80
|
|
|
81
81
|
if (typeof entry === 'string') {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
specifierWithoutMatcher = {
|
|
85
|
-
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
86
|
-
directory: entry,
|
|
87
|
-
files: DEFAULT_FILES
|
|
88
|
-
};
|
|
89
|
-
} else {
|
|
90
|
-
specifierWithoutMatcher = {
|
|
91
|
-
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
92
|
-
directory: _path.default.dirname(entry),
|
|
93
|
-
files: _path.default.basename(entry)
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
var fixedEntry = detectBadGlob(entry);
|
|
98
|
-
var globResult = (0, _picomatch.scan)(fixedEntry);
|
|
99
|
-
|
|
100
|
-
var _directory = globResult.isGlob ? globResult.prefix + globResult.base : _path.default.dirname(fixedEntry);
|
|
101
|
-
|
|
102
|
-
var filesFallback = _directory !== '.' ? fixedEntry.substr(_directory.length + 1) : fixedEntry;
|
|
82
|
+
var fixedEntry = detectBadGlob(entry);
|
|
83
|
+
var globResult = (0, _picomatch.scan)(fixedEntry);
|
|
103
84
|
|
|
104
|
-
|
|
85
|
+
if (globResult.isGlob) {
|
|
86
|
+
var _directory = globResult.prefix + globResult.base;
|
|
105
87
|
|
|
88
|
+
var _files = globResult.glob;
|
|
106
89
|
specifierWithoutMatcher = {
|
|
107
90
|
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
108
91
|
directory: _directory,
|
|
109
92
|
files: _files
|
|
110
93
|
};
|
|
94
|
+
} else if (isDirectory(configDir, entry)) {
|
|
95
|
+
specifierWithoutMatcher = {
|
|
96
|
+
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
97
|
+
directory: entry,
|
|
98
|
+
files: DEFAULT_FILES
|
|
99
|
+
};
|
|
100
|
+
} else {
|
|
101
|
+
specifierWithoutMatcher = {
|
|
102
|
+
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
103
|
+
directory: _path.default.dirname(entry),
|
|
104
|
+
files: _path.default.basename(entry)
|
|
105
|
+
};
|
|
111
106
|
}
|
|
112
107
|
} else {
|
|
113
108
|
specifierWithoutMatcher = _objectSpread({
|
package/dist/cjs/utils/paths.js
CHANGED
|
@@ -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:
|
|
18
|
+
recursive: files.includes('**') || files.split('/').length > 1,
|
|
19
19
|
match: match
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -57,35 +57,30 @@ export var normalizeStoriesEntry = function (entry, {
|
|
|
57
57
|
var specifierWithoutMatcher;
|
|
58
58
|
|
|
59
59
|
if (typeof entry === 'string') {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
specifierWithoutMatcher = {
|
|
63
|
-
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
64
|
-
directory: entry,
|
|
65
|
-
files: DEFAULT_FILES
|
|
66
|
-
};
|
|
67
|
-
} else {
|
|
68
|
-
specifierWithoutMatcher = {
|
|
69
|
-
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
70
|
-
directory: path.dirname(entry),
|
|
71
|
-
files: path.basename(entry)
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
var fixedEntry = detectBadGlob(entry);
|
|
76
|
-
var globResult = scan(fixedEntry);
|
|
77
|
-
|
|
78
|
-
var _directory = globResult.isGlob ? globResult.prefix + globResult.base : path.dirname(fixedEntry);
|
|
79
|
-
|
|
80
|
-
var filesFallback = _directory !== '.' ? fixedEntry.substr(_directory.length + 1) : fixedEntry;
|
|
60
|
+
var fixedEntry = detectBadGlob(entry);
|
|
61
|
+
var globResult = scan(fixedEntry);
|
|
81
62
|
|
|
82
|
-
|
|
63
|
+
if (globResult.isGlob) {
|
|
64
|
+
var _directory = globResult.prefix + globResult.base;
|
|
83
65
|
|
|
66
|
+
var _files = globResult.glob;
|
|
84
67
|
specifierWithoutMatcher = {
|
|
85
68
|
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
86
69
|
directory: _directory,
|
|
87
70
|
files: _files
|
|
88
71
|
};
|
|
72
|
+
} else if (isDirectory(configDir, entry)) {
|
|
73
|
+
specifierWithoutMatcher = {
|
|
74
|
+
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
75
|
+
directory: entry,
|
|
76
|
+
files: DEFAULT_FILES
|
|
77
|
+
};
|
|
78
|
+
} else {
|
|
79
|
+
specifierWithoutMatcher = {
|
|
80
|
+
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
81
|
+
directory: path.dirname(entry),
|
|
82
|
+
files: path.basename(entry)
|
|
83
|
+
};
|
|
89
84
|
}
|
|
90
85
|
} else {
|
|
91
86
|
specifierWithoutMatcher = _objectSpread({
|
package/dist/esm/utils/paths.js
CHANGED
|
@@ -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) {
|
|
@@ -57,35 +57,30 @@ export var normalizeStoriesEntry = function (entry, {
|
|
|
57
57
|
var specifierWithoutMatcher;
|
|
58
58
|
|
|
59
59
|
if (typeof entry === 'string') {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
specifierWithoutMatcher = {
|
|
63
|
-
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
64
|
-
directory: entry,
|
|
65
|
-
files: DEFAULT_FILES
|
|
66
|
-
};
|
|
67
|
-
} else {
|
|
68
|
-
specifierWithoutMatcher = {
|
|
69
|
-
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
70
|
-
directory: path.dirname(entry),
|
|
71
|
-
files: path.basename(entry)
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
var fixedEntry = detectBadGlob(entry);
|
|
76
|
-
var globResult = scan(fixedEntry);
|
|
77
|
-
|
|
78
|
-
var _directory = globResult.isGlob ? globResult.prefix + globResult.base : path.dirname(fixedEntry);
|
|
79
|
-
|
|
80
|
-
var filesFallback = _directory !== '.' ? fixedEntry.substr(_directory.length + 1) : fixedEntry;
|
|
60
|
+
var fixedEntry = detectBadGlob(entry);
|
|
61
|
+
var globResult = scan(fixedEntry);
|
|
81
62
|
|
|
82
|
-
|
|
63
|
+
if (globResult.isGlob) {
|
|
64
|
+
var _directory = globResult.prefix + globResult.base;
|
|
83
65
|
|
|
66
|
+
var _files = globResult.glob;
|
|
84
67
|
specifierWithoutMatcher = {
|
|
85
68
|
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
86
69
|
directory: _directory,
|
|
87
70
|
files: _files
|
|
88
71
|
};
|
|
72
|
+
} else if (isDirectory(configDir, entry)) {
|
|
73
|
+
specifierWithoutMatcher = {
|
|
74
|
+
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
75
|
+
directory: entry,
|
|
76
|
+
files: DEFAULT_FILES
|
|
77
|
+
};
|
|
78
|
+
} else {
|
|
79
|
+
specifierWithoutMatcher = {
|
|
80
|
+
titlePrefix: DEFAULT_TITLE_PREFIX,
|
|
81
|
+
directory: path.dirname(entry),
|
|
82
|
+
files: path.basename(entry)
|
|
83
|
+
};
|
|
89
84
|
}
|
|
90
85
|
} else {
|
|
91
86
|
specifierWithoutMatcher = _objectSpread({
|
|
@@ -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) {
|
|
@@ -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.
|
|
3
|
+
"version": "6.4.17",
|
|
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.
|
|
64
|
+
"@storybook/node-logger": "6.4.17",
|
|
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": "
|
|
113
|
+
"gitHead": "dc061f3e38151d25d2cbfb5d16a4531e7ec6e7d3",
|
|
114
114
|
"sbmodern": "dist/modern/index.js"
|
|
115
115
|
}
|