Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
refactor: apply webpack-defaults (#102)
Browse files Browse the repository at this point in the history
- Upgrades to `webpack-defaults@2.0.0`
- Drops support for `node =< v4.0.0`
- Sets the minimum `peerDependency` to `webpack >= 3.0.0`

BREAKING CHANGE: Sets `engines` to `"node": ">= 6.9.0 || >= 8.9.0"`
BREAKING CHANGE: Drops support for `webpack =< v2.0.0`
  • Loading branch information
michael-ciniawsky authored and joshwiens committed Dec 17, 2017
1 parent 672ba80 commit 073b588
Show file tree
Hide file tree
Showing 37 changed files with 727 additions and 96 deletions.
35 changes: 35 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"presets": [
[
"env",
{
"useBuiltIns": true,
"targets": {
"node": "6.9.0"
},
"exclude": [
"transform-async-to-generator",
"transform-regenerator"
]
}
]
],
"plugins": [
[
"transform-object-rest-spread",
{
"useBuiltIns": true
}
]
],
"env": {
"test": {
"presets": [
"env"
],
"plugins": [
"transform-object-rest-spread"
]
}
}
}
162 changes: 162 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
unit_tests: &unit_tests
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: NPM Rebuild
command: npm rebuild
- run:
name: Run unit tests.
command: npm run ci:test
canary_tests: &canary_tests
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: NPM Rebuild
command: npm rebuild
- run:
name: Install Webpack Canary
command: npm i --no-save webpack@next
- run:
name: Run unit tests.
command: npm run ci:test

version: 2
jobs:
dependency_cache:
docker:
- image: webpackcontrib/circleci-node-base:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules

