Skip to content

Conversation

@le-cong
Copy link
Contributor

@le-cong le-cong commented May 13, 2025

Fixes #84

@le-cong le-cong requested a review from Copilot May 13, 2025 21:58
@le-cong le-cong self-assigned this May 13, 2025
@le-cong le-cong added the MINOR label May 13, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces hard-coded package.json sections with those from the target package to improve flexibility and reduce manual maintenance.

  • Introduces optional "engine" and "overrides" properties in the PackageJson interface.
  • Replaces injected devDependencies with those directly supplied by the target package.
  • Adds a new test case to verify a beta npm package with the latest standards.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/validate-npm-package/validate-npm-package.ts Updates interface properties and package JSON generation logic.
src/validate-npm-package/validate-npm-package.spec.ts Adds a new test case for verifying the beta npm package.
package.json Updates the version number to reflect package updates.
Comments suppressed due to low confidence (2)

src/validate-npm-package/validate-npm-package.ts:47

  • The property 'engine' is typically named 'engines' in package.json. Consider renaming it unless the deviation is deliberate.
    ...(packageJson.engine === undefined ? {} : { engine: packageJson.engine }),

src/validate-npm-package/validate-npm-package.ts:52

  • Removing the hard-coded dependency '@checkdigit/typescript-config' may lead to missing dependencies if the target package does not include it. Verify that the target package's devDependencies fully cover all required dependencies.
    devDependencies: packageJson.devDependencies,

@github-actions
Copy link

Coverage after merging update-validate-npm-package-to-latest-standard into main will be

59.95%▾ -0.06%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/check-imports
   check-imports.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–38, 4–9
   index.ts0%0%0%0%1, 1–5
   package-lock-file-util.ts100%100%100%100%
   packages-not-allowed.ts100%100%100%100%
src/check-label
   check-label.ts94.23%89.47%100%95.12%62–64, 71–73
   index.ts0%0%0%0%1, 1–5
src/check-pr-reviews
   check-pr-reviews.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50, 6–9
   index.ts0%0%0%0%1, 1–5
src/check-published
   check-published.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–65, 7–9
   index.ts0%0%0%0%1, 1–5
   slack.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6–9
src/comment-npm-publish
   comment-npm-publish.ts0%0%0%0%1, 1, 10–19, 2, 20–22, 3–9
   index.ts0%0%0%0%1, 1–5
src/coverage-reporter
   cli.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50, 6–9
   comment.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–52, 6–9
   coverage-reporter.ts0%0%0%0%1, 1, 10, 100–109, 11, 110–111, 12–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–99
   delete-old-comments.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–72, 8–9
   get-changes.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–41, 5–9
   html.ts100%100%100%100%
   index.ts0%0%0%0%1, 1–5
   lcov.ts93.97%90%100%94.32%122–132, 139
   options.ts0%0%0%0%1, 1, 10–14, 2–9
   tabulate.ts99.56%97.96%100%100%159
   util.ts100%100%100%100%
src/github-api
   index.ts80.42%68.42%100%82.42%109–112, 134–137, 156–165, 180–183, 187–190, 203–206, 210–213, 224–227, 238–240, 246–248, 250–253, 49, 55, 57–61, 70–73, 77–80, 95–97
src/nocks
   github.test.ts98.95%90.91%100%99.44%164, 64
src/perform-bundle
   analyze.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–36, 4–9
   deployer.ts0%0%0%0%1, 1, 10–18, 2–9
   index.ts0%0%0%0%1, 1–5
   perform-bundle.ts0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–42, 5–9
src/prepare-beta
   index.ts0%0%0%0%1, 1–5
   package.ts93.33%66.67%100%95%22–24
   prepare-beta.ts0%0%0%0%1, 1, 10–17, 2–9
src/publish-beta
   compile.ts0%0%0%0%1, 1, 10–14, 2–9
   files.ts92.86%91.67%100%92.86%28–31
   index.ts0%0%0%0%1, 1–5
   package.ts94.92%83.33%100%96%22–24
   publish-beta.ts0%0%0%0%1, 1, 10–19, 2, 20–28, 3–9
   publish.ts82.35%100%50%82.76%25–29
   validate-name-and-resource-length.ts89.08%100%50%88.30%35–38, 88–94
src/validate-npm-package
   index.ts0%0%0%0%1, 1–5
   validate-npm-package.ts98.35%77.78%100%100%47, 53

@le-cong le-cong requested a review from adcreare May 13, 2025 22:08
Copy link
Contributor

@adcreare adcreare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

✅ PR review status - All reviews completed and approved!

@le-cong le-cong merged commit ddba131 into main May 13, 2025
6 checks passed
@le-cong le-cong deleted the update-validate-npm-package-to-latest-standard branch May 13, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update validate-npm-package to use the latest standard

3 participants