0.4.3 • Published 4 months ago

@turnipxenon/pineapple2 v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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.

  1. 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'
  1. 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>
  1. 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

Current steps how to use this package in another project

  1. Create using Skeleton: https://next.skeleton.dev/docs/get-started/installation/sveltekit
  2. Follow instructions and skeleton UI package
  3. Install pineapple2
  4. Set up ModeWatcher and Modals, primarily in +layout.svelte
  5. Set up ParaglideJS internationalization (beta not SvelteKit)
  6. 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

  1. In pineapple2, run yarn link
  2. In seaweed2, run yarn unlink @turnipxenon/pineapple2

To unlink:

  1. In seaweed2, run yarn unlink @turnipxenon/pineapple2
  2. In pineapple2, run yarn unlink
  3. If unlinking, remember to restart PC cause Windows symlinking is tricky
0.4.3

4 months ago

0.4.2

4 months ago

0.4.1

4 months ago

0.4.0

4 months ago

0.3.4

4 months ago

0.3.3

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.3.0

4 months ago

0.2.2

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago