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

ava-styleguide

v1.2.17

Published

Style guide for Ava Technology LLC

Downloads

39

Readme

styleguide

npm install ava-styleguide

Thanks for all the downloads, but we're just using this to push some components and Bootstrap overrides downstream to multiple projects, in an attempt to get design system consistency. For this reason it had to be public. This approach will change and is probably not useful to anyone outside our company, so sorry.

bootstrap will be added along with override file

(New Project Only) Create a new scss file named "styleguide.scss" in the root directory

Add an import to styleguide.scss

@import './node_modules/ava-styleguide/styleguide.scss';

(New Project Only) Add the scss script to package.json file in main project

"scss": "sass override.scss compiled-bootstrap/override-bootstrap.css"
npm run scss

a new folder named compiled-bootstrap with a file named override-bootstrap.css will populate at root of project

(New Project Only) add imports to main.js order is important

import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'
import '../compiled-bootstrap/override-bootstrap.css'

after any updates are made to the package here, then do this in the app repo which uses this:

npm update --save ava-styleguide
npm run scss

API Usage

ListApiPlugin

in main.js file:

import listApiPlugin from 'ava-styleguide/js/plugin/ListApiPlugin.js'
const listConfigs = [
	{ envVariable: import.meta.env.VITE_APP_LISTS_BASE_URL, listName: '<list name here>'}
]
app.use(listApiPlugin, listConfigs)

In your component

methods: {
	async getData() {
		const listApi = this.$listApis['<above listname in listConfigs here>']
		const response = await listApi.getAll()
		console.log(response.d.results)
	}
}

Use in Pinia store

in your main.js file after app.use(listApiPlugin, listConfigs)

export const listApi = app.config.globalProperties.$listApis['<listName from listConfigs>']

in your pinia store

import { listApi } from '../main.js'

call it in a function/actions

const response = await listApi.getAll()

UserApiPlugin

in main.js file:

import userApiPlugin from 'ava-styleguide/js/plugin/UserApiPlugin.js'
const userConfigs = [
	{ envVariable: import.meta.env.VITE_APP_USER_BASE_URL, key: '<unique key name here>'}
]
app.use(userApiPlugin, userConfigs)

In your component

methods: {
	async getUserData() {
		const userApi = this.$userApis['<above key in userConfigs here>']
		const response = await userApi.getCurrentUser()
		console.log(response.d)
	}
}

Use in Pinia store

in your main.js file after app.use(listApiPlugin, listConfigs)

export const userApi = app.config.globalProperties.$userApis['<key from userConfigs>']

in your pinia store

import { userApi } from '../main.js'

call it in a function/actions

const response = await userApi.getCurrentUser()

LegacyUserApiPlugin

in main.js file:

import legacyUserApiPlugin from 'ava-styleguide/js/plugin/LegacyUserApiPlugin.js'
const legacyUserConfigs = [
	{ envVariable: process.env.VUE_APP_USER_BASE_URL, key: '<unique key name here>'}
]
app.use(legacyUserApiPlugin, legacyUserConfigs)

In your component

methods: {
	async getUserData() {
		const userApi = this.$legacyUserApis['<above key in userConfigs here>']
		const response = await userApi.getCurrentUser()
		console.log(response.d)
	}
}

Use in Pinia store

in your main.js file after app.use(listApiPlugin, listConfigs)

export const legacyUserApi = app.config.globalProperties.$legacyUserApis['<key from legacyUserConfigs>']

in your pinia store

import { legacyUserApi } from '../main.js'

call it in a function/actions

const response = await legacyUserApi.getCurrentUser()

Update styleguide.scss

after adding the components or classes you want to populate in the styleguide -push changes to github

npm version <major, minor, patch>

you need a contributor npm account to run these, verify on https://www.npmjs.com/package/ava-styleguide/access ``sh npm publish

then push the new puiblished version to github again

(example patch push)

git push npm version patch npm publish git push