siegel v0.15.8
Siegel is a higly opiniated CSR SPA development platform to build and host any scale projects in a simple way
Features:
Preconfigured and easily extendable
Webpackbundler:ESBuildto transformTypeScriptandJSXsyntaxes- Code linting with
ESLint Hot Modules Replacefor scripts and stylesSASSwithtyped CSS modules- Build and serve site assets compressed with
BrotliorGZIP SVG icons to fontconverter
ExpressJSstatic server:HTTP(S)1 / HTTP(S)2. +Script to create dev certificates to use in Chrome on localhost
Utilsandmodulesto use on client side:- Big set of
React components - Easy configurable
Router - React
global state managerbuilt on top ofreact hooks - Optional
fetch moduleto track requests statuses with Networkservices to makerequestsand minimal clientWebSocketimplementation
- Big set of
Demo projectwith 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 typesthat 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 siegelCreate app.ts 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 runNow 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.ts
import type { ServerExtenderFn, ExpressExtenderParams } from 'siegel'
const appServer: ServerExtenderFn = params => {
const { express, staticServer } = params as ExpressExtenderParams
staticServer
.use(express.json())
}
export default appServerTo bootstrap the app with server defined - run the next command:
npx siegel run --server server.tsSiegel provides a command to initialize mini project along with server and app files we created above:
npx siegel init -sTo list all the available Siegel CLI commands and flags: npx siegel
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 initHere we have initialized a demo project in a current dirrectory along with package.json (if not yet created)
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 startProbably you don't need to initialize a big project to play with code.
For this reason you may init minimal project passing -m as argument to the siegel init command.
Only client side React entry file and tsconfig will be created.
Optionally you may also pass -s parameter to create server extender file.
npm init -m -sTo run mini project use npm start_client if created without server extender.
Otherwise use 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 __transpileTo start a local development with provided Demo Application run:
npm start12 months ago
12 months ago
10 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago