Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: Lint
run: pnpm lint

- name: Astro & Svelte Check
run: pnpm check
# - name: Astro & Svelte Check
# run: pnpm check

tests:
name: Test
Expand Down Expand Up @@ -66,4 +66,3 @@ jobs:

- name: Test
run: pnpm test

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
| [playground](packages/playground) | Development playground to experiment with svelte-cloudinary |
| [docs](packages/docs) | Source for the [docs](https://svelte.cloudinary.dev) |


## Contributing & Setup

Please take a look at our [guide](./CONTRIBUTING.md).
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_CLOUDINARY_CLOUD_NAME=
VITE_CLOUDINARY_CLOUD_NAME=""
1 change: 1 addition & 0 deletions packages/playground/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_CLOUDINARY_CLOUD_NAME=""
VITE_CLOUDINARY_API_KEY=""
CLOUDINARY_API_SECRET=""
40 changes: 18 additions & 22 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,27 @@
"build": "vite build",
"preview": "vite preview",
"lint": "prettier --check .",
"format": "prettier --write ."
"format": "prettier --write .",
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/kit": "^2.8.1",
"@sveltejs/vite-plugin-svelte": "4.0.0",
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
"@tailwindcss/typography": "^0.5.15",
"autoprefixer": "^10.4.20",
"cloudinary": "^2.5.1",
"@sveltejs/adapter-auto": "^7.0.1",
"@sveltejs/kit": "^2.53.4",
"@sveltejs/vite-plugin-svelte": "6.2.4",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.2.1",
"cloudinary": "^2.9.0",
"gooey": "^0.3.2",
"highlight.js": "^11.10.0",
"postcss": "^8.4.49",
"postcss-load-config": "^6.0.1",
"postcss-nesting": "^13.0.1",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.8",
"shiki": "^1.22.2",
"svelte": "^5.2.0",
"prettier": "^3.8.1",
"prettier-plugin-svelte": "^3.5.1",
"shiki": "^4.0.1",
"svelte": "^5.53.7",
"svelte-check": "^4.0.7",
"svelte-cloudinary": "workspace:^",
"svelte-highlight": "^7.7.0",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^3.4.15",
"svelte-highlight": "^7.9.0",
"tailwindcss": "^4.2.1",
"tslib": "^2.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.11"
"typescript": "^5.9.3",
"vite": "^7.3.1"
}
}
}
11 changes: 0 additions & 11 deletions packages/playground/postcss.config.cjs

This file was deleted.

90 changes: 90 additions & 0 deletions packages/playground/src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/* Write your global styles here, in PostCSS syntax */
@import 'tailwindcss';

@plugin '@tailwindcss/typography';

@custom-variant dark (&:where(.dark, .dark *));

@custom-variant dark (&:where(.dark, .dark *));

@theme {
--breakpoint-*: initial;
--breakpoint-sm: 640px;
--breakpoint-md: 768px;
--breakpoint-lg: 1024px;
--breakpoint-xl: 1280px;

--font-*: initial;
--font-display: inter, sans-serif;

--tracking-*: initial;
--tracking-tight: -0.015em;

--color-dark: #111;
}

@theme {
--breakpoint-*: initial;
--breakpoint-sm: 640px;
--breakpoint-md: 768px;
--breakpoint-lg: 1024px;
--breakpoint-xl: 1280px;

--font-*: initial;
--font-display: inter, sans-serif;

--tracking-*: initial;
--tracking-tight: -0.015em;

--color-dark: #111;
}