node8_webpack_latest:
docker:
- image: webpackcontrib/circleci-node8:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: NPM Rebuild
command: npm rebuild
- run:
name: Run unit tests.
command: npm run ci:coverage
- run:
name: Submit coverage data to codecov.
command: bash <(curl -s https://codecov.io/bash)
when: on_success
node6_webpack_latest:
docker:
- image: webpackcontrib/circleci-node6:latest
<<: *unit_tests
node9_webpack_latest:
docker:
- image: webpackcontrib/circleci-node9:latest
<<: *unit_tests
node8_webpack_canary:
docker:
- image: webpackcontrib/circleci-node8:latest
<<: *canary_tests
analysis:
docker:
- image: webpackcontrib/circleci-node-base:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: NPM Rebuild
command: npm rebuild
- run:
name: Run linting.
command: npm run lint
- run:
name: Run NSP Security Check.
command: npm run security
- run:
name: Validate Commit Messages
command: npm run ci:lint:commits
publish:
docker:
- image: webpackcontrib/circleci-node-base:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: NPM Rebuild
command: npm rebuild
- run:
name: Validate Commit Messages
command: npm run release:validate
- run:
name: Publish to NPM
command: printf "noop running conventional-github-releaser"

version: 2.0
workflows:
version: 2
validate-publish:
jobs:
- dependency_cache
- node6_webpack_latest:
requires:
- dependency_cache
filters:
tags:
only: /.*/
- node8_webpack_latest:
requires:
- dependency_cache
filters:
tags:
only: /.*/
- node9_webpack_latest:
requires:
- dependency_cache
filters:
tags:
only: /.*/
- node8_webpack_canary:
requires:
- dependency_cache
filters:
tags:
only: /.*/
- analysis:
requires:
- node6_webpack_latest
- node8_webpack_latest
- node9_webpack_latest
filters:
tags:
only: /.*/
- publish:
requires:
- node6_webpack_latest
- node8_webpack_latest
- node9_webpack_latest
- analysis
filters:
branches:
only:
- master
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[.md]
insert_final_newline = false
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
root: true,
plugins: ['prettier'],
extends: ['@webpack-contrib/eslint-config-webpack'],
rules: {
'prettier/prettier': [
'error',
{ singleQuote: true, trailingComma: 'es5', arrowParens: 'always' },
],
},
};
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package-lock.json -diff
* text=auto
bin/* eol=lf
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are the default owners for everything in
# webpack-contrib
@webpack-contrib/org-maintainers

# Add repository specific users / groups
# below here for libs that are not maintained by the org.
20 changes: 6 additions & 14 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
<!-- Before creating an issue please make sure you are using the latest version of url-loader. -->
<!--
1. Check the version of package you are using. If it's not the newest version, update and try again (see changelog while updating!).
2. If the issue is still there, write a minimal project showing the problem and expected output.
3. Link to the project and mention Node version and OS in your report.
**Do you want to request a *feature* or report a *bug*?**
<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). Questions will be closed. -->

**What is the current behavior?**

**If the current behavior is a bug, please provide the steps to reproduce.**
<!-- A great way to do this is to provide your configuration via a GitHub gist. -->

**What is the expected behavior?**

**If this is a feature request, what is motivation or use case for changing the behavior?**

**Please mention other relevant information such as your webpack version, Node.js version and Operating System.**
**IMPORTANT! You should use [Stack Overflow](https://stackoverflow.com/) for support related questions.**
-->
23 changes: 5 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**What kind of change does this PR introduce?**
<!-- E.g. a bugfix, feature, refactoring, build related change, etc… -->

**Did you add tests for your changes?**

**If relevant, did you update the README?**

**Summary**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. -->

**Does this PR introduce a breaking change?**
<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->

**Other information**
<!--
1. [Read and sign the CLA](https://cla.js.foundation/webpack/webpack.js.org). This needs to be done only once. PRs that haven't signed it won't be accepted.
2. Check out the [development guide](https://webpack.js.org/development/) for the API and development guidelines.
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
-->
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
node_modules
node_modules
logs
*.log
npm-debug.log*
.eslintcache
/coverage
/dist
/local
/reports
/node_modules
.DS_Store
Thumbs.db
.idea
.vscode
*.sublime-project
*.sublime-workspace
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "always"
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ module.exports = {

|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|**`limit`**|`{Number}`|`undefined`|Byte limit to inline files as Data URL|
|**`mimetype`**|`{String}`|`extname`|Specify MIME type for the file (Otherwise it's inferred from the file extension)|
|**`fallback`**|`{String}`|`file-loader`|Specify `loader` for the file when file is greater than the limit (in bytes)|
|**[`limit`](#limit)**|`{Number}`|`undefined`|Byte limit to inline files as Data URL|
|**[`mimetype`](#mimetype)**|`{String}`|`extname`|Specify MIME type for the file (Otherwise it's inferred from the file extension)|
|**[`fallback`](#fallback)**|`{String}`|`file-loader`|Specify `loader` for the file when file is greater than the limit (in bytes)|

### `limit`

Expand Down
30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
branches:
only:
- master
- next
init:
- git config --global core.autocrlf input
environment:
matrix:
- nodejs_version: '8'
webpack_version: latest
job_part: test
- nodejs_version: '6'
webpack_version: latest
job_part: test
- nodejs_version: '8'
webpack_version: next
job_part: test
build: 'off'
matrix:
fast_finish: true
install:
- ps: Install-Product node $env:nodejs_version x64
- npm i -g npm@latest
- npm install
before_test:
- cmd: npm install webpack@%webpack_version%
test_script:
- node --version
- npm --version
- cmd: npm run ci:%job_part%
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
precision: 2
round: down
range: 70...100

status:
project: no
patch: yes

comment: 'off'
31 changes: 31 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable */
const Configuration = {
extends: ['@commitlint/config-angular'],

rules: {
'body-leading-blank': [1, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 72],
'scope-case': [2, 'always', 'lower-case'],
'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
},
};

module.exports = Configuration;
Loading

0 comments on commit 073b588

Please sign in to comment.