@papillonbits/library 0.32.0 → 0.34.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papillonbits/library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Papillon Bits Library",
|
|
5
5
|
"homepage": "https://github.com/papillonbits/papillonbits/tree/master/packages/library",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"pagination/",
|
|
25
25
|
"sort/",
|
|
26
26
|
"store/",
|
|
27
|
+
"storybook/",
|
|
27
28
|
"string/",
|
|
28
29
|
"webpack/",
|
|
29
30
|
"README.md"
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
"build-acceptance": "npm run build",
|
|
38
39
|
"build-release": "npm run build"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "f891ea6c3f15319912254db9049bce8e7f4aa6ef"
|
|
41
42
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "getStorybookMainSetup", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _mainSetup.getStorybookMainSetup;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _mainSetup = require("./setup/mainSetup");
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getStorybookMainSetup = getStorybookMainSetup;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
|
|
14
|
+
var _mdxCompilerPlugin = _interopRequireDefault(require("@storybook/addon-docs/mdx-compiler-plugin"));
|
|
15
|
+
|
|
16
|
+
/* eslint-disable no-restricted-syntax */
|
|
17
|
+
|
|
18
|
+
/* eslint-disable vars-on-top */
|
|
19
|
+
|
|
20
|
+
/* eslint-disable no-var */
|
|
21
|
+
|
|
22
|
+
/* eslint-disable no-prototype-builtins */
|
|
23
|
+
|
|
24
|
+
/* eslint-disable no-unused-vars */
|
|
25
|
+
|
|
26
|
+
/* eslint-disable no-param-reassign */
|
|
27
|
+
|
|
28
|
+
/* eslint-disable global-require */
|
|
29
|
+
function isEmptyObject(obj) {
|
|
30
|
+
for (var prop in obj) {
|
|
31
|
+
if (obj.hasOwnProperty(prop)) return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getStorybookMainSetup(_ref) {
|
|
38
|
+
var storiesBasePath = _ref.storiesBasePath,
|
|
39
|
+
includeBasePath = _ref.includeBasePath,
|
|
40
|
+
modulesBasePath = _ref.modulesBasePath;
|
|
41
|
+
return {
|
|
42
|
+
stories: ["".concat(storiesBasePath, "/*.int.story.@(js|mdx)")],
|
|
43
|
+
addons: ['@storybook/addon-a11y', '@storybook/addon-actions', '@storybook/addon-backgrounds', {
|
|
44
|
+
name: '@storybook/addon-docs',
|
|
45
|
+
options: {
|
|
46
|
+
configureJSX: true,
|
|
47
|
+
babelOptions: {},
|
|
48
|
+
sourceLoaderOptions: {
|
|
49
|
+
injectStoryParameters: false
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, '@storybook/addon-controls', '@storybook/addon-jest', {
|
|
53
|
+
name: '@storybook/addon-storysource',
|
|
54
|
+
options: {
|
|
55
|
+
rule: {
|
|
56
|
+
test: [/\.int.story\.js?$/],
|
|
57
|
+
include: ["".concat(includeBasePath, "/*")]
|
|
58
|
+
},
|
|
59
|
+
loaderOptions: {
|
|
60
|
+
prettierConfig: {
|
|
61
|
+
tabWidth: 2,
|
|
62
|
+
semi: false,
|
|
63
|
+
singleQuote: true,
|
|
64
|
+
printWidth: 140,
|
|
65
|
+
trailingComma: 'all'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, '@storybook/addon-viewport' // fails with @storybook/addon-postcss v3.0.0-alpha.1
|
|
70
|
+
// '@storybook/addon-postcss',
|
|
71
|
+
// {
|
|
72
|
+
// name: '@storybook/addon-postcss',
|
|
73
|
+
// options: {
|
|
74
|
+
// postcssLoaderOptions: {
|
|
75
|
+
// implementation: require('postcss'),
|
|
76
|
+
// },
|
|
77
|
+
// },
|
|
78
|
+
// },
|
|
79
|
+
],
|
|
80
|
+
framework: '@storybook/react',
|
|
81
|
+
core: {
|
|
82
|
+
builder: 'webpack5'
|
|
83
|
+
},
|
|
84
|
+
webpackFinal: function () {
|
|
85
|
+
var _webpackFinal = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(config, _ref2) {
|
|
86
|
+
var configType, fileLoaderRuleSVG;
|
|
87
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
88
|
+
while (1) {
|
|
89
|
+
switch (_context.prev = _context.next) {
|
|
90
|
+
case 0:
|
|
91
|
+
configType = _ref2.configType;
|
|
92
|
+
// to be activated when storybook catches up with react/babel new jsx transform
|
|
93
|
+
// https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
|
|
94
|
+
// const babelLoaderRule = config.module.rules.find((rule) => rule.test.test && rule.test.test('.jsx'))
|
|
95
|
+
// babelLoaderRule.use[0].options.presets = babelLoaderRule.use[0].options.presets.map((preset) => {
|
|
96
|
+
// return preset === path.resolve(__dirname, '../node_modules/@babel/preset-react/lib/index.js')
|
|
97
|
+
// ? [
|
|
98
|
+
// path.resolve(__dirname, '../node_modules/@babel/preset-react/lib/index.js'),
|
|
99
|
+
// {
|
|
100
|
+
// runtime: 'automatic',
|
|
101
|
+
// },
|
|
102
|
+
// ]
|
|
103
|
+
// : preset
|
|
104
|
+
// })
|
|
105
|
+
fileLoaderRuleSVG = config.module.rules.find(function (rule) {
|
|
106
|
+
return !isEmptyObject(rule) && rule.test.test && rule.test.test('.svg');
|
|
107
|
+
});
|
|
108
|
+
fileLoaderRuleSVG.exclude = /\.svg$/; // const fileLoaderRuleJSX = config.module.rules.find((rule) => !isEmptyObject(rule) && rule.test.test && rule.test.test('.jsx'))
|
|
109
|
+
// fileLoaderRuleJSX.use[0].options.plugins.push(
|
|
110
|
+
// path.resolve(__dirname, '../node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js'),
|
|
111
|
+
// )
|
|
112
|
+
// fileLoaderRuleJSX.use[0].options.plugins.push(
|
|
113
|
+
// path.resolve(__dirname, '../node_modules/babel-plugin-syntax-async-functions/lib/index.js'),
|
|
114
|
+
// )
|
|
115
|
+
|
|
116
|
+
config.module.rules = config.module.rules.concat([{
|
|
117
|
+
test: /\.(css|scss)$/,
|
|
118
|
+
use: [{
|
|
119
|
+
loader: 'style-loader'
|
|
120
|
+
}, {
|
|
121
|
+
loader: 'css-loader',
|
|
122
|
+
options: {
|
|
123
|
+
importLoaders: 2,
|
|
124
|
+
sourceMap: true,
|
|
125
|
+
modules: {
|
|
126
|
+
localIdentName: '[name]__[local]___[hash:base64:5]'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
loader: 'postcss-loader',
|
|
131
|
+
options: {
|
|
132
|
+
postcssOptions: {
|
|
133
|
+
sourceMap: true,
|
|
134
|
+
plugins: function plugins() {
|
|
135
|
+
return [require('postcss-preset-env')()];
|
|
136
|
+
},
|
|
137
|
+
parser: 'postcss-scss'
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
loader: 'sass-loader',
|
|
142
|
+
options: {
|
|
143
|
+
sassOptions: {
|
|
144
|
+
includePaths: [modulesBasePath]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}]
|
|
148
|
+
}, {
|
|
149
|
+
test: /\.svg$/i,
|
|
150
|
+
issuer: /\.[jt]sx?$/,
|
|
151
|
+
use: ['@svgr/webpack']
|
|
152
|
+
}, {
|
|
153
|
+
test: /\.int.story\.mdx$/,
|
|
154
|
+
use: [{
|
|
155
|
+
loader: 'babel-loader',
|
|
156
|
+
options: {
|
|
157
|
+
plugins: ['@babel/plugin-transform-react-jsx']
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
loader: '@mdx-js/loader',
|
|
161
|
+
options: {
|
|
162
|
+
compilers: [(0, _mdxCompilerPlugin["default"])({})]
|
|
163
|
+
}
|
|
164
|
+
}]
|
|
165
|
+
}, {
|
|
166
|
+
test: /\.int.story\.jsx?$/,
|
|
167
|
+
loader: require.resolve('@storybook/source-loader'),
|
|
168
|
+
exclude: [/node_modules/],
|
|
169
|
+
enforce: 'pre'
|
|
170
|
+
}]);
|
|
171
|
+
return _context.abrupt("return", config);
|
|
172
|
+
|
|
173
|
+
case 5:
|
|
174
|
+
case "end":
|
|
175
|
+
return _context.stop();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}, _callee);
|
|
179
|
+
}));
|
|
180
|
+
|
|
181
|
+
function webpackFinal(_x, _x2) {
|
|
182
|
+
return _webpackFinal.apply(this, arguments);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return webpackFinal;
|
|
186
|
+
}()
|
|
187
|
+
};
|
|
188
|
+
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getMarkdownLoaderStandardSetup = getMarkdownLoaderStandardSetup;
|
|
7
7
|
|
|
8
|
+
// https://github.com/webpack-contrib/html-loader
|
|
8
9
|
// https://github.com/peerigon/markdown-loader
|
|
9
10
|
function getMarkdownLoaderStandardSetup() {
|
|
10
11
|
return {
|