This commit is contained in:
Benjamin Toby 2025-01-16 09:18:45 +01:00
parent 6867e8c17c
commit 2cd83295bf
7 changed files with 14 additions and 20 deletions

View File

@ -2,11 +2,6 @@
NOTE: This package is for Bun runtime NOTE: This package is for Bun runtime
[![package version](https://img.shields.io/bun/v/nodecid.svg?style=flat-square)](https://bunjs.org/package/nodecid)
[![package downloads](https://img.shields.io/bun/dm/nodecid.svg?style=flat-square)](https://bunjs.org/package/nodecid)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![package license](https://img.shields.io/bun/l/nodecid.svg?style=flat-square)](https://bunjs.org/package/nodecid)
Integrate a simple CI/CD process into your application without the hassle. Integrate a simple CI/CD process into your application without the hassle.
_**NOTE:** This package needs `node` installed to work_ _**NOTE:** This package needs `node` installed to work_
@ -14,20 +9,20 @@ _**NOTE:** This package needs `node` installed to work_
## Requirements ## Requirements
- **Node JS Runtime and NPM:** You need to have `NodeJS` and `bun` installed on the target machine for this package to work. - **Node JS Runtime and NPM:** You need to have `NodeJS` and `bun` installed on the target machine for this package to work.
- **`nodecid.config.json` file:** This package depends on a configuration file located in the root directory of your application. - **`buncid.config.json` file:** This package depends on a configuration file located in the root directory of your application.
## Installation ## Installation
To install this package globally just run: To install this package globally just run:
```shell ```shell
bun install -g nodecid bun install -g buncid
``` ```
To run the package directly run: To run the package directly run:
```shell ```shell
bunx nodecid bunx buncid
``` ```
This will download the package and run the binaries directly. After the first run it won't download the package again. This will download the package and run the binaries directly. After the first run it won't download the package again.
@ -37,14 +32,14 @@ This will download the package and run the binaries directly. After the first ru
To run the package after installing it globally just run: To run the package after installing it globally just run:
```shell ```shell
nodecid buncid
``` ```
Remember you must have a `nodecid.config.json` file located in your root directory else this will throw an error. Remember you must have a `buncid.config.json` file located in your root directory else this will throw an error.
### Configuration ### Configuration
Your `nodecid.config.json` file should look like this: Your `buncid.config.json` file should look like this:
```json ```json
{ {
@ -97,7 +92,7 @@ _NOTE:_ This also works for other languages, example:
This app just runs whatever command you send it in an isolated child process, the command will be run as if being run in a terminal. This app just runs whatever command you send it in an isolated child process, the command will be run as if being run in a terminal.
#### All Available options in `nodecid.config.json` file #### All Available options in `buncid.config.json` file
- **`start`**: _string_: The start Command - **`start`**: _string_: The start Command
- **`preflight`**: _string | Array_: Array of commands or shell script file to run before reloading application - **`preflight`**: _string | Array_: Array of commands or shell script file to run before reloading application

2
dist/index.js vendored
View File

@ -11,7 +11,7 @@ const start_1 = __importDefault(require("./utils/start"));
const WORK_DIR = process.cwd(); const WORK_DIR = process.cwd();
function run() { function run() {
try { try {
const configText = fs_1.default.readFileSync(path_1.default.join(WORK_DIR, "nodecid.config.json"), "utf-8"); const configText = fs_1.default.readFileSync(path_1.default.join(WORK_DIR, "buncid.config.json"), "utf-8");
const config = JSON.parse(configText); const config = JSON.parse(configText);
const { start, preflight, postflight, build, redeploy_path, first_run, port, } = config; const { start, preflight, postflight, build, redeploy_path, first_run, port, } = config;
/** @type {string | undefined} */ /** @type {string | undefined} */

File diff suppressed because one or more lines are too long

2
dist/utils/start.js vendored
View File

@ -11,7 +11,7 @@ const run_1 = __importDefault(require("./run"));
const kill_child_1 = __importDefault(require("./kill-child")); const kill_child_1 = __importDefault(require("./kill-child"));
let redeployments = 0; let redeployments = 0;
let childProcess = null; let childProcess = null;
const pTitle = "nodecid"; const pTitle = "buncid";
process.title = pTitle; process.title = pTitle;
/** /**
* # Start the process * # Start the process

View File

@ -11,7 +11,7 @@ const WORK_DIR = process.cwd();
function run() { function run() {
try { try {
const configText = fs.readFileSync( const configText = fs.readFileSync(
path.join(WORK_DIR, "nodecid.config.json"), path.join(WORK_DIR, "buncid.config.json"),
"utf-8" "utf-8"
); );

View File

@ -1,13 +1,13 @@
{ {
"name": "@moduletrace/buncid", "name": "@moduletrace/buncid",
"version": "1.0.0", "version": "1.0.1",
"description": "Simple CI/CD process For Bun runtime", "description": "Simple CI/CD process For Bun runtime",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {
"buncid": "./dist/index.js" "buncid": "./dist/index.js"
}, },
"scripts": { "scripts": {
"compile": "bun build --compile --minify --sourcemap --bytecode index.ts --outfile bin/nodecid" "compile": "bun build --compile --minify --sourcemap --bytecode index.ts --outfile bin/buncid"
}, },
"keywords": [ "keywords": [
"CI/CD", "CI/CD",

View File

@ -1,7 +1,6 @@
import fs from "fs"; import fs from "fs";
import { ChildProcess } from "child_process"; import { ChildProcess } from "child_process";
import colors from "./console-colors"; import colors from "./console-colors";
import kill from "kill-port";
import preflightFn from "./preflight"; import preflightFn from "./preflight";
import run from "./run"; import run from "./run";
import killChild from "./kill-child"; import killChild from "./kill-child";
@ -10,7 +9,7 @@ let redeployments = 0;
let childProcess: ChildProcess | null = null; let childProcess: ChildProcess | null = null;
const pTitle = "nodecid"; const pTitle = "buncid";
process.title = pTitle; process.title = pTitle;
/** /**