https://github.com/cinderblock/rdt
A Node.js development environment for lightweight remote systems. Use your high performance development machine to build and serve your project to a low performance remote device.
https://github.com/cinderblock/rdt
Last synced: 5 months ago
JSON representation
A Node.js development environment for lightweight remote systems. Use your high performance development machine to build and serve your project to a low performance remote device.
- Host: GitHub
- URL: https://github.com/cinderblock/rdt
- Owner: cinderblock
- Created: 2023-03-01T20:16:03.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-30T09:52:40.000Z (over 1 year ago)
- Last Synced: 2025-08-08T14:41:43.796Z (11 months ago)
- Language: TypeScript
- Homepage:
- Size: 318 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
Awesome Lists containing this project
README
# `rdt` - Remote Development Tool
[](https://badge.fury.io/js/@cinderblock%2Frdt)
[](https://github.com/cinderblock/rdt/actions/workflows/build.yaml)
[](https://github.com/cinderblock/rdt/actions/workflows/publish.yaml)
A Node.js development tool for lightweight remote systems.
Use your high performance development machine to build and serve your project to a low performance remote device.
`rdt` is a daemon that runs on your development machine.
`rdt` watches your project directory for changes and gives APIs to build and deploy your project to a remote device.
`rdt` can run a local web server for a fast local UI experience with easy connection to the real backend through integrated port forwarding.
Remote Development Tool is still in early development.
The API and configuration format might change.
## Installation
```bash
npm install -D @cinderblock/rdt # Npm package
npm install -D cinderblock/rdt # Github repository
```
## Usage
Create a file `rdt.ts` in the root of your project that exports a `targets` object and an optional default target name.
### Example `rdt.ts`
```ts
import { Targets, logger } from 'rdt';
// export const defaultTarget = 'myPi'; // Defaults to the first target
export const targets: Targets = {
myPi: {
// remote: {
// host: 'myPi', // Defaults to target name
// username: 'pi', // Default
// },
handler: {
async onConnected({ connection, targetName, targetConfig }) {
logger.info(`connected: ${targetName}`);
logger.info(targetConfig);
},
async onDisconnected({ targetName, targetConfig }) {
logger.info(`disconnected: ${targetName}`);
},
async onFileChanged({ connection, targetName, targetConfig, localPath }) {
return true;
},
async onDeployed({ connection, targetName, targetConfig, changedFiles }) {
logger.info(`deployed: ${targetName}`);
},
},
// devServer: 'src/ui/index.ts', // File must exist
},
};
```
### `rdt dev [target]` - Start the development server
```
npx rdt dev # Run default target
npx rdt dev myPi # Run target: myPi
npx rdt dev otherPi # Run target: otherPi
```
Use `npx` or directly in `package.json` scripts without `npx`:
```json
{
"name": "my-project",
"type": "module",
"scripts": {
"dev": "rdt dev"
},
"devDependencies": {
"rdt": "^0.1.1"
}
}
```
```
npm run dev
npm run dev -- myPi
npm run dev -- otherPi
```