Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ironkinoko/bocchi
A cli build tool for userscript
https://github.com/ironkinoko/bocchi
cli greasemonkey tampermonkey userscript violentmonkey
Last synced: 12 days ago
JSON representation
A cli build tool for userscript
- Host: GitHub
- URL: https://github.com/ironkinoko/bocchi
- Owner: IronKinoko
- License: mit
- Created: 2022-11-22T01:48:05.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T07:08:00.000Z (over 1 year ago)
- Last Synced: 2025-01-26T15:47:48.977Z (12 days ago)
- Topics: cli, greasemonkey, tampermonkey, userscript, violentmonkey
- Language: TypeScript
- Homepage:
- Size: 445 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bocchi
A cli build tool for userscript
## Install
```shell
# npm
npm i bocchi -D# yarn
yarn add bocchi -D# pnpm
pnpm i bocchi -D
```### Create with template
```shell
# npm
npm create bocchi-app# yarn
yarn create bocchi-app# pnpm
pnpm create bocchi-app
```## Usage
1. create `meta.template`
```
// ==UserScript==
// @name
// @namespace #homepage#
// @version #version#
// @description #description#
// @author
// @match https://example.com/*
// @grant none
// @downloadURL
// @updateURL
// ==/UserScript==
```2. write entry `src/index.(j|t)s`
3. add scripts to `package.json````json
{
"scripts": {
"dev": "bocchi dev",
"build": "bocchi build"
}
}
```4. `npm run dev` for development, `npm run build` for bundle production
## Feature
1. `package.json` support rollup `globals`
```json
{
"globals": {
"lodash": "window._"
}
}
```2. support `[name].template.html`
```html
1
```js
// file: index.js
import tmp from './[name].template.html'console.log(tmp.tmpId) //=> \n 1\n
console.log(tmp.anchorId) //=>
```3. auto load `postcss.config.js`