├── .npmrc ├── CODEOWNERS ├── .gitattributes ├── src ├── images │ └── icon.png ├── assets │ └── images │ │ ├── init-cli.png │ │ ├── add-new-component.png │ │ ├── shadcn-svelte-docs.png │ │ ├── shadcn-svelte-import.png │ │ ├── add-multiple-components.png │ │ ├── add-new-component-preview.png │ │ ├── shadcn-svelte-component-docs.png │ │ └── add-multiple-components-preview.png ├── utils │ ├── getProjectDir.ts │ ├── index.ts │ ├── getSvelteVersion.ts │ ├── logs.ts │ ├── getProjectDeps.ts │ ├── registry.ts │ └── vscode.ts ├── snippets │ ├── help-code-snippets.json │ ├── help-code-snippets-next.json │ ├── imports-code-snippets.json │ ├── imports-code-snippets-next.json │ ├── usage-code-snippets.json │ └── usage-code-snippets-next.json └── extension.ts ├── .gitignore ├── renovate.json ├── .vscodeignore ├── .vscode ├── extensions.json ├── tasks.json ├── settings.json └── launch.json ├── .github ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── publish.yml ├── tsconfig.json ├── eslint.config.mjs ├── LICENSE ├── esbuild.js ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── package.json ├── CHANGELOG.md └── pnpm-lock.yaml /.npmrc: -------------------------------------------------------------------------------- 1 | --ignore-engines true -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @selemondev -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /src/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/images/icon.png -------------------------------------------------------------------------------- /src/assets/images/init-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/init-cli.png -------------------------------------------------------------------------------- /src/assets/images/add-new-component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/add-new-component.png -------------------------------------------------------------------------------- /src/assets/images/shadcn-svelte-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/shadcn-svelte-docs.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | dist 3 | node_modules 4 | .vscode-test/ 5 | *.vsix 6 | .env 7 | *.log* 8 | .eslintcache 9 | *.DS_Store 10 | node_modules 11 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/assets/images/shadcn-svelte-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/shadcn-svelte-import.png -------------------------------------------------------------------------------- /src/assets/images/add-multiple-components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/add-multiple-components.png -------------------------------------------------------------------------------- /src/assets/images/add-new-component-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/add-new-component-preview.png -------------------------------------------------------------------------------- /src/assets/images/shadcn-svelte-component-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/shadcn-svelte-component-docs.png -------------------------------------------------------------------------------- /src/assets/images/add-multiple-components-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/HEAD/src/assets/images/add-multiple-components-preview.png -------------------------------------------------------------------------------- /src/utils/getProjectDir.ts: -------------------------------------------------------------------------------- 1 | import { workspace } from "vscode"; 2 | 3 | export const getProjectDirectory = () => { 4 | const workspaceFolder = workspace.workspaceFolders?.[0]?.uri.fsPath; 5 | return workspaceFolder; 6 | }; -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/** 4 | node_modules/** 5 | .gitignore 6 | .npmrc 7 | vsc-extension-quickstart.md 8 | **/tsconfig.json 9 | **/.eslintrc.json 10 | **/*.map 11 | **/*.ts 12 | **/.vscode-test.* -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export const to = async (promise: Promise) => { 2 | try { 3 | const res = await promise; 4 | return [res, null] as const; 5 | } catch (error) { 6 | return [null, error] as const; 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"] 5 | } 6 | -------------------------------------------------------------------------------- /src/utils/getSvelteVersion.ts: -------------------------------------------------------------------------------- 1 | import { getProjectDependencies } from "./getProjectDeps"; 2 | 3 | export const getSvelteVersion = async (): Promise => { 4 | const dependencies = await getProjectDependencies(); 5 | const svelteDep = dependencies.find((dep) => dep.name === 'svelte'); 6 | return svelteDep ? svelteDep?.version : 4; 7 | }; 8 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "dev", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never", 13 | "group": "watchers" 14 | }, 15 | "group": { 16 | "kind": "build", 17 | "isDefault": true 18 | } 19 | }, 20 | ] 21 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "Node16", 4 | "target": "ES2022", 5 | "lib": [ 6 | "ES2022" 7 | ], 8 | "sourceMap": true, 9 | "rootDir": "src", 10 | "strict": true, 11 | "skipLibCheck": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false, // set this to true to hide the "out" folder with the compiled JS files 5 | "dist": false // set this to true to hide the "dist" folder with the compiled JS files 6 | }, 7 | "search.exclude": { 8 | "out": true, // set this to false to include "out" folder in search results 9 | "dist": true // set this to false to include "dist" folder in search results 10 | }, 11 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 12 | "typescript.tsc.autoDetect": "off" 13 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/dist/**/*.js" 17 | ], 18 | "preLaunchTask": "${defaultBuildTask}" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /src/snippets/help-code-snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "shadcn/svelte help cn": { 3 | "prefix": ["cn-help"], 4 | "body": [ 5 | "// cni-[component] e.g. cni-button", 6 | "import { Button } from '$$lib/components/ui/button'", 7 | "", 8 | "// cnx-[component] e.g. cnx-button", 9 | "", 10 | "" 11 | ] 12 | }, 13 | 14 | "shadcn/svelte help shadcn": { 15 | "prefix": ["shadcn-help"], 16 | "body": [ 17 | "// shadcn-i-[component] e.g. shadcn-i-button", 18 | "import { Button } from \"$$lib/components/ui/button\"", 19 | "", 20 | "// shadcn-x-[component] e.g. shadcn-x-button", 21 | "", 22 | "" 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/snippets/help-code-snippets-next.json: -------------------------------------------------------------------------------- 1 | { 2 | "shadcn/svelte help cn": { 3 | "prefix": ["cn-x-help"], 4 | "body": [ 5 | "// cni-x-[component] e.g. cni-x-button", 6 | "import { Button } from \"$$lib/components/ui/button/index.js\";", 7 | "", 8 | "// cnx-[component] e.g. cnx-button", 9 | "", 10 | "" 11 | ] 12 | }, 13 | 14 | "shadcn/svelte help shadcn": { 15 | "prefix": ["shadcn-x-help"], 16 | "body": [ 17 | "// shadcn-ix-[component] e.g. shadcn-ix-button", 18 | "import { Button } from \"$$lib/components/ui/button/index.js\";", 19 | "", 20 | "// shadcn-x-[component] e.g. shadcn-x-button", 21 | "", 22 | "" 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/utils/logs.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | import { ofetch } from "ofetch"; 3 | import { type } from "os"; 4 | import { detectPackageManager } from "./vscode"; 5 | 6 | // Endpoint to visualize the mostly used commands, package manager, Operating system and VSCode version. 7 | 8 | const BASE_URL = ""; 9 | 10 | export const logCmd = async (cmd: string) => { 11 | const packageManager = await detectPackageManager(); 12 | const log = { 13 | cmd, 14 | packageManager, 15 | os: type, 16 | vscodeVersion: vscode.version, 17 | }; 18 | 19 | const reqUrl = `${BASE_URL}/api/log`; 20 | await ofetch(reqUrl, { 21 | method: "POST", 22 | headers: { 23 | "Content-Type": "application/json", 24 | authentication: `Bearer ${process.env.BEARER_TOKE}`, 25 | }, 26 | body: JSON.stringify(log), 27 | }); 28 | }; 29 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig, globalIgnores } from "eslint/config"; 2 | import typescriptEslint from "@typescript-eslint/eslint-plugin"; 3 | import tsParser from "@typescript-eslint/parser"; 4 | 5 | export default defineConfig([globalIgnores(["**/out", "**/dist", "**/*.d.ts"]), { 6 | plugins: { 7 | "@typescript-eslint": typescriptEslint, 8 | }, 9 | 10 | languageOptions: { 11 | parser: tsParser, 12 | ecmaVersion: 6, 13 | sourceType: "module", 14 | }, 15 | 16 | rules: { 17 | "@typescript-eslint/naming-convention": ["warn", { 18 | selector: "import", 19 | format: ["camelCase", "PascalCase"], 20 | }], 21 | 22 | "@/semi": "warn", 23 | curly: "warn", 24 | eqeqeq: "warn", 25 | "no-throw-literal": "warn", 26 | semi: "off", 27 | }, 28 | }]); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 vscode-shadcn-svelte and Selemondev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/utils/getProjectDeps.ts: -------------------------------------------------------------------------------- 1 | import { getProjectDirectory } from "./getProjectDir"; 2 | import { existsSync } from 'fs'; 3 | 4 | type Dependency = { 5 | name: string; 6 | version: number; 7 | }; 8 | 9 | export const getProjectDependencies = async (): Promise => { 10 | const dependencies: Dependency[] = []; 11 | const packageJsonPath = `${getProjectDirectory()}/package.json`; 12 | 13 | if (!existsSync(packageJsonPath)) { 14 | return []; 15 | } else { 16 | const { readPackageJSON } = await import("pkg-types"); 17 | const packageJSON = await readPackageJSON(packageJsonPath); 18 | 19 | const addDependencies = (depObj: Record | undefined) => { 20 | if (depObj) { 21 | dependencies.push( 22 | ...Object.keys(depObj).map((key) => ({ 23 | name: key, 24 | version: parseInt(depObj[key].replace(/[\^~]/g, '')), // Use 'g' flag to replace all occurrences 25 | })) 26 | ); 27 | } 28 | }; 29 | 30 | addDependencies(packageJSON?.devDependencies); 31 | 32 | return dependencies; 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Extension 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v*.*.*" # Trigger on new version tags 7 | workflow_dispatch: 8 | 9 | jobs: 10 | publish: 11 | permissions: 12 | contents: read 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v5 17 | 18 | - name: Set up Node.js with pnpm 19 | uses: actions/setup-node@v6 20 | with: 21 | node-version: 22.x 22 | cache: "pnpm" 23 | 24 | - name: Install dependencies 25 | run: pnpm install 26 | 27 | - name: Lint code 28 | run: pnpm run lint 29 | 30 | - name: Check types 31 | run: pnpm run check-types 32 | 33 | - name: Build the extension 34 | run: pnpm run build 35 | 36 | - name: Publish to Open VSX Registry 37 | uses: HaaLeo/publish-vscode-extension@v1 38 | id: publishToOpenVSX 39 | with: 40 | pat: ${{ secrets.OVSX_PAT }} 41 | 42 | - name: Publish to VS Code Marketplace 43 | if: secrets.VSCE_PAT != '' 44 | uses: HaaLeo/publish-vscode-extension@v1 45 | with: 46 | pat: ${{ secrets.VSCE_PAT }} 47 | registryUrl: https://marketplace.visualstudio.com 48 | extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} 49 | -------------------------------------------------------------------------------- /esbuild.js: -------------------------------------------------------------------------------- 1 | const esbuild = require("esbuild"); 2 | 3 | const production = process.argv.includes('--production'); 4 | const watch = process.argv.includes('--watch'); 5 | 6 | /** 7 | * @type {import('esbuild').Plugin} 8 | */ 9 | const esbuildProblemMatcherPlugin = { 10 | name: 'esbuild-problem-matcher', 11 | 12 | setup(build) { 13 | build.onStart(() => { 14 | console.log('[watch] build started'); 15 | }); 16 | build.onEnd((result) => { 17 | result.errors.forEach(({ text, location }) => { 18 | console.error(`✘ [ERROR] ${text}`); 19 | console.error(` ${location.file}:${location.line}:${location.column}:`); 20 | }); 21 | console.log('[watch] build finished'); 22 | }); 23 | }, 24 | }; 25 | 26 | async function main() { 27 | const ctx = await esbuild.context({ 28 | entryPoints: [ 29 | 'src/extension.ts' 30 | ], 31 | bundle: true, 32 | format: 'cjs', 33 | minify: production, 34 | sourcemap: !production, 35 | sourcesContent: false, 36 | platform: 'node', 37 | outfile: 'dist/extension.js', 38 | external: ['vscode'], 39 | logLevel: 'silent', 40 | plugins: [ 41 | /* add to the end of plugins array */ 42 | esbuildProblemMatcherPlugin, 43 | ], 44 | }); 45 | if (watch) { 46 | await ctx.watch(); 47 | } else { 48 | await ctx.rebuild(); 49 | await ctx.dispose(); 50 | } 51 | } 52 | 53 | main().catch(e => { 54 | console.error(e); 55 | process.exit(1); 56 | }); 57 | -------------------------------------------------------------------------------- /src/utils/registry.ts: -------------------------------------------------------------------------------- 1 | import { ofetch } from "ofetch"; 2 | import { to } from "./index"; 3 | import { detectPackageManager } from "./vscode"; 4 | 5 | type OgComponent = { 6 | type: "registry:ui"; 7 | name: string; 8 | files: string[]; 9 | dependencies?: string[]; 10 | registryDependencies?: string[]; 11 | }; 12 | 13 | export type Component = { 14 | label: string; 15 | detail?: string; 16 | }; 17 | 18 | export type Components = Component[]; 19 | 20 | export const getRegistry = async (): Promise => { 21 | const reqUrl = "https://shadcn-svelte.com/registry/index.json"; 22 | const [res, err] = await to(ofetch(reqUrl)); 23 | 24 | if (err || !res) { 25 | return null; 26 | } 27 | 28 | const [data] = await to(res); 29 | 30 | if (!data) { 31 | return null; 32 | } 33 | 34 | const components: Components = (data as OgComponent[]).filter((c) => c.type === 'registry:ui').map((c) => { 35 | const component: Component = { 36 | label: c.name, 37 | detail: `dependencies: ${c.registryDependencies && c.registryDependencies.length > 0 ? c.registryDependencies.join(", ") : "no dependency"}`, 38 | }; 39 | 40 | return component; 41 | }); 42 | return components; 43 | }; 44 | 45 | export const getInstallCmd = async (components: string[], cwd: string) => { 46 | const packageManager = await detectPackageManager(); 47 | const componentStr = components.join(" "); 48 | 49 | if (packageManager === "bun") { 50 | return `bunx shadcn-svelte@latest add ${componentStr} -c ${cwd}`; 51 | } 52 | 53 | if (packageManager === "pnpm") { 54 | return `pnpm dlx shadcn-svelte@latest add ${componentStr} -c ${cwd}`; 55 | } 56 | 57 | return `npx shadcn-svelte@latest add ${componentStr} -c ${cwd}`; 58 | }; 59 | 60 | export const getInitCmd = async (cwd: string) => { 61 | const packageManager = await detectPackageManager(); 62 | 63 | if (packageManager === "bun") { 64 | return `bunx shadcn-svelte@latest init -c ${cwd}`; 65 | } 66 | 67 | if (packageManager === "pnpm") { 68 | return `pnpm dlx shadcn-svelte@latest init -c ${cwd}`; 69 | } 70 | 71 | return `npx shadcn-svelte@latest init -c ${cwd}`; 72 | }; 73 | 74 | export const getComponentDocLink = async (component: string) => { 75 | const shadCnDocUrl = "https://shadcn-svelte.com/docs"; 76 | return `${shadCnDocUrl}/components/${component}`; 77 | }; -------------------------------------------------------------------------------- /src/utils/vscode.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | 3 | export type PackageManager = "npm" | "pnpm" | "yarn" | "bun"; 4 | 5 | export const executeCommand = (cmd: string, createNew = true): void => { 6 | let terminal = vscode.window.activeTerminal; 7 | if (createNew || !terminal) { 8 | terminal = vscode.window.createTerminal(); 9 | } 10 | 11 | terminal.show(); 12 | terminal.sendText(cmd); 13 | }; 14 | 15 | export const getFileStat = async (fileName: string) => { 16 | // Get the currently opened workspace folders 17 | const workspaceFolders = vscode.workspace.workspaceFolders; 18 | 19 | if (!workspaceFolders) { 20 | return null; 21 | } 22 | 23 | for (const workspaceFolder of workspaceFolders) { 24 | const filePath = vscode.Uri.joinPath(workspaceFolder.uri, fileName); 25 | try { 26 | const fileMetadata = await vscode.workspace.fs.stat(filePath); 27 | 28 | return fileMetadata; 29 | } catch (error) { 30 | return null; 31 | } 32 | } 33 | }; 34 | 35 | export const detectPackageManager = async (): Promise => { 36 | const lockFiles = ["bun.lock", "bun.lockb"]; 37 | const results = await Promise.all( 38 | lockFiles.map((file) => 39 | getFileStat(file).catch(err => err.code === 'ENOENT' ? false : Promise.reject(err)) 40 | ) 41 | ); 42 | 43 | if (results.some(Boolean)) { 44 | return 'bun'; 45 | } 46 | 47 | 48 | const pnpmLockExists = await getFileStat("pnpm-lock.yaml"); 49 | if (pnpmLockExists) { 50 | return "pnpm"; 51 | } 52 | 53 | const yarnLockExists = await getFileStat("yarn.lock"); 54 | if (yarnLockExists) { 55 | return "yarn"; 56 | } 57 | 58 | return "npm"; 59 | }; 60 | 61 | export const getOrChooseCwd = async (): Promise => { 62 | let cwd = ""; 63 | const prefix = "${workspaceFolder}/"; 64 | 65 | const workspaceFolders = (vscode.workspace.workspaceFolders ?? []).filter( 66 | (f) => f.uri.scheme === "file" 67 | ); 68 | 69 | if (!workspaceFolders.length) { return "./"; } 70 | 71 | const workspacePath = workspaceFolders[0]?.uri.fsPath ?? ""; 72 | const cwdFromConfig = vscode.workspace 73 | .getConfiguration() 74 | .get("terminal.integrated.cwd") 75 | ?.trim(); 76 | 77 | if (cwdFromConfig) { 78 | if (cwdFromConfig.startsWith(prefix)) { 79 | cwd = cwdFromConfig.slice(prefix.length); 80 | } 81 | else if (cwdFromConfig.startsWith(workspacePath)) { 82 | cwd = cwdFromConfig.replace(new RegExp(`^${workspacePath}/?`), ""); 83 | } else { 84 | cwd = cwdFromConfig; 85 | } 86 | 87 | return `${workspacePath}/${cwd}`; 88 | } 89 | 90 | const choice = await vscode.window.showQuickPick( 91 | workspaceFolders.map((f) => f.name) 92 | ); 93 | 94 | if (!choice) { return "./"; } 95 | 96 | return workspaceFolders.find((f) => f.name === choice)?.uri.fsPath ?? "./"; 97 | }; 98 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, race, body size, disability, ethnicity, sex characteristics, and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 7 | 8 | ## Our Standards 9 | 10 | Examples of behavior that contributes to creating a positive environment include: 11 | 12 | - Using welcoming and inclusive language 13 | - Being respectful of differing viewpoints and experiences 14 | - Gracefully accepting constructive criticism 15 | - Focusing on what is best for the community 16 | - Showing empathy towards other community members 17 | 18 | Examples of unacceptable behavior by participants include: 19 | 20 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 21 | - Trolling, insulting/derogatory comments, and personal or political attacks 22 | - Public or private harassment 23 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 24 | - Other conduct which could reasonably be considered inappropriate in a professional setting 25 | 26 | ## Our Responsibilities 27 | 28 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 29 | 30 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 31 | 32 | ## Scope 33 | 34 | This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 35 | 36 | ## Enforcement 37 | 38 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at selemondev19@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 39 | 40 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 41 | 42 | ## Attribution 43 | 44 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 45 | 46 | For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your valuable contribution and dedication to improving this project! We greatly appreciate your involvement. To ensure a smooth and cohesive collaboration, we have provided some guidelines to help you get started. Kindly take a moment to review them before submitting your contributions. Your efforts will undoubtedly make this project even better, and we look forward to working together on its success!. 4 | 5 | ## Code of Conduct 6 | 7 | This project is governed by the [Contributor Covenant Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to adhere to it. 8 | 9 | ## Open Development 10 | 11 | All work happens directly on `GitHub`. Both core team members and external contributors send pull requests which go through the same `code review` process. 12 | 13 | ## Semantic Versioning 14 | 15 | This project follows semantic versioning. We release patch versions for bug fixes or other changes that do not change the behavior of the API, minor versions for new features that are backward-compatible, and major versions for any breaking changes. 16 | 17 | Every significant change is documented in the changelog file. 18 | 19 | ## Reporting Issues 20 | 21 | Welcome to vscode-shadcn-svelte! We value your feedback and contributions to make this project better. If you encounter any bugs or have feature requests, please use [Github issues](https://github.com/selemondev/vscode-shadcn-svelte/issues) issues to submit them. 22 | 23 | Before reporting an issue, we ask you to: 24 | 25 | 1. `Search for Similar Issues` : Ensure you have searched through our existing issues to see if the problem or feature request has already been addressed or is under discussion. 26 | 27 | 2. `Reproduce the Bug` : If reporting a bug, please provide the minimum code required to reproduce the issue. This will help us understand and resolve the problem more efficiently. 28 | 29 | 3. `Describe Feature Requests` : For feature requests, please describe the desired functionality and any additional context that might be helpful. 30 | 31 | Your participation and attention to these guidelines will help us maintain a more organized and effective development process. 32 | 33 | ## Commit Guidelines 34 | 35 | Commit messages are required to follow the [conventional-changelog standard](https://www.conventionalcommits.org/en/v1.0.0/): 36 | 37 | ```bash 38 | [optional scope]: 39 | 40 | [optional body] 41 | 42 | [optional footer(s)] 43 | ``` 44 | 45 | 👉 [Commit example](https://github.com/unocss/unocss/releases/tag/v0.39.0) 46 | 47 | ### Commit types 48 | 49 | The following is a list of commit types: 50 | 51 | ### Commit Types: 52 | 53 | - `feat`: Adding a new snippet or significant functionality to the vscode-shadcn-svelte extension. 54 | 55 | - `fix`: Addressing bugs or issues in existing vscode-shadcn-svelte extension. 56 | 57 | - `docs`: Commits related to documentation changes for vscode-shadcn-svelte extension. 58 | 59 | - `style`: Commits related to code formatting, styling, or theming of vscode-shadcn-svelte extension. 60 | 61 | - `refactor`: Code changes that enhance the library's structure without introducing new features or fixing bugs extension. 62 | 63 | - `perf`: Commits aimed at improving performance for vscode-shadcn-svelte extension. 64 | 65 | - `test`: Commits related to testing vscode-shadcn-svelte extension. 66 | 67 | - `chore`: Other commits not affecting source or test files directly extension. 68 | 69 | ## License 70 | 71 | By contributing your code to the repository, you agree to license your contribution under the [MIT license](./LICENSE). -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | import { 3 | getInitCmd, 4 | getInstallCmd, 5 | getComponentDocLink, 6 | getRegistry, 7 | } from "./utils/registry"; 8 | import { executeCommand, getOrChooseCwd } from "./utils/vscode"; 9 | import { getSvelteVersion } from "./utils/getSvelteVersion"; 10 | import type { Component, Components } from "./utils/registry"; 11 | 12 | const commands = { 13 | initCli: "shadcn-svelte.initCli", 14 | addNewComponent: "shadcn-svelte.addNewComponent", 15 | addMultipleComponents: "shadcn-svelte.addMultipleComponents", 16 | gotoComponentDoc: "shadcn-svelte.gotoComponentDoc", 17 | reloadComponentList: "shadcn-svelte.reloadComponentList", 18 | gotoDoc: "shadcn-svelte.gotoDoc", 19 | } as const; 20 | 21 | export async function activate(context: vscode.ExtensionContext) { 22 | if (!vscode.workspace.workspaceFolders || vscode.workspace.workspaceFolders.length === 0) { 23 | vscode.window.showErrorMessage("No workspace folder open."); 24 | return; 25 | } 26 | 27 | let registryData: Components; 28 | 29 | const disposables: vscode.Disposable[] = [ 30 | vscode.commands.registerCommand(commands.initCli, async () => { 31 | const cwd = await getOrChooseCwd(); 32 | const intCmd = await getInitCmd(cwd); 33 | executeCommand(intCmd); 34 | }), 35 | vscode.commands.registerCommand(commands.addNewComponent, async () => { 36 | registryData = []; 37 | const newRegistryData = await getRegistry(); 38 | 39 | if (!newRegistryData) { 40 | vscode.window.showErrorMessage("Cannot get the component list"); 41 | return; 42 | } 43 | 44 | registryData = newRegistryData; 45 | 46 | const selectedComponent = await vscode.window.showQuickPick(registryData, { 47 | matchOnDescription: true, 48 | }); 49 | 50 | if (!selectedComponent) { 51 | return; 52 | } 53 | const cwd = await getOrChooseCwd(); 54 | const installCmd = await getInstallCmd([selectedComponent.label], cwd); 55 | executeCommand(installCmd); 56 | }), 57 | 58 | vscode.commands.registerCommand(commands.addMultipleComponents, async () => { 59 | registryData = []; 60 | const newRegistryData = await getRegistry(); 61 | 62 | if (!newRegistryData) { 63 | vscode.window.showErrorMessage("Cannot get the component list"); 64 | return; 65 | } 66 | 67 | registryData = newRegistryData; 68 | 69 | const selectedComponents = await vscode.window.showQuickPick(registryData, { 70 | matchOnDescription: true, 71 | canPickMany: true, 72 | }); 73 | 74 | if (!selectedComponents) { 75 | return; 76 | } 77 | 78 | const selectedComponent = selectedComponents.map((component: Component) => component.label); 79 | const cwd = await getOrChooseCwd(); 80 | const installCmd = await getInstallCmd(selectedComponent, cwd); 81 | executeCommand(installCmd); 82 | }), 83 | vscode.commands.registerCommand(commands.gotoComponentDoc, async () => { 84 | registryData = []; 85 | const newRegistryData = await getRegistry(); 86 | 87 | if (!newRegistryData) { 88 | vscode.window.showErrorMessage("Cannot get the component list"); 89 | return; 90 | } 91 | 92 | registryData = newRegistryData; 93 | 94 | const selectedComponent = await vscode.window.showQuickPick(registryData, { 95 | matchOnDescription: true, 96 | }); 97 | 98 | if (!selectedComponent) { 99 | return; 100 | } 101 | 102 | const componentDocLink = await getComponentDocLink(selectedComponent.label); 103 | vscode.env.openExternal(vscode.Uri.parse(componentDocLink)); 104 | }), 105 | vscode.commands.registerCommand(commands.reloadComponentList, async () => { 106 | registryData = []; 107 | const newRegistryData = await getRegistry(); 108 | 109 | if (!newRegistryData) { 110 | vscode.window.showErrorMessage("Cannot get the component list"); 111 | return; 112 | } 113 | 114 | registryData = newRegistryData; 115 | vscode.window.showInformationMessage("shadcn/svelte: Reloaded components"); 116 | }), 117 | vscode.commands.registerCommand(commands.gotoDoc, async () => { 118 | const svelteVersion = await getSvelteVersion(); 119 | const shadCnDocUrl = svelteVersion >= 5 ? "https://next.shadcn-svelte.com/docs" : "https://shadcn-svelte.com/docs"; 120 | vscode.env.openExternal(vscode.Uri.parse(shadCnDocUrl)); 121 | }), 122 | ]; 123 | 124 | context.subscriptions.push(...disposables); 125 | } 126 | 127 | // This method is called when your extension is deactivated 128 | export function deactivate() { } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | shadcn-svelte 5 |

