@profoundlogic/pjscodermake
v0.2.1
Published
Sync & build tool for Profoundjs IBM i development
Readme
pjscodermake
Internal tool. Published publicly on npm for installation convenience, but intended for use by Profound Logic Software and authorized customers only. See
LICENSE.txt.
Sync & build tool for ProfoundJS IBM i development. Lets you edit profoundjs-ibmi and profoundui-ibmi checkouts on a Unix-like workstation, then sync changed sources and rebuild on a remote IBM i over SSH.
Two binaries:
pjsCoderMakeInstances— sync & build. On the first run (no.pjscodermake/state.json) it does a full setup: allocates libraries, restores savefiles, unpacks tarballs, runs initial build. On subsequent runs it does an incremental rebuild: detect changed files → tar+ssh sync → stop service →make→ start service. Repos run in parallel.pjsCoderRemoveInstances— tear down the remote workspace (stop services, drop libraries, removerootFolder, delete state).
To re-initialize, run pjsCoderRemoveInstances then pjsCoderMakeInstances.
Installation
npm install -g @profoundlogic/pjscodermakeRequires Node.js >= 22 and an SSH client.
Project layout
pjsCoderMakeInstances is run from a workspace directory that contains the two repo checkouts as siblings:
my-project/
├── profoundjs-ibmi/ # git checkout
├── profoundui-ibmi/ # git checkout
├── proddev/ # written by first-run setup (.env, runtime config)
├── tmp/ # ssh control sockets, transient
└── .pjscodermake/
└── state.json # written on first run; consumed by subsequent runsConnection
pjscodermake connects to the remote IBM i via the SSH host alias pjscodermake.
You must have a Host pjscodermake block in ~/.ssh/config with HostName, User,
and IdentityFile set. In a coderflow workspace this is materialized automatically
from an external_connection named pjscodermake.
pjsCoderMakeInstances writes setup state to ./.pjscodermake/state.json and reuses it on subsequent runs:
rootFolder— remote workspace root (e.g./home/<user>/<suffix>)libraries.pui,libraries.pjs— newly allocated IBM i librariesrepos.<name>.commit— tarball baseline commit per repo (used for first-build SHA diff)repos.<name>.syncedAt— last successful sync timestamp per repo (used for incremental mtime mode),nulluntil the first successful build
Usage
pjsCoderMakeInstances
pjsCoderMakeInstances --debugFirst run (no state.json)
- SSH to the remote and call
BUILDTOOLS/CRTLIBSto allocatePUIWRKLIB/PJSWRKLIB. - Verify each local
*-ibmirepo is at-or-ahead of the tarball commit (refuses to clobber newer with older). - In parallel: unpack
profoundjs.tgz,profoundjs_node_modules.tgz,proddev.tgz,profoundui-ibmi.tgz,profoundjs-ibmi.tgz; restore PUI and PJS savefiles into the new libraries. - Write
proddev/.env(locally and remotely). - Persist setup state to
./.pjscodermake/state.json. - Run an initial
makefor each repo as soon as its prereqs land — does not wait fornode_modulesunpack.
Subsequent runs (state.json exists)
Per repo, in parallel:
- Detect changes — first incremental run uses
git diff <tarballCommit>..HEAD+ dirty + untracked. Subsequent runs usemtime > <repo>SyncedAtover tracked + untracked files. - Sync —
tarthe changed files, pipe over SSH,tar -xon the remote into$ROOTFLR/<repo>. - Stop service —
ENDTCPSVRfor*HTTP(PUI) or*PJS(PJS instance). - Make —
makein the remote repo dir withPUIWRKLIB/PJSWRKLIBexported. - Start service —
STRTCPSVR. - On success, persist
<repo>SyncedAt(the run's start time, so edits during the sync get caught next build).
Final stdout line of every run is a single JSON object with per-repo results ({name, files, synced, stopped, made, started, durationMs}) — easy to consume programmatically.
Development
npm test # node --test test/unit/**/*.test.js
npm run lintSee ARCHITECTURE.md for module layout and design notes.
