Socket
Socket
Sign inDemoInstall

feature-sliced-svelte

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    feature-sliced-svelte

Control of FSD with Svelte


Version published
Maintainers
1
Install size
15.4 kB
Created

Readme

Source

Feature Sliced Svelte

Useful utilities for maintaining a project on Svelte according to the Feature Sliced Design architecture.

Usage

First, install the package.

npm install --save-dev feature-sliced-svelte

Then wrap the root (App) element of your application in a FeatureSlicedDebug component.

<script>
  import { FeatureSlicedDebug } from 'feature-sliced-svelte'
</script>

<FeatureSlicedDebug />
<div>
  <!-- your app code -->
</div>

Layers

Now when creating a new component, use action to set the FSD layer. The allowed layer names can be found in the FSD documentation.

<script>
  import { fsd } from 'feature-sliced-svelte'
</script>

<div use:fsd={'widgets/UserList'}>
  <!-- your widget code -->
</div>

Debugging

To start or disable Feature Sliced Design debugging mode, press the key combination: Ctrl + Shift + F

Developing

Once you've installed dependencies withpnpm install, start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Everything inside src/lib is part of library, everything inside src/routes used as a showcase.

Building

To build library:

npm run package

To create a production version of showcase app:

npm run build

You can preview the production build with npm run preview.

Keywords

FAQs

Last updated on 14 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc