Skip to content

Commit

Permalink
Infra/orr/update deps (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
orrgottlieb authored Jan 5, 2022
1 parent c7dfb40 commit e459b99
Show file tree
Hide file tree
Showing 44 changed files with 19,074 additions and 26,414 deletions.
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"root": true,
"env": {
"browser": true,
"mocha": true
"browser": true
},
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"ignorePatterns": ["*test.js", "*.jest.js", "*.stories*.js"],
"extends": ["airbnb", "plugin:prettier/recommended", "plugin:react-hooks/recommended"],
"plugins": ["import", "react", "jsx-a11y", "json", "markdown", "mocha", "react-hooks"],
"plugins": ["import", "react", "jsx-a11y", "json", "markdown", "react-hooks"],
"rules": {
"no-debugger": "error",
"global-require": "off",
Expand All @@ -34,6 +33,8 @@
"react/jsx-one-expression-per-line": "off",
"react/prop-types": 0,
"react/forbid-prop-types": "off",
"react/function-component-definition": "off",
"default-param-last": "off",
"react/require-default-props": ["error"],
"jsx-a11y/anchor-is-valid": ["error"],
"react/jsx-props-no-spreading": 0,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
- name: Build & deploy Storybook to GitHub Pages
run: |
npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
- name: Install
run: |
npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
get-version:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch release version
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.18.3
16.13.1
27 changes: 0 additions & 27 deletions .storybook/.babelrc

This file was deleted.

14 changes: 8 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
const projectConfig = require("../webpack/storybook.config.js");

const createCompiler = require("@storybook/addon-docs/mdx-compiler-plugin");

const mergeConfigRules = (originalConfig, newConfigRules) => {
return {
...originalConfig,
module: {
...originalConfig.module,
rules: [...originalConfig.module.rules, ...newConfigRules]
}
module: { ...originalConfig.module, rules: [...originalConfig.module.rules, ...newConfigRules] }
};
};

const getProjectConfigRules = () => {
return projectConfig.module.rules;
};

const getDocsConfigRules = () => {
return [];
};

const buildConfig = config => {
config = mergeConfigRules(config, getProjectConfigRules());
config = mergeConfigRules(config, getDocsConfigRules());

return config;
};

Expand All @@ -35,5 +34,8 @@ module.exports = {
"@storybook/addon-a11y",
"storybook-addon-performance/register",
"@storybook/addon-docs"
]
],
core: {
builder: "webpack5"
}
};
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parameters } from "@storybook/addon-docs/dist/esm/frameworks/react/config";
import { addParameters } from "@storybook/react";
import { DocsPage, DocsContainer } from "@storybook/addon-docs/blocks";
import { DocsPage, DocsContainer } from "@storybook/addon-docs";
import {
SectionName,
Title,
Expand Down
10 changes: 4 additions & 6 deletions __mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const path = require("path");

module.exports = {
process() {
return "module.exports = '';";
},
getCacheKey() {
// The output is always the same.
return "svgTransform";
process(src, filename) {
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
}
};
10 changes: 8 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ module.exports = api => {
api.cache.using(() => process.env.NODE_ENV);

return {
env: {
test: {
plugins: ["@babel/plugin-transform-runtime"]
}
},
presets: [
[
"@babel/preset-env",
Expand All @@ -14,10 +19,11 @@ module.exports = api => {
node: "current"
}
: {
chrome: "49",
chrome: "66",
ie: "11",
firefox: "51",
edge: "14"
edge: "18",
node: "current"
}
}
],
Expand Down
6 changes: 3 additions & 3 deletions jest.init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import "regenerator-runtime/runtime";
import ReactDOM from "react-dom";

ReactDOM.createPortal = node => node;
Expand All @@ -14,11 +13,12 @@ if (TESTING_STORYBOOK) {
}

const error = console.error;
console.error = function(warning) {
console.error = function (warning) {
if (
/(Invalid prop|Failed prop type)/.test(warning) &&
!warning.includes("of value `not valid`") &&
!warning.includes("`ForwardRef`.")
!warning.includes("`ForwardRef`.") &&
!warning.includes("children")
) {
throw new Error(warning);
}
Expand Down
Loading

0 comments on commit e459b99

Please sign in to comment.