├── .changeset └── config.json ├── .github ├── ISSUE_TEMPLATE │ ├── 1-bug_report.yml │ ├── 2-feature_request.yml │ ├── 3-docs_change.yml │ └── config.yml └── workflows │ ├── ci.yml │ ├── pkg-pr-new.yml │ └── publish.yaml ├── .gitignore ├── LICENSE ├── README.md ├── examples ├── project │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── pnpm-lock.yaml │ ├── src │ │ └── index.ts │ └── tsup.config.ts └── registry │ ├── README.md │ ├── blocks │ ├── angular │ │ └── button │ │ │ └── button.html │ ├── dynamic-imports │ │ ├── test.svelte │ │ └── test.ts │ ├── logging │ │ └── logger.ts │ ├── scripts │ │ └── test.js │ ├── styles │ │ └── test.scss │ └── svelte │ │ ├── component.svelte │ │ ├── test.js │ │ └── test.svelte.ts │ ├── jsrepo-build-config.json │ ├── jsrepo-manifest.json │ ├── package.json │ ├── pnpm-lock.yaml │ ├── src │ ├── app.css │ ├── components │ │ └── button.svelte │ ├── types │ │ ├── index.ts │ │ └── point.ts │ └── utils │ │ ├── math-user │ │ └── use.ts │ │ ├── math │ │ ├── add.test.ts │ │ ├── add.ts │ │ ├── create-point.ts │ │ ├── format-answer.ts │ │ ├── index.ts │ │ ├── subtract.test.ts │ │ └── subtract.ts │ │ └── pretty-print │ │ ├── index.ts │ │ └── print.ts │ └── tsconfig.json ├── package.json ├── packages └── cli │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── biome.json │ ├── jsrepo.json │ ├── package.json │ ├── schemas │ ├── project-config.json │ └── registry-config.json │ ├── scripts │ └── generate-docs.ts │ ├── src │ ├── api │ │ └── index.ts │ ├── cli.ts │ ├── commands │ │ ├── add.ts │ │ ├── auth.ts │ │ ├── build.ts │ │ ├── exec.ts │ │ ├── index.ts │ │ ├── init.ts │ │ ├── test.ts │ │ └── update.ts │ ├── constants.ts │ ├── index.ts │ ├── types.ts │ └── utils │ │ ├── ai.ts │ │ ├── ascii.ts │ │ ├── blocks.ts │ │ ├── blocks │ │ ├── package-managers │ │ │ └── flags.ts │ │ └── ts │ │ │ ├── array.ts │ │ │ ├── lines.ts │ │ │ ├── pad.ts │ │ │ ├── result.ts │ │ │ ├── strings.ts │ │ │ ├── strip-ansi.ts │ │ │ └── url.ts │ │ ├── build │ │ ├── check.ts │ │ └── index.ts │ │ ├── config.ts │ │ ├── context.ts │ │ ├── dependencies.ts │ │ ├── diff.ts │ │ ├── files.ts │ │ ├── format.ts │ │ ├── get-latest-version.ts │ │ ├── get-watermark.ts │ │ ├── language-support.ts │ │ ├── manifest.ts │ │ ├── package.ts │ │ ├── parse-package-name.ts │ │ ├── persisted.ts │ │ ├── prompts.ts │ │ └── registry-providers │ │ ├── azure.ts │ │ ├── bitbucket.ts │ │ ├── github.ts │ │ ├── gitlab.ts │ │ ├── http.ts │ │ ├── index.ts │ │ ├── internal.ts │ │ └── types.ts │ ├── tests │ ├── add.test.ts │ ├── build.test.ts │ ├── language-support.test.ts │ ├── providers.test.ts │ ├── unwrap-code.test.ts │ └── utils.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── vitest.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── sites └── docs ├── .gitignore ├── .npmrc ├── .prettierignore ├── .prettierrc ├── README.md ├── components.json ├── eslint.config.js ├── jsrepo.json ├── package.json ├── postcss.config.js ├── src ├── app.css ├── app.d.ts ├── app.html ├── hooks.server.ts ├── lib │ ├── actions │ │ ├── active.svelte.ts │ │ └── shortcut.svelte.ts │ ├── components │ │ ├── animations │ │ │ ├── animated-gradient-text.svelte │ │ │ └── flip │ │ │ │ ├── flip.svelte │ │ │ │ └── index.ts │ │ ├── icons │ │ │ ├── azure-devops.svelte │ │ │ ├── bitbucket.svelte │ │ │ ├── css.svelte │ │ │ ├── github.svelte │ │ │ ├── gitlab.svelte │ │ │ ├── html.svelte │ │ │ ├── index.ts │ │ │ ├── javascript.svelte │ │ │ ├── jsrepo.svelte │ │ │ ├── react.svelte │ │ │ ├── sass.svelte │ │ │ ├── svelte.svelte │ │ │ ├── svg.svelte │ │ │ ├── typescript.svelte │ │ │ ├── vue.svelte │ │ │ └── yaml.svelte │ │ ├── site │ │ │ ├── app-sidebar.svelte │ │ │ ├── command.svelte │ │ │ ├── docs │ │ │ │ ├── blockquote.svelte │ │ │ │ ├── code-span.svelte │ │ │ │ ├── doc-header.svelte │ │ │ │ ├── index.ts │ │ │ │ ├── jsrepo.svelte │ │ │ │ ├── link.svelte │ │ │ │ └── sub-heading.svelte │ │ │ ├── footer.svelte │ │ │ └── header.svelte │ │ └── ui │ │ │ ├── accordion │ │ │ ├── accordion-content.svelte │ │ │ ├── accordion-item.svelte │ │ │ ├── accordion-trigger.svelte │ │ │ └── index.ts │ │ │ ├── badge │ │ │ ├── badge.svelte │ │ │ └── index.ts │ │ │ ├── breadcrumb │ │ │ ├── breadcrumb-ellipsis.svelte │ │ │ ├── breadcrumb-item.svelte │ │ │ ├── breadcrumb-link.svelte │ │ │ ├── breadcrumb-list.svelte │ │ │ ├── breadcrumb-page.svelte │ │ │ ├── breadcrumb-separator.svelte │ │ │ ├── breadcrumb.svelte │ │ │ └── index.ts │ │ │ ├── button │ │ │ ├── button.svelte │ │ │ └── index.ts │ │ │ ├── card │ │ │ ├── card-content.svelte │ │ │ ├── card-description.svelte │ │ │ ├── card-footer.svelte │ │ │ ├── card-header.svelte │ │ │ ├── card-title.svelte │ │ │ ├── card.svelte │ │ │ └── index.ts │ │ │ ├── code │ │ │ ├── code.svelte │ │ │ ├── index.ts │ │ │ └── shiki.ts │ │ │ ├── collapsible │ │ │ └── index.ts │ │ │ ├── command │ │ │ ├── command-dialog.svelte │ │ │ ├── command-empty.svelte │ │ │ ├── command-group.svelte │ │ │ ├── command-input.svelte │ │ │ ├── command-item.svelte │ │ │ ├── command-link-item.svelte │ │ │ ├── command-list.svelte │ │ │ ├── command-separator.svelte │ │ │ ├── command-shortcut.svelte │ │ │ ├── command.svelte │ │ │ └── index.ts │ │ │ ├── copy-button │ │ │ ├── copy-button.svelte │ │ │ └── index.ts │ │ │ ├── dialog │ │ │ ├── dialog-content.svelte │ │ │ ├── dialog-description.svelte │ │ │ ├── dialog-footer.svelte │ │ │ ├── dialog-header.svelte │ │ │ ├── dialog-overlay.svelte │ │ │ ├── dialog-title.svelte │ │ │ └── index.ts │ │ │ ├── drawer │ │ │ ├── drawer-content.svelte │ │ │ ├── drawer-description.svelte │ │ │ ├── drawer-footer.svelte │ │ │ ├── drawer-header.svelte │ │ │ ├── drawer-nested.svelte │ │ │ ├── drawer-overlay.svelte │ │ │ ├── drawer-title.svelte │ │ │ ├── drawer.svelte │ │ │ └── index.ts │ │ │ ├── dropdown-menu │ │ │ ├── dropdown-menu-checkbox-item.svelte │ │ │ ├── dropdown-menu-content.svelte │ │ │ ├── dropdown-menu-group-heading.svelte │ │ │ ├── dropdown-menu-item.svelte │ │ │ ├── dropdown-menu-label.svelte │ │ │ ├── dropdown-menu-radio-item.svelte │ │ │ ├── dropdown-menu-separator.svelte │ │ │ ├── dropdown-menu-shortcut.svelte │ │ │ ├── dropdown-menu-sub-content.svelte │ │ │ ├── dropdown-menu-sub-trigger.svelte │ │ │ └── index.ts │ │ │ ├── file-icon │ │ │ ├── file-icon.svelte │ │ │ └── index.ts │ │ │ ├── github │ │ │ ├── index.ts │ │ │ └── star-button.svelte │ │ │ ├── input │ │ │ ├── index.ts │ │ │ └── input.svelte │ │ │ ├── kbd │ │ │ ├── index.ts │ │ │ └── kbd.svelte │ │ │ ├── light-switch │ │ │ ├── index.ts │ │ │ └── light-switch.svelte │ │ │ ├── modal │ │ │ ├── index.ts │ │ │ └── modal.svelte │ │ │ ├── pagination │ │ │ ├── index.ts │ │ │ ├── next.svelte │ │ │ └── previous.svelte │ │ │ ├── scroll-area │ │ │ ├── index.ts │ │ │ ├── scroll-area-scrollbar.svelte │ │ │ └── scroll-area.svelte │ │ │ ├── search │ │ │ ├── index.ts │ │ │ └── search.svelte │ │ │ ├── separator │ │ │ ├── index.ts │ │ │ └── separator.svelte │ │ │ ├── sheet │ │ │ ├── index.ts │ │ │ ├── sheet-content.svelte │ │ │ ├── sheet-description.svelte │ │ │ ├── sheet-footer.svelte │ │ │ ├── sheet-header.svelte │ │ │ ├── sheet-overlay.svelte │ │ │ └── sheet-title.svelte │ │ │ ├── sidebar │ │ │ ├── constants.ts │ │ │ ├── context.svelte.ts │ │ │ ├── index.ts │ │ │ ├── sidebar-content.svelte │ │ │ ├── sidebar-footer.svelte │ │ │ ├── sidebar-group-action.svelte │ │ │ ├── sidebar-group-content.svelte │ │ │ ├── sidebar-group-label.svelte │ │ │ ├── sidebar-group.svelte │ │ │ ├── sidebar-header.svelte │ │ │ ├── sidebar-input.svelte │ │ │ ├── sidebar-inset.svelte │ │ │ ├── sidebar-menu-action.svelte │ │ │ ├── sidebar-menu-badge.svelte │ │ │ ├── sidebar-menu-button.svelte │ │ │ ├── sidebar-menu-item.svelte │ │ │ ├── sidebar-menu-skeleton.svelte │ │ │ ├── sidebar-menu-sub-button.svelte │ │ │ ├── sidebar-menu-sub-item.svelte │ │ │ ├── sidebar-menu-sub.svelte │ │ │ ├── sidebar-menu.svelte │ │ │ ├── sidebar-provider.svelte │ │ │ ├── sidebar-rail.svelte │ │ │ ├── sidebar-separator.svelte │ │ │ ├── sidebar-trigger.svelte │ │ │ └── sidebar.svelte │ │ │ ├── skeleton │ │ │ ├── index.ts │ │ │ └── skeleton.svelte │ │ │ ├── snippet │ │ │ ├── index.ts │ │ │ ├── jsrepo-snippet.svelte │ │ │ ├── pm-copy-button.svelte │ │ │ └── snippet.svelte │ │ │ ├── table │ │ │ ├── index.ts │ │ │ ├── table-body.svelte │ │ │ ├── table-caption.svelte │ │ │ ├── table-cell.svelte │ │ │ ├── table-footer.svelte │ │ │ ├── table-head.svelte │ │ │ ├── table-header.svelte │ │ │ ├── table-row.svelte │ │ │ └── table.svelte │ │ │ ├── tabs │ │ │ ├── index.ts │ │ │ ├── tabs-content.svelte │ │ │ ├── tabs-list.svelte │ │ │ └── tabs-trigger.svelte │ │ │ ├── tooltip │ │ │ ├── index.ts │ │ │ └── tooltip-content.svelte │ │ │ └── video-player │ │ │ ├── index.ts │ │ │ └── video-player.svelte │ ├── hooks │ │ ├── is-mobile.svelte.ts │ │ └── use-clipboard.svelte.ts │ ├── map.ts │ ├── ts │ │ ├── array.ts │ │ ├── context.ts │ │ ├── markdown.ts │ │ ├── math │ │ │ ├── circle.ts │ │ │ ├── conversions.ts │ │ │ ├── fractions.ts │ │ │ ├── gcf.ts │ │ │ ├── index.ts │ │ │ ├── triangles.ts │ │ │ └── types.ts │ │ ├── on-this-page.ts │ │ ├── parse-package-name.ts │ │ ├── persisted-context-provider.ts │ │ ├── redis-client.ts │ │ ├── registry │ │ │ └── index.ts │ │ ├── server-actions │ │ │ └── search-registries │ │ │ │ ├── client.ts │ │ │ │ └── server.ts │ │ └── types │ │ │ └── result.ts │ ├── utils.ts │ └── utils │ │ ├── context-provider.ts │ │ └── utils.ts └── routes │ ├── +error.svelte │ ├── +layout.server.ts │ ├── +layout.svelte │ ├── +page.server.ts │ ├── +page.svelte │ ├── demos │ └── +page.svelte │ ├── docs │ ├── +layout.svelte │ ├── +page.svelte │ ├── about │ │ └── +page.svelte │ ├── badges │ │ └── +page.svelte │ ├── cli │ │ ├── +page.svelte │ │ ├── add │ │ │ └── +page.svelte │ │ ├── auth │ │ │ └── +page.svelte │ │ ├── build │ │ │ └── +page.svelte │ │ ├── exec │ │ │ └── +page.svelte │ │ ├── init │ │ │ └── +page.svelte │ │ ├── option-docs.svelte │ │ ├── test │ │ │ └── +page.svelte │ │ └── update │ │ │ └── +page.svelte │ ├── git-providers │ │ ├── +page.svelte │ │ ├── azure-devops │ │ │ └── +page.svelte │ │ ├── bitbucket │ │ │ └── +page.svelte │ │ ├── github │ │ │ └── +page.svelte │ │ ├── gitlab │ │ │ └── +page.svelte │ │ └── self-hosted │ │ │ └── +page.svelte │ ├── jsrepo-build-config-json │ │ └── +page.svelte │ ├── jsrepo-json │ │ └── +page.svelte │ ├── language-support │ │ └── +page.svelte │ ├── private-repositories │ │ └── +page.svelte │ └── setup │ │ ├── +page.svelte │ │ ├── project │ │ └── +page.svelte │ │ └── registry │ │ └── +page.svelte │ └── registry │ ├── +layout.server.ts │ ├── +layout.svelte │ ├── +page.server.ts │ ├── +page.svelte │ └── registry.svelte ├── static ├── badges │ ├── build │ │ ├── failing.svg │ │ └── passing.svg │ └── jsrepo.svg ├── demos │ └── update-w-ai.mp4 ├── docs │ └── cli │ │ └── llms.txt ├── favicon.png └── llms.txt ├── svelte.config.js ├── tailwind.config.ts ├── tsconfig.json └── vite.config.ts /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "public", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": [] 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-feature_request.yml: -------------------------------------------------------------------------------- 1 | name: 🆕 Feature request 2 | description: Help us improve jsrepo. 3 | labels: ["feature"] 4 | title: "feat: " 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | ## Thanks for helping us improve jsrepo! 10 | Before continuing make sure you have checked other issues to see if your feature was already requested / added. 11 | 12 | - type: textarea 13 | id: desc 14 | attributes: 15 | label: Describe the feature 16 | description: What doesn't jsrepo do now? What should it do? 17 | validations: 18 | required: true 19 | 20 | - type: checkboxes 21 | id: terms 22 | attributes: 23 | label: Validations 24 | description: Please make sure you have checked all of the following. 25 | options: 26 | - label: I have checked other issues to see if my feature was already requested or added 27 | required: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3-docs_change.yml: -------------------------------------------------------------------------------- 1 | name: 📜 Report Docs Issue 2 | description: Suggest an addition or modification to the documentation 3 | labels: ["documentation"] 4 | title: "docs: " 5 | body: 6 | - type: dropdown 7 | attributes: 8 | label: Change Type 9 | description: What type of change are you proposing? 10 | options: 11 | - Addition 12 | - Correction 13 | - Removal 14 | - Cleanup (formatting, typos, etc.) 15 | validations: 16 | required: true 17 | 18 | - type: textarea 19 | attributes: 20 | label: Proposed Changes 21 | description: Describe the proposed changes and why they are necessary 22 | validations: 23 | required: true 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Get Help 4 | url: https://github.com/ieedan/jsrepo/discussions/new?category=help 5 | about: If you can't get something to work the way you expect, open a question in our discussion forums. 6 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | CI: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: pnpm/action-setup@v4 13 | - uses: actions/setup-node@v4 14 | with: 15 | node-version: "20" 16 | cache: pnpm 17 | 18 | - name: Install dependencies 19 | run: pnpm install 20 | 21 | - name: Check Types 22 | run: pnpm lint 23 | 24 | - name: Test 25 | run: pnpm test 26 | 27 | - name: Build CLI 28 | run: pnpm build:cli 29 | -------------------------------------------------------------------------------- /.github/workflows/pkg-pr-new.yml: -------------------------------------------------------------------------------- 1 | name: CLI Preview 2 | on: 3 | pull_request: 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v4 11 | - uses: pnpm/action-setup@v4 12 | - uses: actions/setup-node@v4 13 | with: 14 | node-version: "20" 15 | cache: pnpm 16 | 17 | - name: Run changed-files 18 | id: changed-files 19 | uses: tj-actions/changed-files@v44 20 | with: 21 | separator: ' ' 22 | dir_names: 'true' 23 | dir_names_max_depth: '2' # truncates the path to packages/package-name 24 | files: | 25 | packages/** 26 | 27 | - name: Install dependencies 28 | run: pnpm install 29 | 30 | - name: Build 31 | run: pnpm build:cli 32 | 33 | - name: publish preview 34 | if: ${{ steps.changed-files.outputs.all_changed_files_count > 0 }} 35 | env: 36 | CHANGED_DIRS: ${{ steps.changed-files.outputs.all_changed_files }} 37 | # run: | 38 | run: pnpm dlx pkg-pr-new publish './packages/cli' --template './examples/*' -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | concurrency: ${{ github.workflow }}-${{ github.ref }} 9 | 10 | jobs: 11 | release: 12 | name: Build & Publish Release 13 | if: github.repository == 'ieedan/jsrepo' 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: pnpm/action-setup@v4 19 | - uses: actions/setup-node@v4 20 | with: 21 | node-version: "20" 22 | cache: pnpm 23 | 24 | - name: Install dependencies 25 | run: pnpm install 26 | 27 | - name: Create Release Pull Request or Publish 28 | id: changesets 29 | uses: changesets/action@v1 30 | with: 31 | commit: "chore(release): version package" 32 | title: "chore(release): version package" 33 | publish: pnpm ci:release 34 | env: 35 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | NODE_ENV: production 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Aidan Bleser 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. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 | 6 |

jsrepo

7 | 8 |

9 | 10 |

11 | 12 | 13 | 14 |

15 | 16 | **jsrepo** is a CLI to build and distribute your code. 17 | 18 | ## Getting Started 19 | 20 | - [Create a registry](https://jsrepo.dev/docs/setup/registry) 21 | - [Download your blocks](https://jsrepo.dev/docs/setup/project) 22 | 23 | ## Demos 24 | 25 | - [Create your first registry](https://youtu.be/IyJQI3z8PWg) 26 | - [Build your own shadcn-style library with jsrepo](https://youtu.be/zWfBt1vKb84) 27 | - [Building the shadcn/ui registry with jsrepo](https://youtu.be/tj7BUE9V7fw) 28 | -------------------------------------------------------------------------------- /examples/project/.gitignore: -------------------------------------------------------------------------------- 1 | dist -------------------------------------------------------------------------------- /examples/project/README.md: -------------------------------------------------------------------------------- 1 | # project example 2 | 3 | Test this example on your own registry. Initialize the `jsrepo.json` add components etc. 4 | 5 | You can run `index.ts` with: 6 | 7 | ```bash 8 | pnpm start 9 | ``` 10 | 11 | Run the jsrepo CLI with: 12 | 13 | ```bash 14 | pnpm jsrepo [...args] 15 | ``` 16 | -------------------------------------------------------------------------------- /examples/project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "project", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "type": "module", 7 | "scripts": { 8 | "jsrepo": "jsrepo", 9 | "start": "tsup --silent && node ./dist/index.js", 10 | "build": "tsup" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "jsrepo": "^1.2.4", 17 | "tsup": "^8.3.5", 18 | "typescript": "^5.6.3" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/project/src/index.ts: -------------------------------------------------------------------------------- 1 | console.log("project example"); 2 | -------------------------------------------------------------------------------- /examples/project/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | clean: true, 5 | entry: ["src/index.ts"], 6 | format: ["esm"], 7 | target: "es2022", 8 | outDir: "dist", 9 | }); 10 | -------------------------------------------------------------------------------- /examples/registry/README.md: -------------------------------------------------------------------------------- 1 | # Registry Example 2 | 3 | This is an example of what a registry might look like 4 | 5 | Here different blocks depend on each other and import dependencies. And jsrepo is responsible for handling all of that correctly. 6 | 7 | We use this to test the functionality of the `build` command. 8 | 9 | To test this example run: 10 | 11 | ```bash 12 | pnpm install 13 | 14 | pnpm build:registry 15 | ``` -------------------------------------------------------------------------------- /examples/registry/blocks/angular/button/button.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Button 7 | 8 | 9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/registry/blocks/dynamic-imports/test.svelte: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/registry/blocks/dynamic-imports/test.ts: -------------------------------------------------------------------------------- 1 | // Follows the best practices established in https://shiki.matsu.io/guide/best-performance 2 | import { createJavaScriptRegexEngine } from 'shiki/engine/javascript'; 3 | import { createHighlighterCore } from 'shiki/core'; 4 | 5 | const bundledLanguages = { 6 | bash: () => import('@shikijs/langs/bash'), 7 | diff: () => import('@shikijs/langs/diff'), 8 | javascript: () => import('@shikijs/langs/javascript'), 9 | json: () => import('@shikijs/langs/json'), 10 | svelte: () => import('@shikijs/langs/svelte'), 11 | typescript: () => import('@shikijs/langs/typescript') 12 | }; 13 | 14 | /** The languages configured for the highlighter */ 15 | export type SupportedLanguage = keyof typeof bundledLanguages; 16 | 17 | /** A preloaded highlighter instance. */ 18 | export const highlighter = createHighlighterCore({ 19 | themes: [ 20 | import('@shikijs/themes/github-light-default'), 21 | import('@shikijs/themes/github-dark-default') 22 | ], 23 | langs: Object.entries(bundledLanguages).map(([_, lang]) => lang), 24 | engine: createJavaScriptRegexEngine() 25 | }); 26 | -------------------------------------------------------------------------------- /examples/registry/blocks/logging/logger.ts: -------------------------------------------------------------------------------- 1 | const log = console.log; 2 | 3 | export { log } -------------------------------------------------------------------------------- /examples/registry/blocks/scripts/test.js: -------------------------------------------------------------------------------- 1 | console.log('hello') -------------------------------------------------------------------------------- /examples/registry/blocks/styles/test.scss: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } -------------------------------------------------------------------------------- /examples/registry/blocks/svelte/component.svelte: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/registry/blocks/svelte/test.js: -------------------------------------------------------------------------------- 1 | export const THING2 = 1; -------------------------------------------------------------------------------- /examples/registry/blocks/svelte/test.svelte.ts: -------------------------------------------------------------------------------- 1 | export const THING = "thing"; -------------------------------------------------------------------------------- /examples/registry/jsrepo-build-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/jsrepo@1.30.1/schemas/registry-config.json", 3 | "meta": { 4 | "authors": ["Aidan Bleser"], 5 | "description": "An example registry", 6 | "tags": ["svelte", "typescript", "react"], 7 | "repository": "https://github.com/ieedan/jsrepo", 8 | "homepage": "https://jsrepo.dev", 9 | "bugs": "https://github.com/ieedan/jsrepo/issues" 10 | }, 11 | "dirs": ["./src", "./blocks"], 12 | "doNotListBlocks": [], 13 | "doNotListCategories": [], 14 | "excludeDeps": [], 15 | "includeBlocks": [], 16 | "includeCategories": [] 17 | } 18 | -------------------------------------------------------------------------------- /examples/registry/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "registry", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "test": "vitest", 7 | "build:registry": "jsrepo build" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "jsrepo": "^1.2.4", 14 | "typescript": "^5.7.2", 15 | "vitest": "^2.1.5" 16 | }, 17 | "dependencies": { 18 | "chalk": "^5.3.0" 19 | } 20 | } -------------------------------------------------------------------------------- /examples/registry/src/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkhorse374/JavaScript/ea6d998d7a826d9a25201e029da2cd8c4ba42bbb/examples/registry/src/app.css -------------------------------------------------------------------------------- /examples/registry/src/components/button.svelte: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/registry/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './point' -------------------------------------------------------------------------------- /examples/registry/src/types/point.ts: -------------------------------------------------------------------------------- 1 | export type Point = { 2 | x: number; 3 | y: number; 4 | } -------------------------------------------------------------------------------- /examples/registry/src/utils/math-user/use.ts: -------------------------------------------------------------------------------- 1 | import { add } from "$utils/math/add"; -------------------------------------------------------------------------------- /examples/registry/src/utils/math/add.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from "vitest"; 2 | import { add } from "./add"; 3 | 4 | describe("add", () => { 5 | it("adds 2 numbers", () => { 6 | expect(add(2, 2)).toBe(4); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /examples/registry/src/utils/math/add.ts: -------------------------------------------------------------------------------- 1 | const add = (a: number, b: number) => a + b; 2 | 3 | export { add } -------------------------------------------------------------------------------- /examples/registry/src/utils/math/create-point.ts: -------------------------------------------------------------------------------- 1 | import { Point } from "../../types/point"; 2 | 3 | const createPoint = (x: number, y: number): Point => ({ x, y }) 4 | 5 | export { createPoint } -------------------------------------------------------------------------------- /examples/registry/src/utils/math/format-answer.ts: -------------------------------------------------------------------------------- 1 | import { print } from "../pretty-print" 2 | import { add } from "." 3 | 4 | const format = (answer: number) => `answer was ${print(answer.toString())}`; 5 | 6 | const answerAdd = (a: number, b: number) => { 7 | format(add(a, b)) 8 | } 9 | 10 | export { format, answerAdd } -------------------------------------------------------------------------------- /examples/registry/src/utils/math/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./add"; 2 | export * from "./subtract"; 3 | export * from "./format-answer"; 4 | export * from "./create-point"; 5 | -------------------------------------------------------------------------------- /examples/registry/src/utils/math/subtract.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from "vitest"; 2 | import { subtract } from "./subtract"; 3 | 4 | describe("subtract", () => { 5 | it("subtracts 2 numbers", () => { 6 | expect(subtract(2, 2)).toBe(0); 7 | }); 8 | }); -------------------------------------------------------------------------------- /examples/registry/src/utils/math/subtract.ts: -------------------------------------------------------------------------------- 1 | const subtract = (a: number, b: number) => a - b; 2 | 3 | export { subtract } -------------------------------------------------------------------------------- /examples/registry/src/utils/pretty-print/index.ts: -------------------------------------------------------------------------------- 1 | import { print } from "./print"; 2 | 3 | export { print } -------------------------------------------------------------------------------- /examples/registry/src/utils/pretty-print/print.ts: -------------------------------------------------------------------------------- 1 | import color from "chalk"; 2 | import { log } from "$logging/logger"; 3 | 4 | const print = (str: string) => log(color.cyan(str)); 5 | 6 | export { print }; 7 | -------------------------------------------------------------------------------- /examples/registry/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "forceConsistentCasingInFileNames": true, 5 | "isolatedModules": true, 6 | "moduleResolution": "Bundler", 7 | "module": "ES2022", 8 | "target": "ES2022", 9 | "skipLibCheck": true, 10 | "strict": true, 11 | "paths": { 12 | "$types/*": ["./src/types/*"], 13 | "$utils/*": ["./src/utils/*"], 14 | "$logging/*": ["./blocks/logging/*"], 15 | "$svelte/*": ["./blocks/svelte/*"] 16 | } 17 | }, 18 | "include": ["src/**/*.ts"] 19 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsrepo-monorepo", 3 | "packageManager": "pnpm@9.12.3", 4 | "version": "0.0.0", 5 | "description": "A monorepo for jsrepo", 6 | "scripts": { 7 | "ci:publish": "changeset publish", 8 | "format": "pnpm -F jsrepo format && pnpm -F docs format", 9 | "lint": "pnpm -F jsrepo check && pnpm -F docs lint", 10 | "test": "pnpm -F jsrepo test", 11 | "build": "pnpm build:cli && pnpm build:cli-docs && pnpm build:docs", 12 | "build:cli": "pnpm -F jsrepo build", 13 | "build:docs": "pnpm -F docs build", 14 | "ci:release": "pnpm build:cli && changeset publish", 15 | "changeset": "changeset", 16 | "dev": "pnpm -F docs dev", 17 | "build:cli-docs": "pnpm -F jsrepo build:docs" 18 | }, 19 | "keywords": [], 20 | "author": "Aidan Bleser", 21 | "license": "MIT", 22 | "devDependencies": { 23 | "@changesets/cli": "^2.27.12", 24 | "pkg-pr-new": "^0.0.39" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/cli/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | # out 4 | dist 5 | 6 | # testing 7 | temp-test -------------------------------------------------------------------------------- /packages/cli/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | # jsrepo 6 | 7 | ```bash 8 | npm install jsrepo@latest -g 9 | ``` 10 | 11 | CLI for [jsrepo](https://jsrepo.dev). Used to build and download code from registries that **YOU** own. 12 | 13 | Kinda like [shadcn-ui](https://ui.shadcn.com/) but bring-your-own registry! 14 | 15 | 1. [Build your own registry](https://jsrepo.dev/docs/setup/registry) 16 | 2. [Download your blocks](https://jsrepo.dev/docs/setup/project) 17 | 18 | ## Example registries 19 | - [github/ieedan/std](https://github.com/ieedan/std) 20 | - [gitlab/ieedan/std](https://gitlab.com/ieedan/std) 21 | - [bitbucket/ieedan/std](https://bitbucket.org/ieedan/std) 22 | -------------------------------------------------------------------------------- /packages/cli/jsrepo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/jsrepo@1.30.1/schemas/project-config.json", 3 | "repos": ["github/ieedan/std"], 4 | "includeTests": false, 5 | "watermark": true, 6 | "formatter": "biome", 7 | "paths": { 8 | "*": "./src/utils/blocks" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/cli/schemas/project-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "type": "object", 4 | "properties": { 5 | "repos": { 6 | "description": "Repositories to download code from.", 7 | "type": "array", 8 | "items": { 9 | "type": "string" 10 | } 11 | }, 12 | "includeTests": { 13 | "description": "When true includes the test files for each block in the same directory.", 14 | "type": "boolean", 15 | "default": "true" 16 | }, 17 | "watermark": { 18 | "description": "When true will add a watermark with the version and repository at the top of the installed files.", 19 | "type": "boolean", 20 | "default": "true" 21 | }, 22 | "formatter": { 23 | "description": "The formatter to use when adding or updating files.", 24 | "type": "string", 25 | "enum": ["prettier", "biome"] 26 | }, 27 | "configFiles": { 28 | "description": "Config file names mapped to their respective path.", 29 | "type": "object", 30 | "additionalProperties": { 31 | "type": "string" 32 | } 33 | }, 34 | "paths": { 35 | "description": "Paths used to map categories to a directory.", 36 | "type": "object", 37 | "required": ["*"], 38 | "properties": { 39 | "*": { 40 | "type": "string", 41 | "description": "The default path for blocks to be installed in your project." 42 | } 43 | }, 44 | "additionalProperties": { 45 | "type": "string" 46 | }, 47 | "propertyNames": { 48 | "type": "string" 49 | } 50 | } 51 | }, 52 | "required": ["paths", "includeTests"] 53 | } 54 | -------------------------------------------------------------------------------- /packages/cli/scripts/generate-docs.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import { cli } from '../src/cli'; 3 | 4 | const docsOutput = process.argv.slice(2)[0] ?? 'docs.md'; 5 | 6 | const docs = `# ${cli.name()} 7 | 8 | > ${cli.description()} 9 | 10 | Latest Version: ${cli.version()} 11 | 12 | ## Commands 13 | 14 | ${cli.commands 15 | .map((cmd) => { 16 | return `### ${cmd.name()} 17 | 18 | ${cmd.description()} 19 | 20 | #### Usage 21 | \`\`\`bash 22 | ${cli.name()} ${cmd.name()} ${cmd.usage()} 23 | \`\`\` 24 | 25 | #### Options 26 | ${cmd.options 27 | .map((opt) => { 28 | let defaultValue = opt.defaultValue; 29 | if (opt.flags === '--cwd ') { 30 | defaultValue = './'; 31 | } 32 | return `- ${opt.flags}: ${opt.description} ${defaultValue ? `(default: ${defaultValue})\n` : '\n'}`; 33 | }) 34 | .join('')} 35 | `; 36 | }) 37 | .join('')}`; 38 | 39 | fs.writeFileSync(docsOutput, docs); 40 | -------------------------------------------------------------------------------- /packages/cli/src/api/index.ts: -------------------------------------------------------------------------------- 1 | // export any public facing apis from here 2 | // nothing exported from this file should rely on node 3 | 4 | export * from '../constants'; 5 | export * from '../types'; 6 | export * from '../utils/registry-providers/index'; 7 | -------------------------------------------------------------------------------- /packages/cli/src/cli.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import { fileURLToPath } from 'node:url'; 3 | import { program } from 'commander'; 4 | import path from 'pathe'; 5 | import * as commands from './commands'; 6 | import type { CLIContext } from './utils/context'; 7 | import { getLatestVersion } from './utils/get-latest-version'; 8 | 9 | const resolveRelativeToRoot = (p: string): string => { 10 | const dirname = fileURLToPath(import.meta.url); 11 | return path.join(dirname, '../..', p); 12 | }; 13 | 14 | // get version from package.json 15 | const { version, name, description, repository } = JSON.parse( 16 | fs.readFileSync(resolveRelativeToRoot('package.json'), 'utf-8') 17 | ); 18 | 19 | const latestVersion = (await getLatestVersion()).match( 20 | (val) => val, 21 | () => undefined 22 | ); 23 | 24 | const context: CLIContext = { 25 | package: { 26 | name, 27 | description, 28 | version, 29 | repository, 30 | latestVersion, 31 | }, 32 | resolveRelativeToRoot, 33 | }; 34 | 35 | const cli = program 36 | .name(name) 37 | .description(description) 38 | .version(version) 39 | .addCommand(commands.add) 40 | .addCommand(commands.auth) 41 | .addCommand(commands.build) 42 | .addCommand(commands.exec) 43 | .addCommand(commands.init) 44 | .addCommand(commands.test) 45 | .addCommand(commands.update); 46 | 47 | export { cli, context }; 48 | -------------------------------------------------------------------------------- /packages/cli/src/commands/index.ts: -------------------------------------------------------------------------------- 1 | import { add } from './add'; 2 | import { auth } from './auth'; 3 | import { build } from './build'; 4 | import { exec } from './exec'; 5 | import { init } from './init'; 6 | import { test } from './test'; 7 | import { update } from './update'; 8 | 9 | export { add, auth, build, exec, init, test, update }; 10 | -------------------------------------------------------------------------------- /packages/cli/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const MANIFEST_FILE = 'jsrepo-manifest.json'; 2 | export const CONFIG_FILE = 'jsrepo.json'; 3 | -------------------------------------------------------------------------------- /packages/cli/src/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { cli } from './cli'; 4 | 5 | cli.parse(); 6 | -------------------------------------------------------------------------------- /packages/cli/src/types.ts: -------------------------------------------------------------------------------- 1 | import * as v from 'valibot'; 2 | 3 | export const blockSchema = v.object({ 4 | name: v.string(), 5 | category: v.string(), 6 | localDependencies: v.array(v.string()), 7 | dependencies: v.array(v.string()), 8 | devDependencies: v.array(v.string()), 9 | tests: v.boolean(), 10 | list: v.optional(v.boolean(), true), 11 | /** Where to find the block relative to root */ 12 | directory: v.string(), 13 | subdirectory: v.boolean(), 14 | files: v.array(v.string()), 15 | _imports_: v.record(v.string(), v.string()), 16 | }); 17 | 18 | export const categorySchema = v.object({ 19 | name: v.string(), 20 | blocks: v.array(blockSchema), 21 | }); 22 | 23 | export const manifestMeta = v.object({ 24 | authors: v.optional(v.array(v.string())), 25 | bugs: v.optional(v.string()), 26 | description: v.optional(v.string()), 27 | homepage: v.optional(v.string()), 28 | repository: v.optional(v.string()), 29 | tags: v.optional(v.array(v.string())), 30 | }); 31 | 32 | export const configFileSchema = v.object({ 33 | name: v.string(), 34 | path: v.string(), 35 | expectedPath: v.optional(v.string()), 36 | optional: v.optional(v.boolean(), false), 37 | }); 38 | 39 | export const manifestSchema = v.object({ 40 | meta: v.optional(manifestMeta), 41 | configFiles: v.optional(v.array(configFileSchema)), 42 | categories: v.array(categorySchema), 43 | }); 44 | 45 | export type Meta = v.InferOutput; 46 | 47 | export type Category = v.InferOutput; 48 | 49 | export type Block = v.InferOutput; 50 | 51 | export type Manifest = v.InferOutput; 52 | -------------------------------------------------------------------------------- /packages/cli/src/utils/ascii.ts: -------------------------------------------------------------------------------- 1 | import color from 'chalk'; 2 | 3 | export const VERTICAL_LINE = color.gray('│'); 4 | export const HORIZONTAL_LINE = color.gray('─'); 5 | export const TOP_RIGHT_CORNER = color.gray('┐'); 6 | export const BOTTOM_RIGHT_CORNER = color.gray('┘'); 7 | export const JUNCTION_RIGHT = color.gray('├'); 8 | export const TOP_LEFT_CORNER = color.gray('┌'); 9 | export const BOTTOM_LEFT_CORNER = color.gray('└'); 10 | 11 | export const WARN = color.bgRgb(245, 149, 66).black(' WARN '); 12 | export const INFO = color.bgBlueBright.white(' INFO '); 13 | export const ERROR = color.bgRedBright.white(' ERROR '); 14 | 15 | export const JSREPO = color.hex('#f7df1e')('jsrepo'); 16 | -------------------------------------------------------------------------------- /packages/cli/src/utils/blocks/package-managers/flags.ts: -------------------------------------------------------------------------------- 1 | import type { Agent } from 'package-manager-detector'; 2 | 3 | export type Flags = { 4 | 'no-workspace'?: string; 5 | 'install-as-dev-dependency': string; 6 | }; 7 | 8 | export const bun: Flags = { 9 | 'no-workspace': '--no-workspace', 10 | 'install-as-dev-dependency': '-D', 11 | }; 12 | 13 | export const deno: Flags = { 14 | 'install-as-dev-dependency': '-D', 15 | }; 16 | 17 | export const npm: Flags = { 18 | 'no-workspace': '--workspaces=false', 19 | 'install-as-dev-dependency': '-D', 20 | }; 21 | 22 | export const pnpm: Flags = { 23 | 'no-workspace': '--ignore-workspace', 24 | 'install-as-dev-dependency': '-D', 25 | }; 26 | 27 | export const yarn: Flags = { 28 | 'no-workspace': '--focus', 29 | 'install-as-dev-dependency': '-D', 30 | }; 31 | 32 | export const flags: Record = { 33 | bun, 34 | npm, 35 | pnpm, 36 | deno, 37 | yarn, 38 | 'yarn@berry': yarn, 39 | 'pnpm@6': pnpm, 40 | }; 41 | -------------------------------------------------------------------------------- /packages/cli/src/utils/blocks/ts/lines.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.2.4 3 | Installed from github/ieedan/std 4 | 11-21-2024 5 | */ 6 | 7 | import os from 'node:os'; 8 | import { leftPadMin } from './pad'; 9 | 10 | /** Regex used to split on new lines 11 | * 12 | * ``` 13 | * /\n|\r\n/g 14 | * ``` 15 | */ 16 | export const NEW_LINE_REGEX = /\n|\r\n/g; 17 | 18 | /** Splits str into an array of lines. 19 | * 20 | * @param str 21 | * @returns 22 | * 23 | * ## Usage 24 | * 25 | * ```ts 26 | * lines.split("hello\\nhello\nhello"); // ["hello\\nhello", "hello"] 27 | * ``` 28 | */ 29 | const get = (str: string): string[] => str.split(NEW_LINE_REGEX); 30 | 31 | export type Options = { 32 | lineNumbers: boolean; 33 | prefix: (line: number, lineCount: number) => string; 34 | }; 35 | 36 | /** Joins the array of lines back into a string using the platform specific EOL. 37 | * 38 | * @param lines 39 | * @returns 40 | * 41 | * ## Usage 42 | * 43 | * ```ts 44 | * lines.join(["1", "2", "3"]); // "1\n2\n3" or on windows "1\r\n2\r\n3" 45 | * 46 | * // add line numbers 47 | * lines.join(["import { } from '.'", "console.log('test')"], { lineNumbers: true }); 48 | * // 1 import { } from '.' 49 | * // 2 console.log('test') 50 | * 51 | * // add a custom prefix 52 | * lines.join(["import { } from '.'", "console.log('test')"], { prefix: () => " + " }); 53 | * // + import { } from '.' 54 | * // + console.log('test') 55 | * ``` 56 | */ 57 | const join = (lines: string[], { lineNumbers = false, prefix }: Partial = {}): string => { 58 | let transformed = lines; 59 | 60 | if (lineNumbers) { 61 | const length = lines.length.toString().length + 1; 62 | 63 | transformed = transformed.map((line, i) => `${leftPadMin(`${i + 1}`, length)} ${line}`); 64 | } 65 | 66 | if (prefix !== undefined) { 67 | transformed = transformed.map((line, i) => `${prefix(i, lines.length)}${line}`); 68 | } 69 | 70 | return transformed.join(os.EOL); 71 | }; 72 | 73 | export { get, join }; 74 | -------------------------------------------------------------------------------- /packages/cli/src/utils/blocks/ts/strings.ts: -------------------------------------------------------------------------------- 1 | /** Returns true if `str` starts with one of the provided `strings`. 2 | * 3 | * ## Usage 4 | * ```ts 5 | * startsWithOneOf('ab', 'a', 'c'); // true 6 | * startsWithOneOf('cc', 'a', 'b'); // false 7 | * ``` 8 | * 9 | * @param str 10 | * @param strings 11 | * @returns 12 | */ 13 | export const startsWithOneOf = (str: string, strings: string[]): boolean => { 14 | for (const s of strings) { 15 | if (str.startsWith(s)) return true; 16 | } 17 | 18 | return false; 19 | }; 20 | 21 | /** Returns true if `str` starts with one of the provided `strings`. 22 | * 23 | * ## Usage 24 | * ```ts 25 | * endsWithOneOf('cb', 'a', 'b'); // true 26 | * endsWithOneOf('cc', 'a', 'b'); // false 27 | * ``` 28 | * 29 | * @param str 30 | * @param strings 31 | * @returns 32 | */ 33 | export const endsWithOneOf = (str: string, strings: string[]): boolean => { 34 | for (const s of strings) { 35 | if (str.endsWith(s)) return true; 36 | } 37 | 38 | return false; 39 | }; 40 | -------------------------------------------------------------------------------- /packages/cli/src/utils/blocks/ts/strip-ansi.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.22.1 3 | Installed from github/ieedan/std 4 | 1-4-2025 5 | */ 6 | 7 | import ansiRegex from 'ansi-regex'; 8 | 9 | /** Strips a string with ansi escape codes back to it's original form. Useful for when you need to get the actual length of a string. 10 | * 11 | * @param str 12 | * @returns 13 | * 14 | * ## Usage 15 | * ```ts 16 | * import color from "chalk"; 17 | * 18 | * const redString = color.red(redString); 19 | * 20 | * stripAnsi(redString); 21 | * ``` 22 | */ 23 | const stripAsni = (str: string) => str.replace(ansiRegex(), ''); 24 | 25 | export { stripAsni }; 26 | -------------------------------------------------------------------------------- /packages/cli/src/utils/context.ts: -------------------------------------------------------------------------------- 1 | export interface CLIContext { 2 | /** The package.json of the CLI */ 3 | package: { 4 | name: string; 5 | version: string; 6 | description: string; 7 | repository: { 8 | url: string; 9 | }; 10 | latestVersion?: string; 11 | }; 12 | /** Resolves the path relative to the root of the application 13 | * 14 | * @param path 15 | * @returns 16 | */ 17 | resolveRelativeToRoot: (path: string) => string; 18 | } 19 | -------------------------------------------------------------------------------- /packages/cli/src/utils/format.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import type { PartialConfiguration } from '@biomejs/wasm-nodejs'; 3 | import path from 'pathe'; 4 | import * as prettier from 'prettier'; 5 | import type { Formatter } from './config'; 6 | 7 | type FormatterConfig = { 8 | prettierOptions: prettier.Options | null; 9 | biomeOptions: PartialConfiguration | null; 10 | }; 11 | 12 | const loadFormatterConfig = async ({ 13 | formatter, 14 | cwd, 15 | }: { formatter?: Formatter; cwd: string }): Promise => { 16 | let prettierOptions: prettier.Options | null = null; 17 | if (formatter === 'prettier') { 18 | prettierOptions = await prettier.resolveConfig(path.join(cwd, '.prettierrc')); 19 | } 20 | 21 | let biomeOptions: PartialConfiguration | null = null; 22 | if (formatter === 'biome') { 23 | const configPath = path.join(cwd, 'biome.json'); 24 | if (fs.existsSync(configPath)) { 25 | biomeOptions = JSON.parse(fs.readFileSync(configPath).toString()); 26 | } 27 | } 28 | 29 | return { 30 | biomeOptions, 31 | prettierOptions, 32 | }; 33 | }; 34 | 35 | export { type FormatterConfig, loadFormatterConfig }; 36 | -------------------------------------------------------------------------------- /packages/cli/src/utils/get-latest-version.ts: -------------------------------------------------------------------------------- 1 | import nodeFetch from 'node-fetch'; 2 | import { Err, Ok, type Result } from './blocks/ts/result'; 3 | import type { Package } from './parse-package-name'; 4 | import * as persisted from './persisted'; 5 | 6 | const LATEST_VERSION_KEY = 'latest-version'; 7 | const EXPIRATION_TIME = 60 * 60 * 1000; // 1 hour 8 | 9 | type LatestVersion = { 10 | expiration: number; 11 | version: string; 12 | }; 13 | 14 | /** Checks for the latest version from the github repository. Will cache results for up to 1 hour. */ 15 | export const getLatestVersion = async (): Promise> => { 16 | try { 17 | // handle caching 18 | const storage = persisted.get(); 19 | 20 | let version: string; 21 | 22 | const latestVersion = storage.get(LATEST_VERSION_KEY) as LatestVersion | null; 23 | 24 | if (latestVersion) { 25 | if (latestVersion.expiration > Date.now()) { 26 | version = latestVersion.version; 27 | 28 | return Ok(version); 29 | } 30 | 31 | storage.delete(LATEST_VERSION_KEY); 32 | } 33 | 34 | // we abort the request after a second 35 | // because it really just isn't worth it if it's going to take that long 36 | const controller = new AbortController(); 37 | 38 | const timeout = setTimeout(() => { 39 | controller.abort(); 40 | }, 1000); 41 | 42 | const response = await nodeFetch( 43 | 'https://raw.githubusercontent.com/ieedan/jsrepo/refs/heads/main/packages/cli/package.json', 44 | { 45 | signal: controller.signal, 46 | } 47 | ); 48 | 49 | clearTimeout(timeout); 50 | 51 | if (!response.ok) { 52 | return Err('Error getting version'); 53 | } 54 | 55 | const { version: ver } = (await response.json()) as Package; 56 | 57 | version = ver; 58 | 59 | storage.set(LATEST_VERSION_KEY, { 60 | expiration: Date.now() + EXPIRATION_TIME, 61 | version, 62 | } satisfies LatestVersion); 63 | 64 | return Ok(version); 65 | } catch (err) { 66 | return Err(`Error getting version: ${err}`); 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /packages/cli/src/utils/get-watermark.ts: -------------------------------------------------------------------------------- 1 | const getWatermark = (version: string, repoUrl: string): string => { 2 | return `jsrepo ${version}\nInstalled from ${repoUrl}\n${new Date() 3 | .toLocaleDateString() 4 | .replaceAll('/', '-')}`; 5 | }; 6 | 7 | export { getWatermark }; 8 | -------------------------------------------------------------------------------- /packages/cli/src/utils/manifest.ts: -------------------------------------------------------------------------------- 1 | import * as v from 'valibot'; 2 | import { type Manifest, categorySchema, manifestSchema } from '../types'; 3 | import { Err, Ok, type Result } from './blocks/ts/result'; 4 | 5 | /** Parses the json string (if it can be) into a manifest. 6 | * 7 | * @param json 8 | */ 9 | export const parseManifest = (json: string): Result => { 10 | let parsed: unknown; 11 | 12 | try { 13 | parsed = JSON.parse(json); 14 | } catch (err) { 15 | return Err(`Error parsing manifest json ${err}`); 16 | } 17 | 18 | // first gen array-based config 19 | if (Array.isArray(parsed)) { 20 | const validated = v.safeParse(v.array(categorySchema), parsed); 21 | 22 | if (!validated.success) { 23 | return Err( 24 | `Error parsing categories (array-based config) ${validated.issues.join(' ')}` 25 | ); 26 | } 27 | 28 | return Ok({ 29 | categories: validated.output, 30 | }); 31 | } 32 | 33 | const validated = v.safeParse(manifestSchema, parsed); 34 | 35 | if (!validated.success) { 36 | return Err(`Error parsing manifest ${validated.issues.join(' ')}`); 37 | } 38 | 39 | return Ok(validated.output); 40 | }; 41 | -------------------------------------------------------------------------------- /packages/cli/src/utils/parse-package-name.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Adapted from https://github.com/egoist/parse-package-name/blob/main/src/index.ts 3 | * @module 4 | */ 5 | 6 | import { Err, Ok, type Result } from './blocks/ts/result'; 7 | 8 | // Parsed a scoped package name into name, version, and path. 9 | const RE_SCOPED = /^(@[^\/]+\/[^@\/]+)(?:@([^\/]+))?(\/.*)?$/; 10 | // Parsed a non-scoped package name into name, version, path 11 | const RE_NON_SCOPED = /^([^@\/]+)(?:@([^\/]+))?(\/.*)?$/; 12 | 13 | export type Package = { 14 | /** Name of the package as it would be installed from npm */ 15 | name: string; 16 | /** Version of the package */ 17 | version: string; 18 | path: string; 19 | }; 20 | 21 | const parsePackageName = (input: string): Result => { 22 | const m = RE_SCOPED.exec(input) || RE_NON_SCOPED.exec(input); 23 | 24 | if (!m) return Err(`invalid package name: ${input}`); 25 | 26 | return Ok({ 27 | name: m[1] || '', 28 | version: m[2] || 'latest', 29 | path: m[3] || '', 30 | }); 31 | }; 32 | 33 | export { parsePackageName }; 34 | -------------------------------------------------------------------------------- /packages/cli/src/utils/persisted.ts: -------------------------------------------------------------------------------- 1 | import Conf from 'conf'; 2 | 3 | const get = () => new Conf({ projectName: 'jsrepo' }); 4 | 5 | export { get }; 6 | -------------------------------------------------------------------------------- /packages/cli/tests/language-support.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest'; 2 | import { resolutionEquality } from '../src/utils/language-support'; 3 | 4 | describe('resolutionEquality', () => { 5 | it('returns true for a .js and .ts extension that are equal', () => { 6 | expect(resolutionEquality('test.ts', 'test.js')).toBe(true); 7 | }); 8 | 9 | it('returns true for a no extension and .ts extension that are equal', () => { 10 | expect(resolutionEquality('test.ts', 'test')).toBe(true); 11 | }); 12 | 13 | it('returns true for a no extension and .js extension that are equal', () => { 14 | expect(resolutionEquality('test.js', 'test')).toBe(true); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/cli/tests/unwrap-code.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest'; 2 | import { unwrapCodeFromQuotes } from '../src/utils/ai'; 3 | 4 | describe('unwrapCodeFromQuotes', () => { 5 | it('unwraps quoted code', () => { 6 | const code = `\`\`\` 7 | const thing = () => "hi"; 8 | \`\`\``; 9 | 10 | expect(unwrapCodeFromQuotes(code)).toBe('const thing = () => "hi";'); 11 | }); 12 | 13 | it('unwraps quoted code with language', () => { 14 | const code = `\`\`\`typescript 15 | const thing = () => "hi"; 16 | \`\`\``; 17 | 18 | expect(unwrapCodeFromQuotes(code)).toBe('const thing = () => "hi";'); 19 | }); 20 | 21 | it('unwraps only pre-quoted code', () => { 22 | const code = `\`\`\` 23 | const thing = () => "hi";`; 24 | 25 | expect(unwrapCodeFromQuotes(code)).toBe('const thing = () => "hi";'); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /packages/cli/tests/utils.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import path from 'node:path'; 3 | import { expect } from 'vitest'; 4 | 5 | export const assertFilesExist = (dir: string, ...files: string[]) => { 6 | for (const f of files) { 7 | expect(fs.existsSync(path.join(dir, f))).toBe(true); 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /packages/cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "forceConsistentCasingInFileNames": true, 5 | "isolatedModules": true, 6 | "moduleResolution": "Bundler", 7 | "module": "ES2022", 8 | "target": "ES2022", 9 | "skipLibCheck": true, 10 | "strict": true, 11 | "noEmit": true 12 | }, 13 | "include": ["src/**/*.ts"] 14 | } 15 | -------------------------------------------------------------------------------- /packages/cli/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts', 'src/api/index.ts'], 5 | format: ['esm'], 6 | platform: 'node', 7 | target: 'es2022', 8 | outDir: 'dist', 9 | clean: true, 10 | minify: true, 11 | treeshake: true, 12 | splitting: true, 13 | sourcemap: true, 14 | dts: true, 15 | }); 16 | -------------------------------------------------------------------------------- /packages/cli/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | exclude: ['**/temp-test/**', 'dist/**', 'coverage/**', 'node_modules'], 8 | }, 9 | server: { 10 | watch: { 11 | ignored: ['**/temp-test/**', 'dist/**', 'coverage/**', 'node_modules'], 12 | }, 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | - 'sites/*' -------------------------------------------------------------------------------- /sites/docs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | # Output 4 | .output 5 | .vercel 6 | /.svelte-kit 7 | /build 8 | 9 | # OS 10 | .DS_Store 11 | Thumbs.db 12 | 13 | # Env 14 | .env 15 | .env.* 16 | !.env.example 17 | !.env.test 18 | 19 | # Vite 20 | vite.config.js.timestamp-* 21 | vite.config.ts.timestamp-* 22 | -------------------------------------------------------------------------------- /sites/docs/.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /sites/docs/.prettierignore: -------------------------------------------------------------------------------- 1 | # Package Managers 2 | package-lock.json 3 | pnpm-lock.yaml 4 | yarn.lock 5 | 6 | .vercel -------------------------------------------------------------------------------- /sites/docs/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "printWidth": 100, 6 | "plugins": ["prettier-plugin-svelte"], 7 | "overrides": [ 8 | { 9 | "files": "*.svelte", 10 | "options": { 11 | "parser": "svelte" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /sites/docs/README.md: -------------------------------------------------------------------------------- 1 | # jsrepo 2 | 3 | docs site for jsrepo 4 | 5 | ## Development 6 | 7 | **Initial Setup** 8 | 9 | ```bash 10 | pnpm install 11 | 12 | pnpm dev 13 | ``` 14 | 15 | **Formatting + Linting** 16 | 17 | ```bash 18 | pnpm format 19 | 20 | pnpm lint 21 | ``` 22 | -------------------------------------------------------------------------------- /sites/docs/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://next.shadcn-svelte.com/schema.json", 3 | "style": "default", 4 | "tailwind": { 5 | "config": "tailwind.config.ts", 6 | "css": "src\\app.css", 7 | "baseColor": "zinc" 8 | }, 9 | "aliases": { 10 | "components": "$lib/components", 11 | "utils": "$lib/utils", 12 | "ui": "$lib/components/ui", 13 | "hooks": "$lib/hooks" 14 | }, 15 | "typescript": true, 16 | "registry": "https://next.shadcn-svelte.com/registry" 17 | } 18 | -------------------------------------------------------------------------------- /sites/docs/eslint.config.js: -------------------------------------------------------------------------------- 1 | import prettier from 'eslint-config-prettier'; 2 | import js from '@eslint/js'; 3 | import svelte from 'eslint-plugin-svelte'; 4 | import globals from 'globals'; 5 | import ts from 'typescript-eslint'; 6 | 7 | export default ts.config( 8 | js.configs.recommended, 9 | ...ts.configs.recommended, 10 | ...svelte.configs['flat/recommended'], 11 | prettier, 12 | ...svelte.configs['flat/prettier'], 13 | { 14 | languageOptions: { 15 | globals: { 16 | ...globals.browser, 17 | ...globals.node 18 | } 19 | }, 20 | rules: { 21 | '@typescript-eslint/no-unused-vars': [ 22 | 'error', 23 | { 24 | varsIgnorePattern: '^_', 25 | argsIgnorePattern: '^_' 26 | } 27 | ] 28 | } 29 | }, 30 | { 31 | files: ['**/*.svelte'], 32 | 33 | languageOptions: { 34 | parserOptions: { 35 | parser: ts.parser 36 | } 37 | }, 38 | rules: { 39 | 'svelte/no-at-html-tags': 'warn' 40 | } 41 | }, 42 | { 43 | ignores: ['build/', '.svelte-kit/', 'dist/', '.vercel/'] 44 | } 45 | ); 46 | -------------------------------------------------------------------------------- /sites/docs/jsrepo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/jsrepo@1.33.0/schemas/project-config.json", 3 | "repos": ["github/ieedan/std", "github/ieedan/shadcn-svelte-extras"], 4 | "includeTests": false, 5 | "watermark": true, 6 | "formatter": "prettier", 7 | "paths": { 8 | "*": "./src/lib/ts", 9 | "ts": "$lib/ts", 10 | "components": "$lib/components/ui", 11 | "ui": "$lib/components/ui", 12 | "utils": "$lib/utils", 13 | "actions": "$lib/actions", 14 | "types": "$lib/ts/types", 15 | "hooks": "$lib/hooks" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sites/docs/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /sites/docs/src/app.d.ts: -------------------------------------------------------------------------------- 1 | // See https://svelte.dev/docs/kit/types#app.d.ts 2 | // for information about these interfaces 3 | declare global { 4 | namespace App { 5 | // interface Error {} 6 | // interface Locals {} 7 | // interface PageData {} 8 | // interface PageState {} 9 | // interface Platform {} 10 | } 11 | } 12 | 13 | export {}; 14 | -------------------------------------------------------------------------------- /sites/docs/src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |
%sveltekit.body%
11 | 12 | 13 | -------------------------------------------------------------------------------- /sites/docs/src/hooks.server.ts: -------------------------------------------------------------------------------- 1 | import { redirect } from '@sveltejs/kit'; 2 | 3 | export const handle = async ({ event, resolve }) => { 4 | if (event.url.pathname === '/about') throw redirect(303, '/docs/about'); 5 | 6 | const response = await resolve(event); 7 | 8 | return response; 9 | }; 10 | -------------------------------------------------------------------------------- /sites/docs/src/lib/actions/active.svelte.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.19.1 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 12-12-2024 5 | */ 6 | 7 | import { page } from '$app/state'; 8 | import { untrack } from 'svelte'; 9 | 10 | export type Options = { 11 | /** Determines if the route should be active for subdirectories. 12 | * 13 | * @default true 14 | */ 15 | activeForSubdirectories?: boolean; 16 | /** Determines if the href of the `` tag is a `#` route 17 | * 18 | * @default false 19 | */ 20 | isHash?: boolean; 21 | url: URL; 22 | }; 23 | 24 | /** Sets the `data-active` attribute on an `` tag based on its 'active' state. */ 25 | export const active = (node: HTMLAnchorElement, opts: Omit) => { 26 | checkIsActive(node.href, { ...opts, url: page.url }).toString(); 27 | 28 | $effect(() => { 29 | // eslint-disable-next-line @typescript-eslint/no-unused-expressions 30 | page.url; 31 | 32 | untrack(() => { 33 | node.setAttribute( 34 | 'data-active', 35 | checkIsActive(node.href, { ...opts, url: page.url }).toString() 36 | ); 37 | }); 38 | }); 39 | }; 40 | 41 | export const checkIsActive = ( 42 | nodeHref: string, 43 | { activeForSubdirectories, url, isHash }: Options 44 | ): boolean => { 45 | let href: string = new URL(nodeHref).pathname; 46 | 47 | if (isHash) { 48 | href = new URL(nodeHref).hash; 49 | } 50 | 51 | const samePath = href === url.pathname; 52 | 53 | const isParentRoute: boolean = 54 | (activeForSubdirectories == undefined || activeForSubdirectories) && 55 | url.pathname.startsWith(href ?? ''); 56 | 57 | const isHashRoute: boolean = 58 | isHash == true && (url.hash == href || ((href == '#' || href == '#/') && url.hash == '')); 59 | 60 | return samePath || isParentRoute || isHashRoute; 61 | }; 62 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/animations/animated-gradient-text.svelte: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 25 |
31 | 32 | 35 | {@render children()} 36 | 37 |
38 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/animations/flip/flip.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 |
19 | {#each items as item, i} 20 | 25 | {item} 26 | 27 | {/each} 28 |
29 |
30 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/animations/flip/index.ts: -------------------------------------------------------------------------------- 1 | import Flip from './flip.svelte'; 2 | 3 | export { Flip }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/azure-devops.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 35 | 36 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/bitbucket.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 15 | 19 | 23 | 24 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/gitlab.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 16 | 20 | 24 | 28 | 32 | 33 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/html.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 16 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/index.ts: -------------------------------------------------------------------------------- 1 | import type { HTMLAttributes } from 'svelte/elements'; 2 | import AzureDevops from './azure-devops.svelte'; 3 | import GitHub from './github.svelte'; 4 | import CSS from './css.svelte'; 5 | import TypeScript from './typescript.svelte'; 6 | import Svelte from './svelte.svelte'; 7 | import React from './react.svelte'; 8 | import JavaScript from './javascript.svelte'; 9 | import Vue from './vue.svelte'; 10 | import Jsrepo from './jsrepo.svelte'; 11 | import GitLab from './gitlab.svelte'; 12 | import BitBucket from './bitbucket.svelte'; 13 | import Yaml from './yaml.svelte'; 14 | import Svg from './svg.svelte'; 15 | import HTML from './html.svelte'; 16 | import SASS from './sass.svelte'; 17 | 18 | export interface Props extends HTMLAttributes { 19 | class?: string; 20 | width?: number; 21 | height?: number; 22 | } 23 | 24 | export { 25 | AzureDevops, 26 | CSS, 27 | HTML, 28 | GitHub, 29 | TypeScript, 30 | Svelte, 31 | React, 32 | JavaScript, 33 | Vue, 34 | Jsrepo, 35 | GitLab, 36 | BitBucket, 37 | Yaml, 38 | SASS, 39 | Svg 40 | }; 41 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/javascript.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/sass.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/svg.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 27 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/icons/vue.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/command.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | No results found. 16 | {#each categories as category} 17 | 18 | {#each category.routes as route} 19 | { 21 | await goto(route.href); 22 | $open = false; 23 | }} 24 | > 25 | {route.name} 26 | 27 | {#each route.routes ?? [] as { name, href, icon: Icon }} 28 | { 30 | await goto(href); 31 | $open = false; 32 | }} 33 | > 34 | {route.name} ~ 35 | {#if Icon} 36 | 37 | {/if} 38 | {name} 39 | 40 | {/each} 41 | {/each} 42 | 43 | {/each} 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/blockquote.svelte: -------------------------------------------------------------------------------- 1 | 25 | 26 |
27 |
28 |

{@render children?.()}

29 |
30 | {#if by} 31 |

- {by}

32 | {/if} 33 |
34 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/code-span.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | {@render children()} 15 | 16 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/doc-header.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | jsrepo ~ Docs ~ {title} 12 | 13 | 14 | 15 |
16 |

17 | {title} 18 |

19 |

20 | {description} 21 |

22 |
23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/index.ts: -------------------------------------------------------------------------------- 1 | import DocHeader from './doc-header.svelte'; 2 | import Jsrepo from './jsrepo.svelte'; 3 | import Link from './link.svelte'; 4 | import SubHeading from './sub-heading.svelte'; 5 | import CodeSpan from './code-span.svelte'; 6 | import Blockquote from './blockquote.svelte'; 7 | 8 | export { DocHeader, Jsrepo, Link, SubHeading, CodeSpan, Blockquote }; 9 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/jsrepo.svelte: -------------------------------------------------------------------------------- 1 | jsrepo 2 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/link.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 20 | {@render children?.()} 21 | 22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/docs/sub-heading.svelte: -------------------------------------------------------------------------------- 1 | 49 | 50 |

55 | {@render children()} 56 |

57 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/site/footer.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 |
15 |
16 |
17 | 18 | v{version} 19 |
20 |
21 |
22 | 26 | 27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/accordion/accordion-content.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 21 |
22 | {@render children?.()} 23 |
24 |
25 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/accordion/accordion-item.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/accordion/accordion-trigger.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | svg]:rotate-180', 22 | className 23 | )} 24 | {...restProps} 25 | > 26 | {@render children?.()} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/accordion/index.ts: -------------------------------------------------------------------------------- 1 | import { Accordion as AccordionPrimitive } from 'bits-ui'; 2 | import Content from './accordion-content.svelte'; 3 | import Item from './accordion-item.svelte'; 4 | import Trigger from './accordion-trigger.svelte'; 5 | const Root = AccordionPrimitive.Root; 6 | 7 | export { 8 | Root, 9 | Content, 10 | Item, 11 | Trigger, 12 | // 13 | Root as Accordion, 14 | Content as AccordionContent, 15 | Item as AccordionItem, 16 | Trigger as AccordionTrigger 17 | }; 18 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/badge/badge.svelte: -------------------------------------------------------------------------------- 1 | 23 | 24 | 40 | 41 | 48 | {@render children?.()} 49 | 50 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/badge/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Badge } from './badge.svelte'; 2 | export { badgeVariants, type BadgeVariant } from './badge.svelte'; 3 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
  • 15 | {@render children?.()} 16 |
  • 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte: -------------------------------------------------------------------------------- 1 | 24 | 25 | {#if child} 26 | {@render child({ props: attrs })} 27 | {:else} 28 | 29 | {@render children?.()} 30 | 31 | {/if} 32 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
      22 | {@render children?.()} 23 |
    24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | {@render children?.()} 23 | 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 28 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/breadcrumb.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/breadcrumb/index.ts: -------------------------------------------------------------------------------- 1 | import Root from './breadcrumb.svelte'; 2 | import Ellipsis from './breadcrumb-ellipsis.svelte'; 3 | import Item from './breadcrumb-item.svelte'; 4 | import Separator from './breadcrumb-separator.svelte'; 5 | import Link from './breadcrumb-link.svelte'; 6 | import List from './breadcrumb-list.svelte'; 7 | import Page from './breadcrumb-page.svelte'; 8 | 9 | export { 10 | Root, 11 | Ellipsis, 12 | Item, 13 | Separator, 14 | Link, 15 | List, 16 | Page, 17 | // 18 | Root as Breadcrumb, 19 | Ellipsis as BreadcrumbEllipsis, 20 | Item as BreadcrumbItem, 21 | Separator as BreadcrumbSeparator, 22 | Link as BreadcrumbLink, 23 | List as BreadcrumbList, 24 | Page as BreadcrumbPage 25 | }; 26 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/button/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.32.0 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 2-6-2025 5 | */ 6 | 7 | import Root, { 8 | type ButtonProps, 9 | type ButtonSize, 10 | type ButtonVariant, 11 | buttonVariants 12 | } from './button.svelte'; 13 | 14 | export { 15 | Root, 16 | type ButtonProps as Props, 17 | // 18 | Root as Button, 19 | buttonVariants, 20 | type ButtonProps, 21 | type ButtonSize, 22 | type ButtonVariant 23 | }; 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/card-content.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    15 | {@render children?.()} 16 |
    17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/card-description.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |

    15 | {@render children?.()} 16 |

    17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/card-footer.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    15 | {@render children?.()} 16 |
    17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/card-header.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    15 | {@render children?.()} 16 |
    17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/card-title.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 |
    24 | {@render children?.()} 25 |
    26 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/card.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    19 | {@render children?.()} 20 |
    21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/card/index.ts: -------------------------------------------------------------------------------- 1 | import Root from './card.svelte'; 2 | import Content from './card-content.svelte'; 3 | import Description from './card-description.svelte'; 4 | import Footer from './card-footer.svelte'; 5 | import Header from './card-header.svelte'; 6 | import Title from './card-title.svelte'; 7 | 8 | export { 9 | Root, 10 | Content, 11 | Description, 12 | Footer, 13 | Header, 14 | Title, 15 | // 16 | Root as Card, 17 | Content as CardContent, 18 | Description as CardDescription, 19 | Footer as CardFooter, 20 | Header as CardHeader, 21 | Title as CardTitle 22 | }; 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/code/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.32.0 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 2-6-2025 5 | */ 6 | 7 | import Code from './code.svelte'; 8 | 9 | export { Code }; 10 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/code/shiki.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.32.0 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 2-6-2025 5 | */ 6 | 7 | // Follows the best practices established in https://shiki.matsu.io/guide/best-performance 8 | import { createJavaScriptRegexEngine } from 'shiki/engine/javascript'; 9 | import { createHighlighterCore } from 'shiki/core'; 10 | 11 | const bundledLanguages = { 12 | bash: () => import('@shikijs/langs/bash'), 13 | diff: () => import('@shikijs/langs/diff'), 14 | javascript: () => import('@shikijs/langs/javascript'), 15 | json: () => import('@shikijs/langs/json'), 16 | svelte: () => import('@shikijs/langs/svelte'), 17 | typescript: () => import('@shikijs/langs/typescript'), 18 | yaml: () => import('@shikijs/langs/yaml'), 19 | vue: () => import('@shikijs/langs/vue'), 20 | tsx: () => import('@shikijs/langs/tsx'), 21 | jsx: () => import('@shikijs/langs/jsx') 22 | }; 23 | 24 | /** The languages configured for the highlighter */ 25 | export type SupportedLanguage = keyof typeof bundledLanguages; 26 | 27 | /** A preloaded highlighter instance. */ 28 | export const highlighter = createHighlighterCore({ 29 | themes: [ 30 | import('@shikijs/themes/github-light-default'), 31 | import('@shikijs/themes/github-dark-default') 32 | ], 33 | langs: Object.entries(bundledLanguages).map(([_, lang]) => lang), 34 | engine: createJavaScriptRegexEngine() 35 | }); 36 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/collapsible/index.ts: -------------------------------------------------------------------------------- 1 | import { Collapsible as CollapsiblePrimitive } from 'bits-ui'; 2 | 3 | const Root = CollapsiblePrimitive.Root; 4 | const Trigger = CollapsiblePrimitive.Trigger; 5 | const Content = CollapsiblePrimitive.Content; 6 | 7 | export { 8 | Root, 9 | Content, 10 | Trigger, 11 | // 12 | Root as Collapsible, 13 | Content as CollapsibleContent, 14 | Trigger as CollapsibleTrigger 15 | }; 16 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-dialog.svelte: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-empty.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-group.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | {#if heading} 22 | 23 | {heading} 24 | 25 | {/if} 26 | 27 | 28 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-input.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    15 | 16 | 25 |
    26 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-item.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-link-item.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-list.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-separator.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command-shortcut.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | {@render children?.()} 20 | 21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/command.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/command/index.ts: -------------------------------------------------------------------------------- 1 | import { Command as CommandPrimitive } from 'bits-ui'; 2 | 3 | import Root from './command.svelte'; 4 | import Dialog from './command-dialog.svelte'; 5 | import Empty from './command-empty.svelte'; 6 | import Group from './command-group.svelte'; 7 | import Item from './command-item.svelte'; 8 | import Input from './command-input.svelte'; 9 | import List from './command-list.svelte'; 10 | import Separator from './command-separator.svelte'; 11 | import Shortcut from './command-shortcut.svelte'; 12 | import LinkItem from './command-link-item.svelte'; 13 | 14 | const Loading = CommandPrimitive.Loading; 15 | 16 | export { 17 | Root, 18 | Dialog, 19 | Empty, 20 | Group, 21 | Item, 22 | LinkItem, 23 | Input, 24 | List, 25 | Separator, 26 | Shortcut, 27 | Loading, 28 | // 29 | Root as Command, 30 | Dialog as CommandDialog, 31 | Empty as CommandEmpty, 32 | Group as CommandGroup, 33 | Item as CommandItem, 34 | LinkItem as CommandLinkItem, 35 | Input as CommandInput, 36 | List as CommandList, 37 | Separator as CommandSeparator, 38 | Shortcut as CommandShortcut, 39 | Loading as CommandLoading 40 | }; 41 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/copy-button/copy-button.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 36 | 37 | 72 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/copy-button/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.32.0 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 2-6-2025 5 | */ 6 | 7 | import CopyButton from './copy-button.svelte'; 8 | 9 | export { CopyButton }; 10 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/dialog-content.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 27 | 28 | 29 | 30 | 38 | {@render children?.()} 39 | {#if !hideClose} 40 | 43 | 44 | Close 45 | 46 | {/if} 47 | 48 | 49 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/dialog-description.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/dialog-footer.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 |
    25 | {@render children?.()} 26 |
    27 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/dialog-header.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 |
    25 | {@render children?.()} 26 |
    27 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/dialog-overlay.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 26 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/dialog-title.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dialog/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.19.1 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 12-12-2024 5 | */ 6 | 7 | import { Dialog as DialogPrimitive } from 'bits-ui'; 8 | 9 | import Title from './dialog-title.svelte'; 10 | import Footer from './dialog-footer.svelte'; 11 | import Header from './dialog-header.svelte'; 12 | import Overlay from './dialog-overlay.svelte'; 13 | import Content from './dialog-content.svelte'; 14 | import Description from './dialog-description.svelte'; 15 | 16 | const Root = DialogPrimitive.Root; 17 | const Trigger = DialogPrimitive.Trigger; 18 | const Close = DialogPrimitive.Close; 19 | const Portal = DialogPrimitive.Portal; 20 | 21 | export { 22 | Root, 23 | Title, 24 | Portal, 25 | Footer, 26 | Header, 27 | Trigger, 28 | Overlay, 29 | Content, 30 | Description, 31 | Close, 32 | // 33 | Root as Dialog, 34 | Title as DialogTitle, 35 | Portal as DialogPortal, 36 | Footer as DialogFooter, 37 | Header as DialogHeader, 38 | Trigger as DialogTrigger, 39 | Overlay as DialogOverlay, 40 | Content as DialogContent, 41 | Description as DialogDescription, 42 | Close as DialogClose 43 | }; 44 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-content.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 22 | 23 | 24 | 25 | 33 |
    34 | {@render children?.()} 35 |
    36 |
    37 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-description.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-footer.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 |
    21 | {@render children?.()} 22 |
    23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-header.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 |
    25 | {@render children?.()} 26 |
    27 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-nested.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-overlay.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer-title.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/drawer.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/drawer/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.19.1 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 12-12-2024 5 | */ 6 | 7 | import { Drawer as DrawerPrimitive } from 'vaul-svelte'; 8 | 9 | import Root from './drawer.svelte'; 10 | import Content from './drawer-content.svelte'; 11 | import Description from './drawer-description.svelte'; 12 | import Overlay from './drawer-overlay.svelte'; 13 | import Footer from './drawer-footer.svelte'; 14 | import Header from './drawer-header.svelte'; 15 | import Title from './drawer-title.svelte'; 16 | import NestedRoot from './drawer-nested.svelte'; 17 | 18 | const Trigger: typeof DrawerPrimitive.Trigger = DrawerPrimitive.Trigger; 19 | const Portal: typeof DrawerPrimitive.Portal = DrawerPrimitive.Portal; 20 | const Close: typeof DrawerPrimitive.Close = DrawerPrimitive.Close; 21 | 22 | export { 23 | Root, 24 | NestedRoot, 25 | Content, 26 | Description, 27 | Overlay, 28 | Footer, 29 | Header, 30 | Title, 31 | Trigger, 32 | Portal, 33 | Close, 34 | 35 | // 36 | Root as Drawer, 37 | NestedRoot as DrawerNestedRoot, 38 | Content as DrawerContent, 39 | Description as DrawerDescription, 40 | Overlay as DrawerOverlay, 41 | Footer as DrawerFooter, 42 | Header as DrawerHeader, 43 | Title as DrawerTitle, 44 | Trigger as DrawerTrigger, 45 | Portal as DrawerPortal, 46 | Close as DrawerClose 47 | }; 48 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte: -------------------------------------------------------------------------------- 1 | 19 | 20 | 30 | {#snippet children({ checked, indeterminate })} 31 | 32 | {#if indeterminate} 33 | 34 | {:else} 35 | 36 | {/if} 37 | 38 | {@render childrenProp?.()} 39 | {/snippet} 40 | 41 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 23 | 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 |
    22 | {@render children?.()} 23 |
    24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | {#snippet children({ checked })} 23 | 24 | {#if checked} 25 | 26 | {/if} 27 | 28 | {@render childrenProp?.({ checked })} 29 | {/snippet} 30 | 31 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | {@render children?.()} 20 | 21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | {@render children?.()} 27 | 28 | 29 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/dropdown-menu/index.ts: -------------------------------------------------------------------------------- 1 | import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; 2 | import CheckboxItem from './dropdown-menu-checkbox-item.svelte'; 3 | import Content from './dropdown-menu-content.svelte'; 4 | import GroupHeading from './dropdown-menu-group-heading.svelte'; 5 | import Item from './dropdown-menu-item.svelte'; 6 | import Label from './dropdown-menu-label.svelte'; 7 | import RadioItem from './dropdown-menu-radio-item.svelte'; 8 | import Separator from './dropdown-menu-separator.svelte'; 9 | import Shortcut from './dropdown-menu-shortcut.svelte'; 10 | import SubContent from './dropdown-menu-sub-content.svelte'; 11 | import SubTrigger from './dropdown-menu-sub-trigger.svelte'; 12 | 13 | const Sub = DropdownMenuPrimitive.Sub; 14 | const Root = DropdownMenuPrimitive.Root; 15 | const Trigger = DropdownMenuPrimitive.Trigger; 16 | const Group = DropdownMenuPrimitive.Group; 17 | const RadioGroup = DropdownMenuPrimitive.RadioGroup; 18 | 19 | export { 20 | CheckboxItem, 21 | Content, 22 | Root as DropdownMenu, 23 | CheckboxItem as DropdownMenuCheckboxItem, 24 | Content as DropdownMenuContent, 25 | Group as DropdownMenuGroup, 26 | GroupHeading as DropdownMenuGroupHeading, 27 | Item as DropdownMenuItem, 28 | Label as DropdownMenuLabel, 29 | RadioGroup as DropdownMenuRadioGroup, 30 | RadioItem as DropdownMenuRadioItem, 31 | Separator as DropdownMenuSeparator, 32 | Shortcut as DropdownMenuShortcut, 33 | Sub as DropdownMenuSub, 34 | SubContent as DropdownMenuSubContent, 35 | SubTrigger as DropdownMenuSubTrigger, 36 | Trigger as DropdownMenuTrigger, 37 | Group, 38 | GroupHeading, 39 | Item, 40 | Label, 41 | RadioGroup, 42 | RadioItem, 43 | Root, 44 | Separator, 45 | Shortcut, 46 | Sub, 47 | SubContent, 48 | SubTrigger, 49 | Trigger 50 | }; 51 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/file-icon/file-icon.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | {#if extension === '.svelte'} 15 | 16 | {:else if extension === '.ts'} 17 | 18 | {:else if extension === '.js'} 19 | 20 | {:else if extension === '.jsx'} 21 | 22 | {:else if extension === '.tsx'} 23 | 24 | {:else if extension === '.vue'} 25 | 26 | {:else if extension === '.html'} 27 | 28 | {:else if extension === '.json' || extension === '.jsonc'} 29 | 30 | {:else if extension === '.yml' || extension === '.yaml'} 31 | 32 | {:else if extension === '.css'} 33 | 34 | {:else if extension === '.sass' || extension === 'scss'} 35 | 36 | {:else if extension === '.svg'} 37 | 38 | {:else} 39 | {@render fallback?.()} 40 | {/if} 41 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/file-icon/index.ts: -------------------------------------------------------------------------------- 1 | import FileIcon from './file-icon.svelte'; 2 | 3 | export { FileIcon }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/github/index.ts: -------------------------------------------------------------------------------- 1 | import StarButton from './star-button.svelte'; 2 | 3 | export { StarButton }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/github/star-button.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 25 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/input/index.ts: -------------------------------------------------------------------------------- 1 | import Root from './input.svelte'; 2 | 3 | export { 4 | Root, 5 | // 6 | Root as Input 7 | }; 8 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/input/input.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/kbd/index.ts: -------------------------------------------------------------------------------- 1 | import Kbd from './kbd.svelte'; 2 | 3 | export { Kbd }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/kbd/kbd.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 19 | {@render children()} 20 | 21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/light-switch/index.ts: -------------------------------------------------------------------------------- 1 | import LightSwitch from './light-switch.svelte'; 2 | 3 | export { LightSwitch }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/light-switch/light-switch.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/modal/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.19.1 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 12-12-2024 5 | */ 6 | 7 | import Modal from './modal.svelte'; 8 | 9 | export { Modal }; 10 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/modal/modal.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 30 | 31 | {#if isDesktop.current} 32 | 33 | 34 | {@render children()} 35 | 36 | 37 | {:else} 38 | 39 | 40 | {@render children()} 41 | 42 | 43 | {/if} 44 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/pagination/index.ts: -------------------------------------------------------------------------------- 1 | import Next from './next.svelte'; 2 | import Previous from './previous.svelte'; 3 | 4 | export { Next, Previous }; 5 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/pagination/next.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 19 | Next 20 | 23 | 24 |
    25 | {@render children()} 26 |
    30 |
    31 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/pagination/previous.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 19 | 22 | Previous 23 | 24 |
    25 |
    30 |
    31 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/scroll-area/index.ts: -------------------------------------------------------------------------------- 1 | import Scrollbar from './scroll-area-scrollbar.svelte'; 2 | import Root from './scroll-area.svelte'; 3 | 4 | export { 5 | Root, 6 | Scrollbar, 7 | //, 8 | Root as ScrollArea, 9 | Scrollbar as ScrollAreaScrollbar 10 | }; 11 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/scroll-area/scroll-area-scrollbar.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 25 | {@render children?.()} 26 | 29 | 30 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/scroll-area/scroll-area.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | {@render children?.()} 24 | 25 | {#if orientation === 'vertical' || orientation === 'both'} 26 | 27 | {/if} 28 | {#if orientation === 'horizontal' || orientation === 'both'} 29 | 30 | {/if} 31 | 32 | 33 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/search/index.ts: -------------------------------------------------------------------------------- 1 | import Search from './search.svelte'; 2 | 3 | export { Search }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/separator/index.ts: -------------------------------------------------------------------------------- 1 | import Root from './separator.svelte'; 2 | 3 | export { 4 | Root, 5 | // 6 | Root as Separator 7 | }; 8 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/separator/separator.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 23 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sheet/index.ts: -------------------------------------------------------------------------------- 1 | import { Dialog as SheetPrimitive } from 'bits-ui'; 2 | import Overlay from './sheet-overlay.svelte'; 3 | import Content from './sheet-content.svelte'; 4 | import Header from './sheet-header.svelte'; 5 | import Footer from './sheet-footer.svelte'; 6 | import Title from './sheet-title.svelte'; 7 | import Description from './sheet-description.svelte'; 8 | 9 | const Root = SheetPrimitive.Root; 10 | const Close = SheetPrimitive.Close; 11 | const Trigger = SheetPrimitive.Trigger; 12 | const Portal = SheetPrimitive.Portal; 13 | 14 | export { 15 | Root, 16 | Close, 17 | Trigger, 18 | Portal, 19 | Overlay, 20 | Content, 21 | Header, 22 | Footer, 23 | Title, 24 | Description, 25 | // 26 | Root as Sheet, 27 | Close as SheetClose, 28 | Trigger as SheetTrigger, 29 | Portal as SheetPortal, 30 | Overlay as SheetOverlay, 31 | Content as SheetContent, 32 | Header as SheetHeader, 33 | Footer as SheetFooter, 34 | Title as SheetTitle, 35 | Description as SheetDescription 36 | }; 37 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sheet/sheet-description.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sheet/sheet-footer.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    19 | {@render children?.()} 20 |
    21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sheet/sheet-header.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    19 | {@render children?.()} 20 |
    21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sheet/sheet-overlay.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sheet/sheet-title.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/constants.ts: -------------------------------------------------------------------------------- 1 | export const SIDEBAR_COOKIE_NAME = 'sidebar:state'; 2 | export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7; 3 | export const SIDEBAR_WIDTH = '16rem'; 4 | export const SIDEBAR_WIDTH_MOBILE = '18rem'; 5 | export const SIDEBAR_WIDTH_ICON = '3rem'; 6 | export const SIDEBAR_KEYBOARD_SHORTCUT = 'b'; 7 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-content.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    23 | {@render children?.()} 24 |
    25 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-footer.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    20 | {@render children?.()} 21 |
    22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-group-action.svelte: -------------------------------------------------------------------------------- 1 | 29 | 30 | {#if child} 31 | {@render child({ props: propObj })} 32 | {:else} 33 | 36 | {/if} 37 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-group-content.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    20 | {@render children?.()} 21 |
    22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-group-label.svelte: -------------------------------------------------------------------------------- 1 | 27 | 28 | {#if child} 29 | {@render child({ props: mergedProps })} 30 | {:else} 31 |
    32 | {@render children?.()} 33 |
    34 | {/if} 35 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-group.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    20 | {@render children?.()} 21 |
    22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-header.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    20 | {@render children?.()} 21 |
    22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-input.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-inset.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    23 | {@render children?.()} 24 |
    25 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-action.svelte: -------------------------------------------------------------------------------- 1 | 36 | 37 | {#if child} 38 | {@render child({ props: mergedProps })} 39 | {:else} 40 | 43 | {/if} 44 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-badge.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    28 | {@render children?.()} 29 |
    30 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-item.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
  • 20 | {@render children?.()} 21 |
  • 22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-skeleton.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 |
    27 | {#if showIcon} 28 | 29 | {/if} 30 | 35 | {@render children?.()} 36 |
    37 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-sub-button.svelte: -------------------------------------------------------------------------------- 1 | 36 | 37 | {#if child} 38 | {@render child({ props: mergedProps })} 39 | {:else} 40 | 41 | {@render children?.()} 42 | 43 | {/if} 44 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-sub-item.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |
  • 13 | {@render children?.()} 14 |
  • 15 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu-sub.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
      24 | {@render children?.()} 25 |
    26 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-menu.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
      20 | {@render children?.()} 21 |
    22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-provider.svelte: -------------------------------------------------------------------------------- 1 | 44 | 45 | 46 | 47 | 48 |
    57 | {@render children?.()} 58 |
    59 |
    60 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-rail.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 37 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-separator.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/sidebar/sidebar-trigger.svelte: -------------------------------------------------------------------------------- 1 | 19 | 20 | 35 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/skeleton/index.ts: -------------------------------------------------------------------------------- 1 | import Root from './skeleton.svelte'; 2 | 3 | export { 4 | Root, 5 | // 6 | Root as Skeleton 7 | }; 8 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/skeleton/skeleton.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 |
    18 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/snippet/index.ts: -------------------------------------------------------------------------------- 1 | import Snippet from './snippet.svelte'; 2 | import JsrepoSnippet from './jsrepo-snippet.svelte'; 3 | 4 | export { Snippet, JsrepoSnippet }; 5 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/snippet/jsrepo-snippet.svelte: -------------------------------------------------------------------------------- 1 | 14 | 15 |
    21 |
    22 | jsrepo 23 | {args.join(' ')} 24 |
    25 | 26 |
    27 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/snippet/snippet.svelte: -------------------------------------------------------------------------------- 1 | 22 | 23 |
    29 |
    30 | {cmd?.command} 31 | {cmd?.args.join(' ')} 32 |
    33 | 34 |
    35 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/index.ts: -------------------------------------------------------------------------------- 1 | import Root from './table.svelte'; 2 | import Body from './table-body.svelte'; 3 | import Caption from './table-caption.svelte'; 4 | import Cell from './table-cell.svelte'; 5 | import Footer from './table-footer.svelte'; 6 | import Head from './table-head.svelte'; 7 | import Header from './table-header.svelte'; 8 | import Row from './table-row.svelte'; 9 | 10 | export { 11 | Root, 12 | Body, 13 | Caption, 14 | Cell, 15 | Footer, 16 | Head, 17 | Header, 18 | Row, 19 | // 20 | Root as Table, 21 | Body as TableBody, 22 | Caption as TableCaption, 23 | Cell as TableCell, 24 | Footer as TableFooter, 25 | Head as TableHead, 26 | Header as TableHeader, 27 | Row as TableRow 28 | }; 29 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-body.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | {@render children?.()} 16 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-caption.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | {@render children?.()} 16 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-cell.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | {@render children?.()} 20 | 21 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-footer.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | {@render children?.()} 16 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-head.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 22 | {@render children?.()} 23 | 24 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-header.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | {@render children?.()} 16 | 17 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table-row.svelte: -------------------------------------------------------------------------------- 1 | 18 | 19 | 30 | {@render children?.()} 31 | 32 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/table/table.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 |
    15 | 16 | {@render children?.()} 17 |
    18 |
    19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/tabs/index.ts: -------------------------------------------------------------------------------- 1 | import { Tabs as TabsPrimitive } from 'bits-ui'; 2 | import Content from './tabs-content.svelte'; 3 | import List from './tabs-list.svelte'; 4 | import Trigger from './tabs-trigger.svelte'; 5 | 6 | const Root = TabsPrimitive.Root; 7 | 8 | export { 9 | Root, 10 | Content, 11 | List, 12 | Trigger, 13 | // 14 | Root as Tabs, 15 | Content as TabsContent, 16 | List as TabsList, 17 | Trigger as TabsTrigger 18 | }; 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/tabs/tabs-content.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/tabs/tabs-list.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 16 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/tabs/tabs-trigger.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/tooltip/index.ts: -------------------------------------------------------------------------------- 1 | import { Tooltip as TooltipPrimitive } from 'bits-ui'; 2 | import Content from './tooltip-content.svelte'; 3 | 4 | const Root = TooltipPrimitive.Root; 5 | const Trigger = TooltipPrimitive.Trigger; 6 | const Provider = TooltipPrimitive.Provider; 7 | 8 | export { 9 | Root, 10 | Trigger, 11 | Content, 12 | Provider, 13 | // 14 | Root as Tooltip, 15 | Content as TooltipContent, 16 | Trigger as TooltipTrigger, 17 | Provider as TooltipProvider 18 | }; 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/tooltip/tooltip-content.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 22 | -------------------------------------------------------------------------------- /sites/docs/src/lib/components/ui/video-player/index.ts: -------------------------------------------------------------------------------- 1 | import VideoPlayer from './video-player.svelte'; 2 | 3 | export { VideoPlayer }; 4 | -------------------------------------------------------------------------------- /sites/docs/src/lib/hooks/is-mobile.svelte.ts: -------------------------------------------------------------------------------- 1 | import { untrack } from 'svelte'; 2 | 3 | const MOBILE_BREAKPOINT = 768; 4 | 5 | export class IsMobile { 6 | #current = $state(false); 7 | 8 | constructor() { 9 | $effect(() => { 10 | return untrack(() => { 11 | const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`); 12 | const onChange = () => { 13 | this.#current = window.innerWidth < MOBILE_BREAKPOINT; 14 | }; 15 | mql.addEventListener('change', onChange); 16 | onChange(); 17 | return () => { 18 | mql.removeEventListener('change', onChange); 19 | }; 20 | }); 21 | }); 22 | } 23 | 24 | get current() { 25 | return this.#current; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/context.ts: -------------------------------------------------------------------------------- 1 | import type { Agent } from 'package-manager-detector'; 2 | import { persistedContext } from './persisted-context-provider'; 3 | import { context } from '$lib/utils/context-provider'; 4 | 5 | export const pmContext = persistedContext('package-manager', { persistValue: true }); 6 | 7 | export const commandContext = context('command-open'); 8 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/markdown.ts: -------------------------------------------------------------------------------- 1 | import MarkdownIt from 'markdown-it'; 2 | import { markdownItTable } from 'markdown-it-table'; 3 | import { highlighter } from '$lib/components/ui/code/shiki'; 4 | import { fromHighlighter } from '@shikijs/markdown-it/core'; 5 | 6 | let md: MarkdownIt | null = null; 7 | 8 | const markdownIt = async () => { 9 | if (md != null) return md; 10 | 11 | const newMd = MarkdownIt({ html: true }); 12 | 13 | const stripComments = (md: MarkdownIt) => { 14 | md.core.ruler.before('normalize', 'strip_comments', function (state) { 15 | state.src = state.src.replace(//g, ''); 16 | }); 17 | }; 18 | 19 | // plugins 20 | newMd.use(stripComments); 21 | newMd.use(markdownItTable); 22 | 23 | const hl = await highlighter; 24 | 25 | newMd.use( 26 | fromHighlighter(hl, { 27 | themes: { 28 | light: 'github-light-default', 29 | dark: 'github-dark-default' 30 | } 31 | }) 32 | ); 33 | 34 | md = newMd; 35 | 36 | return md; 37 | }; 38 | 39 | export { markdownIt }; 40 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/math/conversions.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.3.0 3 | Installed from github/ieedan/std 4 | 11-22-2024 5 | */ 6 | 7 | /** Converts degrees to radians 8 | * 9 | * @param degrees 10 | * @returns 11 | * 12 | * ## Usage 13 | * ```ts 14 | * dtr(180); // 3.14159268358979 15 | * ``` 16 | */ 17 | const dtr = (degrees: number): number => degrees * (Math.PI / 180); 18 | 19 | /** Converts radians to degrees 20 | * 21 | * @param radians 22 | * @returns 23 | * 24 | * ## Usage 25 | * ```ts 26 | * rtd(Math.PI); // 180 27 | * ``` 28 | */ 29 | const rtd = (radians: number): number => radians * (180 / Math.PI); 30 | 31 | export { dtr, rtd }; 32 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/math/fractions.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.3.0 3 | Installed from github/ieedan/std 4 | 11-22-2024 5 | */ 6 | 7 | import { gcf } from './gcf'; 8 | 9 | /** Simplifies the fraction 10 | * 11 | * @param numerator 12 | * @param denominator 13 | * @returns 14 | * 15 | * ## Usage 16 | * ```ts 17 | * simplify(1920, 1080).join(":"); // 16:9 18 | * ``` 19 | */ 20 | const simplify = (numerator: number, denominator: number): [number, number] => { 21 | const factor = gcf(numerator, denominator); 22 | 23 | return [numerator / factor, denominator / factor]; 24 | }; 25 | 26 | export { simplify }; 27 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/math/gcf.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.3.0 3 | Installed from github/ieedan/std 4 | 11-22-2024 5 | */ 6 | 7 | /** Solves the GCF (Greatest Common Factor) using the **Euclidean Algorithm** 8 | * 9 | * @param a 10 | * @param b 11 | * @returns 12 | * 13 | * ## Usage 14 | * ```ts 15 | * gcf(1920, 1080); // 120 16 | * gcf(2, 2); // 2 17 | * ``` 18 | */ 19 | const gcf = (a: number, b: number): number => { 20 | if (a === 0 || b === 0) throw new Error('Cannot get the GCF of 0'); 21 | 22 | // if they are negative we really just want the same thing 23 | let num1: number = Math.abs(a); 24 | let num2: number = Math.abs(b); 25 | 26 | while (num1 !== num2) { 27 | if (num1 > num2) { 28 | num1 -= num2; 29 | } else { 30 | num2 -= num1; 31 | } 32 | } 33 | 34 | return num1; 35 | }; 36 | 37 | /** Solves the GCD (Greatest Common Divisor) using the **Euclidean Algorithm** (Alternate alias of `gcf`) 38 | * 39 | * @param a 40 | * @param b 41 | * @returns 42 | * 43 | * ## Usage 44 | * ```ts 45 | * gcd(1920, 1080); // 120 46 | * gcd(2, 2); // 2 47 | * ``` 48 | */ 49 | const gcd = gcf; 50 | 51 | export { gcf, gcd }; 52 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/math/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.3.0 3 | Installed from github/ieedan/std 4 | 11-22-2024 5 | */ 6 | 7 | import * as circles from './circle'; 8 | import * as conversions from './conversions'; 9 | import * as fractions from './fractions'; 10 | import { gcd, gcf } from './gcf'; 11 | import * as triangles from './triangles'; 12 | export * from './types'; 13 | 14 | export { gcf, gcd, fractions, conversions, triangles, circles }; 15 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/math/types.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.3.0 3 | Installed from github/ieedan/std 4 | 11-22-2024 5 | */ 6 | 7 | export type Point = { 8 | x: number; 9 | y: number; 10 | }; 11 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/on-this-page.ts: -------------------------------------------------------------------------------- 1 | import { persistedContext } from './persisted-context-provider'; 2 | 3 | type Heading = { 4 | rank: 2 | 3 | 4 | 5 | 6; 5 | el: HTMLHeadingElement; 6 | children: Heading[]; 7 | }; 8 | 9 | type PageMap = { 10 | /** Only used on mount */ 11 | curr?: { 12 | path: string; 13 | headings: Heading[]; 14 | }; 15 | headings: Map; 16 | }; 17 | 18 | export const onThisPage = persistedContext('on-this-page'); 19 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/parse-package-name.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Adapted from https://github.com/egoist/parse-package-name/blob/main/src/index.ts 3 | * @module 4 | */ 5 | 6 | import { Err, Ok, type Result } from './types/result'; 7 | 8 | // Parsed a scoped package name into name, version, and path. 9 | const RE_SCOPED = /^(@[^/]+\/[^@/]+)(?:@([^/]+))?(\/.*)?$/; 10 | // Parsed a non-scoped package name into name, version, path 11 | const RE_NON_SCOPED = /^([^@/]+)(?:@([^/]+))?(\/.*)?$/; 12 | 13 | export type Package = { 14 | /** Name of the package as it would be installed from npm */ 15 | name: string; 16 | /** Version of the package */ 17 | version: string; 18 | path: string; 19 | }; 20 | 21 | const parsePackageName = (input: string): Result => { 22 | const m = RE_SCOPED.exec(input) || RE_NON_SCOPED.exec(input); 23 | 24 | if (!m) return Err(`invalid package name: ${input}`); 25 | 26 | return Ok({ 27 | name: m[1] || '', 28 | version: m[2] || 'latest', 29 | path: m[3] || '' 30 | }); 31 | }; 32 | 33 | export { parsePackageName }; 34 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/persisted-context-provider.ts: -------------------------------------------------------------------------------- 1 | import { getContext, setContext } from 'svelte'; 2 | import { writable, type Writable } from 'svelte/store'; 3 | import { persisted } from 'svelte-persisted-store'; 4 | 5 | type Options = { 6 | persistValue: boolean; 7 | }; 8 | 9 | export type PersistedContext = { 10 | init: (value: T) => Writable; 11 | get: () => Writable; 12 | }; 13 | 14 | export const persistedContext = ( 15 | key: string, 16 | { persistValue = false }: Partial = {} 17 | ): PersistedContext => { 18 | const keySymbol = Symbol(key); 19 | return { 20 | init: (value) => { 21 | let store: Writable; 22 | 23 | if (persistValue) { 24 | store = persisted(key, value); 25 | } else { 26 | store = writable(value); 27 | } 28 | 29 | const val = setContext(keySymbol, store); 30 | 31 | return val; 32 | }, 33 | get: () => getContext(keySymbol) 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/redis-client.ts: -------------------------------------------------------------------------------- 1 | import { UPSTASH_REDIS_TOKEN, UPSTASH_REDIS_URL } from '$env/static/private'; 2 | import { Redis } from '@upstash/redis'; 3 | 4 | export const VIEW_SET_NAME = 'view'; 5 | 6 | const redis = new Redis({ 7 | url: UPSTASH_REDIS_URL, 8 | token: UPSTASH_REDIS_TOKEN 9 | }); 10 | 11 | export { redis }; 12 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/server-actions/search-registries/client.ts: -------------------------------------------------------------------------------- 1 | import * as v from 'valibot'; 2 | 3 | export const schema = v.object({ 4 | search: v.string() 5 | }); 6 | -------------------------------------------------------------------------------- /sites/docs/src/lib/ts/server-actions/search-registries/server.ts: -------------------------------------------------------------------------------- 1 | import { getProviderState } from '$lib/ts/registry'; 2 | import { fail, redirect, type RequestEvent } from '@sveltejs/kit'; 3 | import { selectProvider } from 'jsrepo'; 4 | import { message, setError, superValidate } from 'sveltekit-superforms'; 5 | import { valibot } from 'sveltekit-superforms/adapters'; 6 | import { schema } from './client'; 7 | 8 | export const action = async (event: RequestEvent) => { 9 | const form = await superValidate(event, valibot(schema)); 10 | if (!form.valid) { 11 | return fail(400, { 12 | form 13 | }); 14 | } 15 | 16 | const provider = selectProvider(form.data.search); 17 | 18 | if (!provider) { 19 | return setError(form, 'search', 'Invalid registry url'); 20 | } 21 | 22 | const registryUrl = form.data.search; 23 | 24 | // this prevents infinite loading state if you are already on the same page 25 | if (event.url.pathname === '/registry' && event.url.searchParams.get('url') === registryUrl) { 26 | return message(form, 'You are already there!'); 27 | } 28 | 29 | // just gets the state and sets the cache 30 | await getProviderState(registryUrl, provider, { cache: true }); 31 | 32 | throw redirect(303, `/registry?url=${registryUrl}`); 33 | }; 34 | -------------------------------------------------------------------------------- /sites/docs/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from 'clsx'; 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /sites/docs/src/lib/utils/context-provider.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.29.1 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 1-28-2025 5 | */ 6 | 7 | import { getContext, setContext } from 'svelte'; 8 | import { writable, type Writable } from 'svelte/store'; 9 | 10 | /** A context provider to safely share state across your app 11 | * 12 | * ## Usage 13 | * ``` 14 | * const myContext = context('my-context-key'); 15 | * ``` 16 | */ 17 | export type Context = { 18 | /** Call this to initialize context at the parent component root. 19 | * 20 | * ## Usage 21 | * ```svelte 22 | * 25 | * ``` 26 | */ 27 | init: (value: T) => Writable; 28 | /** Call this to retrieve the context at the child component root. 29 | * 30 | * ## Usage 31 | * ```svelte 32 | * 35 | * ``` 36 | */ 37 | get: () => Writable; 38 | }; 39 | 40 | /** Creates a new Context instance. 41 | * 42 | * ## Usage 43 | * ``` 44 | * const myContext = context('my-context-key'); 45 | * ``` 46 | */ 47 | export const context = (key: string): Context => { 48 | return { 49 | init: (value) => setContext(key, writable(value)), 50 | get: () => getContext(key) 51 | }; 52 | }; 53 | -------------------------------------------------------------------------------- /sites/docs/src/lib/utils/utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | jsrepo 1.32.0 3 | Installed from github/ieedan/shadcn-svelte-extras 4 | 2-6-2025 5 | */ 6 | 7 | import { type ClassValue, clsx } from 'clsx'; 8 | import { twMerge } from 'tailwind-merge'; 9 | 10 | export function cn(...inputs: ClassValue[]) { 11 | return twMerge(clsx(inputs)); 12 | } 13 | -------------------------------------------------------------------------------- /sites/docs/src/routes/+error.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |
    7 |
    8 |
    9 | {#if page.status === 404} 10 |

    11 | {page.status} 12 |

    13 |

    Page Not Found

    14 |

    15 | Sorry we couldn't find what you were looking for! 16 |

    17 | {:else} 18 |

    19 | {page.status} 20 |

    21 | {/if} 22 |
    23 | 24 |
    25 |
    26 | -------------------------------------------------------------------------------- /sites/docs/src/routes/+layout.server.ts: -------------------------------------------------------------------------------- 1 | import { GITHUB_TOKEN } from '$env/static/private'; 2 | import { Err, Ok, type Result } from '$lib/ts/types/result'; 3 | import { Octokit } from 'octokit'; 4 | 5 | export const load = async () => { 6 | const octokit = new Octokit({ auth: GITHUB_TOKEN }); 7 | 8 | const repo = await octokit.rest.repos.get({ owner: 'ieedan', repo: 'jsrepo' }); 9 | 10 | const version = (await tryGetVersion()).unwrapOr('1.0.0'); 11 | 12 | return { 13 | version, 14 | stars: repo.data.stargazers_count 15 | }; 16 | }; 17 | 18 | const tryGetVersion = async (): Promise> => { 19 | try { 20 | const response = await fetch( 21 | 'https://raw.githubusercontent.com/ieedan/jsrepo/refs/heads/main/packages/cli/package.json' 22 | ); 23 | 24 | if (!response.ok) { 25 | return Err('Error getting version'); 26 | } 27 | 28 | const { version } = await response.json(); 29 | 30 | return Ok(version); 31 | } catch (err) { 32 | return Err(`Error getting version: ${err}`); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /sites/docs/src/routes/+page.server.ts: -------------------------------------------------------------------------------- 1 | import { superValidate } from 'sveltekit-superforms'; 2 | import { valibot } from 'sveltekit-superforms/adapters'; 3 | import { schema } from '$lib/ts/server-actions/search-registries/client'; 4 | import { redis, VIEW_SET_NAME } from '$lib/ts/redis-client'; 5 | import { action } from '$lib/ts/server-actions/search-registries/server'; 6 | 7 | export const load = async () => { 8 | const ranked = await redis.zrange(VIEW_SET_NAME, 0, -1, { 9 | rev: true, 10 | count: 4, 11 | offset: 0 12 | }); 13 | 14 | const form = await superValidate(valibot(schema)); 15 | 16 | return { 17 | form, 18 | popular: ranked 19 | }; 20 | }; 21 | 22 | export const actions = { 23 | default: action 24 | }; 25 | -------------------------------------------------------------------------------- /sites/docs/src/routes/docs/cli/+page.svelte: -------------------------------------------------------------------------------- 1 | 42 | 43 | 44 | 45 | 46 | 47 | Name 48 | Description 49 | 50 | 51 | 52 | {#each commands as { name, description }} 53 | goto(`/docs/cli/${name}`)}> 54 | 55 | {name} 56 | 57 | {description} 58 | 59 | {/each} 60 | 61 | 62 | -------------------------------------------------------------------------------- /sites/docs/src/routes/docs/cli/auth/+page.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | Usage 10 | 11 | Options 12 | 13 | {#snippet description()} 14 | The token to use for authenticating to your provider. 15 | {/snippet} 16 | {#snippet usage()} 17 | 18 | {/snippet} 19 | 20 | 21 | {#snippet description()} 22 | The provider to store the token for. (github, gitlab, 23 | bitbucket, azure). 24 | {/snippet} 25 | {#snippet usage()} 26 | 27 | {/snippet} 28 | 29 | 30 | {#snippet description()} 31 | Changes to an interactive logout where you choose the provider to remove the token from. 32 | {/snippet} 33 | {#snippet usage()} 34 | 35 | {/snippet} 36 | 37 | 38 | {#snippet description()} 39 | Help with the command. 40 | {/snippet} 41 | {#snippet usage()} 42 | 43 | {/snippet} 44 | 45 | -------------------------------------------------------------------------------- /sites/docs/src/routes/docs/cli/option-docs.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 |
    17 |
    18 | {name} 19 | {#if deprecated} 20 | Deprecated 21 | {/if} 22 |
    23 |

    {@render description()}

    24 |

    Usage

    25 | {@render usage?.()} 26 |
    27 | -------------------------------------------------------------------------------- /sites/docs/src/routes/docs/git-providers/azure-devops/+page.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | Branches and Tags 10 |

    11 | Because the AzureDevops URL structure doesn't 12 | include enough information to fetch raw files we have to use a custom structure so copy pasting the 13 | URL from the homepage like you can for other providers won't just work. 14 |

    15 |

    Instead you need to follow the following format:

    16 | ///(tags|heads)/`} /> 17 | 24 | Using Tags for Versioning 25 |

    26 | Tags can be a great solution to ensuring remote tests and blocks stay on a consistent version. 27 |

    28 | 43 |

    44 | Tags do not however work like npm packages. Tags are completely mutable meaning a malicious 45 | registry could publish over a tag with different code. 46 |

    47 |

    This is why it's always important to make sure you trust the owner of the registry.

    48 | -------------------------------------------------------------------------------- /sites/docs/src/routes/docs/setup/+page.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | Guides 20 |
    21 | {#each guides as { name, href, description }} 22 | 26 |
    27 |

    {name}

    28 |

    {description}

    29 |
    30 |
    31 | {/each} 32 |
    33 |
    34 | 43 |
    44 | -------------------------------------------------------------------------------- /sites/docs/src/routes/registry/+layout.server.ts: -------------------------------------------------------------------------------- 1 | import { schema } from '$lib/ts/server-actions/search-registries/client'; 2 | import { superValidate } from 'sveltekit-superforms'; 3 | import { valibot } from 'sveltekit-superforms/adapters'; 4 | 5 | export const load = async () => { 6 | const form = await superValidate(valibot(schema)); 7 | 8 | return { 9 | form 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /sites/docs/src/routes/registry/+layout.svelte: -------------------------------------------------------------------------------- 1 | 35 | 36 |
    37 |
    38 | 56 | 57 |
    58 |
    59 | {@render children()} 60 |
    61 | -------------------------------------------------------------------------------- /sites/docs/src/routes/registry/+page.server.ts: -------------------------------------------------------------------------------- 1 | import { error, redirect } from '@sveltejs/kit'; 2 | import { selectProvider } from 'jsrepo'; 3 | import { getProviderState, getRegistryData } from '$lib/ts/registry/index.js'; 4 | import { redis, VIEW_SET_NAME } from '$lib/ts/redis-client.js'; 5 | import { action } from '$lib/ts/server-actions/search-registries/server.js'; 6 | import { dev } from '$app/environment'; 7 | 8 | export const load = async ({ url }) => { 9 | const registryUrl = url.searchParams.get('url'); 10 | 11 | if (registryUrl == null) throw redirect(303, '/registries'); 12 | 13 | const provider = selectProvider(registryUrl); 14 | 15 | if (!provider) throw redirect(303, '/registries'); 16 | 17 | const state = await getProviderState(registryUrl, provider, { cache: true }); 18 | 19 | const pageData = await getRegistryData(state); 20 | 21 | if (!pageData) { 22 | throw error(404, { message: 'registry-search: Could not find the requested registry' }); 23 | } 24 | 25 | if (!dev) { 26 | await redis.zincrby(VIEW_SET_NAME, 1, registryUrl); 27 | } 28 | 29 | return { 30 | ...pageData, 31 | registryUrl 32 | }; 33 | }; 34 | 35 | export const actions = { 36 | default: action 37 | }; 38 | -------------------------------------------------------------------------------- /sites/docs/src/routes/registry/+page.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sites/docs/static/demos/update-w-ai.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkhorse374/JavaScript/ea6d998d7a826d9a25201e029da2cd8c4ba42bbb/sites/docs/static/demos/update-w-ai.mp4 -------------------------------------------------------------------------------- /sites/docs/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkhorse374/JavaScript/ea6d998d7a826d9a25201e029da2cd8c4ba42bbb/sites/docs/static/favicon.png -------------------------------------------------------------------------------- /sites/docs/static/llms.txt: -------------------------------------------------------------------------------- 1 | # jsrepo Documentation for LLMs 2 | 3 | > jsrepo is a CLI that aims to make sharing your code easy and lightweight. It builds your code into a registry and allows you to download it from the CLI a lot like shadcn-ui. 4 | 5 | ## Package Documentation 6 | 7 | - [jsrepo CLI](https://jsrepo.dev/docs/cli/llms.txt) 8 | 9 | ## Provider Support 10 | 11 | jsrepo supports multiple ways of serving your registry, you can host your registry on GitHub, GitLab, BitBucket, Azure DevOps or on your own domain. 12 | 13 | ## Language Support 14 | 15 | - JavaScript (*.js) 16 | - TypeScript (*.ts) 17 | - JSX (*.jsx) 18 | - TSX (*.tsx) 19 | - Svelte (*.svelte) 20 | - Vue (*.vue) 21 | - YAML (*.(yaml|yml)) 22 | - JSON (*.(json|jsonc)) 23 | - CSS (*.css) 24 | - SVG (*.svg) 25 | - SASS (*.(sass|scss)) 26 | - HTML (*.html) 27 | -------------------------------------------------------------------------------- /sites/docs/svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-vercel'; 2 | import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; 3 | 4 | /** @type {import('@sveltejs/kit').Config} */ 5 | const config = { 6 | preprocess: vitePreprocess(), 7 | kit: { 8 | // https://svelte.dev/docs/kit/adapter-vercel 9 | adapter: adapter() 10 | } 11 | }; 12 | 13 | export default config; 14 | -------------------------------------------------------------------------------- /sites/docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.svelte-kit/tsconfig.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "checkJs": true, 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "resolveJsonModule": true, 9 | "skipLibCheck": true, 10 | "sourceMap": true, 11 | "strict": true, 12 | "moduleResolution": "bundler" 13 | } 14 | // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias 15 | // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files 16 | // 17 | // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes 18 | // from the referenced tsconfig.json - TypeScript does not merge them in 19 | } 20 | -------------------------------------------------------------------------------- /sites/docs/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { sveltekit } from '@sveltejs/kit/vite'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | plugins: [sveltekit()] 6 | }); 7 | --------------------------------------------------------------------------------