GithubHelp home page GithubHelp logo

gog's Introduction

GoG

Learning Grammar of Graphics

vite-vanilla-ts-lib-starter

The starter is built on top of Vite 5.x and prepared for writing libraries in TypeScript. It generates a hybrid package - both support for CommonJS and ESM modules.

Features

  • Hybrid support - CommonJS and ESM modules
  • IIFE bundle for direct browser support without bundler
  • Typings bundle
  • ESLint - scripts linter
  • Stylelint - styles linter
  • Prettier - formatter
  • Vitest - test framework
  • Husky + lint-staged - pre-commit git hook set up for formatting

GitHub Template

This is a template repo. Click the green Use this template button to get started.

Clone to local

If you prefer to do it manually with the cleaner git history

git clone https://github.com/kbysiec/vite-vanilla-ts-lib-starter.git
cd vite-vanilla-ts-lib-starter
npm i

Checklist

When you use this template, update the following:

  • Remove .git directory and run git init to clean up the history
  • Change the name in package.json - it will be the name of the IIFE bundle global variable and bundle files name (.cjs, .mjs, .iife.js, d.ts)
  • Change the author name in LICENSE
  • Clean up the README and CHANGELOG files

And, enjoy :)

Usage

The starter contains the following scripts:

  • dev - starts dev server
  • build - generates the following bundles: CommonJS (.cjs) ESM (.mjs) and IIFE (.iife.js). The name of bundle is automatically taken from package.json name property
  • test - starts vitest and runs all tests
  • test:coverage - starts vitest and run all tests with code coverage report
  • lint:scripts - lint .ts files with eslint
  • lint:styles - lint .css and .scss files with stylelint
  • format:scripts - format .ts, .html and .json files with prettier
  • format:styles - format .cs and .scss files with stylelint
  • format - format all with prettier and stylelint
  • prepare - script for setting up husky pre-commit hook
  • uninstall-husky - script for removing husky from repository

Acknowledgment

If you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.

Thank you.

gog's People

Contributors

kbysiec avatar zhouchangju avatar olitreadwell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.