@turnipxenon/pineapple2 v0.4.3
sv
Everything you need to build a Svelte project, powered by sv
.
Creating a project
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
Developing
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Building
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.
Installing as a package
yarn add @turnipxenon2/pineapple2
Manual steps
We still have to do some manual set up to our project to make it work.
- Configure Tailwind. Open your global stylesheet in
/src/app.css
and add the following imports:
@import 'tailwindcss';
@import '@skeletonlabs/skeleton/optional/presets';
@import '@skeletonlabs/skeleton';
@import '@skeletonlabs/skeleton/themes/cerberus';
@import '../node_modules/@turnipxenon/pineapple2/dist/styles/app.css';
@plugin '@tailwindcss/forms';
@plugin '@tailwindcss/typography';
@source '../node_modules/@skeletonlabs/skeleton-svelte/dist';
@source '../node_modules/@turnipxenon/pineapple2/dist/styles'
- Set Active Theme. Open /src/app.html, then set the data-theme attribute on the HTML tag to define the active theme.
<html lang="en" data-theme="turnip">
...
</html>
- We have to setup +layout.svelte to and import some dependencies
As a reference as to why we need to do above, we use the UI framework Skeleton, which has the same setup. But, we have to make some modifications to make our project and Skeleton to work as a package.
Reference
- https://next.skeleton.dev/docs/get-started/installation/sveltekit
https://inlang.com/m/gerre34r/library-inlang-paraglideJs/sveltekit
Just use skeleton or use the base project?
Current steps how to use this package in another project
- Create using Skeleton: https://next.skeleton.dev/docs/get-started/installation/sveltekit
- Follow instructions and skeleton UI package
- Install pineapple2
- Set up ModeWatcher and Modals, primarily in +layout.svelte
- Set up ParaglideJS internationalization (beta not SvelteKit)
- Add this to
+layout.svelte
<script lang="ts">
import { PinyaPageLayout, PinyaBase } from '@turnipxenon/pineapple2';
import '../app.css';
let { children } = $props();
</script>
<PinyaBase>
<PinyaPageLayout>
{@render children()}
</PinyaPageLayout>
</PinyaBase>
TODO: if we are happy with our base, publish it to github and link the corresponding git commits here
Local linking
- In pineapple2, run
yarn link
- In seaweed2, run
yarn unlink @turnipxenon/pineapple2
To unlink:
- In seaweed2, run
yarn unlink @turnipxenon/pineapple2
- In pineapple2, run
yarn unlink
- If unlinking, remember to restart PC cause Windows symlinking is tricky
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago