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

siegel

v0.15.4

Published

Web application development ecosystem

Downloads

2,229

Readme

Siegel is a higly opiniated SPA development platform to build and host any scale projects in a simple way

Features:

  • Preconfigured and easily extendable Webpack bundler:

    • ESBuild to transform TypeScript and JSX syntaxes
    • Code linting with ESLint
    • Hot Modules Replace for scripts and styles
    • SASS with typed CSS modules
    • Build and serve site assets compressed with Brotli or GZIP
    • SVG icons to font converter
  • ExpressJS static server:

    • HTTP(S)1 / HTTP(S)2. +Script to create dev certificates to use in Chrome on localhost
  • Utils and modules to use on client side:

    • Big set of React components
    • Easy configurable Router
    • React global state manager built on top of react hooks
    • Optional fetch module to track requests statuses with
    • Network services to make requests and minimal client WebSocket implementation
  • Demo project with already themed components, predefined folder structure and scalable architecture built on top of Siegel It gives you a quick start right after initialization!

  • Global TS utility types that you may import. They could be usefull while you are building your React project

Read more about each part following the links below:

Simple usage

npm i siegel

Create app.js file:

import { createRoot } from 'react-dom/client'

const root = document.getElementById('root')
createRoot(root)
    .render('Hello Siegel!')

Bootstrap the app with the next command:

npx siegel run

Now your application is hosting on localhost:3000 in watch mode and ready for development!

You may also define NodeJS dev server using --server flag:

// server.js

function appServer(app, { express }) {
    console.log('Custom server is ready')
}

module.exports = appServer

In console run:

npx siegel run --server server.js 

Run npx siegel To get list of Siegel CLI commands

Usage

import siegel from 'siegel'

siegel(config, runParams)

Or just pass an entry point to react app and it will do everything else for you:

import siegel from 'siegel'

siegel('/path/to/js_entry.ts')

Config

Build configuration Server configuration

{   
    /*
        Affects both server(as public dir to be served),
        and client_build(as webpack output folder).
        Default is: path.join(process.cwd(), 'dist')
    */
    publicDir: String,

    /* Static server configuration. */
    server: Object,

    /* Build configuration. */
    build: Object
}

runParams

{   
    /* Run static server. Default is true */
    isServer: Boolean,

    /* Build a project. Default is true */
    isBuild: Boolean,

    /* Run siegel in production mode. Default is false */
    isProd: Boolean
}

Demo project init

Quick way to start your development journey with everything you need right after project initialization is Demo project. You may init the demo project having Siegel installed localy:

npx siegel init

Here we initialize a demo project in a current dirrectory along with package.json (if not yet exists) Now you have project skeleton with preconfigured Siegel in it! Use various npm commands from the new package.json to perform build, code validation and static serving in development or production modes Bootstrap newly created project with:

npm start

More about demo project read here

VSCode tweaks

{
    "typescript.tsdk": "./node_modules/typescript/lib",
    "eslint.useFlatConfig": true
}

typescript.tsdk - to tell TS extension to load ts plugins from your tsconfig.json

eslint.useFlatConfig - to tell ESLint to use .js config file extension by default

Siegel development

In case you've cloned this repo:

To build siegel run:

npm run __transpile

To start a local development with provided Demo Application run:

npm start