@histoire/plugin-percy 0.17.17 → 1.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,8 +9,8 @@ pnpm add -D @histoire/plugin-percy
9
9
  Add the plugin in histoire config:
10
10
 
11
11
  ```js
12
- import { defineConfig } from 'histoire'
13
12
  import { HstPercy } from '@histoire/plugin-percy'
13
+ import { defineConfig } from 'histoire'
14
14
 
15
15
  export default defineConfig({
16
16
  plugins: [
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { fileURLToPath } from 'node:url';
2
1
  import { createRequire } from 'node:module';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { fetchPercyDOM, isPercyEnabled, postSnapshot } from '@percy/sdk-utils';
3
4
  import { defu } from 'defu';
4
5
  import path from 'pathe';
5
- import { fetchPercyDOM, isPercyEnabled, postSnapshot } from '@percy/sdk-utils';
6
6
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
  const require = createRequire(import.meta.url);
8
8
  const defaultOptions = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@histoire/plugin-percy",
3
3
  "type": "module",
4
- "version": "0.17.17",
4
+ "version": "1.0.0-alpha.2",
5
5
  "description": "Histoire plugin to take screenshots with Percy for visual regression testing",
6
6
  "author": {
7
7
  "name": "Guillaume Chau"
@@ -23,19 +23,19 @@
23
23
  "module": "./dist/index.js",
24
24
  "types": "./dist/index.d.ts",
25
25
  "peerDependencies": {
26
- "histoire": "^0.17.17"
26
+ "histoire": "^1.0.0-alpha.2"
27
27
  },
28
28
  "dependencies": {
29
- "@percy/sdk-utils": "^1.27.4",
30
- "defu": "^6.1.3",
31
- "fs-extra": "^10.1.0",
32
- "pathe": "^1.1.1",
33
- "puppeteer": "^13.7.0"
29
+ "@percy/sdk-utils": "^1.30.4",
30
+ "defu": "^6.1.4",
31
+ "fs-extra": "^11.2.0",
32
+ "pathe": "^1.1.2",
33
+ "puppeteer": "^23.10.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/node": "^18.11.9",
37
- "typescript": "^5.4.4",
38
- "histoire": "0.17.17"
36
+ "@types/node": "^22.10.1",
37
+ "typescript": "5.6.3",
38
+ "histoire": "1.0.0-alpha.2"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "rimraf dist && tsc -d",
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { fileURLToPath } from 'node:url'
2
- import { createRequire } from 'node:module'
3
1
  import type { Plugin } from 'histoire'
2
+ import type { Page, WaitForOptions } from 'puppeteer'
3
+ import { createRequire } from 'node:module'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { fetchPercyDOM, isPercyEnabled, postSnapshot } from '@percy/sdk-utils'
4
6
  import { defu } from 'defu'
5
7
  import path from 'pathe'
6
- import { fetchPercyDOM, isPercyEnabled, postSnapshot } from '@percy/sdk-utils'
7
- import type { JSONObject, Page, WaitForOptions } from 'puppeteer'
8
8
 
9
9
  const __dirname = path.dirname(fileURLToPath(import.meta.url))
10
10
  const require = createRequire(import.meta.url)
@@ -148,7 +148,7 @@ export function HstPercy(options: PercyPluginOptions = {}): Plugin {
148
148
  const domSnapshot = await page.evaluate((opts) => {
149
149
  // @ts-expect-error window global var
150
150
  return window.PercyDOM.serialize(opts)
151
- }, percyOptions as JSONObject)
151
+ }, percyOptions)
152
152
  await postSnapshot({
153
153
  ...percyOptions,
154
154
  environmentInfo: ENV_INFO,