mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-23 20:40:34 +03:00
chore(*): update dependencies (#57)
Updated Rollup Updated Babel Fixed security problems with some dependencies
This commit is contained in:
committed by
GitHub
parent
cdc7f66e21
commit
aac1ae0e81
@@ -1,4 +1,3 @@
|
||||
package-lock.json
|
||||
coverage
|
||||
dist
|
||||
lib
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('../../babel.config');
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "@bbob/preset-html5",
|
||||
"version": "2.5.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@bbob/html": {
|
||||
"version": "2.5.4",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@bbob/core": "^2.5.4",
|
||||
"@bbob/plugin-helper": "^2.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bbob/core": {
|
||||
"version": "2.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@bbob/core/-/core-2.5.4.tgz",
|
||||
"integrity": "sha512-8M/xQkU84XvXw82vBhLFukRWTyTSFoGBmCe3nuE62z4wRaYmmg+B9GYGZv6rM6KNva5UyOi5zVQhgpw7fYH5rg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@bbob/parser": "^2.5.4"
|
||||
}
|
||||
},
|
||||
"@bbob/parser": {
|
||||
"version": "2.5.4",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@bbob/plugin-helper": "^2.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bbob/plugin-helper": {
|
||||
"version": "2.5.4",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@bbob/plugin-helper": {
|
||||
"version": "2.5.4",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@bbob/plugin-helper": {
|
||||
"version": "2.5.4"
|
||||
},
|
||||
"@bbob/preset": {
|
||||
"version": "2.5.4",
|
||||
"requires": {
|
||||
"@bbob/plugin-helper": "^2.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bbob/plugin-helper": {
|
||||
"version": "2.5.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,15 +30,15 @@
|
||||
"url": "git://github.com/JiLiZART/bbob.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build:commonjs": "../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../node_modules/.bin/babel src --out-dir lib",
|
||||
"build:es": "../../node_modules/.bin/cross-env BABEL_ENV=es ../../node_modules/.bin/babel src --out-dir es",
|
||||
"build:umd": "../../node_modules/.bin/cross-env BABEL_ENV=rollup NODE_ENV=development ../../node_modules/.bin/rollup --config ../../rollup.config.js",
|
||||
"build:commonjs": "../../node_modules/.bin/cross-env BABEL_ENV=commonjs NODE_ENV=production ../../node_modules/.bin/babel src --out-dir lib",
|
||||
"build:es": "../../node_modules/.bin/cross-env BABEL_ENV=es NODE_ENV=production ../../node_modules/.bin/babel src --out-dir es",
|
||||
"build:umd": "../../node_modules/.bin/cross-env BABEL_ENV=rollup NODE_ENV=production ../../node_modules/.bin/rollup --config ../../rollup.config.js",
|
||||
"build": "npm run build:commonjs && npm run build:es && npm run build:umd",
|
||||
"test": "../../node_modules/.bin/jest --",
|
||||
"cover": "../../node_modules/.bin/jest --coverage",
|
||||
"lint": "../../node_modules/.bin/eslint .",
|
||||
"size": "../../node_modules/.bin/size-limit",
|
||||
"bundlesize": "../../node_modules/.bin/bundlesize"
|
||||
"size": "../../node_modules/.bin/cross-env NODE_ENV=production ../../node_modules/.bin/size-limit",
|
||||
"bundlesize": "../../node_modules/.bin/cross-env NODE_ENV=production ../../node_modules/.bin/bundlesize"
|
||||
},
|
||||
"size-limit": [
|
||||
{
|
||||
@@ -48,7 +48,7 @@
|
||||
"bundlesize": [
|
||||
{
|
||||
"path": "./dist/index.min.js",
|
||||
"maxSize": "1.6 KB"
|
||||
"maxSize": "1.8 KB"
|
||||
}
|
||||
],
|
||||
"publishConfig": {
|
||||
|
||||
@@ -5,15 +5,14 @@ import TagNode from '@bbob/plugin-helper/lib/TagNode';
|
||||
const isStartsWith = (node, type) => (node[0] === type);
|
||||
|
||||
const styleMap = {
|
||||
color: val => `color:${val};`,
|
||||
size: val => `font-size:${val};`,
|
||||
color: (val) => `color:${val};`,
|
||||
size: (val) => `font-size:${val};`,
|
||||
};
|
||||
|
||||
const getStyleFromAttrs = attrs =>
|
||||
Object
|
||||
.keys(attrs)
|
||||
.reduce((acc, key) => (styleMap[key] ? acc.concat(styleMap[key](attrs[key])) : acc), [])
|
||||
.join(' ');
|
||||
const getStyleFromAttrs = (attrs) => Object
|
||||
.keys(attrs)
|
||||
.reduce((acc, key) => (styleMap[key] ? acc.concat(styleMap[key](attrs[key])) : acc), [])
|
||||
.join(' ');
|
||||
|
||||
const asListItems = (content) => {
|
||||
let listIdx = 0;
|
||||
@@ -56,33 +55,33 @@ const asListItems = (content) => {
|
||||
return [].concat(listItems);
|
||||
};
|
||||
|
||||
const getUniqAttr = attrs => Object
|
||||
const getUniqAttr = (attrs) => Object
|
||||
.keys(attrs)
|
||||
.reduce((res, key) => (attrs[key] === key ? attrs[key] : null), null);
|
||||
|
||||
export default {
|
||||
b: node => ({
|
||||
b: (node) => ({
|
||||
tag: 'span',
|
||||
attrs: {
|
||||
style: 'font-weight: bold;',
|
||||
},
|
||||
content: node.content,
|
||||
}),
|
||||
i: node => ({
|
||||
i: (node) => ({
|
||||
tag: 'span',
|
||||
attrs: {
|
||||
style: 'font-style: italic;',
|
||||
},
|
||||
content: node.content,
|
||||
}),
|
||||
u: node => ({
|
||||
u: (node) => ({
|
||||
tag: 'span',
|
||||
attrs: {
|
||||
style: 'text-decoration: underline;',
|
||||
},
|
||||
content: node.content,
|
||||
}),
|
||||
s: node => ({
|
||||
s: (node) => ({
|
||||
tag: 'span',
|
||||
attrs: {
|
||||
style: 'text-decoration: line-through;',
|
||||
@@ -103,7 +102,7 @@ export default {
|
||||
},
|
||||
content: null,
|
||||
}),
|
||||
quote: node => ({
|
||||
quote: (node) => ({
|
||||
tag: 'blockquote',
|
||||
attrs: {},
|
||||
content: [{
|
||||
@@ -112,19 +111,19 @@ export default {
|
||||
content: node.content,
|
||||
}],
|
||||
}),
|
||||
code: node => ({
|
||||
code: (node) => ({
|
||||
tag: 'pre',
|
||||
attrs: {},
|
||||
content: node.content,
|
||||
}),
|
||||
style: node => ({
|
||||
style: (node) => ({
|
||||
tag: 'span',
|
||||
attrs: {
|
||||
style: getStyleFromAttrs(node.attrs),
|
||||
},
|
||||
content: node.content,
|
||||
}),
|
||||
list: node => ({
|
||||
list: (node) => ({
|
||||
tag: getUniqAttr(node.attrs) ? 'ol' : 'ul',
|
||||
attrs: getUniqAttr(node.attrs) ? {
|
||||
type: getUniqAttr(node.attrs),
|
||||
|
||||
Reference in New Issue
Block a user