qaify-playwright-reporter 0.9.1 → 0.9.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/dist/fix.d.ts CHANGED
@@ -142,6 +142,11 @@ export declare function fixDeps(dir: string, exec?: Exec): Promise<{
142
142
  summary: string;
143
143
  reason?: string;
144
144
  }>;
145
+ /**
146
+ * Paket di composer.lock yang me-require pkg secara langsung. `--with-all-dependencies` hanya memperbarui dependensi
147
+ * pkg; tanpa ini dependennya tertinggal di versi lama yang belum tentu cocok dengan pkg baru.
148
+ */
149
+ export declare function composerDependents(repo: string, pkg: string): Promise<string[]>;
145
150
  /** Masih ada advisory untuk paket ini? npm: hanya high / critical (sama dengan temuan audit-static). */
146
151
  export declare function stillVulnerable(output: string, manager: 'composer' | 'npm', pkg: string): boolean;
147
152
  /**
package/dist/fix.js CHANGED
@@ -206,8 +206,10 @@ export async function fixDeps(dir, exec = defaultExec) {
206
206
  let vulnerable;
207
207
  try {
208
208
  if (composer) {
209
- steps.push(`composer update ${pkg} --with-all-dependencies --no-install`);
210
- await exec('composer', ['update', pkg, '--with-all-dependencies', '--no-install', '--no-scripts', '--no-interaction', '--no-progress', `--working-dir=${repo}`]);
209
+ // paket yang me-require pkg ikut naik: mis. laravel/framework baru butuh laravel/sanctum yang mengenal perubahannya
210
+ const packages = [pkg, ...(await composerDependents(repo, pkg))];
211
+ steps.push(`composer update ${packages.join(' ')} --with-all-dependencies --no-install`);
212
+ await exec('composer', ['update', ...packages, '--with-all-dependencies', '--no-install', '--no-scripts', '--no-interaction', '--no-progress', `--working-dir=${repo}`]);
211
213
  vulnerable = stillVulnerable(await report('composer', ['audit', '--locked', '--format=json', '--no-interaction', `--working-dir=${repo}`]), 'composer', pkg);
212
214
  }
213
215
  else {
@@ -244,6 +246,22 @@ export async function fixDeps(dir, exec = defaultExec) {
244
246
  tests_run: `${auditCmd}: ${pkg} bersih. Test aplikasi dijalankan CI repo pada PR ini.`,
245
247
  });
246
248
  }
249
+ /**
250
+ * Paket di composer.lock yang me-require pkg secara langsung. `--with-all-dependencies` hanya memperbarui dependensi
251
+ * pkg; tanpa ini dependennya tertinggal di versi lama yang belum tentu cocok dengan pkg baru.
252
+ */
253
+ export async function composerDependents(repo, pkg) {
254
+ let lock;
255
+ try {
256
+ lock = JSON.parse(await readFile(join(repo, 'composer.lock'), 'utf8'));
257
+ }
258
+ catch {
259
+ return [];
260
+ }
261
+ return [...(lock.packages ?? []), ...(lock['packages-dev'] ?? [])]
262
+ .filter((p) => p.name !== pkg && p.require && pkg in p.require)
263
+ .map((p) => p.name);
264
+ }
247
265
  /** Masih ada advisory untuk paket ini? npm: hanya high / critical (sama dengan temuan audit-static). */
248
266
  export function stillVulnerable(output, manager, pkg) {
249
267
  const start = output.search(/[[{]/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qaify-playwright-reporter",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Reporter Playwright untuk QA Factory (Qaify): kirim hasil test dan artefak ke /api/ingest, tanpa pernah menggagalkan test.",
5
5
  "license": "MIT",
6
6
  "author": "ahmdkenz",