Skip to content

Commit

Permalink
chore(build): clean up build tooling
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove bower build, use npm
BREAKING CHANGE: cherry picked imports no longer have to specify `lib` in the import
  • Loading branch information
jquense committed Jan 25, 2019
1 parent 83506e8 commit e71fa89
Show file tree
Hide file tree
Showing 27 changed files with 421 additions and 348 deletions.
30 changes: 2 additions & 28 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = api => {
let dev = false;
let modules = true;
let modules = 'commonjs';

switch (api.env()) {
case 'docs':
Expand All @@ -22,32 +22,6 @@ module.exports = api => {
}

return {
presets: [
[
'@babel/preset-env',
{
loose: true,
shippedProposals: true,
modules: modules ? 'commonjs' : false,
targets: {
browsers: ['last 4 versions', 'not ie <= 8'],
},
},
],
['@babel/preset-react', { development: dev }],
],
plugins: [
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-export-namespace-from',
['@babel/plugin-transform-runtime', { useESModules: !modules }],
'babel-plugin-dev-expression',
modules && 'babel-plugin-add-module-exports',
api.env() === 'test' && 'babel-plugin-istanbul',
!dev && [
'transform-react-remove-prop-types',
{ removeImport: true, additionalLibraries: ['prop-types-extra'] },
],
].filter(Boolean),
presets: [['@react-bootstrap', { dev, modules, removePropTypes: !dev }]],
};
};
6 changes: 0 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
lib/
dist/
node_modules/**
es/
amd/
docs/assets/
coverage/
**/node_modules/**
tmp-*-repo/
www/.cache
www/public
stories/
116 changes: 2 additions & 114 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,116 +1,4 @@
{
"extends": ["eslint-config-airbnb", "prettier", "prettier/react"],
"env": {
"browser": true
},
"globals": {
"__DEV__": false
},
"parser": "babel-eslint",
"plugins": ["react", "prettier"],
"rules": {
"max-len": "off",
"no-plusplus": "off",
"prefer-const": "off",
"one-var": "off",
"no-param-reassign": "off",
"no-mixed-operators": [
"error",
{
"groups": [
["&", "|", "^", "~", "<<", ">>", ">>>"],
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
["&&", "||"],
["in", "instanceof"]
],
"allowSamePrecedence": false
}
],
"class-methods-use-this": "off",
"no-underscore-dangle": "off",
"prefer-destructuring": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/label-has-for": [
"error",
{ "required": { "some": ["nesting", "id"] } }
],
"react/forbid-prop-types": "off",
"react/jsx-boolean-value": 2,
"react/jsx-no-duplicate-props": 2,
"react/no-find-dom-node": "off",
"react/no-array-index-key": "off",
"react/no-string-refs": "off",
"react/prefer-stateless-function": "off",
"react/destructuring-assignment": "off",
"react/default-props-match-prop-types": "off",
"react/jsx-one-expression-per-line": "off",
"react/forbid-foreign-prop-types": "error",
"import/no-named-as-default-member": "off",
"react/jsx-filename-extension": [
"error",
{
"extensions": [".js"]
}
],
"react/prop-types": [
2,
{
"ignore": [
"children",
"className",
"style",
]
}
],
"react/require-default-props": "off",
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["!src/**/*.js"] }
],
"no-restricted-syntax": [
"error",
"ForOfStatement",
"LabeledStatement",
"WithStatement"
],
"no-unused-vars": [
2,
{
"vars": "all",
"args": "after-used",
"varsIgnorePattern": "^_\\d?$",
"argsIgnorePattern": "^_\\d?$"
}
]
},
"overrides": [
{
"files": ["tools/*"],
"env": {
"node": true,
"browser": false
},
"rules": {
"global-require": "off",
"no-console": "off"
}
},
{
"files": ["test/*"],
"rules": {
"no-return-assign": "off",
"global-require": "off",
"no-console": "off",
"react/no-render-return-value": "off",
"jsx-a11y/aria-role": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/tabindex-no-positive": "off",
"jsx-a11y/no-static-element-interactions": "off",
"import/first": "off"
}
}
]
"extends": ["@react-bootstrap"],
"plugins": ["prettier"]
}
101 changes: 90 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,92 @@
*~
.DS_Store
npm-debug.log*
node_modules
amd/


lib/
es/
dist/
tmp-*-repo/
.babel-cache/
coverage/
.idea
.vs/
www/.cache/
www/public/
.idea/
.vscode/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

*~
.DS_Store
4 changes: 0 additions & 4 deletions .projections.json

This file was deleted.

16 changes: 0 additions & 16 deletions .storybook/config.js

This file was deleted.

12 changes: 0 additions & 12 deletions .storybook/examples.css

This file was deleted.

1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ branches:
only:
- master
- next
- v4-support
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '{build}'

environment:
NODE_VERSION: "8"
NODE_VERSION: '8'
# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of io.js
Expand All @@ -13,12 +13,11 @@ install:
# No need for MSBuild on this project
build: off
cache:
- "%LOCALAPPDATA%\\Yarn"
- "%LOCALAPPDATA%\\Yarn"
test_script:
- yarn test

branches:
only:
- master
- next
- v4-support
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"homepage": "https://react-bootstrap.github.io/",
"sideEffects": false,
"main": "lib/index.js",
"module": "es/index.js",
"module": "lib/es/index.js",
"scripts": {
"bootstrap": "yarn && yarn --cwd www",
"build": "node tools/build.js",
Expand Down Expand Up @@ -68,6 +68,8 @@
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@react-bootstrap/babel-preset": "^1.1.2",
"@react-bootstrap/eslint-config": "^1.1.1",
"@storybook/react": "^3.4.8",
"@types/react": "^16.7.13",
"babel-core": "^7.0.0-bridge.0",
Expand Down Expand Up @@ -139,9 +141,7 @@
"uncontrollable": "^6.0.0",
"warning": "^4.0.1"
},
"release-script": {
"bowerRepo": "git@github.com:react-bootstrap/react-bootstrap-bower.git",
"docsRepo": "git@github.com:react-bootstrap/react-bootstrap.github.io.git",
"docsRoot": "www/public/"
"release": {
"publishDir": "lib"
}
}
Loading

0 comments on commit e71fa89

Please sign in to comment.