New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

shadcn-differ

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shadcn-differ

This CLI tool figures out the difference between the initial commit of a ShadCN project and the current state of the project and creates a new ShadCN JSON output file with the changes. This ShadCN JSON file can then be used with the ShadCN CLI to generate

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

ShadCN Project Differ

This CLI tool figures out the difference between the initial commit of a ShadCN project and the current state of the project and creates a new ShadCN JSON output file with the changes. This ShadCN JSON file can then be used with the ShadCN CLI to generate a new project or add to an existing project.

Steps

  • Create a new NextJS app
  • Add ShadCN to the app
  • Create a new initial commit; rm -fr .git && git init && git add . && git commit -m "Initial commit"
  • Make your updates to the project
  • Run the CLI tool; npx shadcn-differ

The reason we are recreating the initial commit is so that the resulting JSON output is only the changes to the project after ShadCN was added, and not the entire project history.

You can then take the resulting JSON ouput and host it on a URL, then use that with the ShadCN CLI to generate a new project or add to an existing project.

npx shadcn@latest init http://your-json-output-url

You can use the --src-dir flag if you want to use the src directory in your project.

Or you can add the JSON output to an existing project:

npx shadcn@latest add http://your-json-output-url

Why is this useful?

This allows library maintainers or SaaS services to create a one step installer for their library or service into an existing project, or to bootstrap a new project with the library or service.

FAQs

Package last updated on 22 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts