creevey 0.9.0-beta.7 → 0.9.0-beta.9
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/lib/cjs/client/addon/components/Tools.js +1 -1
- package/lib/cjs/client/addon/preset.js +0 -45
- package/lib/cjs/client/addon/preset.sb7.js +19 -0
- package/lib/cjs/client/addon/preview.js +14 -0
- package/lib/cjs/server/selenium/browser.js +5 -3
- package/lib/cjs/server/testsFiles/register.js +2 -2
- package/lib/esm/client/addon/components/Tools.js +1 -1
- package/lib/esm/client/addon/preset.js +0 -33
- package/lib/esm/client/addon/preset.sb7.js +8 -0
- package/lib/esm/client/addon/preview.js +5 -0
- package/lib/esm/server/selenium/browser.js +5 -3
- package/lib/esm/server/testsFiles/register.js +2 -2
- package/lib/types/client/addon/preset.d.ts +0 -21
- package/lib/types/client/addon/preset.sb7.d.ts +2 -0
- package/lib/types/client/addon/preview.d.ts +4 -0
- package/package.json +2 -1
- package/preset/sb7.js +5 -0
- package/types/global.d.ts +5 -0
@@ -77,7 +77,7 @@ const Tools = _ref => {
|
|
77
77
|
}
|
78
78
|
|
79
79
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.IconButton, {
|
80
|
-
href: "http://localhost:".concat(__CREEVEY_CLIENT_PORT__ || __CREEVEY_SERVER_PORT__, "/?").concat((0, _qs.stringify)({
|
80
|
+
href: "http://localhost:".concat(__CREEVEY_CLIENT_PORT__ || __CREEVEY_SERVER_PORT__ || 3000, "/?").concat((0, _qs.stringify)({
|
81
81
|
testPath: (0, _helpers.getTestPath)(test)
|
82
82
|
})),
|
83
83
|
target: "_blank",
|
@@ -3,24 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports._managerWebpack = _managerWebpack;
|
7
6
|
exports.config = config;
|
8
7
|
exports.managerEntries = managerEntries;
|
9
8
|
|
10
|
-
var _path = _interopRequireDefault(require("path"));
|
11
|
-
|
12
|
-
var _shelljs = require("shelljs");
|
13
|
-
|
14
|
-
var _webpack = require("webpack");
|
15
|
-
|
16
|
-
var _helpers = require("../../server/storybook/helpers");
|
17
|
-
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
-
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
23
|
-
|
24
9
|
function config() {
|
25
10
|
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
26
11
|
return [...entry, require.resolve('./decorator')];
|
@@ -29,34 +14,4 @@ function config() {
|
|
29
14
|
function managerEntries() {
|
30
15
|
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
31
16
|
return [...entry, require.resolve('./register')];
|
32
|
-
}
|
33
|
-
|
34
|
-
function _managerWebpack(config, options) {
|
35
|
-
var _options$presets$appl, _options$presets;
|
36
|
-
|
37
|
-
// TODO How to execute with non-webpack bundlers
|
38
|
-
if (options.configType == 'PRODUCTION' && options.skipExtract != true) {
|
39
|
-
const args = [];
|
40
|
-
if (options.creeveyPreExtract) args.push("--require \"".concat(options.creeveyPreExtract, "\""));
|
41
|
-
args.push(_path.default.join(__dirname, '../../cli'));
|
42
|
-
args.push("--extract \"".concat(options.outputDir, "\""));
|
43
|
-
if (options.creeveyConfigPath) args.push("--config \"".concat(options.creeveyConfigPath, "\""));
|
44
|
-
(0, _shelljs.exec)("node ".concat(args.join(' ')), {
|
45
|
-
async: true
|
46
|
-
});
|
47
|
-
}
|
48
|
-
|
49
|
-
return ((_options$presets$appl = (_options$presets = options.presets) === null || _options$presets === void 0 ? void 0 : _options$presets.apply('webpackInstance')) !== null && _options$presets$appl !== void 0 ? _options$presets$appl : Promise.resolve(undefined)).then(webpack => webpack !== null && webpack !== void 0 ? webpack : Promise.resolve("".concat((0, _helpers.resolveFromStorybookCoreServer)('webpack'))).then(s => _interopRequireWildcard(require(s)))).then(webpack => {
|
50
|
-
var _config$plugins, _options$creeveyPort;
|
51
|
-
|
52
|
-
const {
|
53
|
-
DefinePlugin = _webpack.DefinePlugin
|
54
|
-
} = webpack !== null && webpack !== void 0 ? webpack : {};
|
55
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.push(new DefinePlugin({
|
56
|
-
__CREEVEY_SERVER_HOST__: options.creeveyHost,
|
57
|
-
__CREEVEY_SERVER_PORT__: (_options$creeveyPort = options.creeveyPort) !== null && _options$creeveyPort !== void 0 ? _options$creeveyPort : 3000,
|
58
|
-
__CREEVEY_CLIENT_PORT__: options.clientPort
|
59
|
-
}));
|
60
|
-
return config;
|
61
|
-
});
|
62
17
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.managerEntries = managerEntries;
|
7
|
+
exports.previewAnnotations = void 0;
|
8
|
+
|
9
|
+
const previewAnnotations = function () {
|
10
|
+
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
11
|
+
return [...entry, require.resolve('./preview')];
|
12
|
+
};
|
13
|
+
|
14
|
+
exports.previewAnnotations = previewAnnotations;
|
15
|
+
|
16
|
+
function managerEntries() {
|
17
|
+
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
18
|
+
return [...entry, require.resolve('./register')];
|
19
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _withCreevey = require("./withCreevey");
|
9
|
+
|
10
|
+
const preview = {
|
11
|
+
decorators: [(0, _withCreevey.withCreevey)()]
|
12
|
+
};
|
13
|
+
var _default = preview;
|
14
|
+
exports.default = _default;
|
@@ -145,9 +145,11 @@ async function waitForStorybook(browser) {
|
|
145
145
|
return callback(false);
|
146
146
|
}, Events.SET_STORIES);
|
147
147
|
} else {
|
148
|
-
wait = await browser.executeAsyncScript(function (callback) {
|
149
|
-
|
150
|
-
|
148
|
+
wait = await browser.executeAsyncScript(function (SET_GLOBALS, callback) {
|
149
|
+
if (typeof window.__STORYBOOK_ADDONS_CHANNEL__ == 'undefined') return callback(true);
|
150
|
+
if (window.__STORYBOOK_ADDONS_CHANNEL__.last(SET_GLOBALS) == undefined) return callback(true);
|
151
|
+
return callback(false);
|
152
|
+
}, Events.SET_GLOBALS);
|
151
153
|
}
|
152
154
|
|
153
155
|
if (!wait) clearTimeout(initiateTimeout);
|
@@ -37,8 +37,8 @@ async function register(config) {
|
|
37
37
|
},
|
38
38
|
modules: 'commonjs'
|
39
39
|
}]],
|
40
|
-
plugins: [['@babel/plugin-transform-runtime'], ['babel-plugin-tsconfig-paths', {
|
40
|
+
plugins: [['@babel/plugin-transform-runtime'], ...(tsConfigPath ? [['babel-plugin-tsconfig-paths', {
|
41
41
|
tsconfig: tsConfigPath
|
42
|
-
}]]
|
42
|
+
}]] : [])]
|
43
43
|
})); // (await import('ts-node')).register({ project: tsConfigPath, transpileOnly: true });
|
44
44
|
}
|
@@ -58,7 +58,7 @@ export const Tools = _ref => {
|
|
58
58
|
}
|
59
59
|
|
60
60
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
|
61
|
-
href: "http://localhost:".concat(__CREEVEY_CLIENT_PORT__ || __CREEVEY_SERVER_PORT__, "/?").concat(stringify({
|
61
|
+
href: "http://localhost:".concat(__CREEVEY_CLIENT_PORT__ || __CREEVEY_SERVER_PORT__ || 3000, "/?").concat(stringify({
|
62
62
|
testPath: getTestPath(test)
|
63
63
|
})),
|
64
64
|
target: "_blank",
|
@@ -1,7 +1,3 @@
|
|
1
|
-
import path from 'path';
|
2
|
-
import { exec } from 'shelljs';
|
3
|
-
import { DefinePlugin as FallbackDefinePlugin } from 'webpack';
|
4
|
-
import { resolveFromStorybookCoreServer } from '../../server/storybook/helpers';
|
5
1
|
export function config() {
|
6
2
|
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
7
3
|
return [...entry, require.resolve('./decorator')];
|
@@ -9,33 +5,4 @@ export function config() {
|
|
9
5
|
export function managerEntries() {
|
10
6
|
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
11
7
|
return [...entry, require.resolve('./register')];
|
12
|
-
}
|
13
|
-
export function _managerWebpack(config, options) {
|
14
|
-
var _options$presets$appl, _options$presets;
|
15
|
-
|
16
|
-
// TODO How to execute with non-webpack bundlers
|
17
|
-
if (options.configType == 'PRODUCTION' && options.skipExtract != true) {
|
18
|
-
const args = [];
|
19
|
-
if (options.creeveyPreExtract) args.push("--require \"".concat(options.creeveyPreExtract, "\""));
|
20
|
-
args.push(path.join(__dirname, '../../cli'));
|
21
|
-
args.push("--extract \"".concat(options.outputDir, "\""));
|
22
|
-
if (options.creeveyConfigPath) args.push("--config \"".concat(options.creeveyConfigPath, "\""));
|
23
|
-
exec("node ".concat(args.join(' ')), {
|
24
|
-
async: true
|
25
|
-
});
|
26
|
-
}
|
27
|
-
|
28
|
-
return ((_options$presets$appl = (_options$presets = options.presets) === null || _options$presets === void 0 ? void 0 : _options$presets.apply('webpackInstance')) !== null && _options$presets$appl !== void 0 ? _options$presets$appl : Promise.resolve(undefined)).then(webpack => webpack !== null && webpack !== void 0 ? webpack : import(resolveFromStorybookCoreServer('webpack'))).then(webpack => {
|
29
|
-
var _config$plugins, _options$creeveyPort;
|
30
|
-
|
31
|
-
const {
|
32
|
-
DefinePlugin = FallbackDefinePlugin
|
33
|
-
} = webpack !== null && webpack !== void 0 ? webpack : {};
|
34
|
-
(_config$plugins = config.plugins) === null || _config$plugins === void 0 ? void 0 : _config$plugins.push(new DefinePlugin({
|
35
|
-
__CREEVEY_SERVER_HOST__: options.creeveyHost,
|
36
|
-
__CREEVEY_SERVER_PORT__: (_options$creeveyPort = options.creeveyPort) !== null && _options$creeveyPort !== void 0 ? _options$creeveyPort : 3000,
|
37
|
-
__CREEVEY_CLIENT_PORT__: options.clientPort
|
38
|
-
}));
|
39
|
-
return config;
|
40
|
-
});
|
41
8
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export const previewAnnotations = function () {
|
2
|
+
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
3
|
+
return [...entry, require.resolve('./preview')];
|
4
|
+
};
|
5
|
+
export function managerEntries() {
|
6
|
+
let entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
7
|
+
return [...entry, require.resolve('./register')];
|
8
|
+
}
|
@@ -117,9 +117,11 @@ async function waitForStorybook(browser) {
|
|
117
117
|
return callback(false);
|
118
118
|
}, Events.SET_STORIES);
|
119
119
|
} else {
|
120
|
-
wait = await browser.executeAsyncScript(function (callback) {
|
121
|
-
|
122
|
-
|
120
|
+
wait = await browser.executeAsyncScript(function (SET_GLOBALS, callback) {
|
121
|
+
if (typeof window.__STORYBOOK_ADDONS_CHANNEL__ == 'undefined') return callback(true);
|
122
|
+
if (window.__STORYBOOK_ADDONS_CHANNEL__.last(SET_GLOBALS) == undefined) return callback(true);
|
123
|
+
return callback(false);
|
124
|
+
}, Events.SET_GLOBALS);
|
123
125
|
}
|
124
126
|
|
125
127
|
if (!wait) clearTimeout(initiateTimeout);
|
@@ -24,8 +24,8 @@ export default async function register(config) {
|
|
24
24
|
},
|
25
25
|
modules: 'commonjs'
|
26
26
|
}]],
|
27
|
-
plugins: [['@babel/plugin-transform-runtime'], ['babel-plugin-tsconfig-paths', {
|
27
|
+
plugins: [['@babel/plugin-transform-runtime'], ...(tsConfigPath ? [['babel-plugin-tsconfig-paths', {
|
28
28
|
tsconfig: tsConfigPath
|
29
|
-
}]]
|
29
|
+
}]] : [])]
|
30
30
|
})); // (await import('ts-node')).register({ project: tsConfigPath, transpileOnly: true });
|
31
31
|
}
|
@@ -1,23 +1,2 @@
|
|
1
|
-
import { Configuration } from 'webpack';
|
2
1
|
export declare function config(entry?: string[]): string[];
|
3
2
|
export declare function managerEntries(entry?: string[]): string[];
|
4
|
-
declare global {
|
5
|
-
const __CREEVEY_SERVER_HOST__: string;
|
6
|
-
const __CREEVEY_SERVER_PORT__: number;
|
7
|
-
const __CREEVEY_CLIENT_PORT__: number | null;
|
8
|
-
}
|
9
|
-
export interface CreeveyAddonOptions {
|
10
|
-
creeveyConfigPath?: string;
|
11
|
-
creeveyPreExtract?: string;
|
12
|
-
creeveyHost?: string;
|
13
|
-
creeveyPort?: number;
|
14
|
-
clientPort?: number;
|
15
|
-
configType: string;
|
16
|
-
configDir: string;
|
17
|
-
outputDir: string;
|
18
|
-
skipExtract?: boolean;
|
19
|
-
presets?: {
|
20
|
-
apply: <T>(preset: string) => Promise<T | undefined>;
|
21
|
-
};
|
22
|
-
}
|
23
|
-
export declare function _managerWebpack(config: Configuration, options: CreeveyAddonOptions): Promise<Configuration>;
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"addon",
|
14
14
|
"test"
|
15
15
|
],
|
16
|
-
"version": "0.9.0-beta.
|
16
|
+
"version": "0.9.0-beta.9",
|
17
17
|
"bin": {
|
18
18
|
"creevey": "./lib/cjs/cli.js"
|
19
19
|
},
|
@@ -29,6 +29,7 @@
|
|
29
29
|
},
|
30
30
|
"./preset": "./preset/index.js",
|
31
31
|
"./preset/ie11": "./preset/ie11.js",
|
32
|
+
"./preset/sb7": "./preset/sb7.js",
|
32
33
|
"./lib/esm/client/addon/decorator.js": "./lib/esm/client/addon/decorator.js"
|
33
34
|
},
|
34
35
|
"main": "lib/cjs/index.js",
|
package/preset/sb7.js
ADDED