Skip to content

Commit d2c429a

Browse files
authored
chore: Update vite-plugin-tailwind-purgecss and PurgeCSS docs (#2604)
1 parent 4d6d409 commit d2c429a

File tree

12 files changed

+520
-219
lines changed

12 files changed

+520
-219
lines changed

.changeset/stupid-foxes-switch.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-skeleton-app": patch
3+
---
4+
5+
chore: Updated purgecss plugin template

packages/create-skeleton-app/package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-skeleton-app",
3-
"version": "0.0.53",
3+
"version": "0.0.54",
44
"description": "Use this CLI app to setup a new Skeleton application in a new SvelteKit project.",
55
"keywords": [
66
"skeleton",
@@ -30,7 +30,8 @@
3030
"scripts": {
3131
"prep": "node scripts/prepare-templates.mjs && pnpm format",
3232
"tw": "node scripts/tw.mjs",
33-
"dev": "node src/index.js -p=../../../atest --skeletontemplatedir=../../templates/",
33+
"dev": "node src/index.js -p=../../../_test --skeletontemplatedir=../../templates/",
34+
"short": "node src/index.js",
3435
"long": "node src/index.js --types=typescript --prettier --eslint --playwright=false --vitest=false --codeblocks=true --popups=true --typography=false --forms=false -t crimson --skeletontemplate=welcome",
3536
"pub:beta": "pnpm prep && npm publish --tag beta",
3637
"pub:rc": "pnpm prep && npm publish --tag rc",
@@ -41,9 +42,9 @@
4142
"dependencies": {
4243
"@clack/prompts": "^0.7.0",
4344
"columnify": "^1.6.0",
44-
"create-svelte": "^5.0.6",
45-
"fast-glob": "^3.3.1",
46-
"fs-extra": "^11.1.1",
45+
"create-svelte": "^6.0.0",
46+
"fast-glob": "^3.3.2",
47+
"fs-extra": "^11.2.0",
4748
"got": "^13.0.0",
4849
"json5": "^2.2.3",
4950
"kleur": "^4.1.5",
@@ -52,7 +53,7 @@
5253
},
5354
"devDependencies": {
5455
"archiver": "^6.0.1",
55-
"eslint": "^8.49.0",
56-
"eslint-config-prettier": "^9.0.0"
56+
"eslint": "^8.55.0",
57+
"eslint-config-prettier": "^9.1.0"
5758
}
5859
}

packages/create-skeleton-app/pnpm-lock.yaml

+47-42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/create-skeleton-app/src/creator.js

+6-24
Original file line numberDiff line numberDiff line change
@@ -182,27 +182,21 @@ function createSvelteConfig(opts) {
182182
// For some reason create-svelte will turn off preprocessing for jsdoc and no type checking
183183
// this will break the using of all CSS preprocessing as well, which is undesirable.
184184
// Here we will just return the typescript default setup
185-
const mdsvexConfig = `import { mdsvex } from 'mdsvex'
186-
187-
/** @type {import('mdsvex').MdsvexOptions} */
188-
const mdsvexOptions = {
189-
extensions: ['.md'],
190-
}`;
185+
191186
const inspectorConfig = `
192187
vitePlugin: {
193188
inspector: true,
194189
},`;
195190

196191
let str = `import adapter from '@sveltejs/adapter-auto';
197-
import { vitePreprocess } from '@sveltejs/kit/vite';
198-
${iit(opts.mdsvex, mdsvexConfig)}
192+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
199193
200194
/** @type {import('@sveltejs/kit').Config} */
201195
const config = {
202-
extensions: ['.svelte'${iit(opts.mdsvex, `, '.md'`)}],
196+
extensions: ['.svelte'],
203197
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
204198
// for more information about preprocessors
205-
preprocess: [${iit(opts.mdsvex, 'mdsvex(mdsvexOptions),')} vitePreprocess()],
199+
preprocess: [vitePreprocess()],
206200
${iit(opts.inspector, inspectorConfig)}
207201
kit: {
208202
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
@@ -222,21 +216,9 @@ import { sveltekit } from '@sveltejs/kit/vite';
222216
import { defineConfig } from 'vite';
223217
224218
export default defineConfig({
225-
plugins: [sveltekit(), purgeCss(`;
226-
227-
if (opts.codeblocks) {
228-
contents += `{
229-
safelist: {
230-
// any selectors that begin with "hljs-" will not be purged
231-
greedy: [/^hljs-/],
232-
},
233-
}),
234-
],
235-
});`;
236-
} else {
237-
contents += `)]
219+
plugins: [sveltekit(), purgeCss()]
238220
});`;
239-
}
221+
240222
writeFileSync(filename, contents);
241223
}
242224

packages/create-skeleton-app/src/utils.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@ export function getHelpText() {
143143
Description: 'Install codeblock optional dependencies',
144144
},
145145
{ Option: '--popups', Short: '', 'Quiet Default': 'false', Value: 'true|false', Description: 'Install popups dependencies' },
146-
{
147-
Option: '--mdsvex',
148-
Short: '',
149-
'Quiet Default': 'false',
150-
Value: 'true|false',
151-
Description: 'Install mdsvex for markdown processing',
152-
},
153146
{ Option: '--forms', Short: '', 'Quiet Default': 'false', Value: 'true|false', Description: 'Install Tailwinds Forms plugin' },
154147
{
155148
Option: '--typography',
@@ -172,6 +165,7 @@ export function getHelpText() {
172165
Value: 'skeleton',
173166
Description: 'Choose one for the Skeleton theme',
174167
},
168+
{ Option: '', Short: '', 'Quiet Default': 'wintry', Value: 'wintry', Description: '' },
175169
{ Option: '', Short: '', 'Quiet Default': 'modern', Value: 'modern', Description: '' },
176170
{ Option: '', Short: '', 'Quiet Default': 'hamlindigo', Value: 'hamlindigo', Description: '' },
177171
{ Option: '', Short: '', 'Quiet Default': 'rocket', Value: 'rocket', Description: '' },

packages/create-skeleton-app/templates/skeleton-template-bare/src/routes/+page.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- YOU CAN DELETE EVERYTHING IN THIS PAGE -->
22

3-
<div class="container h-screen mx-auto flex justify-center items-center">
3+
<div class="container h-full mx-auto flex justify-center items-center">
44
<div class="space-y-5">
55
<h1 class="h1">Let's get cracking bones!</h1>
66
<p>Start by exploring:</p>

packages/skeleton/src/lib/components/InputChip/InputChip.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
return allowDuplicates || !value.includes(chip);
198198
}
199199
200-
function validate(chip: string = ''): boolean {
200+
function validate(chip = ''): boolean {
201201
if (!chip && !input) return false;
202202
// Format: trim value
203203
chip = chip !== '' ? chip.trim() : input.trim();

sites/skeleton.dev/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@floating-ui/dom": "^1.2.9",
2828
"@skeletonlabs/skeleton": "workspace:*",
2929
"@skeletonlabs/tw-plugin": "workspace:*",
30-
"@sveltejs/adapter-vercel": "^3.0.1",
30+
"@sveltejs/adapter-vercel": "^3.1.0",
3131
"@sveltejs/kit": "^1.20.2",
3232
"@tailwindcss/forms": "^0.5.3",
3333
"@tailwindcss/typography": "^0.5.9",
@@ -52,7 +52,7 @@
5252
"tslib": "^2.5.3",
5353
"typescript": "^5.0.3",
5454
"vite": "^4.3.9",
55-
"vite-plugin-tailwind-purgecss": "^0.1.4",
55+
"vite-plugin-tailwind-purgecss": "^0.3.0",
5656
"vitest": "^0.32.0"
5757
},
5858
"type": "module"

0 commit comments

Comments
 (0)