Skip to content

Commit

Permalink
Merge pull request #20 from swup/next
Browse files Browse the repository at this point in the history
Update for swup 4
  • Loading branch information
daun authored Jul 26, 2023
2 parents 8b635e5 + 13d6dcf commit e890a14
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 139 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

<!-- ## [Unreleased] -->

## [4.0.0] - 2023-07-26

- Update for swup 4 compatibility

## [3.0.0] - 2023-03-10

- Switch to microbundle
- Export native ESM module

## [2.0.0] - 2022-08-20

- Make global instance on window optional

## [1.0.0] - 2019-05-02

- Initial release

[Unreleased]: https://github.com/swup/debug-plugin/compare/4.0.0...HEAD

[4.0.0]: https://github.com/swup/debug-plugin/releases/tag/4.0.0
[3.0.0]: https://github.com/swup/debug-plugin/releases/tag/3.0.0
[2.0.0]: https://github.com/swup/debug-plugin/releases/tag/2.0.0
[1.0.0]: https://github.com/swup/debug-plugin/releases/tag/1.0.0
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Swup Debug Plugin

A [swup](https://swup.js.org) plugin for debugging and helping in development.

- Output all triggered hooks to the console as they happen
- Rewrites swup's `log` method so that any output provided by plugins is visible
- Detect common mistakes and suggest solutions in the console

## Installation

Install the plugin from npm and import it into your bundle.

```bash
npm install @swup/debug-plugin
```

```js
import SwupDebugPlugin from '@swup/debug-plugin';
```

Or include the minified production file from a CDN:

```html
<script src="https://unpkg.com/@swup/debug-plugin@4"></script>
```

## Usage

To run this plugin, include an instance in the swup options.

```javascript
const swup = new Swup({
plugins: [new SwupDebugPlugin()]
});
```

## Options

### globalInstance

If `true`, the plugin will store the swup instance on the global window object, making swup
available at `window.swup`. Defaults to `false`.

```javascript
{
globalInstance: true
}
```
49 changes: 29 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@swup/debug-plugin",
"amdName": "SwupDebugPlugin",
"version": "3.0.0",
"description": "Swup Debug plugin.",
"version": "4.0.0",
"description": "A swup plugin for debugging and helping in development",
"type": "module",
"source": "src/index.js",
"main": "./dist/index.cjs",
Expand All @@ -17,7 +17,7 @@
"dev": "swup-plugin dev",
"lint": "swup-plugin lint",
"format": "swup-plugin format",
"prepublish": "npm run build"
"prepublishOnly": "npm run build"
},
"author": {
"name": "Georgy Marchuk",
Expand All @@ -42,10 +42,10 @@
"url": "https://github.com/swup/debug-plugin.git"
},
"dependencies": {
"@swup/plugin": "^2.0.0"
"@swup/plugin": "^3.0.0"
},
"peerDependencies": {
"swup": "^3.0.0"
"swup": "^4.0.0"
},
"browserslist": [
"extends @swup/browserslist-config"
Expand Down
48 changes: 0 additions & 48 deletions readme.md

This file was deleted.

Loading

0 comments on commit e890a14

Please sign in to comment.