@cinderblock/rdt
v0.7.0
Published
A developer tool for working on lightweight remote systems.
Downloads
61
Maintainers
Readme
rdt
- Remote Development Tool
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
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
import { Targets, logger } from 'rdt';
export const defaultTarget = 'myPi';
export const targets: Targets = {
myPi: {
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',
},
};
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
:
{
"name": "my-project",
"scripts": {
"dev": "rdt dev"
},
"devDependencies": {
"rdt": "^0.1.1"
}
}
npm run dev
npm run dev -- myPi
npm run dev -- otherPi