Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev xvfb

- name: Install Node dependencies
run: npm ci || npm install

- name: Run unit tests
run: xvfb-run -a npm test

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Adrenaline.js is an ultra-lightweight, high-performance desktop application fram
- **Zero Rust / Go Barrier:** Written 100% for Node.js & JavaScript developers. Use your favorite npm packages without learning a new language or toolchain.
- **Drop-in Electron-like API:** Work with familiar APIs like `app`, `BrowserWindow`, and `ipcMain` out of the box with zero learning curve.
- **Bidirectional IPC:** High-speed asynchronous inter-process communication between Node.js backend processes and webview frontends.
- **Built-in CLI & Scaffolder:** Instant project scaffolding and execution with `npx adrenaline init` and `adrenaline dev`.
- **Built-in CLI & Scaffolder:** Instant project scaffolding and execution with `npx adrenaline-js init` and `adrenaline dev`.

---

Expand All @@ -25,7 +25,9 @@ Scaffold and launch a new project in seconds:

```bash
# 1. Create a new Adrenaline.js project
npx adrenaline init my-app
npm install adrenaline-js
# or scaffold a new project:
npx adrenaline-js init my-app

# 2. Navigate to your project folder
cd my-app
Expand Down Expand Up @@ -58,7 +60,7 @@ npx adrenaline dev
### Main Process (`main.js`)

```javascript
const { app, BrowserWindow, ipcMain } = require('adrenaline');
const { app, BrowserWindow, ipcMain } = require('adrenaline-js');
const path = require('path');

app.whenReady().then(() => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "adrenaline",
"name": "adrenaline-js",
"version": "0.1.0",
"description": "Desktop app framework using Node.js and webview.h",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion templates/starter/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain } = require('adrenaline');
const { app, BrowserWindow, ipcMain } = require('adrenaline-js');
const path = require('path');
const fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion templates/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"dev": "adrenaline dev"
},
"dependencies": {
"adrenaline": "^0.1.0"
"adrenaline-js": "^0.1.0"
}
}
6 changes: 3 additions & 3 deletions test/test_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ try {
const scaffoldedPkg = JSON.parse(fs.readFileSync(path.join(testAppDir, 'package.json'), 'utf8'));
assert.strictEqual(scaffoldedPkg.name, testAppName, 'Scaffolded package.json name should match project name');

// Create node_modules/adrenaline inside testAppDir to point to root index.js so require('adrenaline') works directly
// Create node_modules/adrenaline-js inside testAppDir to point to root index.js so require('adrenaline-js') works directly
const nodeModulesDir = path.join(testAppDir, 'node_modules');
const adrenalinePackageDir = path.join(nodeModulesDir, 'adrenaline');
const adrenalinePackageDir = path.join(nodeModulesDir, 'adrenaline-js');
fs.mkdirSync(adrenalinePackageDir, { recursive: true });

// Copy/link root index.js, package.json, lib and build into testAppDir node_modules/adrenaline
// Copy/link root index.js, package.json, lib and build into testAppDir node_modules/adrenaline-js
fs.copyFileSync(path.join(projectRoot, 'index.js'), path.join(adrenalinePackageDir, 'index.js'));
fs.copyFileSync(path.join(projectRoot, 'package.json'), path.join(adrenalinePackageDir, 'package.json'));

Expand Down
Loading