From 5344fd58e6e95bbe97e2cf57fcacbf64b40f334b Mon Sep 17 00:00:00 2001 From: Rajab Natshah Date: Sat, 1 Aug 2026 16:53:56 +0300 Subject: [PATCH] feat: scope the package as @webship/diffy-steps at 2.0.0 (#1) "name": "diffy-steps", -> "name": "@webship/diffy-steps", "version": "0.1.0", -> "version": "2.0.0", The scope puts the package in the organisation's namespace instead of the global one. The version aligns the plugin with the line it plugs into: it peers against webship-js ^2.0.4, its branch is 2.0.x, and its step phrasings are the 2.0.x phrasings extracted from webship-js. 0.1.0 implied a pre-release on an unrelated track. Scoped packages publish as `restricted` by default, which would contradict the public repository, so publishConfig.access is set to public. Every reference to the package name follows: the install commands, the node_modules/@webship/diffy-steps/... require paths in the configuration examples, the copy and uninstall snippets, the doc headings, and the step-file header. package-lock.json regenerated. Not published. The webship org does not yet exist on npmjs.com and the publishing account needs membership in it before a first release. Verified: npm pack --dry-run reports @webship/diffy-steps@2.0.0, and the suite still passes 6 scenarios / 37 steps against the mock Diffy API. Co-Authored-By: Claude Opus 5 --- README.md | 8 ++++---- docs/README.md | 4 ++-- package-lock.json | 8 ++++---- package.json | 7 +++++-- tests/step-definitions/README.md | 10 +++++----- tests/step-definitions/diffy.steps.js | 2 +- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ea37b9f..29279cd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# diffy-steps +# @webship/diffy-steps [![Test](https://github.com/webship/diffy-steps/actions/workflows/test.yml/badge.svg)](https://github.com/webship/diffy-steps/actions/workflows/test.yml) -Diffy-specific Cucumber step definitions for [webship-js](https://www.npmjs.com/package/webship-js) — a Playwright + Cucumber BDD testing framework. `diffy-steps` adds a `diffy.steps.js` step-pack that captures full-page Playwright screenshots at multiple breakpoints and drives [Diffy](https://diffy.website) visual-regression comparisons through the Diffy REST API, so you can express visual checks as readable Gherkin instead of hand-rolling API calls. +Diffy-specific Cucumber step definitions for [webship-js](https://www.npmjs.com/package/webship-js) — a Playwright + Cucumber BDD testing framework. `@webship/diffy-steps` adds a `diffy.steps.js` step-pack that captures full-page Playwright screenshots at multiple breakpoints and drives [Diffy](https://diffy.website) visual-regression comparisons through the Diffy REST API, so you can express visual checks as readable Gherkin instead of hand-rolling API calls. It is a **plugin for webship-js** — it does not run standalone. It ships one file of step definitions; you drop it into an existing (or new) webship-js test project. @@ -27,7 +27,7 @@ See [tests/step-definitions/diffy.steps.js](tests/step-definitions/diffy.steps.j ## Installation ```bash -npm install --save-dev webship-js diffy-steps +npm install --save-dev webship-js @webship/diffy-steps ``` Add both step-definition paths to your project's `cucumber.js`: @@ -37,7 +37,7 @@ module.exports = { default: { require: [ 'node_modules/webship-js/tests/step-definitions/**/*.js', // webship-js core steps - 'node_modules/diffy-steps/tests/step-definitions/**/*.js', // this plugin + 'node_modules/@webship/diffy-steps/tests/step-definitions/**/*.js', // this plugin 'tests/step-definitions/**/*.js', // your own custom steps, if any ], paths: ['tests/features/**/*.feature'], diff --git a/docs/README.md b/docs/README.md index d72c8c1..328bf4a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ -# diffy-steps documentation +# @webship/diffy-steps documentation -Per-step reference for the `diffy-steps` plugin for [webship-js](https://www.npmjs.com/package/webship-js). +Per-step reference for the `@webship/diffy-steps` plugin for [webship-js](https://www.npmjs.com/package/webship-js). Start with the [root README](../README.md) for installation, configuration, and the environment-variable table. The [step-definitions README](../tests/step-definitions/README.md) carries the deep reference: the adoption walkthrough, the Diffy REST API endpoint map, the Diffy-side IP allow-list, and links into Diffy's own documentation. diff --git a/package-lock.json b/package-lock.json index c3e9592..f022261 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "diffy-steps", - "version": "0.1.0", + "name": "@webship/diffy-steps", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "diffy-steps", - "version": "0.1.0", + "name": "@webship/diffy-steps", + "version": "2.0.0", "license": "MIT", "dependencies": { "axios": "~1" diff --git a/package.json b/package.json index aad5fd2..d744b6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "diffy-steps", - "version": "0.1.0", + "name": "@webship/diffy-steps", + "version": "2.0.0", "description": "Diffy-specific Cucumber step definitions plugin for webship-js — visual-regression testing for any site via the Diffy REST API (Playwright + Cucumber).", "main": "tests/step-definitions/diffy.steps.js", "files": [ @@ -42,6 +42,9 @@ "url": "https://github.com/webship/diffy-steps/issues" }, "homepage": "https://github.com/webship/diffy-steps#readme", + "publishConfig": { + "access": "public" + }, "dependencies": { "axios": "~1" }, diff --git a/tests/step-definitions/README.md b/tests/step-definitions/README.md index 077a003..e24d657 100755 --- a/tests/step-definitions/README.md +++ b/tests/step-definitions/README.md @@ -27,7 +27,7 @@ and links into Diffy's own documentation. Install the plugin alongside webship-js: ```bash -npm install --save-dev webship-js diffy-steps +npm install --save-dev webship-js @webship/diffy-steps ``` `diffy.steps.js` pulls in `axios` (a direct dependency of this package) plus @@ -45,7 +45,7 @@ module.exports = { requireModule: ['tsx/cjs'], require: [ 'node_modules/webship-js/tests/step-definitions/**/*.js', - 'node_modules/diffy-steps/tests/step-definitions/**/*.js', + 'node_modules/@webship/diffy-steps/tests/step-definitions/**/*.js', 'tests/step-definitions/**/*.js', ], paths: ['tests/features/**/*.feature'], @@ -126,7 +126,7 @@ option. Start from one of this repository's reference features: ```bash -cp node_modules/diffy-steps/tests/features/01-example-demo.feature \ +cp node_modules/@webship/diffy-steps/tests/features/01-example-demo.feature \ tests/features/my-visual-regression.feature ``` @@ -157,8 +157,8 @@ examples (GitHub Actions, CircleCI, Tugboat, Platform.sh). ### Remove Diffy later (reversible) ```bash -npm uninstall diffy-steps -# then remove the 'node_modules/diffy-steps/**' line from cucumber.js require: +npm uninstall @webship/diffy-steps +# then remove the 'node_modules/@webship/diffy-steps/**' line from cucumber.js require: # and delete your own @diffy feature files. ``` diff --git a/tests/step-definitions/diffy.steps.js b/tests/step-definitions/diffy.steps.js index 03e9902..bb20cc8 100755 --- a/tests/step-definitions/diffy.steps.js +++ b/tests/step-definitions/diffy.steps.js @@ -1,7 +1,7 @@ 'use strict'; // --------------------------------------------------------------------------- -// diffy-steps — Diffy visual-regression step definitions for webship-js +// @webship/diffy-steps — Diffy visual-regression step definitions for webship-js // // Plugin for webship-js (https://www.npmjs.com/package/webship-js): relies on // the World it installs (this.page, this.parameters) and adds nothing to it.