Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "chore: fix maintainers images being squished (#576)" #577

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
121 changes: 50 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ yarn `yarn add -D karma-webpack`
<h2 align="center">Usage</h2>

**karma.conf.js**

```js
module.exports = (config) => {
config.set({
// ... normal karma configuration

// make sure to include webpack as a framework
frameworks: ['mocha', 'webpack'],

plugins: [
'karma-webpack',
'karma-mocha',
Expand All @@ -41,12 +40,12 @@ module.exports = (config) => {
files: [
// all files ending in ".test.js"
// !!! use watched: false as we use webpacks watch
{pattern: 'test/**/*.test.js', watched: false}
{ pattern: 'test/**/*.test.js', watched: false }
],

preprocessors: {
// add webpack as preprocessor
'test/**/*.test.js': ['webpack']
'test/**/*.test.js': [ 'webpack' ]
},

webpack: {
Expand Down Expand Up @@ -96,30 +95,25 @@ const defaultWebpackOptions = {

### How it works

This project is a framework and preprocessor for Karma that combines test files and dependencies into 2 shared bundles
and 1 chunk per test file. It relies on webpack to generate the bundles/chunks and to keep it updated during
autoWatch=true.
This project is a framework and preprocessor for Karma that combines test files and dependencies into 2 shared bundles and 1 chunk per test file. It relies on webpack to generate the bundles/chunks and to keep it updated during autoWatch=true.

The first preproccessor triggers the build of all the bundles/chunks and all following files just return the output of
this one build process.
The first preproccessor triggers the build of all the bundles/chunks and all following files just return the output of this one build process.

### Webpack typescript support

By default karma-webpack forces *.js files so if you test *.ts files and use webpack to build typescript to javascript
it works out of the box.
By default karma-webpack forces *.js files so if you test *.ts files and use webpack to build typescript to javascript it works out of the box.

If you have a different need you can override by settig `webpack.transformPath`

```js
// this is the by default applied transformPath
webpack: {
transformPath: (filepath) => {
// force *.js files by default
const info = path.parse(filepath);
return `${path.join(info.dir, info.name)}.js`;
},
}
,
// force *.js files by default
const info = path.parse(filepath);
return `${path.join(info.dir, info.name)}.js`;
},
},
```

### `Source Maps`
Expand All @@ -133,113 +127,98 @@ npm i -D karma-sourcemap-loader
And then add it to your preprocessors.

**karma.conf.js**

```js
preprocessors: {
'test/test_index.js'
:
['webpack', 'sourcemap']
'test/test_index.js': [ 'webpack', 'sourcemap' ]
}
```

And tell `webpack` to generate sourcemaps.

**webpack.config.js**

```js
webpack: {
// ...
devtool: 'inline-source-map'
}
```

<style>

.maintainer-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

.maintainer {
display: flex;
flex-direction: column;
padding: 8px;
}

.maintainer > a {
padding-top: 8px;
}

</style>

<h2 align="center">Current Maintainers</h2>

<div class="maintainer-container">
<div class="maintainer">
<img width="150" height="150" src="https://avatars.githubusercontent.com/u/13606342?s=460&u=467cf9a106d2bb474cf627ffd4e0eac80d0b4705&v=4">
<a href="http://codymikol.com">Cody Mikol</a>
</div>
</div>

<table>
<tbody>
<tr>
<td>
<img width="150" height="150"
src="https://avatars.githubusercontent.com/u/13606342?s=460&u=467cf9a106d2bb474cf627ffd4e0eac80d0b4705&v=4">
<br>
<a href="http://codymikol.com">Cody Mikol</a>
</td>
</tr>
<tbody>
</table>

<h2 align="center">Previous Maintainers</h2>

Previous maintainers of the `karma-webpack` plugin that have done such amazing work to get it to where it is today. 🎉🎉🎉
Previous maintainers of the `karma-webpack` plugin that have done such amazing work to get it to where it is today.

<div class="maintainer-container">
<div class="maintainer">
<table class="maintainers">
<tbody>
<tr>
<td align="center">
<img width="150" height="150"
src="https://avatars0.githubusercontent.com/u/7922109?v=4&s=150">
<br>
<a href="https://github.com/ryanclark">Ryan Clark</a>
</div>
<div class="maintainer">
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/2045543?v=4&s=150">
<br>
<a href="https://github.com/AprilArcus">April Arcus</a>
</div>
<div class="maintainer">
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars.githubusercontent.com/u/4650931?v=3&s=150">
</br>
<a href="https://github.com/MikaAK">Mika Kalathil</a>
</div>
<div class="maintainer">
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars.githubusercontent.com/u/8420490?v=3&s=150">
<a href="https://github.com/d3viant0ne">Joshua Wiens</a>
</div>
<div class="maintainer">
</td>
<td align="center">
<img width="150" height="150" src="https://avatars.githubusercontent.com/u/1919664?v=3&s=150">
<a href="https://github.com/goldhand">Will Farley</a>
</div>
<div class="maintainer">
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars.githubusercontent.com/u/1307954?v=3&s=150">
<a href="https://github.com/DanielaValero">Daniela Valero</a>
</div>
</td>
</tr>
<tr>
<div class="maintainer">
<td align="center">
<img width="150" height="150"
src="https://avatars.githubusercontent.com/u/122108?v=3&s=150">
<a href="https://github.com/jon301">Jonathan Trang</a>
</div>
<div class="maintainer">
</td>
<td align="center">
<img width="150" height="150"
src="https://avatars.githubusercontent.com/u/3285723?v=3&s=150">
<a href="https://github.com/carlos-">Carlos Morales</a>
</div>
</div>
</td>
</tr>
<tbody>
</table>


[npm]: https://img.shields.io/npm/v/karma-webpack.svg

[npm-url]: https://npmjs.com/package/karma-webpack

[node]: https://img.shields.io/node/v/karma-webpack.svg

[node-url]: https://nodejs.org

[cover]: https://codecov.io/gh/webpack-contrib/karma-webpack/branch/master/graph/badge.svg

[cover-url]: https://codecov.io/gh/webpack-contrib/karma-webpack