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

@relateit/react-vite-starter

v0.0.5

Published

1. Gets the git project. (Auto run installation)

Downloads

9

Readme

React Vite Starter

Getting started

  1. Gets the git project. (Auto run installation)
  npx @relateit/react-vite-starter my-app
  1. Start the dev server. And open http://127.0.0.1:5173/ in your browser.
  yarn dev
  1. Build your product.
  yarn build

Dependencies

  • React
  • Vite
  • Typescript
  • eslint
  • Prettier
  • @apollo/client
  • Graphql
  • React router dom
  • i18next

Features

  • Localization

This boilerplate supports localization with built-in support for i18next. The localization files can be found under the public/locales directory, where you can add JSON files for as many languages as needed.

import * as React from 'react';
import { useTranslation } from 'react-i18next';

const Nav: React.FC = () => {
    const { t, i18n } = useTranslation();

    const changeLanguage = (lng: string) => {
        i18n.changeLanguage(lng);
    };

    return (
        <div className="App-header">
            <button
                className="mr-2 cursor-pointer rounded-md p-2 text-primary shadow-md"
                onClick={() => changeLanguage(t('lang') === 'en' ? 'dk' : 'en')}
            >
                {t('lang') === 'en' ? 'dk' : 'en'}
            </button>
        </div>
    );
};
  • Routing

Routing is handled using the react-router-dom library. This allows for declarative routing and navigation within the application. Different routes are defined using the Route component, and the routing hierarchy is structured using the Routes and Route components.

import { ApolloProvider } from '@apollo/client';
import { client } from 'Apollo';
import { Layout } from 'Components/Layout';
import { Home, Login } from 'Pages';
import * as React from 'react';
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom';
import RoutePaths from './RoutePath';

const App: React.FC = () => {
    return (
        <ApolloProvider client={client}>
            <Router>
                <Routes>
                    <Route path={RoutePaths.Login} element={<Login />} />

                    <Route element={<Layout />}>
                        <Route path={RoutePaths.Home} element={<Home />} />
                        <Route path={RoutePaths.About} element={<Home />} />
                    </Route>
                </Routes>
            </Router>
        </ApolloProvider>
    );
};

export default App;

Performance

  • fast development server
$ yarn dev

  VITE v4.3.9  ready in 675 ms

  ➜  Local:   http://127.0.0.1:5173/
  ➜  Network: use --host to expose
  ➜  press h to show help
  • fast build speed
$ yarn build

yarn run v1.22.18

$ tsc && vite build
vite v4.3.9 building for production...
✓ 335 modules transformed.
dist/index.html                   0.87 kB │ gzip:   0.43 kB
dist/assets/index-cb041eaa.css    7.51 kB │ gzip:   2.24 kB
dist/assets/index-a068d449.js   394.47 kB │ gzip: 120.52 kB
✓ built in 3.52s
Done in 6.64s.