surveilr / www.surveilr.com

Resource Surveillance & Integration Engine (`surveilr`) Public Facing Omnibus Monorepo
https://www.surveilr.com
MIT License
0 stars 11 forks source link

Introduce surveilrctl.ts for opinionated `dev` experience #17

Closed shah closed 1 month ago

shah commented 1 month ago

Migrate from lib/universal/sqlpagectl.ts to lib/std/surveilrctl.ts for the following functionality:

With this done, all that's required in any pattern or service is:

$ cd lib/pattern/fhir-explorer
$ ../../std/surveilrctl.ts dev

Without any parameters surveilrctl.ts dev will now watch the current directory and all its *.sql and *.sql.ts files and reload the package.sql.ts into resource-surveillance.sqlite.db if any *.sql or *.sql.ts files are modified and saved.

Doing the above will no longer require any arguments to be passed in but of course it can be used as follows:

  -p, --port                      <port>            - Port to run web server on                                             (Default: 9000) 
  -w, --watch                     <path>            - watch path(s)                                                                         
  -R, --watch-recurse                               - Watch subdirectories too                                              (Default: false)
  -l, --load                      <path>            - Load these whenever watched files modified (instead of watched files                  
                                                      themselves), defaults to `package.sql.ts`                                             
  --external-sqlpage              <sqlpage-binary>  - Run standalone SQLPage instead of surveilr embedded                                   
  --external-sqlite3              <sqlite3-binary>  - Run standalone sqlite3 instead of surveilr embedded Rusqlite                          
  --restart-web-server-on-change                    - Restart the web server on each change, needed for surveir & SQLite    (Default: true) 
  --show-modified-urls-on-change                    - After reloading sqlpage_files, show the recently modified URLs        (Default: false)