npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hmcts/ccd-diff

v4.7.2

Published

Diff CCD files

Downloads

1,859

Readme

CCD Diff

Tool to diff CCD changes.

Usage

npm start [pathToBaseCCDJson] [pathToBranchCCDJson]
# or with npx
npx -q @hmcts/ccd-diff [pathToBaseCCDJson] [pathToBranchCCDJson]

Output

The only output format supported at the moment is markdown:

AuthorisationCaseField/APPLICANTTWO.json

-CRU
-applicant2ConfirmReceipt
-[APPLICANTTWO]
-CRU
-applicant2ContinueApplication
-[APPLICANTTWO]
+CRU
+-Applicant2PrayerFinancialOrdersChild
+[APPLICANTTWO]
-CRU 
+R

applicant2Address

[APPLICANTTWO]

-CRU 
+R

applicant2AgreedToReceiveEmails

[APPLICANTTWO]

AuthorisationCaseField/APPTWOSOLICITOR.json

-CRU
-applicant2ConfirmReceipt
-[APPTWOSOLICITOR]

Use on PRs

You can add a report to a PR with CCD changes by adding:


  report:
    runs-on: ubuntu-latest
    needs: [buildBranch, buildMaster]
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - uses: actions/download-artifact@v3
        with:
          name: branch
          path: build/branch
      - uses: actions/download-artifact@v3
        with:
          name: master
          path: build/master
      - name: Generate report
        id: ccd-diff
        run: |
          REPORT="$(npx -q @hmcts/ccd-diff build/master build/branch)"
          REPORT="${REPORT//'%'/'%25'}"
          REPORT="${REPORT//$'\n'/'%0A'}"
          REPORT="${REPORT//$'\r'/'%0D'}"
          echo $REPORT
          echo "::set-output name=content::$REPORT"
      - name: Display
        run: |
          echo "${{ steps.ccd-diff.outputs.content }}"
      - name: Add report
        uses: thollander/actions-comment-pull-request@v1
        with:
          message: |
            # CCD diff report ${{ steps.ccd-diff.outputs.content }}
          comment_includes: CCD diff report
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

You will need to add two steps to upload the CCD JSON definition artifacts to compare. For a CCD config generator based config this would look like:

  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-java@v3
        with:
          distribution: corretto
          java-version: 17

  buildBranch:
    runs-on: ubuntu-latest
    needs: [setup]
    steps:
      - uses: actions/checkout@v3
        with:
          path: build/branch
      - name: Build
        run: ./gradlew generateCCDConfig
        working-directory: build/branch
      - uses: actions/upload-artifact@v3
        with:
          name: branch
          path: build/branch/build/definitions/NFD

  buildMaster:
    runs-on: ubuntu-latest
    needs: [setup]
    steps:
      - uses: actions/checkout@v3
        with:
          ref: master
          path: build/master
      - name: Build
        run: ./gradlew generateCCDConfig
        working-directory: build/master
      - uses: actions/upload-artifact@v3
        with:
          name: master
          path: build/master/build/definitions/NFD

For a plain JSON repository this would look like:

  buildBranch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          path: build/branch
      - uses: actions/upload-artifact@v3
        with:
          name: branch
          path: build/branch/definitions/divorce/json

  buildMaster:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ref: master
          path: build/master
      - uses: actions/upload-artifact@v3
        with:
          name: master
          path: build/master/definitions/divorce/json