Skip to content

Commit

Permalink
Upgrade yarn and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
nkbt committed Aug 17, 2021
1 parent 3b10008 commit 7abc265
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 61 deletions.
22 changes: 11 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ version: 2


jobs:
build:
ui:
working_directory: ~/app
docker:
- image: circleci/node:10
- image: cimg/node:16.3.0-browsers

steps:
- checkout
- restore_cache:
key: deps-{{ checksum "yarn.lock" }}
- run: yarn install --pure-lockfile --offline
- run: yarn deps
- save_cache:
key: deps-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- node_modules
- run: yarn install --immutable --immutable-cache
- run: yarn check:deps
- run: yarn lint
- run: yarn test
- run: yarn lib
- run: yarn dist
- run: yarn pub


workflows:
version: 2
dev:
jobs:
- ui
9 changes: 9 additions & 0 deletions .depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ignores: [
"webpack-dev-server"
]
ignore-dirs: [
".yarn",
"build",
"lib",
"pub"
]
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ module.exports = {
browser: true
},
rules: {
'no-multiple-empty-lines': ["error", {"max": 2}],
'arrow-parens': ['error', 'as-needed'],
'comma-dangle': ['error', 'never'],
'eqeqeq': ['error', 'always'],
'object-curly-spacing': ['error', 'never'],
'no-console': 'off',
'global-require': 'off',
Expand All @@ -24,7 +22,7 @@ module.exports = {
'lifecycle',
'everything-else',
'render'
],
]
}],
'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
'react/jsx-closing-bracket-location': ['error', {
Expand All @@ -46,6 +44,8 @@ module.exports = {

'react/state-in-constructor': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/no-array-index-key': 'off'
'react/no-array-index-key': 'off',

'no-multiple-empty-lines': 'off'
}
};
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ pids
/reports/

/.eslintcache

# Yarn V2 Zero Installs
.yarn/*
!.yarn/cache
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
5 changes: 0 additions & 5 deletions .yarnrc

This file was deleted.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.0.1.cjs
72 changes: 35 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"build": "yarn lib && yarn dist",
"start": "NODE_ENV=development webpack-dev-server --config ./webpack/dev.config.js",
"start": "NODE_ENV=development webpack-cli serve --config ./webpack/dev.config.js",
"predist": "rm -rf ./build",
"dist": "NODE_ENV=production webpack-cli --config ./webpack/dist.config.js && NODE_ENV=production webpack-cli --config ./webpack/min.config.js",
"preghPages": "yarn pub",
Expand All @@ -30,10 +30,8 @@
"test": "node test/Component-test.js",
"prepublishOnly": "yarn build",
"postversion": "git push --follow-tags",
"nuke": "rm -rf node_modules yarn.lock",
"postnuke": "yarn install",
"deps": "! depcheck --specials=bin,eslint --ignore-dirs=build,lib,pub --ignores=@types/* | grep --invert-match 'No depcheck issue'",
"validate": "yarn lint && yarn test && yarn deps",
"deps": "depcheck",
"check:deps": "[ ! $(depcheck | grep --invert-match 'No depcheck issue') ]",
"offline-update": "yarn cache clean && yarn install --force",
"offline": "yarn install --pure-lockfile --offline"
},
Expand All @@ -49,7 +47,7 @@
"debounce",
"throttle"
],
"author": "Nik Butenko <nik@butenko.me>",
"author": "Nik Butenko <nik@butenko.me> (https://butenko.me)",
"license": "MIT",
"bugs": {
"url": "https://github.com/nkbt/react-debounce-input/issues"
Expand All @@ -63,37 +61,36 @@
"prop-types": "^15.7.2"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@types/react": "^16.9.7",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.0",
"@babel/cli": "^7.14.8",
"@babel/core": "^7.15.0",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"@babel/preset-env": "^7.15.0",
"@babel/preset-react": "^7.14.5",
"@babel/register": "^7.15.3",
"@types/react": "^17.0.18",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"css-loader": "^3.2.0",
"depcheck": "^0.8.3",
"eslint": "^6.4.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.7.0",
"gh-pages": "^2.1.1",
"html-webpack-plugin": "^3.2.0",
"html-webpack-tags-plugin": "^2.0.17",
"mini-css-extract-plugin": "^0.8.0",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"style-loader": "^1.0.0",
"tape": "^4.11.0",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.1"
"css-loader": "^6.2.0",
"depcheck": "^1.4.2",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"gh-pages": "^3.2.3",
"html-webpack-plugin": "^5.3.2",
"html-webpack-tags-plugin": "^3.0.1",
"mini-css-extract-plugin": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"style-loader": "^3.2.1",
"tape": "^5.3.1",
"webpack": "^5.50.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^3.11.2"
},
"files": [
"build",
Expand All @@ -102,5 +99,6 @@
"LICENSE",
"package.json",
"README.md"
]
],
"packageManager": "yarn@3.0.1"
}
7 changes: 6 additions & 1 deletion webpack/dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {

module.exports = {
mode,
devtool: 'source-map',
devtool: 'eval',

entry: [
pathTo('example', 'index.js'),
Expand All @@ -21,6 +21,11 @@ module.exports = {
filename: 'bundle.js',
path: pathTo('dev')
},
optimization: {
minimize: false,
moduleIds: 'named',
chunkIds: 'named'
},
plugins: [
plugins.html
],
Expand Down
4 changes: 3 additions & 1 deletion webpack/dist.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ module.exports = {
libraryTarget: 'umd'
},
optimization: {
minimize: false
minimize: false,
moduleIds: 'named',
chunkIds: 'named'
},
plugins: [
plugins.emptyPropTypes
Expand Down
5 changes: 5 additions & 0 deletions webpack/min.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ module.exports = {
library: COMPONENT_NAME,
libraryTarget: 'umd'
},
optimization: {
minimize: true,
moduleIds: 'named',
chunkIds: 'named'
},
plugins: [
plugins.emptyPropTypes,
plugins.loaderOptions
Expand Down
5 changes: 3 additions & 2 deletions webpack/pub.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const {
pathTo,
Expand All @@ -20,7 +19,9 @@ module.exports = {
path: pathTo('pub')
},
optimization: {
minimize: false
minimize: false,
moduleIds: 'named',
chunkIds: 'named'
},
plugins: [
plugins.html,
Expand Down

0 comments on commit 7abc265

Please sign in to comment.