GithubHelp home page GithubHelp logo

swig-cli-init's Introduction

swig-cli-init

An npm script to setup a swig-cli project in an opinionated way with ESM and typescript support.

Requirements

Node.js >= 20 or Volta.

Pnpm is also recommended, but not required.

Script Setup Actions

  • Create package.json if not present
  • Set package.json type to module
  • Detect valid Node.js version (>= 20)
    • If Volta detected, run volta pin node@20
    • If Node.js version is less than 20, throw an error stating the requirement
  • Add tsconfig.json if not present
  • Detect if pnpm is installed
  • Install dev dependencies, latest versions (using pnpm, if detected):
    • swig-cli
    • typescript
    • tsx
    • @mikeyt23/node-cli-utils
    • @types/node@20
  • Create swigfile.ts if not present

Usage

Run this command in the directory you want your swig project initialized in:

npx swig-cli-init@latest

Notes

This script is re-runnable, so it can also act as an updater since it installs the latest versions of dev dependencies and skips steps that are already complete.

The pnpm package manager is preferred and will be used if it is detected as installed, but it not required.

Roadmap and Ideas

  • Add additional options:
    • Output directory
    • Which Node package manager to use
    • ESM vs CommonJS
    • Typescript vs vanilla javascript
    • Tsx vs ts-node for typescript loader
    • Specific version of Node
    • Whether or not to include the Node types
    • Whether or not to include the '@mikeyt23/node-cli-utils' package
    • Whether or not to include swig-cli-modules
  • Additional integration tests

swig-cli-init's People

Contributors

mikey-t 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.