Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
siroc
Advanced tools
Readme
siroc
is a zero-config but extensible framework for developing Node applications and libraries
siroc
is still a work in progress. Feedback is welcome, and changes will be frequent.
Just install siroc
.
# You can install siroc as a development dependency
yarn add siroc --dev
# ... or install globally
yarn global add siroc
You can configure siroc
by creating a siroc.config.ts
, siroc.config.js
or siroc.config.json
file at the same level as your package.json
.
In a monorepo, any configuration options at the root level are inherited by your workspaces, though of course you can override them.
import { defineSirocConfig } from 'siroc'
export default defineSirocConfig({
// fully typed options
})
siroc build
siroc
knows what to build based on your package.json
.
By default, siroc
will build your src/index.js
or src/index.ts
file into whatever output file is specified in your package.json's main
field.
If you have specified additional binaries, siroc
will look for input files matching their names.
Under the hood, siroc
uses rollup
and esbuild
to build and produce type definitions for your files.
If you have enabled yarn workspaces, siroc will build each of your workspaces. You can choose to build only some of these by specifying what to build.
yarn siroc build @mypackage/cli
You can build in watch mode, which will rebuild as necessary when source files change:
yarn siroc build --watch
At the most basic level, your entrypoints are configured in your package.json
:
bin
(see npm docs)main
, module
and browser
(see npm docs)types
if you want a TS declaration file to be generated for your main/module/browser entrypointsexports
(see npm docs)There are some conventions in place of configuration that are worth noting:
babel.es.js
will be in 'es' format)main
defaults to CJS, module
to ES, browser
to UMD, and bin
to CJSsrc
folder, the files within will be copied across and lightly transpiled using mkdist.{
"exports": {
".": {
// This will be compiled in CJS and matched to src/index.ts
"require": "./dist/index.js",
// This will be compiled in ES and matched to src/index.ts
"import": "./dist/index.es.js"
},
// src/templates will be lightly transpiled with mkdist and copied to dist/templates
"./templates/*": "./dist/templates/*",
// siroc will not touch this
"./package.json": "./package.json"
},
// This will be compiled in CJS and matched to src/index.ts
"main": "./dist/index.js",
// This will be compiled in ES and matched to src/index.ts
"module": "./dist/index.es.js",
// Types will be generated for src/index.ts
"types": "./dist/index.d.ts",
"bin": {
// This will be compiled in CJS and matched to src/cli/index.ts
"siroc": "bin/cli.js",
// This will be compiled in CJS and matched to src/cli/runtime.ts
"siroc-runner": "bin/runtime.js"
}
}
siroc
makes available three hooks for customising your build, if you need it.
build:extend
build:extendRollup
build:done
siroc dev
If you're working in a monorepo, it can be helpful to have accurate and up-to-date intellisense when importing from other libraries in a monorepo, without having to rebuild every time you make changes.
Running siroc dev
will replace your package entrypoints with stubs that point to your source files. Your binaries will run your source files directly using jiti
.
siroc run
You can run arbitrary shell commands or node scripts using the power of the jiti
runtime.
For example:
# You can run a node script written in TypeScript
yarn siroc run myfile.ts
# You can run a command in all your workspaces
yarn siroc run ls --workspaces
Contributions are very welcome.
Clone this repo
git clone https://github.com/unjs/siroc
Install dependencies and build project
yarn
# Stub modules for rapid development
yarn siroc dev
# Test (on changes)
yarn siroc jest
Tip: You can also run yarn link
within a package directory to test the module locally with another project.
MIT License - Made with 💖
FAQs
Zero-config build tooling for Node
The npm package siroc receives a total of 503 weekly downloads. As such, siroc popularity was classified as not popular.
We found that siroc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.