@vijaypjavvadi/pw-emit 1.2.0 → 1.3.0
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/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
_Nothing yet._
|
|
11
11
|
|
|
12
|
+
## [1.3.0] — 2026-05-22
|
|
13
|
+
|
|
14
|
+
### Added (consumed by `@vijaypjavvadi/bdd2pw@3.2.0`)
|
|
15
|
+
|
|
16
|
+
- `playwright.config.ts.tmpl` ends with a stable `// bdd2pw:config-end`
|
|
17
|
+
marker line followed by guidance comments. Downstream tooling can
|
|
18
|
+
splice additional code after that line without risking a duplicate
|
|
19
|
+
`defineConfig(...)` import or call. Addresses TestForge handoff
|
|
20
|
+
Issue 6.
|
|
21
|
+
- `EmitProjectOptions.dependencyStrategy?: "caret" | "exact"`. When set
|
|
22
|
+
to `"exact"`, the emitted `package.json` strips the leading `^` from
|
|
23
|
+
every devDependency version so the consuming project pins to exact
|
|
24
|
+
versions. Default `"caret"` matches existing behavior. Addresses
|
|
25
|
+
TestForge handoff Issue 9.
|
|
26
|
+
|
|
27
|
+
Both additions are additive and default-off — existing emission paths
|
|
28
|
+
are byte-stable across the 1.2 → 1.3 upgrade. SemVer minor.
|
|
29
|
+
|
|
12
30
|
## [1.2.0] — 2026-05-22
|
|
13
31
|
|
|
14
32
|
### Added (consumed by `@vijaypjavvadi/bdd2pw@3.1.0`)
|
package/dist/projectEmitter.d.ts
CHANGED
|
@@ -24,6 +24,14 @@ export interface EmitProjectOptions {
|
|
|
24
24
|
baseUrl?: string;
|
|
25
25
|
/** Injected as the `name` in `package.json`. */
|
|
26
26
|
projectName?: string;
|
|
27
|
+
/**
|
|
28
|
+
* v1.3.0 — how to render emitted devDependency versions. `caret`
|
|
29
|
+
* (default) emits `^1.45.0` style ranges — matches existing behavior.
|
|
30
|
+
* `exact` strips the leading `^` so the project pins to the exact
|
|
31
|
+
* version. Useful for teams that have been bitten by silent
|
|
32
|
+
* minor-version Playwright bumps in CI. See TestForge handoff Issue 9.
|
|
33
|
+
*/
|
|
34
|
+
dependencyStrategy?: "caret" | "exact";
|
|
27
35
|
}
|
|
28
36
|
export interface EmitProjectResult {
|
|
29
37
|
filesWritten: string[];
|
package/dist/projectEmitter.js
CHANGED
|
@@ -89,6 +89,14 @@ async function emitProject(opts) {
|
|
|
89
89
|
content = content
|
|
90
90
|
.replace(/\{\{projectName\}\}/g, projectName)
|
|
91
91
|
.replace(/\{\{baseUrl\}\}/g, baseUrl);
|
|
92
|
+
// v1.3.0 — pin emitted devDependency versions when requested.
|
|
93
|
+
// Only applied to package.json; other templates may legitimately
|
|
94
|
+
// use `^` for unrelated purposes (e.g. regex literals in
|
|
95
|
+
// playwright.config). Surgical string-replace inside the
|
|
96
|
+
// devDependencies block keeps the change auditable.
|
|
97
|
+
if (dest === "package.json" && opts.dependencyStrategy === "exact") {
|
|
98
|
+
content = content.replace(/("(?:@?[a-zA-Z0-9/_-]+)"\s*:\s*)"\^([^"]+)"/g, '$1"$2"');
|
|
99
|
+
}
|
|
92
100
|
await fs.writeFile(destPath, content, "utf8");
|
|
93
101
|
filesWritten.push(destPath);
|
|
94
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectEmitter.js","sourceRoot":"","sources":["../src/projectEmitter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"projectEmitter.js","sourceRoot":"","sources":["../src/projectEmitter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCH,kCAwDC;AA5FD,6CAA+B;AAC/B,2CAA6B;AA0B7B,MAAM,iBAAiB,GAAG,IAAI,CAAC,OA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CAAC,QAAQ,CAAC,EAAE,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC;gBACZ,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,IAAI,mCAAmC;aACpD,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QAED,IAAI,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACjD,OAAO,GAAG,OAAO;aACd,OAAO,CAAC,sBAAsB,EAAE,WAAW,CAAC;aAC5C,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QACxC,8DAA8D;QAC9D,iEAAiE;QACjE,yDAAyD;QACzD,yDAAyD;QACzD,oDAAoD;QACpD,IAAI,IAAI,KAAK,cAAc,IAAI,IAAI,CAAC,kBAAkB,KAAK,OAAO,EAAE,CAAC;YACnE,OAAO,GAAG,OAAO,CAAC,OAAO,CACvB,8CAA8C,EAC9C,QAAQ,CACT,CAAC;QACJ,CAAC;QACD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC9C,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,gCAAgC;IAChC,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;QACrC,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vijaypjavvadi/pw-emit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Shared emitter library that renders Playwright TypeScript Page Objects, spec files, and project scaffolds from a generic IR. Powers both @vijaypjavvadi/sel2pw and @vijaypjavvadi/bdd2pw.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,3 +22,10 @@ export default defineConfig({
|
|
|
22
22
|
{ name: "webkit", use: { ...devices["Desktop Safari"] } },
|
|
23
23
|
],
|
|
24
24
|
});
|
|
25
|
+
// bdd2pw:config-end
|
|
26
|
+
//
|
|
27
|
+
// Downstream tooling can safely splice additional code AFTER the line
|
|
28
|
+
// above (e.g. extra projects, custom reporters, post-process plugins).
|
|
29
|
+
// Do not duplicate the `defineConfig(...)` import or call — append a
|
|
30
|
+
// `mergeConfig(...)` overlay or a `Object.assign(exports.default, ...)`
|
|
31
|
+
// helper instead. See TestForge handoff Issue 6 (bdd2pw v3.2.0).
|