/*
The default border color has changed to `currentcolor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.

If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentcolor);
}
}

@utility btn {
@apply px-4 py-2 bg-blue-500 text-white rounded-xs border border-blue-500 hover:bg-blue-600 hover:border-blue-600 focus:outline-hidden focus:ring-2 focus:ring-blue-500 transition-colors duration-200;

&.outline {
@apply bg-transparent text-blue-500 hover:bg-blue-500 hover:text-white;
}
}

@utility outline {
&.btn {
@apply bg-transparent text-blue-500 hover:bg-blue-500 hover:text-white;
}
}

/*
The default border color has changed to `currentcolor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.

If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentcolor);
}
}
14 changes: 0 additions & 14 deletions packages/playground/src/app.postcss

This file was deleted.

2 changes: 1 addition & 1 deletion packages/playground/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import '../app.postcss';
import '../app.css';
</script>

<div class="flex items-center gap-4 p-4">
Expand Down
6 changes: 3 additions & 3 deletions packages/playground/src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { createHighlighterCore } from 'shiki/core';
import serendipity from '$lib/code/serendipity';
import svelte from 'shiki/langs/svelte.mjs';
import getWasm from 'shiki/wasm';
import { createOnigurumaEngine } from 'shiki';

export async function load() {
return {
highlighter: await createHighlighterCore({
loadWasm: getWasm,
langs: [svelte],
engine: createOnigurumaEngine(import('shiki/wasm')),
themes: [serendipity],
langs: [svelte],
}),
};
}
2 changes: 2 additions & 0 deletions packages/playground/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
{
value: 'fill',
onChange(type) {
// @ts-expect-error type mismatch
props.crop!.type = type.value;
},
},
Expand All @@ -207,6 +208,7 @@
{
value: 'center',
onChange(gravity) {
// @ts-expect-error type mismatch
props.crop!.gravity = gravity.value;
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const POST = async ({ request }) => {
);
return json({ signature });
} catch (e) {
return error(500, `${error}`);
return error(500, `${e}`);
}
};
2 changes: 1 addition & 1 deletion packages/playground/src/routes/test/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let:open
let:isLoading>
<button
class="disabled:opacity-60 disabled:cursor-not-allowed rounded-md bg-indigo-500 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500"
class="disabled:opacity-60 disabled:cursor-not-allowed rounded-md bg-indigo-500 px-2.5 py-1.5 text-sm font-semibold text-white shadow-xs hover:bg-indigo-400 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500"
on:click={() => open()}
disabled={isLoading}>
Open the widget
Expand Down
4 changes: 3 additions & 1 deletion packages/playground/src/routes/widget/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@
</button>
</CldUploadWidget>

<button class="btn outline" on:click={() => (img = null)}> Clear </button>
<button class="btn outline-solid" on:click={() => (img = null)}>
Clear
</button>
</div>
10 changes: 1 addition & 9 deletions packages/playground/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';

/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte'],

// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [
vitePreprocess(),
preprocess({
postcss: true,
}),
],
preprocess: vitePreprocess(),

kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
Expand Down
27 changes: 0 additions & 27 deletions packages/playground/tailwind.config.js

This file was deleted.

5 changes: 3 additions & 2 deletions packages/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"rewriteRelativeImportExtensions": true,
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
Expand All @@ -9,7 +10,7 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "Bundler",
"noEmit": true
"moduleResolution": "bundler",
"verbatimModuleSyntax": true
}
}
3 changes: 2 additions & 1 deletion packages/playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [sveltekit()],
plugins: [sveltekit(), tailwindcss()],
});
20 changes: 10 additions & 10 deletions packages/svelte-cloudinary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ High-performance image delivery and uploading at scale in Svelte powered by Clou

## ✨ Features

- Automatically optimize images and deliver in modern formats
- Remove backgrounds from images
- Dynamically add image and text overlays to images
- AI-based cropping and resizing
- Transform images using color and effects
- Generate Open Graph Social Media cards on the fly
- ...all at scale with Cloudinary
- Automatically optimize images and deliver in modern formats
- Remove backgrounds from images
- Dynamically add image and text overlays to images
- AI-based cropping and resizing
- Transform images using color and effects
- Generate Open Graph Social Media cards on the fly
- ...all at scale with Cloudinary

## 🚀 Getting Started

### Installation

- Install `svelte-cloudinary` with:
- Install `svelte-cloudinary` with:

```bash
npm install svelte-cloudinary
```

We support Svelte v3, v4, v5 (compatibility mode), and SvelteKit!

- Add an environment variable with your Cloud Name:
- Add an environment variable with your Cloud Name:

```bash
VITE_CLOUDINARY_CLOUD_NAME="<Your Cloud Name>"
Expand All @@ -68,7 +68,7 @@ https://svelte.cloudinary.dev

## ❤️ Community & Support

- [GitHub: Create an Issue](https://github.com/cloudinary-community/svelte-cloudinary/issues/new)
- [GitHub: Create an Issue](https://github.com/cloudinary-community/svelte-cloudinary/issues/new)

## 🛠 Contributing

Expand Down
Loading