diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 01dd847..a80cda2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,14 +22,14 @@ jobs: - name: Install dependencies with pnpm run: pnpm install - working-directory: ./bambu-node + working-directory: ./bambu-link - name: Build with tsup run: pnpm exec tsup - working-directory: ./bambu-node + working-directory: ./bambu-link - name: Publish to npm run: pnpm publish --access public - working-directory: ./bambu-node + working-directory: ./bambu-link env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index dc089b6..13986ce 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# bambu-node +# bambu-link A node module for communicating with bambulab printers. Currently still a work in progress. Only tested on p1s @@ -6,23 +6,23 @@ Only tested on p1s \ Install the npm package ```bash -npm i bambu-node +npm i bambu-link # or -yarn add bambu-node +yarn add bambu-link # or -pnpm add bambu-node +pnpm add bambu-link # or -bun add bambu-node +bun add bambu-link ``` \ Then import bambuclient ``` javascript -import { bambuClient } from 'bambu-node' +import { connect } from 'bambu-link' ``` \ Connect to the printer ``` javascript - const client = bambuClient({ + const client = connect({ hostname, token, serial, @@ -54,7 +54,7 @@ Alot more actions will come soon Replace token, serial, hostname with information from your printer ``` javascript -import { bambuClient } from 'bambu-node' +import { connect } from 'bambu-link' export async function main() { @@ -62,7 +62,7 @@ export async function main() { const serial = '01P00A000000000' //serial is found in the printer settings const hostname = '192.168.0.1' //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address - const client = bambuClient({ + const client = connect({ hostname, //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address for the printer token, serial, diff --git a/bambu-node/.gitignore b/bambu-link/.gitignore similarity index 100% rename from bambu-node/.gitignore rename to bambu-link/.gitignore diff --git a/bambu-node/.npmignore b/bambu-link/.npmignore similarity index 100% rename from bambu-node/.npmignore rename to bambu-link/.npmignore diff --git a/bambu-node/.vscode/settings.json b/bambu-link/.vscode/settings.json similarity index 100% rename from bambu-node/.vscode/settings.json rename to bambu-link/.vscode/settings.json diff --git a/bambu-node/README.md b/bambu-link/README.md similarity index 92% rename from bambu-node/README.md rename to bambu-link/README.md index dc089b6..8008752 100644 --- a/bambu-node/README.md +++ b/bambu-link/README.md @@ -1,4 +1,4 @@ -# bambu-node +# bambu-link A node module for communicating with bambulab printers. Currently still a work in progress. Only tested on p1s @@ -6,18 +6,18 @@ Only tested on p1s \ Install the npm package ```bash -npm i bambu-node +npm i bambu-link # or -yarn add bambu-node +yarn add bambu-link # or -pnpm add bambu-node +pnpm add bambu-link # or -bun add bambu-node +bun add bambu-link ``` \ Then import bambuclient ``` javascript -import { bambuClient } from 'bambu-node' +import { bambuClient } from 'bambu-link' ``` \ Connect to the printer @@ -54,7 +54,7 @@ Alot more actions will come soon Replace token, serial, hostname with information from your printer ``` javascript -import { bambuClient } from 'bambu-node' +import { bambuClient } from 'bambu-link' export async function main() { diff --git a/bambu-node/package.json b/bambu-link/package.json similarity index 78% rename from bambu-node/package.json rename to bambu-link/package.json index a43455a..1d7566c 100644 --- a/bambu-node/package.json +++ b/bambu-link/package.json @@ -1,14 +1,13 @@ { - "name": "bambu-node", + "name": "bambu-link", "version": "0.1.0", - "description": "", + "description": "A nodejs library for interfacing with the Bambu lab 3D printer", "main": "dist/index.js", "scripts": { "build": "tsup", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ - "bambujs", "bambu", "bambulab", "p1s", @@ -20,7 +19,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/Evan-2007/bambu-node" + "url": "https://github.com/Evan-2007/bambu-link" }, "author": "Evan Cooper", "license": "MIT", diff --git a/bambu-node/pnpm-lock.yaml b/bambu-link/pnpm-lock.yaml similarity index 100% rename from bambu-node/pnpm-lock.yaml rename to bambu-link/pnpm-lock.yaml diff --git a/bambu-node/src/actions.ts b/bambu-link/src/actions.ts similarity index 100% rename from bambu-node/src/actions.ts rename to bambu-link/src/actions.ts diff --git a/bambu-node/src/client.ts b/bambu-link/src/client.ts similarity index 88% rename from bambu-node/src/client.ts rename to bambu-link/src/client.ts index 480332f..6488bac 100644 --- a/bambu-node/src/client.ts +++ b/bambu-link/src/client.ts @@ -2,7 +2,7 @@ import mqqt from 'mqtt' import { actions, ActionsType } from './actions' import { BambuClientType } from './types' -function bambuClient({hostname, port = 8883, token, serial}: {hostname: string, port?: number, token: string, serial: string}) { +function connect({hostname, port = 8883, token, serial}: {hostname: string, port?: number, token: string, serial: string}) { const mqqtClient = mqqt.connect(`mqtts://${hostname}:${port}`, { username: "bblp", password: token, @@ -41,5 +41,5 @@ function bambuClient({hostname, port = 8883, token, serial}: {hostname: string, } } -export {bambuClient} +export {connect} diff --git a/bambu-link/src/index.ts b/bambu-link/src/index.ts new file mode 100644 index 0000000..7473584 --- /dev/null +++ b/bambu-link/src/index.ts @@ -0,0 +1 @@ +export { connect } from './client' \ No newline at end of file diff --git a/bambu-node/src/types.ts b/bambu-link/src/types.ts similarity index 100% rename from bambu-node/src/types.ts rename to bambu-link/src/types.ts diff --git a/bambu-node/tsconfig.json b/bambu-link/tsconfig.json similarity index 100% rename from bambu-node/tsconfig.json rename to bambu-link/tsconfig.json diff --git a/bambu-node/tsup.config.ts b/bambu-link/tsup.config.ts similarity index 100% rename from bambu-node/tsup.config.ts rename to bambu-link/tsup.config.ts diff --git a/bambu-node/src/index.ts b/bambu-node/src/index.ts deleted file mode 100644 index ae2d11f..0000000 --- a/bambu-node/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { bambuClient } from './client' \ No newline at end of file diff --git a/example/index.ts b/example/index.ts index f60c328..bef51dd 100644 --- a/example/index.ts +++ b/example/index.ts @@ -1,4 +1,4 @@ -import { bambuClient } from 'bambu-node' +import { connect } from 'bambu-link' export async function main() { @@ -6,7 +6,7 @@ export async function main() { const serial = '01P00A000000000' //This is a placeholder serial number. serial is found in the printer settings const hostname = '192.168.0.1' //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address for the printer - const client = bambuClient({ + const client = connect({ hostname, //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address for the printer token, serial,