npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cewald/nuxt-boilerplate-layer

v1.6.5

Published

Personal boilerplate layer for nuxt projects

Downloads

624

Readme

@cewald/nuxt-boilerplate-layer

This is a personal-preference boilerplate for Nuxt projects which can be implement as a Nuxt layer into a plain project. It has a bunch of features and is published as a NPM package.

Configs

You can set all configruations in your nuxt.config.ts over the boilerplate config-name. A full list of configurations, you can see in the module/index.ts of the main local module of the boilerplate-layer.

Features

Installed modules

  • @nuxt/eslint
  • @nuxtjs/fontaine
  • @nuxtjs/google-fonts
  • @nuxtjs/i18n (optional)
  • @nuxtjs/tailwindcss
  • @pinia/nuxt
  • nuxt-svgo

Installed packages (peer-deps)

  • dayjs
  • storyblok-js-client (optional)
  • @vueuse/core
  • @cewald/eslint-config

Composables

  • useScreen: TailwindCSS based media-query helper which uses the project TW config
  • useDayJs: dayjs lib composable
  • useHideWhileScrolling: hide elements while scrolling is in progress
  • useLoadScript: helper to load and init external scripts
  • useLocalizedRoute: helper to modify and transform paths using vue-i18n

Utils

  • cloneDeep
  • lazyloadPicture: lazyload picture elements using intersection-observer

Storyblok

There are a lot functionalities around the Storyblok API and javascript SDK.

Typescript types auto-generation and -import

This module can automatically generate types from the components of your Storyblok space using their management API, which you then can use in your project for typesafety. You'll have to supply your space-id and oAuth token using the configs or environment variables.

Components

  • SbPictureComponent: A component to serve SbImage images as they are stored in Storyblok
  • SbRichtextComponent: A component to serve SbRichtText content from Storyblok

Stores

  • SbStoreFactory: A one-line factory for typed Storyblok stores in your project
  • SbStoreUtilityFactory: The utility-factory that SbStoreFactory is using, in case you need a more granular implementation of your store

Composables

  • useStoryblokApiStore: Pinia store for an initialized StoryblokClient
  • useRichTextResolver: Tooling to resolve structured-data Storyblok strings into HTML

Prerendering

If you are using prerendering for specific routes this module can automatically load content URLs of specific component-types from Storyblok and add them using addPrerenderRoutes.

Installation

  1. Just install the package using your package manager:
    npm i -D @cewald/nuxt-boilerplate-layer
  2. Add the layer to your nuxt.config.ts:
    export default defineNuxtConfig({
    extends: [ '@cewald/nuxt-boilerplate-layer' ],
    boilerplate: {
     // custom configs ...
    }
    //...
    })

License

This project is licensed under the GNU General Public License v3.0.


Troubleshooting

Use global types as root generic type parameters of defineProps

If you want to use global types as root generic type parameters of defineProps like defineProps<MyComponentProps> Vue is going to drop an exception like: ERROR Pre-transform error: [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type. This is a bug in Nuxt/Vue and made ticket in their tracker for it: https://github.com/nuxt/nuxt/issues/29757

Until it is solved, you can bypass this problem by using this syntax:

const { propType } = defineProps<{ propType: MyGlobalPropType }>()