diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 964ffa6e8..693f193a2 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -15,62 +15,62 @@ name: Docs - Preview Deployment on: - pull_request_target: - paths: - - apps/www/** + pull_request_target: + paths: + - apps/www/** # cancel in-progress runs on new commits to same PR (github.event.number) concurrency: - group: ${{ github.workflow }}-${{ github.event.number || github.sha }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true jobs: - deploy-preview: - permissions: - contents: read - pull-requests: write - deployments: write - runs-on: ubuntu-latest - name: Deploy Preview to Cloudflare Pages (admin) - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - - uses: pnpm/action-setup@v2 - with: - version: 8 - - uses: actions/setup-node@v3 - with: - node-version: 20 + deploy-preview: + permissions: + contents: read + pull-requests: write + deployments: write + runs-on: ubuntu-latest + name: Deploy Preview to Cloudflare Pages (admin) + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v3 + with: + node-version: 20 - # PNPM Store cache setup - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - - name: Setup pnpm cache - uses: actions/cache@v3 - with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + # PNPM Store cache setup + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - - name: Install dependencies - run: pnpm install + - name: Install dependencies + run: pnpm --filter www install - - name: Build site - run: pnpm build + - name: Build site + run: pnpm build - - name: Deploy to Cloudflare Pages - id: cloudflare-pages-deploy - uses: AdrianGonz97/refined-cf-pages-action@v1 - with: - apiToken: ${{ secrets.CF_API_TOKEN }} - accountId: ${{ secrets.CF_ACCOUNT_ID }} - githubToken: ${{ secrets.GITHUB_TOKEN }} - projectName: shadcn-svelte - directory: ./.svelte-kit/cloudflare - workingDirectory: apps/www - deploymentName: Preview + - name: Deploy to Cloudflare Pages + id: cloudflare-pages-deploy + uses: AdrianGonz97/refined-cf-pages-action@v1 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectName: shadcn-svelte + directory: ./.svelte-kit/cloudflare + workingDirectory: apps/www + deploymentName: Preview diff --git a/.github/workflows/docs-production.yml b/.github/workflows/docs-production.yml index c401169ff..e0244036d 100644 --- a/.github/workflows/docs-production.yml +++ b/.github/workflows/docs-production.yml @@ -1,55 +1,55 @@ name: Docs Production Deployment on: - push: - branches: - - main - paths: - - apps/www/** + push: + branches: + - main + paths: + - apps/www/** concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - deployments: write - name: Publish to Cloudflare Pages - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 - - uses: actions/setup-node@v3 - with: - node-version: 20 + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v3 + with: + node-version: 20 - # PNPM Store cache setup - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - - name: Setup pnpm cache - uses: actions/cache@v3 - with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + # PNPM Store cache setup + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - - name: Install dependencies - run: pnpm install + - name: Install dependencies + run: pnpm --filter www install - - name: Build site - run: pnpm build + - name: Build site + run: pnpm build - - name: Deploy to Cloudflare Pages - uses: AdrianGonz97/refined-cf-pages-action@v1 - with: - apiToken: ${{ secrets.CF_API_TOKEN }} - accountId: ${{ secrets.CF_ACCOUNT_ID }} - githubToken: ${{ secrets.GITHUB_TOKEN }} - projectName: shadcn-svelte - directory: ./.svelte-kit/cloudflare - workingDirectory: apps/www - deploymentName: Production + - name: Deploy to Cloudflare Pages + uses: AdrianGonz97/refined-cf-pages-action@v1 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectName: shadcn-svelte + directory: ./.svelte-kit/cloudflare + workingDirectory: apps/www + deploymentName: Production diff --git a/apps/www/static/registry/styles/default/carousel.json b/apps/www/static/registry/styles/default/carousel.json index 9af4841d3..2e9143757 100644 --- a/apps/www/static/registry/styles/default/carousel.json +++ b/apps/www/static/registry/styles/default/carousel.json @@ -29,7 +29,7 @@ }, { "name": "context.ts", - "content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI = NonNullable<\n\tNonNullable[\"on:emblaInit\"]\n> extends (evt: CustomEvent) => void\n\t? CarouselAPI\n\t: never;\n\ntype EmblaCarouselConfig = NonNullable[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable;\n\tcanScrollPrev: Readable;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable;\n\tplugins: Writable;\n\tonInit: (e: CustomEvent) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a component`);\n\t}\n\treturn getContext>(EMBLA_CAROUSEL_CONTEXT);\n}\n" + "content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI =\n\tNonNullable[\"on:emblaInit\"]> extends (\n\t\tevt: CustomEvent\n\t) => void\n\t\t? CarouselAPI\n\t\t: never;\n\ntype EmblaCarouselConfig = NonNullable[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable;\n\tcanScrollPrev: Readable;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable;\n\tplugins: Writable;\n\tonInit: (e: CustomEvent) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a component`);\n\t}\n\treturn getContext>(EMBLA_CAROUSEL_CONTEXT);\n}\n" }, { "name": "index.ts", diff --git a/apps/www/static/registry/styles/new-york/carousel.json b/apps/www/static/registry/styles/new-york/carousel.json index 304e28ad0..ec1dda011 100644 --- a/apps/www/static/registry/styles/new-york/carousel.json +++ b/apps/www/static/registry/styles/new-york/carousel.json @@ -29,7 +29,7 @@ }, { "name": "context.ts", - "content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI = NonNullable<\n\tNonNullable[\"on:emblaInit\"]\n> extends (evt: CustomEvent) => void\n\t? CarouselAPI\n\t: never;\n\ntype EmblaCarouselConfig = NonNullable[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable;\n\tcanScrollPrev: Readable;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable;\n\tplugins: Writable;\n\tonInit: (e: CustomEvent) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a component`);\n\t}\n\treturn getContext>(EMBLA_CAROUSEL_CONTEXT);\n}\n" + "content": "import type { EmblaCarouselSvelteType } from \"embla-carousel-svelte\";\nimport type emblaCarouselSvelte from \"embla-carousel-svelte\";\nimport { getContext, hasContext, setContext } from \"svelte\";\nimport type { HTMLAttributes } from \"svelte/elements\";\nimport type { Writable, Readable } from \"svelte/store\";\n\nexport type CarouselAPI =\n\tNonNullable[\"on:emblaInit\"]> extends (\n\t\tevt: CustomEvent\n\t) => void\n\t\t? CarouselAPI\n\t\t: never;\n\ntype EmblaCarouselConfig = NonNullable[1]>;\n\nexport type CarouselOptions = EmblaCarouselConfig[\"options\"];\nexport type CarouselPlugins = EmblaCarouselConfig[\"plugins\"];\n\n////\n\nexport type CarouselProps = {\n\topts?: CarouselOptions;\n\tplugins?: CarouselPlugins;\n\tapi?: CarouselAPI;\n\torientation?: \"horizontal\" | \"vertical\";\n} & HTMLAttributes;\n\nconst EMBLA_CAROUSEL_CONTEXT = Symbol(\"EMBLA_CAROUSEL_CONTEXT\");\n\ntype EmblaContext = {\n\tapi: Writable;\n\torientation: Writable<\"horizontal\" | \"vertical\">;\n\tscrollNext: () => void;\n\tscrollPrev: () => void;\n\tcanScrollNext: Readable;\n\tcanScrollPrev: Readable;\n\thandleKeyDown: (e: KeyboardEvent) => void;\n\toptions: Writable;\n\tplugins: Writable;\n\tonInit: (e: CustomEvent) => void;\n};\n\nexport function setEmblaContex(config: EmblaContext): EmblaContext {\n\tsetContext(EMBLA_CAROUSEL_CONTEXT, config);\n\treturn config;\n}\n\nexport function getEmblaContext(name = \"This component\") {\n\tif (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {\n\t\tthrow new Error(`${name} must be used within a component`);\n\t}\n\treturn getContext>(EMBLA_CAROUSEL_CONTEXT);\n}\n" }, { "name": "index.ts", diff --git a/package.json b/package.json index f90c35017..a5e7ffefd 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "check": "pnpm --filter www check", "check:watch": "pnpm --filter www check:watch", "test:unit": "pnpm --filter www test:unit", - "lint": "pnpm -r lint", + "lint": "pnpm --filter www --filter shadcn-svelte lint", "format:check": "pnpm -r format:check", "format": "pnpm -r format", "preinstall": "npx only-allow pnpm",