6 |

7 | 8 | > [!NOTE] 9 | > The Shadcn Svelte VSCode Extension now supports both Svelte 4 and Svelte 5. The following are the abbreviations for help, imports, and usage specific to their respective Svelte versions: Svelte 4: `cn-help`, `cni-accordion` and `cnx-accordion`. Svelte 5: `cn-x-help`, `cni-x-accordion` and `cnx-accordion-next`. 10 | 11 | This VSCode extension enables you to install [shadcn/svelte](https://shadcn-svelte.com) components directly from your IDE ✨. 12 | 13 | ## Initialize the Shadcn/Svelte CLI 14 | 15 | ![to initialize CLI open the command palette and search for shadcn/svelte: install cli command](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/init-cli.png) 16 | 17 | ## Install components 18 | 19 | ![to initialize CLI open the command palette and search for shadcn/svelte: add new component](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/add-new-component.png) 20 | 21 | ## Choose a component to install from the list 22 | 23 | ![choose a component to install from the list](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/add-new-component-preview.png) 24 | 25 | ## Install multiple components 26 | 27 | ![install multiple components](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/add-multiple-components.png) 28 | 29 | ## Choose components to install from the list 30 | ![choose components to install from the list](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/add-multiple-components-preview.png) 31 | 32 | ## Open the Shadcn-Svelte documentation 33 | 34 | ![open the shadcn-svelte documentation](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/shadcn-svelte-docs.png) 35 | 36 | ## Navigate to a particular component's documentation page 37 | 38 | ![navigate to a particular component's documentation page](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/shadcn-svelte-component-docs.png) 39 | 40 | ## Shadcn/Svelte Snippets 41 | 42 | Easily import and use shadcn-svelte components with ease using snippets within VSCode. Just type `cn` or `shadcn` in your svelte file and choose from an array of components to use. 43 | 44 | ![shadcn-svelte-snippets-example](https://raw.githubusercontent.com/selemondev/vscode-shadcn-svelte/master/src/assets/images/shadcn-svelte-import.png) 45 | 46 | ### How it works 47 | 48 | | Snippet | Description | 49 | | ----------------- | -------------------------------------- | 50 | | `cn-help` | How to use shadcn/svelte snippets | 51 | | `cn-x-help` | How to use shadcn/svelte@next snippets | 52 | | `cni-[component]` | Adds imports for the component | 53 | | `cni-x-[component]`| Adds imports for the shadcn/svelte@next component | 54 | | `cnx-[component]` | Adds the markup for the svelte component| 55 | 56 | ### How to use? 57 | 58 | 1. Components 59 | 60 | For `Alert` component, type `cni-alert` to add imports in your svelte file, and to use the component, use `cnx-alert`. 61 | 62 | > Similarly, for any other component, use `cni-[component]` to add imports and `cnx-[component]` to use. 63 | 64 | ```tsx 65 | // cni-alert - Svelte v4 66 | import * as Alert from "$lib/components/ui/alert" 67 | 68 | // cni-x-alert - Svelte v5 69 | import * as Alert from "$lib/components/ui/alert/index.js" 70 | 71 | // cnx-alert 72 | 73 | Heads up! 74 | 75 | You can add components to your app using the cli. 76 | 77 | 78 | ``` 79 | 80 | ### How to contribute? 81 | 82 | Contributions are welcome and encouraged! If you have any ideas or suggestions for new features, or if you encounter any bugs or issues, please open an issue or submit a pull request on the GitHub repository. 83 | 84 | Developers interested in contributing should read the [Code of Conduct](./CODE_OF_CONDUCT.md) and the [Contributing Guide](./CONTRIBUTING.md). 85 | 86 | Use this link - [Snippet Generation](https://snippet-generator.app/?description=https%3A%2F%2Fwww.shadcn-svelte.com%2Fdocs%2Fcomponents&tabtrigger=shadcn-&snippet=&mode=vscode) to generate snippets and add/update them to the `snippets` folder that is located in the `src` accordingly. 87 | 88 | 89 | ### Credits 90 | 91 | All credits go to the creators of these amazing projects: 92 | 93 | - [Shadcn UI](https://ui.shadcn.com) for creating this amazing project. 94 | - [Shadcn Svelte](https://shadcn-svelte.com) for creating the Svelte port of Shadcn UI. 95 | - [Bits UI](https://www.bits-ui.com/docs/introduction) for doing all the hard work to make sure components are accessible. 96 | - [Suhel Makkad](https://github.com/SuhelMakkad/vscode-shadcn-ui) for creating the Shadcn UI VSCode extension. 97 | - [Neeraj Dalal](https://github.com/nrjdalal/shadcn-ui-snippets) for creating the Shadcn UI Snippets VSCode extension. 98 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-shadcn-svelte", 3 | "version": "0.6.0", 4 | "license": "MIT", 5 | "displayName": "shadcn/svelte", 6 | "description": "Integrate components and snippets from Shadcn/Svelte directly into your IDE ✨.", 7 | "publisher": "Selemondev", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/selemondev/vscode-shadcn-svelte" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/selemondev/vscode-shadcn-svelte/issues", 14 | "email": "selemonsrdev@gmail.com" 15 | }, 16 | "engines": { 17 | "vscode": "^1.85.0" 18 | }, 19 | "categories": [ 20 | "Other", 21 | "Snippets" 22 | ], 23 | "keywords": [ 24 | "svelte", 25 | "shadcn-svelte", 26 | "shadcn-svelte-snippet", 27 | "shadcn-svelte-snippets", 28 | "snippet", 29 | "snippets", 30 | "svelte snippets", 31 | "shadcn-svelte snippets", 32 | "svelte typescript snippets" 33 | ], 34 | "icon": "src/images/icon.png", 35 | "activationEvents": [], 36 | "main": "./dist/extension.js", 37 | "contributes": { 38 | "languages": [ 39 | { 40 | "id": "svelte", 41 | "aliases": [ 42 | "Svelte", 43 | "Svelte 3", 44 | "svelte" 45 | ], 46 | "filenamePatterns": [ 47 | "*.svelte" 48 | ] 49 | } 50 | ], 51 | "snippets": [ 52 | { 53 | "language": "javascript", 54 | "path": "./src/snippets/imports-code-snippets.json" 55 | }, 56 | { 57 | "language": "typescript", 58 | "path": "./src/snippets/imports-code-snippets.json" 59 | }, 60 | { 61 | "language": "javascript", 62 | "path": "./src/snippets/imports-code-snippets-next.json" 63 | }, 64 | { 65 | "language": "typescript", 66 | "path": "./src/snippets/imports-code-snippets-next.json" 67 | }, 68 | { 69 | "language": "javascript", 70 | "path": "./src/snippets/help-code-snippets.json" 71 | }, 72 | { 73 | "language": "typescript", 74 | "path": "./src/snippets/help-code-snippets.json" 75 | }, 76 | { 77 | "language": "javascript", 78 | "path": "./src/snippets/help-code-snippets-next.json" 79 | }, 80 | { 81 | "language": "typescript", 82 | "path": "./src/snippets/help-code-snippets-next.json" 83 | }, 84 | { 85 | "language": "html", 86 | "path": "./src/snippets/help-code-snippets.json" 87 | }, 88 | { 89 | "language": "svelte", 90 | "path": "./src/snippets/help-code-snippets.json" 91 | }, 92 | { 93 | "language": "html", 94 | "path": "./src/snippets/help-code-snippets-next.json" 95 | }, 96 | { 97 | "language": "svelte", 98 | "path": "./src/snippets/help-code-snippets-next.json" 99 | }, 100 | { 101 | "language": "html", 102 | "path": "./src/snippets/usage-code-snippets.json" 103 | }, 104 | { 105 | "language": "svelte", 106 | "path": "./src/snippets/usage-code-snippets.json" 107 | }, 108 | { 109 | "language": "html", 110 | "path": "./src/snippets/usage-code-snippets-next.json" 111 | }, 112 | { 113 | "language": "svelte", 114 | "path": "./src/snippets/usage-code-snippets-next.json" 115 | } 116 | ], 117 | "commands": [ 118 | { 119 | "command": "shadcn-svelte.initCli", 120 | "title": "shadcn/svelte: Install CLI" 121 | }, 122 | { 123 | "command": "shadcn-svelte.addNewComponent", 124 | "title": "shadcn/svelte: Add New Component" 125 | }, 126 | { 127 | "command": "shadcn-svelte.addMultipleComponents", 128 | "title": "shadcn/svelte: Add Multiple Components" 129 | }, 130 | { 131 | "command": "shadcn-svelte.gotoComponentDoc", 132 | "title": "shadcn/svelte: Open Component Documentation" 133 | }, 134 | { 135 | "command": "shadcn-svelte.reloadComponentList", 136 | "title": "shadcn/svelte: Reload Component List" 137 | }, 138 | { 139 | "command": "shadcn-svelte.gotoDoc", 140 | "title": "shadcn/svelte: Open Documentation" 141 | } 142 | ], 143 | "configuration": { 144 | "title": "shadcn/svelte", 145 | "properties": { 146 | "shadcn-svelte.cwd": { 147 | "type": "string", 148 | "default": "", 149 | "markdownDescription": "Absolute path to the working directory when running shadcn-svelte CLI. Default is the current workspace folder." 150 | } 151 | } 152 | } 153 | }, 154 | "scripts": { 155 | "vscode:prepublish": "pnpm build", 156 | "generate-major:release": "npx changelogen@latest --major --release", 157 | "generate-minor:release": "npx changelogen@latest --minor --release", 158 | "check-types": "tsc --noEmit", 159 | "build": "pnpm lint && node esbuild.js --production", 160 | "dev": "pnpm build -- --watch", 161 | "vscode": "pnpx vsce publish --no-dependencies", 162 | "ovsx": "pnpx ovsx publish --no-dependencies", 163 | "lint": "eslint src --ext ts --fix" 164 | }, 165 | "devDependencies": { 166 | "@types/node": "24.x", 167 | "@types/vscode": "^1.85.0", 168 | "@typescript-eslint/eslint-plugin": "^8.43.0", 169 | "@typescript-eslint/parser": "^8.45.0", 170 | "esbuild": "^0.25.10", 171 | "eslint": "^9.37.0", 172 | "typescript": "^5.9.2" 173 | }, 174 | "dependencies": { 175 | "ofetch": "^1.4.1", 176 | "pkg-types": "^2.3.0" 177 | }, 178 | "packageManager": "pnpm@9.15.9" 179 | } -------------------------------------------------------------------------------- /src/snippets/imports-code-snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "Accordion": { 3 | "prefix": [ 4 | "shadcn-i-accordion", 5 | "cni-accordion" 6 | ], 7 | "body": [ 8 | "import * as Accordion from \"$$lib/components/ui/accordion\"" 9 | ], 10 | "description": "https://shadcn-svelte.com/docs/components/accordion.html" 11 | }, 12 | "Alert": { 13 | "prefix": [ 14 | "shadcn-i-alert", 15 | "cni-alert" 16 | ], 17 | "body": [ 18 | "import * as Alert from \"$$lib/components/ui/alert\"" 19 | ], 20 | "description": "https://shadcn-svelte.com/docs/components/alert.html" 21 | }, 22 | "Alert Dialog": { 23 | "prefix": [ 24 | "shadcn-i-alert-dialog", 25 | "cni-alert-dialog" 26 | ], 27 | "body": [ 28 | "import * as AlertDialog from \"$$lib/components/ui/alert-dialog\"" 29 | ], 30 | "description": "https://shadcn-svelte.com/docs/components/alert-dialog.html" 31 | }, 32 | "Aspect Ratio": { 33 | "prefix": [ 34 | "shadcn-i-aspect-ratio", 35 | "cni-aspect-ratio" 36 | ], 37 | "body": [ 38 | "import { AspectRatio } from \"$$lib/components/ui/aspect-ratio\"", 39 | "" 40 | ], 41 | "description": "https://shadcn-svelte.com/docs/components/aspect-ratio.html" 42 | }, 43 | "Avatar": { 44 | "prefix": [ 45 | "shadcn-i-avatar", 46 | "cni-avatar" 47 | ], 48 | "body": [ 49 | " import * as Avatar from \"$$lib/components/ui/avatar\"", 50 | "" 51 | ], 52 | "description": "https://shadcn-svelte.com/docs/components/avatar.html" 53 | }, 54 | "Badge": { 55 | "prefix": [ 56 | "shadcn-i-badge", 57 | "cni-badge" 58 | ], 59 | "body": [ 60 | "import { Badge } from \"$$lib/components/ui/badge\"", 61 | "" 62 | ], 63 | "description": "https://shadcn-svelte.com/docs/components/badge.html" 64 | }, 65 | "Button": { 66 | "prefix": [ 67 | "shadcn-i-button", 68 | "cni-button" 69 | ], 70 | "body": [ 71 | "import { Button } from \"$$lib/components/ui/button\"", 72 | "" 73 | ], 74 | "description": "https://shadcn-svelte.com/docs/components/button.html" 75 | }, 76 | "Calendar": { 77 | "prefix": [ 78 | "shadcn-i-calendar", 79 | "cni-calendar" 80 | ], 81 | "body": [ 82 | "import { Calendar } from \"$$lib/components/ui/calendar\"", 83 | "" 84 | ], 85 | "description": "https://shadcn-svelte.com/docs/components/calendar.html" 86 | }, 87 | "Card": { 88 | "prefix": [ 89 | "shadcn-i-card", 90 | "cni-card" 91 | ], 92 | "body": [ 93 | "import * as Card from \"$$lib/components/ui/card\"", 94 | "" 95 | ], 96 | "description": "https://shadcn-svelte.com/docs/components/card.html" 97 | }, 98 | "Carousel": { 99 | "prefix": [ 100 | "shadcn-i-carousel", 101 | "cni-carousel" 102 | ], 103 | "body": [ 104 | "import * as Card from \"$$lib/components/ui/card\"", 105 | "import * as Carousel from \"$$lib/components/ui/carousel\"" 106 | ], 107 | "description": "https://www.shadcn-svelte.com/docs/components/carousel.html" 108 | }, 109 | "Checkbox": { 110 | "prefix": [ 111 | "shadcn-i-checkbox", 112 | "cni-checkbox" 113 | ], 114 | "body": [ 115 | "import { Checkbox } from \"$$lib/components/ui/checkbox\"", 116 | "" 117 | ], 118 | "description": "https://shadcn-svelte.com/docs/components/checkbox.html" 119 | }, 120 | "Collapsible": { 121 | "prefix": [ 122 | "shadcn-i-collapsible", 123 | "cni-collapsible" 124 | ], 125 | "body": [ 126 | "import * as Collapsible from \"$$lib/components/ui/collapsible\"", 127 | "" 128 | ], 129 | "description": "https://shadcn-svelte.com/docs/components/collapsible.html" 130 | }, 131 | "Command": { 132 | "prefix": [ 133 | "shadcn-i-command", 134 | "cni-command" 135 | ], 136 | "body": [ 137 | "import * as Command from \"$$lib/components/ui/command\"", 138 | "" 139 | ], 140 | "description": "https://shadcn-svelte.com/docs/components/command.html" 141 | }, 142 | "Context Menu": { 143 | "prefix": [ 144 | "shadcn-i-context-menu", 145 | "cni-context-menu" 146 | ], 147 | "body": [ 148 | "import * as ContextMenu from \"$$lib/components/ui/context-menu\"", 149 | "" 150 | ], 151 | "description": "https://shadcn-svelte.com/docs/components/context-menu.html" 152 | }, 153 | "Dialog": { 154 | "prefix": [ 155 | "shadcn-i-dialog", 156 | "cni-dialog" 157 | ], 158 | "body": [ 159 | "import * as Dialog from \"$$lib/components/ui/dialog\"", 160 | "" 161 | ], 162 | "description": "https://shadcn-svelte.com/docs/components/dialog.html" 163 | }, 164 | "Dropdown Menu": { 165 | "prefix": [ 166 | "shadcn-i-dropdown-menu", 167 | "cni-dropdown-menu" 168 | ], 169 | "body": [ 170 | "import * as DropdownMenu from \"$$lib/components/ui/dropdown-menu\"", 171 | "" 172 | ], 173 | "description": "https://shadcn-svelte.com/docs/components/dropdown-menu.html" 174 | }, 175 | "Drawer": { 176 | "prefix": [ 177 | "shadcn-i-drawer", 178 | "cni-drawer" 179 | ], 180 | "body": [ 181 | " import * as Drawer from \"$$lib/components/ui/drawer\"", 182 | "" 183 | ], 184 | "description": "https://shadcn-svelte.com/docs/components/drawer.html" 185 | }, 186 | "Hover Card": { 187 | "prefix": [ 188 | "shadcn-i-hover-card", 189 | "cni-hover-card" 190 | ], 191 | "body": [ 192 | "import * as HoverCard from \"$$lib/components/ui/hover-card\"", 193 | "" 194 | ], 195 | "description": "https://shadcn-svelte.com/docs/components/hover-card.html" 196 | }, 197 | "Input": { 198 | "prefix": [ 199 | "shadcn-i-input", 200 | "cni-input" 201 | ], 202 | "body": [ 203 | "import { Input } from \"$$lib/components/ui/input\"", 204 | "" 205 | ], 206 | "description": "https://shadcn-svelte.com/docs/components/input.html" 207 | }, 208 | "Input OTP": { 209 | "prefix": [ 210 | "shadcn-i-input-otp", 211 | "cni-input-otp" 212 | ], 213 | "body": [ 214 | "import * as InputOTP from \"$$lib/components/ui/input-otp/index.js\"", 215 | "" 216 | ], 217 | "description": "https://next.shadcn-svelte.com/docs/components/input-otp" 218 | }, 219 | "Label": { 220 | "prefix": [ 221 | "shadcn-i-label", 222 | "cni-label" 223 | ], 224 | "body": [ 225 | "import { Label } from \"$$lib/components/ui/label\"", 226 | "" 227 | ], 228 | "description": "https://shadcn-svelte.com/docs/components/label.html" 229 | }, 230 | "Menubar": { 231 | "prefix": [ 232 | "shadcn-i-menubar", 233 | "cni-menubar" 234 | ], 235 | "body": [ 236 | "import * as Menubar from \"$$lib/components/ui/menubar\"", 237 | "" 238 | ], 239 | "description": "https://shadcn-svelte.com/docs/components/menu-bar.html" 240 | }, 241 | "Popover": { 242 | "prefix": [ 243 | "shadcn-i-popover", 244 | "cni-popover" 245 | ], 246 | "body": [ 247 | "import * as Popover from \"$$lib/components/ui/popover\"", 248 | "" 249 | ], 250 | "description": "https://shadcn-svelte.com/docs/components/popover.html" 251 | }, 252 | "Progress": { 253 | "prefix": [ 254 | "shadcn-i-progress", 255 | "cni-progress" 256 | ], 257 | "body": [ 258 | "import { Progress } from \"$$lib/components/ui/progress\"", 259 | "" 260 | ], 261 | "description": "https://shadcn-svelte.com/docs/components/progress.html" 262 | }, 263 | "Radio Group": { 264 | "prefix": [ 265 | "shadcn-i-radio-group", 266 | "cni-radio-group" 267 | ], 268 | "body": [ 269 | "import { Label } from \"$$lib/components/ui/label\"", 270 | "import * as RadioGroup from \"$$lib/components/ui/radio-group\"", 271 | "" 272 | ], 273 | "description": "https://shadcn-svelte.com/docs/components/radio-group.html" 274 | }, 275 | "Range Calendar": { 276 | "prefix": [ 277 | "shadcn-i-range-calendar", 278 | "cni-range-calendar" 279 | ], 280 | "body": [ 281 | "import { RangeCalendar } from \"$$lib/components/ui/range-calendar\"", 282 | "" 283 | ], 284 | "description": "https://shadcn-svelte.com/docs/components/range-calendar.html" 285 | }, 286 | "Scroll Area": { 287 | "prefix": [ 288 | "shadcn-i-scroll-area", 289 | "cni-scroll-area" 290 | ], 291 | "body": [ 292 | "import { ScrollArea } from \"$$lib/components/ui/scroll-area\"", 293 | "" 294 | ], 295 | "description": "https://shadcn-svelte.com/docs/components/scroll-area.html" 296 | }, 297 | "Select": { 298 | "prefix": [ 299 | "cni-select" 300 | ], 301 | "body": [ 302 | "import * as Select from \"$$lib/components/ui/select\"", 303 | "" 304 | ], 305 | "description": "https://shadcn-svelte.com/docs/components/select.html" 306 | }, 307 | "Separator": { 308 | "prefix": [ 309 | "shadcn-i-separator", 310 | "cni-separator" 311 | ], 312 | "body": [ 313 | " import { Separator } from \"$$lib/components/ui/separator\"", 314 | "" 315 | ], 316 | "description": "https://shadcn-svelte.com/docs/components/separator.html" 317 | }, 318 | "Sheet": { 319 | "prefix": [ 320 | "shadcn-i-sheet", 321 | "cni-sheet" 322 | ], 323 | "body": [ 324 | "import * as Sheet from \"$$lib/components/ui/sheet\"", 325 | "" 326 | ], 327 | "description": "https://shadcn-svelte.com/docs/components/sheet.html" 328 | }, 329 | "Sidebar": { 330 | "prefix": [ 331 | "shadcn-i-sidebar", 332 | "cni-sidebar" 333 | ], 334 | "body": [ 335 | "import * as Sidebar from \"$$lib/components/ui/sidebar/index.js\"", 336 | "" 337 | ], 338 | "description": "https://next.shadcn-svelte.com/docs/components/sidebar" 339 | }, 340 | "Skeleton": { 341 | "prefix": [ 342 | "shadcn-i-skeleton", 343 | "cni-skeleton" 344 | ], 345 | "body": [ 346 | "import { Skeleton } from \"$$lib/components/ui/skeleton\"", 347 | "" 348 | ], 349 | "description": "https://shadcn-svelte.com/docs/components/skeleton.html" 350 | }, 351 | "Slider": { 352 | "prefix": [ 353 | "shadcn-i-slider", 354 | "cni-slider" 355 | ], 356 | "body": [ 357 | "import { Slider } from \"$$lib/components/ui/slider\"", 358 | "" 359 | ], 360 | "description": "https://shadcn-svelte.com/docs/components/slider.html" 361 | }, 362 | "Sonner": { 363 | "prefix": [ 364 | "shadcn-i-sonner", 365 | "cni-sonner" 366 | ], 367 | "body": [ 368 | "import { toast } from \"svelte-sonner\"" 369 | ], 370 | "description": "https://www.shadcn-svelte.com/docs/components/sonner.html" 371 | }, 372 | "Switch": { 373 | "prefix": [ 374 | "shadcn-i-switch", 375 | "cni-switch" 376 | ], 377 | "body": [ 378 | "import { Switch } from \"$$lib/components/ui/switch\"", 379 | "" 380 | ], 381 | "description": "https://shadcn-svelte.com/docs/components/switch.html" 382 | }, 383 | "Table": { 384 | "prefix": [ 385 | "shadcn-i-table", 386 | "cni-table" 387 | ], 388 | "body": [ 389 | "import * as Table from \"$$lib/components/ui/table\"", 390 | "" 391 | ], 392 | "description": "https://shadcn-svelte.com/docs/components/table.html" 393 | }, 394 | "Tabs": { 395 | "prefix": [ 396 | "shadcn-i-tabs", 397 | "cni-tabs" 398 | ], 399 | "body": [ 400 | "import * as Tabs from \"$$lib/components/ui/tabs\"", 401 | "" 402 | ], 403 | "description": "https://shadcn-svelte.com/docs/components/tabs.html" 404 | }, 405 | "Textarea": { 406 | "prefix": [ 407 | "shadcn-i-textarea", 408 | "cni-textarea" 409 | ], 410 | "body": [ 411 | "import { Textarea } from \"$$lib/components/ui/textarea\"", 412 | "" 413 | ], 414 | "description": "https://shadcn-svelte.com/docs/components/textarea.html" 415 | }, 416 | "Toggle": { 417 | "prefix": [ 418 | "shadcn-i-toggle", 419 | "cni-toggle" 420 | ], 421 | "body": [ 422 | "import { Toggle } from \"$$lib/components/ui/toggle\"", 423 | "" 424 | ], 425 | "description": "https://shadcn-svelte.com/docs/components/toggle.html" 426 | }, 427 | "Toggle Group": { 428 | "prefix": [ 429 | "shadcn-i-toggle", 430 | "cni-toggle" 431 | ], 432 | "body": [ 433 | "import * as ToggleGroup from \"$$lib/components/ui/toggle-group\"", 434 | "" 435 | ], 436 | "description": "https://shadcn-svelte.com/docs/components/toggle-group.html" 437 | }, 438 | "Tooltip": { 439 | "prefix": [ 440 | "shadcn-i-tooltip", 441 | "cni-tooltip" 442 | ], 443 | "body": [ 444 | "import * as Tooltip from \"$$lib/components/ui/tooltip\"", 445 | "" 446 | ], 447 | "description": "https://shadcn-svelte.com/docs/components/tooltip.html" 448 | }, 449 | "Form": { 450 | "prefix": [ 451 | "shadcn-i-form", 452 | "cni-form" 453 | ], 454 | "body": [ 455 | "import * as Form from \"$$lib/components/ui/form\"", 456 | "" 457 | ], 458 | "description": "https://shadcn-svelte.com/docs/components/form.html" 459 | } 460 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "vscode-shadcn-svelte" extension will be documented in this file. 4 | 5 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 6 | 7 | ## v0.6.0 8 | 9 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.5.6...v0.6.0) 10 | 11 | ### 🩹 Fixes 12 | 13 | - User's cwd preference ([ba6847b](https://github.com/selemondev/vscode-shadcn-svelte/commit/ba6847b)) 14 | 15 | ### 🏡 Chore 16 | 17 | - **deps-dev:** Bump @typescript-eslint/eslint-plugin ([63386d9](https://github.com/selemondev/vscode-shadcn-svelte/commit/63386d9)) 18 | - **deps-dev:** Bump @types/node from 20.17.13 to 24.3.1 ([eb8b53a](https://github.com/selemondev/vscode-shadcn-svelte/commit/eb8b53a)) 19 | - **deps-dev:** Bump @types/vscode from 1.85.0 to 1.103.0 ([c579609](https://github.com/selemondev/vscode-shadcn-svelte/commit/c579609)) 20 | - **deps-dev:** Bump @typescript-eslint/parser from 6.21.0 to 8.43.0 ([99b4972](https://github.com/selemondev/vscode-shadcn-svelte/commit/99b4972)) 21 | - **deps-dev:** Bump @types/node from 24.3.1 to 24.6.0 ([871e2ae](https://github.com/selemondev/vscode-shadcn-svelte/commit/871e2ae)) 22 | - **deps-dev:** Bump @typescript-eslint/parser from 8.43.0 to 8.45.0 ([3ca4303](https://github.com/selemondev/vscode-shadcn-svelte/commit/3ca4303)) 23 | - **deps-dev:** Bump eslint from 8.57.1 to 9.36.0 ([4c79fdf](https://github.com/selemondev/vscode-shadcn-svelte/commit/4c79fdf)) 24 | - **deps-dev:** Bump esbuild from 0.25.9 to 0.25.10 ([2b16cb3](https://github.com/selemondev/vscode-shadcn-svelte/commit/2b16cb3)) 25 | - **deps-dev:** Bump eslint from 9.36.0 to 9.37.0 ([9794ea3](https://github.com/selemondev/vscode-shadcn-svelte/commit/9794ea3)) 26 | - **eslint:** Migrate to Eslint v9 file structure ([4feb4ee](https://github.com/selemondev/vscode-shadcn-svelte/commit/4feb4ee)) 27 | 28 | ### ❤️ Contributors 29 | 30 | - Selemondev 31 | 32 | ## v0.5.5 33 | 34 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.5.4...v0.5.5) 35 | 36 | ### 💅 Refactors 37 | 38 | - Resolve types config ([edc9b48](https://github.com/selemondev/vscode-shadcn-svelte/commit/edc9b48)) 39 | 40 | ### 🏡 Chore 41 | 42 | - **deps-dev:** Bump typescript from 5.7.3 to 5.9.2 ([5dfadf4](https://github.com/selemondev/vscode-shadcn-svelte/commit/5dfadf4)) 43 | - **deps-dev:** Bump @types/vscode from 1.96.0 to 1.103.0 ([46f44cb](https://github.com/selemondev/vscode-shadcn-svelte/commit/46f44cb)) 44 | - **deps-dev:** Bump esbuild from 0.24.2 to 0.25.9 ([3250f81](https://github.com/selemondev/vscode-shadcn-svelte/commit/3250f81)) 45 | - **deps-dev:** Bump @typescript-eslint/eslint-plugin ([78e4c0a](https://github.com/selemondev/vscode-shadcn-svelte/commit/78e4c0a)) 46 | - Update dependencies ([2c7a86d](https://github.com/selemondev/vscode-shadcn-svelte/commit/2c7a86d)) 47 | - Update version ([6d40df5](https://github.com/selemondev/vscode-shadcn-svelte/commit/6d40df5)) 48 | - Lint ([dd50478](https://github.com/selemondev/vscode-shadcn-svelte/commit/dd50478)) 49 | 50 | ### ❤️ Contributors 51 | 52 | - Selemondev 53 | 54 | ## v0.5.3 55 | 56 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.5.2...v0.5.3) 57 | 58 | ### 💅 Refactors 59 | 60 | - # 58 refactor bun's lockfile name from bun.lockb to bun.lock ([c2bdc36](https://github.com/selemondev/vscode-shadcn-svelte/commit/c2bdc36)) 61 | 62 | ### 🏡 Chore 63 | 64 | - **release:** V0.5.2 ([13dfe29](https://github.com/selemondev/vscode-shadcn-svelte/commit/13dfe29)) 65 | - Add deployment scripts ([c845c47](https://github.com/selemondev/vscode-shadcn-svelte/commit/c845c47)) 66 | 67 | ### ❤️ Contributors 68 | 69 | - Selemondev 70 | 71 | ## v0.5.2 72 | 73 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.5.1...v0.5.2) 74 | 75 | ### 💅 Refactors 76 | 77 | - Remove popup ([056fa64](https://github.com/selemondev/vscode-shadcn-svelte/commit/056fa64)) 78 | 79 | ### 🏡 Chore 80 | 81 | - Refactor scripts ([664e5c0](https://github.com/selemondev/vscode-shadcn-svelte/commit/664e5c0)) 82 | - Fix typo ([dddf845](https://github.com/selemondev/vscode-shadcn-svelte/commit/dddf845)) 83 | 84 | ### ❤️ Contributors 85 | 86 | - Selemondev 87 | 88 | ## v0.5.1 89 | 90 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.5.0...v0.5.1) 91 | 92 | ### 💅 Refactors 93 | 94 | - Workspace showQuickPick logic ([49250f0](https://github.com/selemondev/vscode-shadcn-svelte/commit/49250f0)) 95 | 96 | ### ❤️ Contributors 97 | 98 | - Selemondev 99 | 100 | ## v0.5.0 101 | 102 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.4.0...v0.5.0) 103 | 104 | ### 🚀 Enhancements 105 | 106 | - Support multiple workspaces ([ba1723e](https://github.com/selemondev/vscode-shadcn-svelte/commit/ba1723e)) 107 | 108 | ### 🏡 Chore 109 | 110 | - Release v0.4.0 ([32cb538](https://github.com/selemondev/vscode-shadcn-svelte/commit/32cb538)) 111 | 112 | ### ❤️ Contributors 113 | 114 | - Selemondev 115 | 116 | ## v0.2.0 117 | 118 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.14...v0.2.0) 119 | 120 | ### 🏡 Chore 121 | 122 | - Release stable version ([ffe708b](https://github.com/selemondev/vscode-shadcn-svelte/commit/ffe708b)) 123 | 124 | ### ❤️ Contributors 125 | 126 | - Selemondev 127 | 128 | ## v0.1.14 129 | 130 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.13...v0.1.14) 131 | 132 | ### 🚀 Enhancements 133 | 134 | - Add snipprts ([342d7d8](https://github.com/selemondev/vscode-shadcn-svelte/commit/342d7d8)) 135 | 136 | ### ❤️ Contributors 137 | 138 | - Selemondev 139 | 140 | ## v0.1.13 141 | 142 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.12...v0.1.13) 143 | 144 | ### 💅 Refactors 145 | 146 | - Use esbuild instead of tsup ([341f8d6](https://github.com/selemondev/vscode-shadcn-svelte/commit/341f8d6)) 147 | 148 | ### ❤️ Contributors 149 | 150 | - Selemondev 151 | 152 | ## v0.1.12 153 | 154 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.11...v0.1.12) 155 | 156 | ### 💅 Refactors 157 | 158 | - Commands ([cd2604f](https://github.com/selemondev/vscode-shadcn-svelte/commit/cd2604f)) 159 | 160 | ### 📖 Documentation 161 | 162 | - Update README.md ([3d95340](https://github.com/selemondev/vscode-shadcn-svelte/commit/3d95340)) 163 | - Update README.md ([229fc1f](https://github.com/selemondev/vscode-shadcn-svelte/commit/229fc1f)) 164 | 165 | ### ❤️ Contributors 166 | 167 | - Selemondev 168 | - Selemon Brahanu ([@selemondev](http://github.com/selemondev)) 169 | 170 | ## v0.1.11 171 | 172 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.10...v0.1.11) 173 | 174 | ### 🏡 Chore 175 | 176 | - Refactor contributes ([cb67018](https://github.com/selemondev/vscode-shadcn-svelte/commit/cb67018)) 177 | 178 | ### ❤️ Contributors 179 | 180 | - Selemondev 181 | 182 | ## v0.1.10 183 | 184 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.9...v0.1.10) 185 | 186 | ### 🏡 Chore 187 | 188 | - Change vscode engine version ([7dd0286](https://github.com/selemondev/vscode-shadcn-svelte/commit/7dd0286)) 189 | 190 | ### ❤️ Contributors 191 | 192 | - Selemondev 193 | 194 | ## v0.1.9 195 | 196 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.8...v0.1.9) 197 | 198 | ### 🏡 Chore 199 | 200 | - Change vscode engine version ([8cf7e82](https://github.com/selemondev/vscode-shadcn-svelte/commit/8cf7e82)) 201 | 202 | ### ❤️ Contributors 203 | 204 | - Selemondev 205 | 206 | ## v0.1.8 207 | 208 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.7...v0.1.8) 209 | 210 | ### 🏡 Chore 211 | 212 | - Change vscode engine version ([2a91cd2](https://github.com/selemondev/vscode-shadcn-svelte/commit/2a91cd2)) 213 | 214 | ### ❤️ Contributors 215 | 216 | - Selemondev 217 | 218 | ## v0.1.7 219 | 220 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.6...v0.1.7) 221 | 222 | ### 🏡 Chore 223 | 224 | - Update deps ([0bd875f](https://github.com/selemondev/vscode-shadcn-svelte/commit/0bd875f)) 225 | 226 | ### ❤️ Contributors 227 | 228 | - Selemondev 229 | 230 | ## v0.1.6 231 | 232 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.5...v0.1.6) 233 | 234 | ### 🏡 Chore 235 | 236 | - Update deps ([def9035](https://github.com/selemondev/vscode-shadcn-svelte/commit/def9035)) 237 | 238 | ### ❤️ Contributors 239 | 240 | - Selemondev 241 | 242 | ## v0.1.5 243 | 244 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.4...v0.1.5) 245 | 246 | ### 🏡 Chore 247 | 248 | - Change vscode engine version ([9a299fd](https://github.com/selemondev/vscode-shadcn-svelte/commit/9a299fd)) 249 | 250 | ### ❤️ Contributors 251 | 252 | - Selemondev 253 | 254 | ## v0.1.4 255 | 256 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/ls...v0.1.4) 257 | 258 | ## v0.1.3 259 | 260 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.1...v0.1.3) 261 | 262 | ### 🚀 Enhancements 263 | 264 | - Add support for Svelte version 5 ([5afcbb6](https://github.com/selemondev/vscode-shadcn-svelte/commit/5afcbb6)) 265 | - Add Svelte 5 registry API endpoint ([0985c32](https://github.com/selemondev/vscode-shadcn-svelte/commit/0985c32)) 266 | - Add sidebar and input-otp snippets ([dbca8ac](https://github.com/selemondev/vscode-shadcn-svelte/commit/dbca8ac)) 267 | - Add Shadcn@next import and help code snippets ([0baecfd](https://github.com/selemondev/vscode-shadcn-svelte/commit/0baecfd)) 268 | 269 | ### 🩹 Fixes 270 | 271 | - Command not found error ([3b00371](https://github.com/selemondev/vscode-shadcn-svelte/commit/3b00371)) 272 | 273 | ### 📖 Documentation 274 | 275 | - Document shadcn-svelte@next snippets ([8ac9206](https://github.com/selemondev/vscode-shadcn-svelte/commit/8ac9206)) 276 | 277 | ### 🏡 Chore 278 | 279 | - Add deploy script ([0470328](https://github.com/selemondev/vscode-shadcn-svelte/commit/0470328)) 280 | - **release:** V0.1.2 ([b25bb31](https://github.com/selemondev/vscode-shadcn-svelte/commit/b25bb31)) 281 | 282 | ### ❤️ Contributors 283 | 284 | - Selemondev 285 | 286 | ## v0.1.2 287 | 288 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.1.1...v0.1.2) 289 | 290 | ### 🚀 Enhancements 291 | 292 | - Add support for Svelte version 5 ([5afcbb6](https://github.com/selemondev/vscode-shadcn-svelte/commit/5afcbb6)) 293 | - Add Svelte 5 registry API endpoint ([0985c32](https://github.com/selemondev/vscode-shadcn-svelte/commit/0985c32)) 294 | - Add sidebar and input-otp snippets ([dbca8ac](https://github.com/selemondev/vscode-shadcn-svelte/commit/dbca8ac)) 295 | - Add Shadcn@next import and help code snippets ([0baecfd](https://github.com/selemondev/vscode-shadcn-svelte/commit/0baecfd)) 296 | 297 | ### 📖 Documentation 298 | 299 | - Document shadcn-svelte@next snippets ([8ac9206](https://github.com/selemondev/vscode-shadcn-svelte/commit/8ac9206)) 300 | 301 | ### 🏡 Chore 302 | 303 | - Add deploy script ([0470328](https://github.com/selemondev/vscode-shadcn-svelte/commit/0470328)) 304 | 305 | ### ❤️ Contributors 306 | 307 | - Selemondev 308 | 309 | ## v0.0.8 310 | 311 | [compare changes](https://github.com/selemondev/vscode-shadcn-svelte/compare/v0.0.7...v0.0.8) 312 | 313 | ### 🚀 Enhancements 314 | 315 | - Add -cwd arg support for shadcn-svelte" ([715b01e](https://github.com/selemondev/vscode-shadcn-svelte/commit/715b01e)) 316 | - Add Sonner component snippets ([6971883](https://github.com/selemondev/vscode-shadcn-svelte/commit/6971883)) 317 | - **snippets:** Add Carousel snippets ([73c849a](https://github.com/selemondev/vscode-shadcn-svelte/commit/73c849a)) 318 | 319 | ### 🩹 Fixes 320 | 321 | - Dropdown menu import snippet ([633c10d](https://github.com/selemondev/vscode-shadcn-svelte/commit/633c10d)) 322 | 323 | ### 💅 Refactors 324 | 325 | - **bundler:** Migrate from webpack to tsup ([7500f06](https://github.com/selemondev/vscode-shadcn-svelte/commit/7500f06)) 326 | 327 | ### 📖 Documentation 328 | 329 | - Update README.md ([25673ad](https://github.com/selemondev/vscode-shadcn-svelte/commit/25673ad)) 330 | - Update README.md ([2e98770](https://github.com/selemondev/vscode-shadcn-svelte/commit/2e98770)) 331 | 332 | ### 🏡 Chore 333 | 334 | - Remove pnpm lock-file ([851dce9](https://github.com/selemondev/vscode-shadcn-svelte/commit/851dce9)) 335 | - **app:** Remove unnecessary files ([5fe0f3e](https://github.com/selemondev/vscode-shadcn-svelte/commit/5fe0f3e)) 336 | 337 | ### ❤️ Contributors 338 | 339 | - Selemondev 340 | 341 | ## v0.0.6 342 | 343 | 344 | ### 🩹 Fixes 345 | 346 | - Component dollar sign ($) import ([c4ddc57](https://github.com/selemondev/vscode-shadcn-svelte/commit/c4ddc57)) 347 | 348 | ### 💅 Refactors 349 | 350 | - Display name ([a1f80f5](https://github.com/selemondev/vscode-shadcn-svelte/commit/a1f80f5)) 351 | 352 | ### 📖 Documentation 353 | 354 | - Update docs ([50540b5](https://github.com/selemondev/vscode-shadcn-svelte/commit/50540b5)) 355 | - Update docs ([e2ddace](https://github.com/selemondev/vscode-shadcn-svelte/commit/e2ddace)) 356 | 357 | ### 🏡 Chore 358 | 359 | - Bumpp version ([4b52039](https://github.com/selemondev/vscode-shadcn-svelte/commit/4b52039)) 360 | 361 | ### ❤️ Contributors 362 | 363 | - Selemondev 364 | 365 | ## [Unreleased] 366 | 367 | - Initial release -------------------------------------------------------------------------------- /src/snippets/imports-code-snippets-next.json: -------------------------------------------------------------------------------- 1 | { 2 | "Accordion": { 3 | "prefix": [ 4 | "shadcn-ix-accordion", 5 | "cni-x-accordion" 6 | ], 7 | "body": [ 8 | "import * as Accordion from \"$$lib/components/ui/accordion/index.js\"" 9 | ], 10 | "description": "https://next.shadcn-svelte.com/docs/components/accordion.html" 11 | }, 12 | "Alert": { 13 | "prefix": [ 14 | "shadcn-ix-alert", 15 | "cni-x-alert" 16 | ], 17 | "body": [ 18 | "import * as Alert from \"$$lib/components/ui/alert/index.js\"" 19 | ], 20 | "description": "https://next.shadcn-svelte.com/docs/components/alert.html" 21 | }, 22 | "Alert Dialog": { 23 | "prefix": [ 24 | "shadcn-ix-alert-dialog", 25 | "cni-x-alert-dialog" 26 | ], 27 | "body": [ 28 | "import * as AlertDialog from \"$$lib/components/ui/alert-dialog/index.js\"" 29 | ], 30 | "description": "https://next.shadcn-svelte.com/docs/components/alert-dialog.html" 31 | }, 32 | "Aspect Ratio": { 33 | "prefix": [ 34 | "shadcn-ix-aspect-ratio", 35 | "cni-x-aspect-ratio" 36 | ], 37 | "body": [ 38 | "import { AspectRatio } from \"$$lib/components/ui/aspect-ratio/index.js\"", 39 | "" 40 | ], 41 | "description": "https://next.shadcn-svelte.com/docs/components/aspect-ratio.html" 42 | }, 43 | "Avatar": { 44 | "prefix": [ 45 | "shadcn-ix-avatar", 46 | "cni-x-avatar" 47 | ], 48 | "body": [ 49 | " import * as Avatar from \"$$lib/components/ui/avatar/index.js\"", 50 | "" 51 | ], 52 | "description": "https://next.shadcn-svelte.com/docs/components/avatar.html" 53 | }, 54 | "Badge": { 55 | "prefix": [ 56 | "shadcn-ix-badge", 57 | "cni-x-badge" 58 | ], 59 | "body": [ 60 | "import { Badge } from \"$$lib/components/ui/badge/index.js\"", 61 | "" 62 | ], 63 | "description": "https://next.shadcn-svelte.com/docs/components/badge.html" 64 | }, 65 | "Button": { 66 | "prefix": [ 67 | "shadcn-ix-button", 68 | "cni-x-button" 69 | ], 70 | "body": [ 71 | "import { Button } from \"$$lib/components/ui/button/index.js\"", 72 | "" 73 | ], 74 | "description": "https://next.shadcn-svelte.com/docs/components/button.html" 75 | }, 76 | "Calendar": { 77 | "prefix": [ 78 | "shadcn-ix-calendar", 79 | "cni-x-calendar" 80 | ], 81 | "body": [ 82 | "import { Calendar } from \"$$lib/components/ui/calendar/index.js\"", 83 | "" 84 | ], 85 | "description": "https://next.shadcn-svelte.com/docs/components/calendar.html" 86 | }, 87 | "Card": { 88 | "prefix": [ 89 | "shadcn-ix-card", 90 | "cni-x-card" 91 | ], 92 | "body": [ 93 | "import * as Card from \"$$lib/components/ui/card/index.js\"", 94 | "" 95 | ], 96 | "description": "https://next.shadcn-svelte.com/docs/components/card.html" 97 | }, 98 | "Carousel": { 99 | "prefix": [ 100 | "shadcn-ix-carousel", 101 | "cni-x-carousel" 102 | ], 103 | "body": [ 104 | "import * as Card from \"$$lib/components/ui/card/index.js\"", 105 | "import * as Carousel from \"$$lib/components/ui/carousel/index.js\"" 106 | ], 107 | "description": "https://next.shadcn-svelte.com/docs/components/carousel.html" 108 | }, 109 | "Checkbox": { 110 | "prefix": [ 111 | "shadcn-ix-checkbox", 112 | "cni-x-checkbox" 113 | ], 114 | "body": [ 115 | "import { Checkbox } from \"$$lib/components/ui/checkbox/index.js\"", 116 | "" 117 | ], 118 | "description": "https://next.shadcn-svelte.com/docs/components/checkbox.html" 119 | }, 120 | "Collapsible": { 121 | "prefix": [ 122 | "shadcn-ix-collapsible", 123 | "cni-x-collapsible" 124 | ], 125 | "body": [ 126 | "import * as Collapsible from \"$$lib/components/ui/collapsible/index.js\"", 127 | "" 128 | ], 129 | "description": "https://next.shadcn-svelte.com/docs/components/collapsible.html" 130 | }, 131 | "Command": { 132 | "prefix": [ 133 | "shadcn-ix-command", 134 | "cni-x-command" 135 | ], 136 | "body": [ 137 | "import * as Command from \"$$lib/components/ui/command/index.js\"", 138 | "" 139 | ], 140 | "description": "https://next.shadcn-svelte.com/docs/components/command.html" 141 | }, 142 | "Context Menu": { 143 | "prefix": [ 144 | "shadcn-ix-context-menu", 145 | "cni-x-context-menu" 146 | ], 147 | "body": [ 148 | "import * as ContextMenu from \"$$lib/components/ui/context-menu/index.js\"", 149 | "" 150 | ], 151 | "description": "https://next.shadcn-svelte.com/docs/components/context-menu.html" 152 | }, 153 | "Dialog": { 154 | "prefix": [ 155 | "shadcn-ix-dialog", 156 | "cni-x-dialog" 157 | ], 158 | "body": [ 159 | "import * as Dialog from \"$$lib/components/ui/dialog/index.js\"", 160 | "" 161 | ], 162 | "description": "https://next.shadcn-svelte.com/docs/components/dialog.html" 163 | }, 164 | "Dropdown Menu": { 165 | "prefix": [ 166 | "shadcn-ix-dropdown-menu", 167 | "cni-x-dropdown-menu" 168 | ], 169 | "body": [ 170 | "import * as DropdownMenu from \"$$lib/components/ui/dropdown-menu/index.js\"", 171 | "" 172 | ], 173 | "description": "https://next.shadcn-svelte.com/docs/components/dropdown-menu.html" 174 | }, 175 | "Drawer": { 176 | "prefix": [ 177 | "shadcn-ix-drawer", 178 | "cni-x-drawer" 179 | ], 180 | "body": [ 181 | " import * as Drawer from \"$$lib/components/ui/drawer/index.js\"", 182 | "" 183 | ], 184 | "description": "https://next.shadcn-svelte.com/docs/components/drawer.html" 185 | }, 186 | "Hover Card": { 187 | "prefix": [ 188 | "shadcn-ix-hover-card", 189 | "cni-x-hover-card" 190 | ], 191 | "body": [ 192 | "import * as HoverCard from \"$$lib/components/ui/hover-card/index.js\"", 193 | "" 194 | ], 195 | "description": "https://next.shadcn-svelte.com/docs/components/hover-card.html" 196 | }, 197 | "Input": { 198 | "prefix": [ 199 | "shadcn-ix-input", 200 | "cni-x-input" 201 | ], 202 | "body": [ 203 | "import { Input } from \"$$lib/components/ui/input/index.js\"", 204 | "" 205 | ], 206 | "description": "https://next.shadcn-svelte.com/docs/components/input.html" 207 | }, 208 | "Input OTP": { 209 | "prefix": [ 210 | "shadcn-ix-input-otp", 211 | "cni-x-input-otp" 212 | ], 213 | "body": [ 214 | "import * as InputOTP from \"$$lib/components/ui/input-otp/index.js\"", 215 | "" 216 | ], 217 | "description": "https://next.shadcn-svelte.com/docs/components/input-otp" 218 | }, 219 | "Label": { 220 | "prefix": [ 221 | "shadcn-ix-label", 222 | "cni-x-label" 223 | ], 224 | "body": [ 225 | "import { Label } from \"$$lib/components/ui/label/index.js\"", 226 | "" 227 | ], 228 | "description": "https://next.shadcn-svelte.com/docs/components/label.html" 229 | }, 230 | "Menubar": { 231 | "prefix": [ 232 | "shadcn-ix-menubar", 233 | "cni-x-menubar" 234 | ], 235 | "body": [ 236 | "import * as Menubar from \"$$lib/components/ui/menubar/index.js\"", 237 | "" 238 | ], 239 | "description": "https://next.shadcn-svelte.com/docs/components/menu-bar.html" 240 | }, 241 | "Popover": { 242 | "prefix": [ 243 | "shadcn-ix-popover", 244 | "cni-x-popover" 245 | ], 246 | "body": [ 247 | "import * as Popover from \"$$lib/components/ui/popover/index.js\"", 248 | "" 249 | ], 250 | "description": "https://next.shadcn-svelte.com/docs/components/popover.html" 251 | }, 252 | "Progress": { 253 | "prefix": [ 254 | "shadcn-ix-progress", 255 | "cni-x-progress" 256 | ], 257 | "body": [ 258 | "import { Progress } from \"$$lib/components/ui/progress/index.js\"", 259 | "" 260 | ], 261 | "description": "https://next.shadcn-svelte.com/docs/components/progress.html" 262 | }, 263 | "Radio Group": { 264 | "prefix": [ 265 | "shadcn-ix-radio-group", 266 | "cni-x-radio-group" 267 | ], 268 | "body": [ 269 | "import { Label } from \"$$lib/components/ui/label/index.js\"", 270 | "import * as RadioGroup from \"$$lib/components/ui/radio-group/index.js\"", 271 | "" 272 | ], 273 | "description": "https://next.shadcn-svelte.com/docs/components/radio-group.html" 274 | }, 275 | "Range Calendar": { 276 | "prefix": [ 277 | "shadcn-ix-range-calendar", 278 | "cni-x-range-calendar" 279 | ], 280 | "body": [ 281 | "import { RangeCalendar } from \"$$lib/components/ui/range-calendar/index.js\"", 282 | "" 283 | ], 284 | "description": "https://next.shadcn-svelte.com/docs/components/range-calendar.html" 285 | }, 286 | "Scroll Area": { 287 | "prefix": [ 288 | "shadcn-ix-scroll-area", 289 | "cni-x-scroll-area" 290 | ], 291 | "body": [ 292 | "import { ScrollArea } from \"$$lib/components/ui/scroll-area/index.js\"", 293 | "" 294 | ], 295 | "description": "https://next.shadcn-svelte.com/docs/components/scroll-area.html" 296 | }, 297 | "Select": { 298 | "prefix": [ 299 | "cni-x-select" 300 | ], 301 | "body": [ 302 | "import * as Select from \"$$lib/components/ui/select/index.js\"", 303 | "" 304 | ], 305 | "description": "https://next.shadcn-svelte.com/docs/components/select.html" 306 | }, 307 | "Separator": { 308 | "prefix": [ 309 | "shadcn-ix-separator", 310 | "cni-x-separator" 311 | ], 312 | "body": [ 313 | "import { Separator } from \"$$lib/components/ui/separator/index.js\"", 314 | "" 315 | ], 316 | "description": "https://next.shadcn-svelte.com/docs/components/separator.html" 317 | }, 318 | "Sheet": { 319 | "prefix": [ 320 | "shadcn-ix-sheet", 321 | "cni-x-sheet" 322 | ], 323 | "body": [ 324 | "import * as Sheet from \"$$lib/components/ui/sheet/index.js\"", 325 | "" 326 | ], 327 | "description": "https://next.shadcn-svelte.com/docs/components/sheet.html" 328 | }, 329 | "Sidebar": { 330 | "prefix": [ 331 | "shadcn-ix-sidebar", 332 | "cni-x-sidebar" 333 | ], 334 | "body": [ 335 | "import * as Sidebar from \"$$lib/components/ui/sidebar/index.js\"", 336 | "" 337 | ], 338 | "description": "https://next.shadcn-svelte.com/docs/components/sidebar" 339 | }, 340 | "Skeleton": { 341 | "prefix": [ 342 | "shadcn-ix-skeleton", 343 | "cni-x-skeleton" 344 | ], 345 | "body": [ 346 | "import { Skeleton } from \"$$lib/components/ui/skeleton/index.js\"", 347 | "" 348 | ], 349 | "description": "https://next.shadcn-svelte.com/docs/components/skeleton.html" 350 | }, 351 | "Slider": { 352 | "prefix": [ 353 | "shadcn-ix-slider", 354 | "cni-x-slider" 355 | ], 356 | "body": [ 357 | "import { Slider } from \"$$lib/components/ui/slider/index.js\"", 358 | "" 359 | ], 360 | "description": "https://next.shadcn-svelte.com/docs/components/slider.html" 361 | }, 362 | "Sonner": { 363 | "prefix": [ 364 | "shadcn-ix-sonner", 365 | "cni-x-sonner" 366 | ], 367 | "body": [ 368 | "import { Toaster } from \"$lib/components/ui/sonner/index.js\";" 369 | ], 370 | "description": "https://next.shadcn-svelte.com/docs/components/sonner.html" 371 | }, 372 | "Switch": { 373 | "prefix": [ 374 | "shadcn-ix-switch", 375 | "cni-x-switch" 376 | ], 377 | "body": [ 378 | "import { Switch } from \"$$lib/components/ui/switch/index.js\"", 379 | "" 380 | ], 381 | "description": "https://next.shadcn-svelte.com/docs/components/switch.html" 382 | }, 383 | "Table": { 384 | "prefix": [ 385 | "shadcn-ix-table", 386 | "cni-x-table" 387 | ], 388 | "body": [ 389 | "import * as Table from \"$$lib/components/ui/table/index.js\"", 390 | "" 391 | ], 392 | "description": "https://next.shadcn-svelte.com/docs/components/table.html" 393 | }, 394 | "Tabs": { 395 | "prefix": [ 396 | "shadcn-ix-tabs", 397 | "cni-x-tabs" 398 | ], 399 | "body": [ 400 | "import * as Tabs from \"$$lib/components/ui/tabs/index.js\"", 401 | "" 402 | ], 403 | "description": "https://next.shadcn-svelte.com/docs/components/tabs.html" 404 | }, 405 | "Textarea": { 406 | "prefix": [ 407 | "shadcn-ix-textarea", 408 | "cni-x-textarea" 409 | ], 410 | "body": [ 411 | "import { Textarea } from \"$$lib/components/ui/textarea/index.js\"", 412 | "" 413 | ], 414 | "description": "https://next.shadcn-svelte.com/docs/components/textarea.html" 415 | }, 416 | "Toggle": { 417 | "prefix": [ 418 | "shadcn-ix-toggle", 419 | "cni-x-toggle" 420 | ], 421 | "body": [ 422 | "import { Toggle } from \"$$lib/components/ui/toggle/index.js\"", 423 | "" 424 | ], 425 | "description": "https://next.shadcn-svelte.com/docs/components/toggle.html" 426 | }, 427 | "Toggle Group": { 428 | "prefix": [ 429 | "shadcn-ix-toggle", 430 | "cni-x-toggle" 431 | ], 432 | "body": [ 433 | "import * as ToggleGroup from \"$$lib/components/ui/toggle-group/index.js\"", 434 | "" 435 | ], 436 | "description": "https://next.shadcn-svelte.com/docs/components/toggle-group.html" 437 | }, 438 | "Tooltip": { 439 | "prefix": [ 440 | "shadcn-ix-tooltip", 441 | "cni-x-tooltip" 442 | ], 443 | "body": [ 444 | "import * as Tooltip from \"$$lib/components/ui/tooltip/index.js\"", 445 | "" 446 | ], 447 | "description": "https://next.shadcn-svelte.com/docs/components/tooltip.html" 448 | }, 449 | "Form": { 450 | "prefix": [ 451 | "shadcn-ix-form", 452 | "cni-x-form" 453 | ], 454 | "body": [ 455 | "import * as Form from \"$$lib/components/ui/form/index.js\"", 456 | "" 457 | ], 458 | "description": "https://next.shadcn-svelte.com/docs/components/form.html" 459 | } 460 | } -------------------------------------------------------------------------------- /src/snippets/usage-code-snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "Accordion": { 3 | "prefix": [ 4 | "shadcn-x-accordion", 5 | "cnx-accordion" 6 | ], 7 | "body": [ 8 | "", 9 | " ", 10 | " Is it accessible?", 11 | " ", 12 | " Yes. It adheres to the WAI-ARIA design pattern.", 13 | " ", 14 | " ", 15 | " ", 16 | " Is it styled?", 17 | " ", 18 | " Yes. It comes with default styles that matches the other components'", 19 | " aesthetic.", 20 | " ", 21 | " ", 22 | " ", 23 | " Is it animated?", 24 | " ", 25 | " Yes. It's animated by default, but you can disable it if you prefer.", 26 | " ", 27 | " ", 28 | "" 29 | ], 30 | "description": "https://shadcn-svelte.com/docs/components/accordion.html" 31 | }, 32 | "Alert": { 33 | "prefix": [ 34 | "shadcn-x-alert", 35 | "cnx-alert" 36 | ], 37 | "body": [ 38 | "", 39 | " Heads up!", 40 | " ", 41 | " You can add components to your app using the cli.", 42 | " ", 43 | "" 44 | ], 45 | "description": "https://shadcn-svelte.com/docs/components/alert.html" 46 | }, 47 | "Alert Destructive": { 48 | "prefix": [ 49 | "shadcn-x-alert-destructive", 50 | "cnx-alert-destructive" 51 | ], 52 | "body": [ 53 | "", 54 | " ", 55 | " Error", 56 | " ", 57 | " Your session has expired. Please login again.", 58 | " ", 59 | "" 60 | ], 61 | "description": "https://shadcn-svelte.com/docs/components/alert.html" 62 | }, 63 | "Alert Dialog": { 64 | "prefix": [ 65 | "shadcn-x-alert-dialog", 66 | "cnx-alert-dialog" 67 | ], 68 | "body": [ 69 | "", 70 | " Open", 71 | " ", 72 | " ", 73 | " Are you absolutely sure?", 74 | " ", 75 | " This action cannot be undone. This will permanently delete your account", 76 | " and remove your data from our servers.", 77 | " ", 78 | " ", 79 | " ", 80 | " Cancel", 81 | " Continue", 82 | " ", 83 | " ", 84 | "" 85 | ], 86 | "description": "https://shadcn-svelte.com/docs/components/alert-dialog.html" 87 | }, 88 | "Aspect Ratio": { 89 | "prefix": [ 90 | "shadcn-x-aspect-ratio", 91 | "cnx-aspect-ratio" 92 | ], 93 | "body": [ 94 | "
", 95 | " ", 96 | " \"Image\"", 97 | " ", 98 | "
" 99 | ], 100 | "description": "https://shadcn-svelte.com/docs/components/aspect-ratio.html" 101 | }, 102 | "Avatar": { 103 | "prefix": [ 104 | "shadcn-x-avatar", 105 | "cnx-avatar" 106 | ], 107 | "body": [ 108 | "", 109 | " ", 110 | " CN", 111 | "" 112 | ], 113 | "description": "https://shadcn-svelte.com/docs/components/avatar.html" 114 | }, 115 | "Badge": { 116 | "prefix": [ 117 | "shadcn-x-badge", 118 | "cnx-badge" 119 | ], 120 | "body": [ 121 | "Badge" 122 | ], 123 | "description": "https://shadcn-svelte.com/docs/components/badge.html" 124 | }, 125 | "Badge Destructive": { 126 | "prefix": [ 127 | "shadcn-x-badge-destructive", 128 | "cnx-badge-destructive" 129 | ], 130 | "body": [ 131 | "", 132 | " Destructive", 133 | "" 134 | ], 135 | "description": "https://shadcn-svelte.com/docs/components/badge.html" 136 | }, 137 | "Badge Outline": { 138 | "prefix": [ 139 | "shadcn-x-badge-outline", 140 | "cnx-badge-outline" 141 | ], 142 | "body": [ 143 | "", 144 | " Outline", 145 | "" 146 | ], 147 | "description": "https://shadcn-svelte.com/docs/components/badge.html" 148 | }, 149 | "Badge Secondary": { 150 | "prefix": [ 151 | "shadcn-x-badge-secondary", 152 | "cnx-badge-secondary" 153 | ], 154 | "body": [ 155 | "", 156 | " Secondary", 157 | "" 158 | ], 159 | "description": "https://shadcn-svelte.com/docs/components/badge.html" 160 | }, 161 | "Button": { 162 | "prefix": [ 163 | "shadcn-x-button", 164 | "cnx-button" 165 | ], 166 | "body": [ 167 | "" 168 | ], 169 | "description": "https://shadcn-svelte.com/docs/components/button.html" 170 | }, 171 | "Button Secondary": { 172 | "prefix": [ 173 | "shadcn-x-button-secondary", 174 | "cnx-button-secondary" 175 | ], 176 | "body": [ 177 | "" 178 | ], 179 | "description": "https://shadcn-svelte.com/docs/components/button.html" 180 | }, 181 | "Button Outline": { 182 | "prefix": [ 183 | "shadcn-x-button-outline", 184 | "cnx-button-outline" 185 | ], 186 | "body": [ 187 | "" 188 | ], 189 | "description": "https://shadcn-svelte.com/docs/components/button.html" 190 | }, 191 | "Button Ghost": { 192 | "prefix": [ 193 | "shadcn-x-button-ghost", 194 | "cnx-button-ghost" 195 | ], 196 | "body": [ 197 | "" 198 | ], 199 | "description": "https://shadcn-svelte.com/docs/components/button.html" 200 | }, 201 | "Button Link": { 202 | "prefix": [ 203 | "shadcn-x-button-link", 204 | "cnx-button-link" 205 | ], 206 | "body": [ 207 | "" 208 | ], 209 | "description": "https://shadcn-svelte.com/docs/components/button.html" 210 | }, 211 | "Calendar": { 212 | "prefix": [ 213 | "shadcn-x-calendar", 214 | "cnx-calendar" 215 | ], 216 | "body": [ 217 | "" 218 | ], 219 | "description": "https://shadcn-svelte.com/docs/components/calendar.html" 220 | }, 221 | "Card": { 222 | "prefix": [ 223 | "shadcn-x-card", 224 | "cnx-card" 225 | ], 226 | "body": [ 227 | "", 228 | " ", 229 | " Card Title", 230 | " Card Description", 231 | " ", 232 | " ", 233 | "

Card Content

", 234 | "
", 235 | " ", 236 | "

Card Footer

", 237 | "
", 238 | "
" 239 | ], 240 | "description": "https://shadcn-svelte.com/docs/components/card.html" 241 | }, 242 | "Carousel": { 243 | "prefix": [ 244 | "shadcn-x-carousel", 245 | "cnx-carousel" 246 | ], 247 | "body": [ 248 | "", 249 | " ", 250 | " {#each Array(5) as _, i (i)}", 251 | " ", 252 | "
", 253 | " ", 254 | " ", 257 | " {i + 1}", 258 | " ", 259 | " ", 260 | "
", 261 | "
", 262 | " {/each}", 263 | "
", 264 | " ", 265 | " ", 266 | "
" 267 | ], 268 | "description": "https://www.shadcn-svelte.com/docs/components/carousel.html" 269 | }, 270 | 271 | "Carousel-Vertical": { 272 | "prefix": [ 273 | "shadcn-x-carousel-vertical", 274 | "cnx-carousel-vertical" 275 | ], 276 | "body": [ 277 | "", 284 | " ", 285 | " {#each Array(5) as _, i (i)}", 286 | " ", 287 | "
", 288 | " ", 289 | " ", 290 | " {i + 1}", 291 | " ", 292 | " ", 293 | "
", 294 | "
", 295 | " {/each}", 296 | "
", 297 | " ", 298 | " ", 299 | "" 300 | ], 301 | "description": "https://www.shadcn-svelte.com/docs/components/carousel.html" 302 | }, 303 | "Checkbox": { 304 | "prefix": [ 305 | "shadcn-x-checkbox", 306 | "cnx-checkbox" 307 | ], 308 | "body": [ 309 | "" 310 | ], 311 | "description": "https://shadcn-svelte.com/docs/components/checkbox.html" 312 | }, 313 | "Collapsible": { 314 | "prefix": [ 315 | "shadcn-x-collapsible", 316 | "cnx-collapsible" 317 | ], 318 | "body": [ 319 | "", 320 | " Can I use this in my project?", 321 | " ", 322 | " Yes. Free to use for personal and commercial projects. No attribution", 323 | " required.", 324 | " ", 325 | "" 326 | ], 327 | "description": "https://shadcn-svelte.com/docs/components/collapsible.html" 328 | }, 329 | "Command": { 330 | "prefix": [ 331 | "shadcn-x-command", 332 | "cnx-command" 333 | ], 334 | "body": [ 335 | "", 336 | " ", 337 | " ", 338 | " No results found.", 339 | " ", 340 | " Calendar", 341 | " Search Emoji", 342 | " Calculator", 343 | " ", 344 | " ", 345 | " ", 346 | " Profile", 347 | " Billing", 348 | " Settings", 349 | " ", 350 | " ", 351 | "" 352 | ], 353 | "description": "https://shadcn-svelte.com/docs/components/command.html" 354 | }, 355 | "Context Menu": { 356 | "prefix": [ 357 | "shadcn-x-context-menu", 358 | "cnx-context-menu" 359 | ], 360 | "body": [ 361 | "", 362 | " Right click", 363 | " ", 364 | " Profile", 365 | " Billing", 366 | " Team", 367 | " Subscription", 368 | " ", 369 | "" 370 | ], 371 | "description": "https://shadcn-svelte.com/docs/components/context-menu.html" 372 | }, 373 | "Dialog": { 374 | "prefix": [ 375 | "shadcn-x-dialog", 376 | "cnx-dialog" 377 | ], 378 | "body": [ 379 | "", 380 | " Open", 381 | " ", 382 | " ", 383 | " Are you sure absolutely sure?", 384 | " ", 385 | " This action cannot be undone. This will permanently delete your account", 386 | " and remove your data from our servers.", 387 | " ", 388 | " ", 389 | " ", 390 | "" 391 | ], 392 | "description": "https://shadcn-svelte.com/docs/components/dialog.html" 393 | }, 394 | 395 | "Drawer": { 396 | "prefix": [ 397 | "shadcn-x-drawer", 398 | "cnx-drawer" 399 | ], 400 | "body": [ 401 | "", 402 | " Open", 403 | " ", 404 | " ", 405 | " Are you sure absolutely sure?", 406 | " This action cannot be undone.", 407 | " ", 408 | " ", 409 | " ", 410 | " Cancel", 411 | " ", 412 | " ", 413 | "", 414 | "" 415 | ], 416 | "description": "https://shadcn-svelte.com/docs/components/drawer.html" 417 | }, 418 | "Dropdown Menu": { 419 | "prefix": [ 420 | "shadcn-x-dropdown-menu", 421 | "cnx-dropdown-menu" 422 | ], 423 | "body": [ 424 | "", 425 | " Open", 426 | " ", 427 | " ", 428 | " My Account", 429 | " ", 430 | " Profile", 431 | " Billing", 432 | " Team", 433 | " Subscription", 434 | " ", 435 | " ", 436 | "" 437 | ], 438 | "description": "https://shadcn-svelte.com/docs/components/dropdown-menu.html" 439 | }, 440 | "Hover Card": { 441 | "prefix": [ 442 | "shadcn-x-hover-card", 443 | "cnx-hover-card" 444 | ], 445 | "body": [ 446 | "", 447 | " Hover", 448 | " ", 449 | " SvelteKit - Web development, streamlined", 450 | " ", 451 | "" 452 | ], 453 | "description": "https://shadcn-svelte.com/docs/components/hover-card.html" 454 | }, 455 | "Input": { 456 | "prefix": [ 457 | "shadcn-x-input", 458 | "cnx-input" 459 | ], 460 | "body": [ 461 | "", 462 | "" 463 | ], 464 | "description": "https://shadcn-svelte.com/docs/components/input.html" 465 | }, 466 | "Input OTP": { 467 | "prefix": [ 468 | "shadcn-x-input-otp", 469 | "cnx-input-otp" 470 | ], 471 | "body": [ 472 | "", 473 | " {#snippet children({ cells })}", 474 | " ", 475 | " {#each cells.slice(0, 3) as cell}", 476 | " ", 477 | " {/each}", 478 | " ", 479 | " ", 480 | " ", 481 | " {#each cells.slice(0, 3) as cell}", 482 | " ", 483 | " {/each}", 484 | " ", 485 | " {/snippet}", 486 | "" 487 | ], 488 | "description": "https://shadcn-svelte.com/docs/components/input-otp" 489 | }, 490 | "Label": { 491 | "prefix": [ 492 | "shadcn-x-label", 493 | "cnx-label" 494 | ], 495 | "body": [ 496 | "", 497 | "" 498 | ], 499 | "description": "https://shadcn-svelte.com/docs/components/label.html" 500 | }, 501 | "Menubar": { 502 | "prefix": [ 503 | "shadcn-x-menubar", 504 | "cnx-menubar" 505 | ], 506 | "body": [ 507 | "", 508 | " ", 509 | " File", 510 | " ", 511 | " ", 512 | " New Tab", 513 | " ⌘T", 514 | " ", 515 | " New Window", 516 | " ", 517 | " Share", 518 | " ", 519 | " Print", 520 | " ", 521 | " ", 522 | "", 523 | "" 524 | ], 525 | "description": "https://shadcn-svelte.com/docs/components/menubar.html" 526 | }, 527 | "Pagination": { 528 | "prefix": [ 529 | "shadcn-x-pagination", 530 | "cnx-pagination" 531 | ], 532 | "body": [ 533 | "", 534 | " ", 535 | " ", 536 | " ", 537 | " ", 538 | " {#each pages as page (page.key)}", 539 | " {#if page.type === \"ellipsis\"}", 540 | " ", 541 | " ", 542 | " ", 543 | " {:else}", 544 | " ", 545 | " ", 546 | " {page.value}", 547 | " ", 548 | " ", 549 | " {/if}", 550 | " {/each}", 551 | " ", 552 | " ", 553 | " ", 554 | " ", 555 | "", 556 | "" 557 | ], 558 | "description": "https://shadcn-svelte.com/docs/components/pagination.html" 559 | }, 560 | "Popover": { 561 | "prefix": [ 562 | "shadcn-x-popover", 563 | "cnx-popover" 564 | ], 565 | "body": [ 566 | "", 567 | " Open", 568 | " Place content for the popover here.", 569 | "", 570 | "" 571 | ], 572 | "description": "https://shadcn-svelte.com/docs/components/popover.html" 573 | }, 574 | "Progress": { 575 | "prefix": [ 576 | "shadcn-x-progress", 577 | "cnx-progress" 578 | ], 579 | "body": [ 580 | "", 581 | "" 582 | ], 583 | "description": "https://shadcn-svelte.com/docs/components/progress.html" 584 | }, 585 | "Radio Group": { 586 | "prefix": "shadcn-x-radio-group", 587 | "body": [ 588 | "", 589 | "
", 590 | " ", 591 | " ", 592 | "
", 593 | "
", 594 | " ", 595 | " ", 596 | "
", 597 | "
" 598 | ], 599 | "description": "https://shadcn-svelte.com/docs/components/radio-group.html" 600 | }, 601 | "Range Calendar": { 602 | "prefix": [ 603 | "shadcn-x-range-calendar", 604 | "cnx-range-calendar" 605 | ], 606 | "body": [ 607 | "", 608 | "" 609 | ], 610 | "description": "https://shadcn-svelte.com/docs/components/range-calendar.html" 611 | }, 612 | "Scroll Area": { 613 | "prefix": [ 614 | "cnx-scroll-area", 615 | "shadcn-x-scroll-area" 616 | ], 617 | "body": [ 618 | "", 619 | "
", 620 | "

Tags

", 621 | " {#each Array.from({ length: 50 }) as _, i (i)}", 622 | "
", 623 | " v1.2.0-beta.{50 - i}", 624 | "
", 625 | "
", 626 | " {/each}", 627 | "
", 628 | "
" 629 | ], 630 | "description": "https://next.shadcn-svelte.com/docs/components/scroll-area.html" 631 | }, 632 | "Select": { 633 | "prefix": [ 634 | "cnx-select", 635 | "shadcn-x-select" 636 | ], 637 | "body": [ 638 | "", 639 | " ", 640 | " ", 641 | " ", 642 | " ", 643 | " Light", 644 | " Dark", 645 | " System", 646 | " ", 647 | "" 648 | ], 649 | "description": "https://shadcn-svelte.com/docs/components/select.html" 650 | }, 651 | "Separator": { 652 | "prefix": [ 653 | "shadcn-x-separator", 654 | "cnx-separator" 655 | ], 656 | "body": [ 657 | "", 658 | "" 659 | ], 660 | "description": "https://shadcn-svelte.com/docs/components/separator.html" 661 | }, 662 | "Sheet": { 663 | "prefix": [ 664 | "shadcn-x-sheet", 665 | "cnx-sheet" 666 | ], 667 | "body": [ 668 | "", 669 | " Open", 670 | " ", 671 | " ", 672 | " Are you sure absolutely sure?", 673 | " ", 674 | " This action cannot be undone. This will permanently delete your account", 675 | " and remove your data from our servers.", 676 | " ", 677 | " ", 678 | " ", 679 | "" 680 | ], 681 | "description": "https://shadcn-svelte.com/docs/components/sheet.html" 682 | }, 683 | "Sidebar": { 684 | "prefix": [ 685 | "shadcn-x-sidebar", 686 | "cnx-sidebar" 687 | ], 688 | "body": [ 689 | "", 690 | " ", 691 | " ", 692 | " ", 693 | " ", 694 | " ", 695 | " ", 696 | "" 697 | ], 698 | "description": "https://shadcn-svelte.com/docs/components/sidebar" 699 | }, 700 | "Skeleton": { 701 | "prefix": [ 702 | "shadcn-x-skeleton", 703 | "cnx-skeleton" 704 | ], 705 | "body": [ 706 | "" 707 | ], 708 | "description": "https://shadcn-svelte.com/docs/components/skeleton.html" 709 | }, 710 | "Slider": { 711 | "prefix": [ 712 | "shadcn-x-slider", 713 | "cnx-slider" 714 | ], 715 | "body": [ 716 | "" 717 | ], 718 | "description": "https://shadcn-svelte.com/docs/components/slider.html" 719 | }, 720 | "Sonner": { 721 | "prefix": [ 722 | "shadcn-x-sonner", 723 | "cnx-sonner" 724 | ], 725 | "body": [ 726 | "" 727 | ], 728 | "description": "https://www.shadcn-svelte.com/docs/components/sonner.html" 729 | }, 730 | "Switch": { 731 | "prefix": [ 732 | "shadcn-x-switch", 733 | "cnx-switch" 734 | ], 735 | "body": [ 736 | "", 737 | "" 738 | ], 739 | "description": "https://shadcn-svelte.com/docs/components/switch.html" 740 | }, 741 | "Table": { 742 | "prefix": [ 743 | "shadcn-x-table", 744 | "cnx-table" 745 | ], 746 | "body": [ 747 | "", 748 | " A list of your recent invoices.", 749 | " ", 750 | " ", 751 | " Invoice", 752 | " Status", 753 | " Method", 754 | " Amount", 755 | " ", 756 | " ", 757 | " ", 758 | " ", 759 | " INV001", 760 | " Paid", 761 | " Credit Card", 762 | " $250.00", 763 | " ", 764 | " ", 765 | "" 766 | ], 767 | "description": "https://shadcn-svelte.com/docs/components/table.html" 768 | }, 769 | "Tabs": { 770 | "prefix": [ 771 | "shadcn-x-tabs", 772 | "cnx-tabs" 773 | ], 774 | "body": [ 775 | "", 776 | " ", 777 | " Account", 778 | " Password", 779 | " ", 780 | " ", 781 | " Make changes to your account here.", 782 | " ", 783 | " Change your password here.", 784 | "" 785 | ], 786 | "description": "https://shadcn-svelte.com/docs/components/tabs.html" 787 | }, 788 | "Textarea": { 789 | "prefix": [ 790 | "shadcn-x-textarea", 791 | "cnx-textarea" 792 | ], 793 | "body": [ 794 | "