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

Commit 21f0ca5

Browse files
authoredApr 15, 2020
chore(deps): update (#90)
1 parent e76476c commit 21f0ca5

10 files changed

+5092
-2914
lines changed
 

‎.github/workflows/nodejs.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: raw-loader
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
pull_request:
9+
branches:
10+
- master
11+
- next
12+
13+
jobs:
14+
lint:
15+
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}
16+
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest]
23+
node-version: [12.x]
24+
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Use Node.js ${{ env.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ env.node-version }}
36+
37+
- name: Use latest NPM
38+
run: sudo npm i -g npm
39+
40+
- name: Install dependencies
41+
run: npm ci
42+
43+
- name: Lint
44+
run: npm run lint
45+
46+
- name: Security audit
47+
run: npm run security
48+
49+
- name: Check commit message
50+
uses: wagoid/commitlint-github-action@v1
51+
52+
test:
53+
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
54+
55+
strategy:
56+
matrix:
57+
os: [ubuntu-latest, windows-latest, macos-latest]
58+
node-version: [10.x, 12.x, 13.x]
59+
webpack-version: [latest, next]
60+
61+
runs-on: ${{ matrix.os }}
62+
63+
steps:
64+
- uses: actions/checkout@v2
65+
66+
- name: Use Node.js ${{ matrix.node-version }}
67+
uses: actions/setup-node@v1
68+
with:
69+
node-version: ${{ matrix.node-version }}
70+
71+
- name: Use latest NPM on ubuntu/macos
72+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
73+
run: sudo npm i -g npm
74+
75+
- name: Use latest NPM on windows
76+
if: matrix.os == 'windows-latest'
77+
run: npm i -g npm
78+
79+
- name: Install dependencies
80+
run: npm ci
81+
82+
- name: Install webpack ${{ matrix.webpack-version }}
83+
run: npm i webpack@${{ matrix.webpack-version }}
84+
85+
- name: Run tests for webpack version ${{ matrix.webpack-version }}
86+
run: npm run test:coverage -- --ci
87+
88+
- name: Submit coverage data to codecov
89+
uses: codecov/codecov-action@v1
90+
with:
91+
token: ${{ secrets.CODECOV_TOKEN }}

‎.prettierrc.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
module.exports = {
2-
singleQuote: true,
3-
trailingComma: 'es5',
4-
arrowParens: 'always',
5-
};
1+
module.exports = { singleQuote: true };

‎README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,14 @@ module.exports = {
5151
};
5252
```
5353

54-
Or from the command-line:
55-
56-
```console
57-
$ webpack --module-bind 'txt=raw-loader'
58-
```
59-
6054
And run `webpack` via your preferred method.
6155

6256
## Options
6357

58+
| Name | Type | Default | Description |
59+
| :-------------------------: | :---------: | :-----: | :--------------------- |
60+
| **[`esModule`](#esmodule)** | `{Boolean}` | `true` | Uses ES modules syntax |
61+
6462
### `esModule`
6563

6664
Type: `Boolean`
@@ -123,8 +121,8 @@ Please take a moment to read our contributing guidelines if you haven't yet done
123121
[node-url]: https://nodejs.org
124122
[deps]: https://david-dm.org/webpack-contrib/raw-loader.svg
125123
[deps-url]: https://david-dm.org/webpack-contrib/raw-loader
126-
[tests]: https://dev.azure.com/webpack-contrib/raw-loader/_apis/build/status/webpack-contrib.raw-loader?branchName=master
127-
[tests-url]: https://dev.azure.com/webpack-contrib/raw-loader/_build/latest?definitionId=10&branchName=master
124+
[tests]: https://github.com/webpack-contrib/raw-loader/workflows/raw-loader/badge.svg
125+
[tests-url]: https://github.com/webpack-contrib/raw-loader/actions
128126
[cover]: https://codecov.io/gh/webpack-contrib/raw-loader/branch/master/graph/badge.svg
129127
[cover-url]: https://codecov.io/gh/webpack-contrib/raw-loader
130128
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg

‎azure-pipelines.yml

-200
This file was deleted.

‎lint-staged.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
3-
'*.{json,md,yml,css,ts}': ['prettier --write', 'git add'],
2+
'*.js': ['prettier --write', 'eslint --fix'],
3+
'*.{json,md,yml,css,ts}': ['prettier --write'],
44
};

‎package-lock.json

+4,957-2,658
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+24-24
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
2323
"commitlint": "commitlint --from=master",
2424
"security": "npm audit",
25-
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
25+
"lint:prettier": "prettier --list-different .",
2626
"lint:js": "eslint --cache .",
2727
"lint": "npm-run-all -l -p \"lint:**\"",
2828
"test:only": "cross-env NODE_ENV=test jest",
@@ -41,35 +41,35 @@
4141
"webpack": "^4.0.0 || ^5.0.0"
4242
},
4343
"dependencies": {
44-
"loader-utils": "^1.2.3",
45-
"schema-utils": "^2.5.0"
44+
"loader-utils": "^2.0.0",
45+
"schema-utils": "^2.6.5"
4646
},
4747
"devDependencies": {
48-
"@babel/cli": "^7.7.4",
49-
"@babel/core": "^7.7.4",
50-
"@babel/preset-env": "^7.7.4",
51-
"@commitlint/cli": "^8.2.0",
52-
"@commitlint/config-conventional": "^8.2.0",
53-
"@webpack-contrib/defaults": "^6.2.0",
48+
"@babel/cli": "^7.8.4",
49+
"@babel/core": "^7.9.0",
50+
"@babel/preset-env": "^7.9.5",
51+
"@commitlint/cli": "^8.3.5",
52+
"@commitlint/config-conventional": "^8.3.4",
53+
"@webpack-contrib/defaults": "^6.3.0",
5454
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
55-
"babel-jest": "^24.9.0",
56-
"commitlint-azure-pipelines-cli": "^1.0.2",
57-
"cross-env": "^6.0.3",
55+
"babel-jest": "^25.3.0",
56+
"commitlint-azure-pipelines-cli": "^1.0.3",
57+
"cross-env": "^7.0.2",
5858
"del": "^5.1.0",
5959
"del-cli": "^3.0.0",
60-
"eslint": "^6.7.1",
61-
"eslint-config-prettier": "^6.7.0",
62-
"eslint-plugin-import": "^2.18.2",
63-
"eslint-plugin-prettier": "^3.1.1",
64-
"husky": "^3.1.0",
65-
"jest": "^24.9.0",
66-
"jest-junit": "^9.0.0",
67-
"lint-staged": "^9.4.3",
68-
"memfs": "^2.16.1",
60+
"eslint": "^6.8.0",
61+
"eslint-config-prettier": "^6.10.1",
62+
"eslint-plugin-import": "^2.20.2",
63+
"eslint-plugin-prettier": "^3.1.3",
64+
"husky": "^4.2.5",
65+
"jest": "^25.3.0",
66+
"jest-junit": "^10.0.0",
67+
"lint-staged": "^10.1.3",
68+
"memfs": "^3.1.2",
6969
"npm-run-all": "^4.1.5",
70-
"prettier": "^1.19.1",
71-
"standard-version": "^7.0.1",
72-
"webpack": "^4.41.2"
70+
"prettier": "^2.0.4",
71+
"standard-version": "^7.1.0",
72+
"webpack": "^4.42.1"
7373
},
7474
"keywords": [
7575
"webpack"

‎src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import validateOptions from 'schema-utils';
44
import schema from './options.json';
55

66
export default function rawLoader(source) {
7-
const options = getOptions(this) || {};
7+
const options = getOptions(this);
88

99
validateOptions(schema, options, {
1010
name: 'Raw Loader',
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`validate options should throw an error on the "esModule" option with "true" value 1`] = `
4-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
4+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
55
- options.esModule should be a boolean."
66
`;
77

88
exports[`validate options should throw an error on the "unknown" option with "/test/" value 1`] = `
9-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
9+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
1010
- options has an unknown property 'unknown'. These properties are valid:
1111
object { esModule? }"
1212
`;
1313
1414
exports[`validate options should throw an error on the "unknown" option with "[]" value 1`] = `
15-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
15+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
1616
- options has an unknown property 'unknown'. These properties are valid:
1717
object { esModule? }"
1818
`;
1919
2020
exports[`validate options should throw an error on the "unknown" option with "{"foo":"bar"}" value 1`] = `
21-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
21+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
2222
- options has an unknown property 'unknown'. These properties are valid:
2323
object { esModule? }"
2424
`;
2525
2626
exports[`validate options should throw an error on the "unknown" option with "{}" value 1`] = `
27-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
27+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
2828
- options has an unknown property 'unknown'. These properties are valid:
2929
object { esModule? }"
3030
`;
3131
3232
exports[`validate options should throw an error on the "unknown" option with "1" value 1`] = `
33-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
33+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
3434
- options has an unknown property 'unknown'. These properties are valid:
3535
object { esModule? }"
3636
`;
3737
3838
exports[`validate options should throw an error on the "unknown" option with "false" value 1`] = `
39-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
39+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
4040
- options has an unknown property 'unknown'. These properties are valid:
4141
object { esModule? }"
4242
`;
4343
4444
exports[`validate options should throw an error on the "unknown" option with "test" value 1`] = `
45-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
45+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
4646
- options has an unknown property 'unknown'. These properties are valid:
4747
object { esModule? }"
4848
`;
4949
5050
exports[`validate options should throw an error on the "unknown" option with "true" value 1`] = `
51-
"Invalid options object. Raw Loader has been initialised using an options object that does not match the API schema.
51+
"Invalid options object. Raw Loader has been initialized using an options object that does not match the API schema.
5252
- options has an unknown property 'unknown'. These properties are valid:
5353
object { esModule? }"
5454
`;

‎test/helpers/normalizeErrors.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ function removeCWD(str) {
1414

1515
export default (errors) => {
1616
return errors.map((error) =>
17-
removeCWD(
18-
error
19-
.toString()
20-
.split('\n')
21-
.slice(0, 2)
22-
.join('\n')
23-
)
17+
removeCWD(error.toString().split('\n').slice(0, 2).join('\n'))
2418
);
2519
};

0 commit comments

Comments
 (0)
This repository has been archived.