Skip to content

Commit

Permalink
Merge pull request #165 from dnbexperience/develop
Browse files Browse the repository at this point in the history
update dependencies with stable mdx and working hot reloading and audit
  • Loading branch information
tujoworker authored Apr 16, 2019
2 parents 86df1e9 + 1b7b560 commit 28205bf
Show file tree
Hide file tree
Showing 12 changed files with 592 additions and 404 deletions.
31 changes: 15 additions & 16 deletions packages/dnb-design-system-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"prettier:package": "prettier-package-json --write ./package.json"
},
"dependencies": {
"core-js": "2",
"dnb-ui-lib": "*",
"react": "^16.8.6",
"react-dom": "^16.8.6"
Expand All @@ -57,8 +56,8 @@
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.4.3",
"@babel/preset-react": "^7.0.0",
"@mdx-js/mdx": "0.20.3",
"@mdx-js/tag": "0.20.3",
"@mdx-js/mdx": "^1.0.7",
"@mdx-js/react": "^1.0.6",
"babel-jest": "^24.7.1",
"babel-plugin-emotion": "^10.0.9",
"camelcase": "^5.3.1",
Expand All @@ -70,38 +69,38 @@
"del": "^4.1.0",
"emotion": "^10.0.9",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.11.2",
"enzyme-adapter-react-16": "^1.12.1",
"enzyme-to-json": "^3.3.5",
"eslint": "^5.16.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.1",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"front-matter": "^3.0.1",
"front-matter": "^3.0.2",
"fs-extra": "^7.0.1",
"gatsby": "^2.3.14",
"gatsby": "^2.3.23",
"gatsby-link": "^2.0.16",
"gatsby-mdx": "^0.4.4",
"gatsby-mdx": "^0.6.2",
"gatsby-plugin-catch-links": "^2.0.13",
"gatsby-plugin-emotion": "^4.0.6",
"gatsby-plugin-manifest": "^2.0.26",
"gatsby-plugin-manifest": "^2.0.29",
"gatsby-plugin-offline": "^2.0.25",
"gatsby-plugin-postcss": "^2.0.7",
"gatsby-plugin-react-helmet": "^3.0.12",
"gatsby-plugin-sass": "^2.0.11",
"gatsby-plugin-sharp": "^2.0.32",
"gatsby-plugin-sharp": "^2.0.34",
"gatsby-remark-images": "^3.0.10",
"gatsby-source-filesystem": "^2.0.28",
"gatsby-source-filesystem": "^2.0.29",
"gh-pages": "^2.0.1",
"github-slugger": "^1.2.1",
"jest": "^24.7.1",
"jest-emotion": "^10.0.10",
"jest-raw-loader": "^1.0.1",
"keycode": "^2.2.0",
"lint-staged": "^8.1.5",
"nodemon": "^1.18.10",
"nodemon": "^1.18.11",
"ora": "^3.4.0",
"postcss-preset-env": "^6.6.0",
"prettier": "^1.16.4",
"prettier": "^1.17.0",
"prettier-package-json": "^2.1.0",
"pretty": "^2.0.0",
"prism-react-renderer": "^0.1.6",
Expand All @@ -110,9 +109,9 @@
"react-anchor-link-smooth-scroll": "^1.0.12",
"react-fake-props": "^0.3.1",
"react-helmet": "^5.2.0",
"react-live": "^2.0.0",
"react-markdown": "^4.0.6",
"stylelint": "^9.10.1",
"react-live": "^2.0.1",
"react-markdown": "^4.0.8",
"stylelint": "^10.0.1",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.6.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/dnb-design-system-portal/src/pages/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Change log'
draft: false
---

import Changelog from 'Pages/design-system/changelog'
import ChangeLog from 'Root/../../CHANGELOG.md'
import ReleasesInfo from 'Pages/design-system/changelog/info-about-releases'

# Change log of Eufemia
Expand All @@ -12,4 +12,4 @@ import ReleasesInfo from 'Pages/design-system/changelog/info-about-releases'

---

<Changelog />
<ChangeLog />
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ draft: true
order: 1
---

import Changelog from 'Root/../../CHANGELOG.md'
import ChangeLog from 'Root/../../CHANGELOG.md'
import ReleasesInfo from 'Pages/design-system/changelog/info-about-releases'

# Change log of Eufemia
Expand All @@ -14,4 +14,4 @@ import ReleasesInfo from 'Pages/design-system/changelog/info-about-releases'

---

<Changelog />
<ChangeLog />
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,16 @@ export default class SidebarLayout extends PureComponent {
let delayBuff
this.scrollToLastPosition()

this._scrollRef.current.onscroll = () => {
this._scrollRef.current.onscroll = e => {
if (this.bussyOnSettingNewPos) return
clearTimeout(delayBuff)
delayBuff = setTimeout(() => {
try {
window.localStorage.setItem(
'sidebarPos',
this._scrollRef.current.scrollTop
)
window.localStorage.setItem('sidebarPos', e.target.scrollTop)
} catch (e) {
console.log('SidebarLayout error:', e)
}
}, 200)
}, 100)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { FormLabel, Switch } from 'dnb-ui-lib/src'
import { gridStyle } from '../parts/PortalStyle'

const globalStyle = css`
.dev-grid,
.dev-grid-first > div:first-of-type {
.dev-grid {
${gridStyle({ rgb: '220, 220, 220', a: 0.8 })};
/* stylelint-disable no-descending-specificity */
Expand All @@ -31,12 +30,6 @@ const globalStyle = css`
}
}
/* stylelint-enable */
${'' /* code {
display: block;
margin: 0 0 1rem 0;
background-color: rgba(0, 200, 200, 0.25);
} */}
}
`

Expand Down
8 changes: 4 additions & 4 deletions packages/dnb-design-system-portal/src/shared/parts/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class Layout extends PureComponent {
return (
<>
<Content className="fullscreen-page">
<ContentInner className="dnb-app-content-inner dev-grid-first">
{children}
<ContentInner className="dnb-app-content-inner">
<div className="dev-grid">{children}</div>
</ContentInner>
</Content>
<ToggleGrid hidden />
Expand All @@ -62,8 +62,8 @@ class Layout extends PureComponent {
<Wrapper className="content-wrapper">
<Sidebar location={location} showAll={false} />
<Content>
<ContentInner className="dnb-app-content-inner dev-grid-first">
{children}
<ContentInner className="dnb-app-content-inner">
<div className="dev-grid">{children}</div>
</ContentInner>
<Footer />
</Content>
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-design-system-portal/src/templates/mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'

import Head from 'react-helmet'
import Layout from '../shared/parts/Layout'
import { MDXProvider } from '@mdx-js/tag'
import { MDXProvider } from '@mdx-js/react'
import MDXRenderer from 'gatsby-mdx/mdx-renderer'
import { graphql, withPrefix } from 'gatsby'
import tags from '../shared/tags'
Expand Down
26 changes: 12 additions & 14 deletions packages/dnb-ui-lib/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
*
*/

module.exports = {
module: {
rules: [
{
test: /\.(css|scss)$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\/font.*\.(woff|woff2|ttf|eot|otf|svg)/,
use: 'file-loader'
},
{ test: /\.(txt|md)$/, use: 'raw-loader' }
]
}
module.exports = async ({ config }) => {
config.module.rules.push({
test: /\.(css|scss)$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
})
config.module.rules.push({
test: /\/font.*\.(woff|woff2|ttf|eot|otf|svg)/,
use: 'file-loader'
})
config.module.rules.push({ test: /\.(txt|md)$/, use: 'raw-loader' })

return config
}
12 changes: 7 additions & 5 deletions packages/dnb-ui-lib/audit-ci.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"advisories": [
782,
788,
803,
812
"788"
],
"moderate": true,
"package-manager": "npm",
"registry": "https://registry.npmjs.org",
"whitelist": []
"whitelist": [
"js-yaml",
"lodash",
"tar",
"handlebars"
]
}
4 changes: 2 additions & 2 deletions packages/dnb-ui-lib/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const production = {
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 2
corejs: 3
}
],
'@babel/preset-react'
Expand Down Expand Up @@ -80,7 +80,7 @@ module.exports = {
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 2,
corejs: 3,
modules: false
}
],
Expand Down
4 changes: 2 additions & 2 deletions packages/dnb-ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"main": "index.js",
"scripts": {
"post-build": "yarn prettier:other",
"audit-ci": "npm install && audit-ci --directory ./ --config ./audit-ci.json",
"audit-ci": "npm install && npm run audit-ci:npm",
"audit-ci:npm": "audit-ci --directory ./ --config ./audit-ci.json",
"audit-ci:yarn": "babel-node ./scripts/prepub/audit/toOpt && audit-ci --moderate --package-manager=yarn --advisories=782 && babel-node ./scripts/prepub/audit/toDev",
"build": "yarn prebuild:local && yarn post-build",
"prebuild-ci": "yarn figma-ci-build && yarn prebuild:local && yarn test:update && yarn figma-ci-commit",
Expand Down Expand Up @@ -98,7 +99,6 @@
"@babel/preset-env": "^7.4.3",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.4.0",
"@babel/runtime": "^7.4.3",
"@emotion/babel-plugin-core": "^0.6.9",
"@emotion/core": "^10.0.10",
"@emotion/styled": "^10.0.10",
Expand Down
Loading

0 comments on commit 28205bf

Please sign in to comment.