8.4.1 • Published 10 months ago

@gb-nx/svelte v8.4.1

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

@gb-nx/svelte

This library was generated with Nx.

CI npm version

See the NX Discussion of first class support for Sveltekit. You may not need this plugin.

Nx Plugin for managing svelte-kit applications in your Nx workspace

Features

Here is a list of some of the coolest features of the plugin:

  • ✅ You work with the routes and components and the plugin manages boilerplate
  • ✅ Building, testing, linting your projects

Prerequisite

If you have not already, create an Nx workspace with the following:

# npm
npx create-nx-workspace@latest

# yarn
yarn create nx-workspace@latest

Getting Started

Then you need to install the plugin in order to work with svelte applications later on.

Installing Plugin

nx add @gb-nx/svelte

Generating Project

The plugin will create an Nx project for an existing svelte-kit application. Do so with commands similar to the following

npx create-nx-workspace@latest sample-workspace --preset apps
cd sample-workspace/apps
npm create svelte@latest web
cd web
npm install
cd ..\..
nx g @gb-nx/svelte:application web
nx build web
nx lint web
nx test web

Add a route

nx g @gb-nx/svelte:route admin/[area] --project web
OptionTypeDescription
namestringThe name of the route.
projectstringThe Svelte project to target.
directorystringDirectory where the generated files are placed.
skipFormatbooleanSkip formatting files.
skipTestsbooleanDo not create 'spec' test file for the route.
languagestringRoute script language (ts/js).
stylestringRoute style language (css/scss).
loadstringSource of data for your load function
runesbooleanUse svelte runes (requires svelte >=5)

Add a component

nx g @gb-nx/svelte:component SocialMedia --project web
OptionTypeDescription
namestringThe name of the component.
projectstringThe Svelte project to target.
directorystringDirectory where the component is placed, relative to your Svelte project lib folder.
skipFormatbooleanSkip formatting files.
languagestringComponent script language (ts/js).
stylestringComponent style language (css/scss).
runesbooleanUse svelte runes (requires svelte >=5)

Add a lib dependency

The generator will

  • add an alias to your svelte.config.js for importing a workspace library in your SvelteKit application
  • add an implicit dependency to the SvelteKit project
nx g @gb-nx/svelte:dependency --project web --dependency my-lib
OptionTypeDescription
projectstringThe project to add the dependency src to
dependencystringThe dependent project to add
scopestringThe scope to prepend to the dependency name for the alias name (without the @)
skipFormatbooleanSkip formatting files.

Migrations

This plugin supports Nx migrations and provides necessary version and code updates. So instead of bumping plugin version manually in package.json it's recommended to run nx migrate @gb-nx/svelte command, that includes bumping the version of the @gb-nx/svelte plugin, related dependencies and running code migrations.

@gb-nx/svelte & Nx Compatibility Chart

@gb-nx/svelte versionNx version
^8.0.0>=17.0.0
^6.0.0^17.0.0
^5.0.0^16.0.0
<5.0.0^15.0.0

License

MIT

8.4.1

10 months ago

8.4.0

10 months ago

8.3.0-alpha.2

10 months ago

8.3.0-alpha.3

10 months ago

8.3.0-alpha.5

10 months ago

8.3.0-alpha.0

10 months ago

8.3.2

10 months ago

8.3.1

10 months ago

8.2.0

1 year ago

8.3.0

10 months ago

8.1.0

1 year ago

8.1.2

1 year ago

8.1.1

1 year ago

8.1.1-alpha.2

1 year ago

8.1.1-alpha.1

1 year ago

8.1.0-alpha.1

1 year ago

8.1.0-alpha.3

1 year ago

8.1.0-alpha.2

1 year ago

8.0.1

1 year ago

8.0.0

1 year ago

8.0.0-alpha.0

1 year ago

0.0.0-e.0

1 year ago

7.0.1

1 year ago

7.0.0-alpha.7

1 year ago

7.0.0-alpha.8

1 year ago

7.0.0

1 year ago

7.0.0-alpha.1

1 year ago

7.0.0-alpha.6

1 year ago

7.0.0-alpha.3

1 year ago

7.0.0-alpha.2

1 year ago

7.0.0-alpha.5

1 year ago

6.4.5

1 year ago

6.4.4

1 year ago

6.4.7

1 year ago

6.4.6

1 year ago

6.4.9

1 year ago

6.4.8

1 year ago

6.4.10

1 year ago

6.4.12

1 year ago

6.4.11

1 year ago

6.3.0

1 year ago

6.4.3

1 year ago

6.4.2

1 year ago

6.4.1

1 year ago

6.4.0

1 year ago

6.2.0-alpha.3

1 year ago

6.2.0-alpha.2

1 year ago

6.2.0-alpha.1

1 year ago

6.1.0

1 year ago

6.1.2

1 year ago

6.1.4

1 year ago

6.1.3

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

5.3.1

2 years ago

5.3.0

2 years ago

5.3.0-alpha.0

2 years ago

5.2.2

2 years ago

5.2.1

2 years ago

5.2.0

2 years ago

5.0.0-0

2 years ago

5.1.0

2 years ago

5.1.0-2

2 years ago

5.1.0-0

2 years ago

4.0.3-0

2 years ago

4.1.0-0

2 years ago

5.0.0

2 years ago

4.1.0

2 years ago

4.0.0-alpha.1

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.2

2 years ago

3.5.0

2 years ago

3.4.0

2 years ago

3.3.1

2 years ago

3.3.2

2 years ago

2.0.0-alpha.7

3 years ago

2.0.0-alpha.8

3 years ago

2.0.0-alpha.9

3 years ago

2.0.0-alpha.11

3 years ago

2.0.0-alpha.3

3 years ago

2.0.2

3 years ago

2.0.0-alpha.10

3 years ago

2.0.0-alpha.4

3 years ago

3.0.0-alpha.1

3 years ago

2.0.0-alpha.5

3 years ago

3.0.0-alpha.0

3 years ago

2.0.0-alpha.6

3 years ago

2.0.0-alpha.1

3 years ago

2.0.0-alpha.2

3 years ago

2.0.0-alpha.14

3 years ago

2.0.1

3 years ago

2.0.0-alpha.13

3 years ago

2.0.0

3 years ago

2.0.0-alpha.12

3 years ago

3.2.0

2 years ago

3.3.0-alpha.2

2 years ago

3.3.0-alpha.1

2 years ago

3.0.0

3 years ago

3.3.0-alpha.6

2 years ago

3.3.0-alpha.5

2 years ago

3.3.0-alpha.4

2 years ago

3.3.0-alpha.3

2 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

2.1.0

3 years ago

3.3.0

2 years ago

3.1.0

2 years ago

1.5.0-alpha.2

3 years ago

1.5.0-alpha.17

3 years ago

1.5.0-alpha.16

3 years ago

1.5.0-alpha.13

3 years ago

1.5.0-alpha.3

3 years ago

1.5.0-alpha.12

3 years ago

1.5.0-alpha.4

3 years ago

1.5.0-alpha.15

3 years ago

1.5.0-alpha.5

3 years ago

1.5.0-alpha.14

3 years ago

1.5.0-alpha.7

3 years ago

1.5.0-alpha.8

3 years ago

1.5.0-alpha.11

3 years ago

1.5.0-alpha.9

3 years ago

1.5.0-alpha.10

3 years ago

1.5.0-alpha.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago