@saltcorn/cli 0.8.6-beta.8 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -106
- package/npm-shrinkwrap.json +680 -640
- package/oclif.manifest.json +1 -1
- package/package.json +12 -7
- package/src/commands/build-app.js +25 -5
- package/src/commands/build-cordova-builder.js +20 -15
- package/src/commands/{localize-plugin.js → dev/localize-plugin.js} +1 -1
- package/src/commands/dev/post-release.js +154 -0
- package/src/commands/{release.js → dev/release.js} +3 -3
- package/src/commands/{test-plugin.js → dev/test-plugin.js} +3 -3
- package/src/commands/setup-benchmark.js +2 -2
- package/src/commands/transform-field.js +2 -2
- /package/src/commands/{make-migration.js → dev/make-migration.js} +0 -0
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.8.6-beta.8","commands":{"add-schema":{"id":"add-schema","description":"Add Saltcorn schema to existing database","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false}},"args":[]},"backup":{"id":"backup","description":"Backup the PostgreSQL database to a file with pg_dump or zip","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"output":{"name":"output","type":"option","char":"o","description":"output filename"},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"zip":{"name":"zip","type":"boolean","char":"z","description":"zip format","allowNo":false}},"args":[]},"build-app":{"id":"build-app","description":"Build mobile app","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenantAppName":{"name":"tenantAppName","type":"option","description":"Optional name of a tenant application, if set, the app will be build for this tenant"},"platforms":{"name":"platforms","type":"option","char":"p","description":"Platforms to build for, space separated list"},"entryPoint":{"name":"entryPoint","type":"option","char":"e","description":"This is the first view or page (see -t) after the login."},"entryPointType":{"name":"entryPointType","type":"option","char":"t","description":"Type of the entry point ('view' or 'page'). The default is 'view'."},"localUserTables":{"name":"localUserTables","type":"option","char":"l","description":"user defined tables that should be replicated into the app"},"useDocker":{"name":"useDocker","type":"boolean","char":"d","description":"Use a docker container to build the app.","allowNo":false},"buildDirectory":{"name":"buildDirectory","type":"option","char":"b","description":"A directory where the app should be build"},"copyAppDirectory":{"name":"copyAppDirectory","type":"option","char":"c","description":"If set, the app file will be copied here, please set 'user email', too"},"userEmail":{"name":"userEmail","type":"option","char":"u","description":"Email of the user building the app"},"appFileName":{"name":"appFileName","type":"option","char":"a","description":"If set, the copied app will get this name"},"serverURL":{"name":"serverURL","type":"option","char":"s","description":"URL to a saltcorn server"},"allowOfflineMode":{"name":"allowOfflineMode","type":"boolean","description":"Switch to offline mode when there is no internet, sync the data when a connection is available again.","allowNo":false},"buildForEmulator":{"name":"buildForEmulator","type":"boolean","description":"build without '--device', generates no .ipa file so that iOS apps can be build without developer accounts","allowNo":false}},"args":[]},"build-cordova-builder":{"id":"build-cordova-builder","description":"Build the 'saltcorn/cordova-builder' docker image","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"configuration-check-backups":{"id":"configuration-check-backups","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"destructive":{"name":"destructive","type":"boolean","char":"d","description":"destructive","allowNo":false}},"args":[{"name":"files","description":"backup file to check. can be repeated, e.g. with *","required":true}]},"configuration-check":{"id":"configuration-check","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"create-tenant":{"id":"create-tenant","description":"Create a tenant","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"url":{"name":"url","type":"option","description":"Url of tenant"},"email":{"name":"email","type":"option","char":"e","description":"Email of owner of tenant"},"description":{"name":"description","type":"option","char":"d","description":"Description of tenant"}},"args":[{"name":"tenant","description":"Tenant subdomain to create","required":true}]},"create-user":{"id":"create-user","description":"Create a new user","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"Admin user","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"email"},"role":{"name":"role","type":"option","char":"r","description":"role"},"password":{"name":"password","type":"option","char":"p","description":"password"}},"args":[]},"delete-tenants":{"id":"delete-tenants","description":"Delete inactive tenants","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"delete-user":{"id":"delete-user","description":"Delete user.\n\nCommand deletes the user specified by USER_EMAIL.\n\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"user_email","description":"User to delete","required":true}]},"fixtures":{"id":"fixtures","description":"Load fixtures for testing\n...\nThis manual step it is never required for users and rarely required for developers\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"reset":{"name":"reset","type":"boolean","char":"r","description":"Also reset schema","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"get-cfg":{"id":"get-cfg","description":"Get a configuration value. The value is printed to stdout as a JSON value","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"}},"args":[{"name":"key","description":"Configuration key","required":false}]},"info":{"id":"info","description":"Show paths\n...\nShow configuration and file store paths\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":["paths"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"json format","allowNo":false}},"args":[]},"inspect":{"id":"inspect","description":"Inspect an entity's JSON representation, or list entities","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"type","description":"Entity type","required":true,"options":["view","page","trigger","table"]},{"name":"name","description":"Entity name. If not supplied, list all names"}]},"install-pack":{"id":"install-pack","description":"Install a pack or restore a snapshot","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Pack name in store"},"file":{"name":"file","type":"option","char":"f","description":"File with pack JSON"}},"args":[]},"install-plugin":{"id":"install-plugin","description":"Install a plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Plugin name in store"},"directory":{"name":"directory","type":"option","char":"d","description":"Directory with local plugin"}},"args":[]},"list-tenants":{"id":"list-tenants","description":"List tenants in CSV format","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"localize-plugin":{"id":"localize-plugin","description":"Convert plugin to local plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"unlocalize":{"name":"unlocalize","type":"boolean","char":"u","description":"Unlocalize plugin (local to npm)","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"plugin","description":"Current plugin name","required":true},{"name":"path","description":"Absolute path to local plugin"}]},"make-migration":{"id":"make-migration","description":"Create a new blank Database structure migration file.\nThese migrations update database structure.\nYou should not normally need to run this\nunless you are a developer.\n","usage":"make-migration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"migrate":{"id":"migrate","description":"Run Database structure migrations\n...\nNOTE!\n- Please stop Saltcorn before run DB migrations.\n- Please make db backup before migration.\n- There are no way to rollback migration if you doesn't make backup.\n\nThis is not normally required as migrations will be run when the server starts.\nHowever, this command may be useful if you are running multiple application\nservers and need to control when the migrations are run.\n","usage":"saltcorn migrate","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"modify-user":{"id":"modify-user","description":"Modify (update) user.\n\nCommand changes the user specified by USER_EMAIL.\n\nYou can change the user group, password and email.\n\nNOTE that -a and -r role (--role=role) can give conflict.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"make user be Admin","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"new email"},"role":{"name":"role","type":"option","char":"r","description":"new role (can conflict with -a option)"},"password":{"name":"password","type":"option","char":"p","description":"new password"},"imode":{"name":"imode","type":"boolean","char":"i","description":"interactive mode","allowNo":false}},"args":[{"name":"user_email","description":"User to modify","required":true}]},"plugins":{"id":"plugins","description":"List and upgrade plugins for tenants\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"examples":["plugins -v - verbose output of commands","plugins -u -d - dry-run for plugin update","plugins -u -f - force plugin update"],"flags":{"upgrade":{"name":"upgrade","type":"boolean","char":"u","description":"Upgrade","allowNo":false},"dryRun":{"name":"dryRun","type":"boolean","char":"d","description":"Upgrade dry-run","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Force update","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"Plugin name"}},"args":[]},"release":{"id":"release","description":"Release a new saltcorn version","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"version","description":"New version number","required":true}]},"reset-schema":{"id":"reset-schema","description":"Reset the database\n...\nThis will delete all existing information\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"restore":{"id":"restore","description":"Restore a previously backed up database (zip or sqlc format)","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"file","description":"backup file to restore","required":true}]},"rm-tenant":{"id":"rm-tenant","description":"Remove a tenant.\nAttention! All tenant data will be lost!\nIt recommended to make backup of tenant before perform this command.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant","required":true}},"args":[]},"run-benchmark":{"id":"run-benchmark","description":"Run benchmark","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"API Token for reporting results"},"benchmark":{"name":"benchmark","type":"option","char":"b","description":"Which benchmark to run"},"delay":{"name":"delay","type":"option","char":"d","description":"delay between runs (s)","default":30}},"args":[{"name":"baseurl","description":"Base URL","required":false}]},"run-tests":{"id":"run-tests","description":"Run test suites","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false},"listTests":{"name":"listTests","type":"boolean","char":"l","description":"List tests","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"detectOpenHandles":{"name":"detectOpenHandles","type":"boolean","char":"d","description":"Detect Open Handles","allowNo":false},"testFilter":{"name":"testFilter","type":"option","char":"t","description":"Filter tests by suite or test name"},"watch":{"name":"watch","type":"boolean","description":"Watch files for changes and rerun tests related to changed files.","allowNo":false},"watchAll":{"name":"watchAll","type":"boolean","description":"Watch files for changes and rerun all tests.","allowNo":false},"database":{"name":"database","type":"option","description":"Run on specified database. Default is saltcorn_test"}},"args":[{"name":"package","description":"which package to run tests for"}]},"run-trigger":{"id":"run-trigger","description":"Run a trigger","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"trigger","description":"trigger name","required":true}]},"scheduler":{"id":"scheduler","description":"Run the Saltcorn scheduler","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Start the Saltcorn server","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":3000},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"watchReaper":{"name":"watchReaper","type":"boolean","char":"r","description":"Watch reaper","allowNo":false},"dev":{"name":"dev","type":"boolean","char":"d","description":"Run in dev mode and re-start on file changes","allowNo":false},"addschema":{"name":"addschema","type":"boolean","char":"a","description":"Add schema if missing","allowNo":false},"nomigrate":{"name":"nomigrate","type":"boolean","char":"n","description":"No migrations","allowNo":false},"noscheduler":{"name":"noscheduler","type":"boolean","char":"s","description":"No scheduler","allowNo":false},"subdomain_offset":{"name":"subdomain_offset","type":"option","description":"Number of parts to remove to access subdomain in 'multi_tenant' mode"}},"args":[]},"set-cfg":{"id":"set-cfg","description":"Set a configuration value. The supplied value (argument, or file stdin) will be parsed as JSON. If this fails, it is stored as a string.","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"},"file":{"name":"file","type":"option","char":"f","description":"file"},"stdin":{"name":"stdin","type":"boolean","char":"i","description":"read value from stdin","allowNo":false}},"args":[{"name":"key","description":"Configuration key","required":false},{"name":"value","description":"Configuration value (JSON or string)"}]},"setup-benchmark":{"id":"setup-benchmark","description":"Setup an instance for benchmarking","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"setup":{"id":"setup","description":"Set up a new system\n...\nThis will attempt to install or connect a database, and set up a\nconfiguration file\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false}},"args":[]},"take-snapshot":{"id":"take-snapshot","description":"Print a current snapshout to stdout","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"fresh":{"name":"fresh","type":"boolean","char":"f","description":"fresh","allowNo":false}},"args":[]},"test-plugin":{"id":"test-plugin","description":"Test a plugin\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin package","required":true}]},"transform-field":{"id":"transform-field","description":"transform an existing field by applying a calculated expression","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"expression","description":"expression to calculate field","required":true},{"name":"field","description":"field name","required":true},{"name":"table","description":"table name","required":true},{"name":"tenant","description":"tenant name","required":false}]}}}
|
|
1
|
+
{"version":"0.8.6","commands":{"add-schema":{"id":"add-schema","description":"Add Saltcorn schema to existing database","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false}},"args":[]},"backup":{"id":"backup","description":"Backup the PostgreSQL database to a file with pg_dump or zip","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"output":{"name":"output","type":"option","char":"o","description":"output filename"},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"zip":{"name":"zip","type":"boolean","char":"z","description":"zip format","allowNo":false}},"args":[]},"build-app":{"id":"build-app","description":"Build mobile app","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenantAppName":{"name":"tenantAppName","type":"option","description":"Optional name of a tenant application, if set, the app will be build for this tenant"},"platforms":{"name":"platforms","type":"option","char":"p","description":"Platforms to build for, space separated list"},"entryPoint":{"name":"entryPoint","type":"option","char":"e","description":"This is the first view or page (see -t) after the login."},"entryPointType":{"name":"entryPointType","type":"option","char":"t","description":"Type of the entry point ('view' or 'page'). The default is 'view'."},"localUserTables":{"name":"localUserTables","type":"option","char":"l","description":"user defined tables that should be replicated into the app"},"useDocker":{"name":"useDocker","type":"boolean","char":"d","description":"Use a docker container to build the app.","allowNo":false},"buildDirectory":{"name":"buildDirectory","type":"option","char":"b","description":"A directory where the app should be build"},"copyAppDirectory":{"name":"copyAppDirectory","type":"option","char":"c","description":"If set, the app file will be copied here, please set 'user email', too"},"userEmail":{"name":"userEmail","type":"option","char":"u","description":"Email of the user building the app"},"appName":{"name":"appName","type":"option","description":"Name of the mobile app (default SaltcornMobileApp)"},"appVersion":{"name":"appVersion","type":"option","description":"Version of the mobile app (default 1.0.0)"},"appIcon":{"name":"appIcon","type":"option","description":"A png that will be used as launcher icon. The default is a png of a saltcorn symbol."},"serverURL":{"name":"serverURL","type":"option","char":"s","description":"URL to a saltcorn server"},"splashPage":{"name":"splashPage","type":"option","description":"Name of a page that should be shown while the app is loading."},"allowOfflineMode":{"name":"allowOfflineMode","type":"boolean","description":"Switch to offline mode when there is no internet, sync the data when a connection is available again.","allowNo":false},"buildForEmulator":{"name":"buildForEmulator","type":"boolean","description":"build without '--device', generates no .ipa file so that iOS apps can be build without developer accounts","allowNo":false}},"args":[]},"build-cordova-builder":{"id":"build-cordova-builder","description":"Build the 'saltcorn/cordova-builder' docker image","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"buildClean":{"name":"buildClean","type":"boolean","description":"run a clean build with --no-cache","allowNo":false}},"args":[]},"configuration-check-backups":{"id":"configuration-check-backups","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"destructive":{"name":"destructive","type":"boolean","char":"d","description":"destructive","allowNo":false}},"args":[{"name":"files","description":"backup file to check. can be repeated, e.g. with *","required":true}]},"configuration-check":{"id":"configuration-check","description":"Check configuration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"create-tenant":{"id":"create-tenant","description":"Create a tenant","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"url":{"name":"url","type":"option","description":"Url of tenant"},"email":{"name":"email","type":"option","char":"e","description":"Email of owner of tenant"},"description":{"name":"description","type":"option","char":"d","description":"Description of tenant"}},"args":[{"name":"tenant","description":"Tenant subdomain to create","required":true}]},"create-user":{"id":"create-user","description":"Create a new user","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"Admin user","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"email"},"role":{"name":"role","type":"option","char":"r","description":"role"},"password":{"name":"password","type":"option","char":"p","description":"password"}},"args":[]},"delete-tenants":{"id":"delete-tenants","description":"Delete inactive tenants","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"delete-user":{"id":"delete-user","description":"Delete user.\n\nCommand deletes the user specified by USER_EMAIL.\n\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"user_email","description":"User to delete","required":true}]},"fixtures":{"id":"fixtures","description":"Load fixtures for testing\n...\nThis manual step it is never required for users and rarely required for developers\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"reset":{"name":"reset","type":"boolean","char":"r","description":"Also reset schema","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"get-cfg":{"id":"get-cfg","description":"Get a configuration value. The value is printed to stdout as a JSON value","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"}},"args":[{"name":"key","description":"Configuration key","required":false}]},"info":{"id":"info","description":"Show paths\n...\nShow configuration and file store paths\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":["paths"],"flags":{"json":{"name":"json","type":"boolean","char":"j","description":"json format","allowNo":false}},"args":[]},"inspect":{"id":"inspect","description":"Inspect an entity's JSON representation, or list entities","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"type","description":"Entity type","required":true,"options":["view","page","trigger","table"]},{"name":"name","description":"Entity name. If not supplied, list all names"}]},"install-pack":{"id":"install-pack","description":"Install a pack or restore a snapshot","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Pack name in store"},"file":{"name":"file","type":"option","char":"f","description":"File with pack JSON"}},"args":[]},"install-plugin":{"id":"install-plugin","description":"Install a plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"name":{"name":"name","type":"option","char":"n","description":"Plugin name in store"},"directory":{"name":"directory","type":"option","char":"d","description":"Directory with local plugin"}},"args":[]},"list-tenants":{"id":"list-tenants","description":"List tenants in CSV format","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"migrate":{"id":"migrate","description":"Run Database structure migrations\n...\nNOTE!\n- Please stop Saltcorn before run DB migrations.\n- Please make db backup before migration.\n- There are no way to rollback migration if you doesn't make backup.\n\nThis is not normally required as migrations will be run when the server starts.\nHowever, this command may be useful if you are running multiple application\nservers and need to control when the migrations are run.\n","usage":"saltcorn migrate","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"modify-user":{"id":"modify-user","description":"Modify (update) user.\n\nCommand changes the user specified by USER_EMAIL.\n\nYou can change the user group, password and email.\n\nNOTE that -a and -r role (--role=role) can give conflict.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"admin":{"name":"admin","type":"boolean","char":"a","description":"make user be Admin","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"email":{"name":"email","type":"option","char":"e","description":"new email"},"role":{"name":"role","type":"option","char":"r","description":"new role (can conflict with -a option)"},"password":{"name":"password","type":"option","char":"p","description":"new password"},"imode":{"name":"imode","type":"boolean","char":"i","description":"interactive mode","allowNo":false}},"args":[{"name":"user_email","description":"User to modify","required":true}]},"plugins":{"id":"plugins","description":"List and upgrade plugins for tenants\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"examples":["plugins -v - verbose output of commands","plugins -u -d - dry-run for plugin update","plugins -u -f - force plugin update"],"flags":{"upgrade":{"name":"upgrade","type":"boolean","char":"u","description":"Upgrade","allowNo":false},"dryRun":{"name":"dryRun","type":"boolean","char":"d","description":"Upgrade dry-run","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose output","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Force update","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"Plugin name"}},"args":[]},"reset-schema":{"id":"reset-schema","description":"Reset the database\n...\nThis will delete all existing information\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"restore":{"id":"restore","description":"Restore a previously backed up database (zip or sqlc format)","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"file","description":"backup file to restore","required":true}]},"rm-tenant":{"id":"rm-tenant","description":"Remove a tenant.\nAttention! All tenant data will be lost!\nIt recommended to make backup of tenant before perform this command.\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"force command execution","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant","required":true}},"args":[]},"run-benchmark":{"id":"run-benchmark","description":"Run benchmark","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"API Token for reporting results"},"benchmark":{"name":"benchmark","type":"option","char":"b","description":"Which benchmark to run"},"delay":{"name":"delay","type":"option","char":"d","description":"delay between runs (s)","default":30}},"args":[{"name":"baseurl","description":"Base URL","required":false}]},"run-tests":{"id":"run-tests","description":"Run test suites","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false},"listTests":{"name":"listTests","type":"boolean","char":"l","description":"List tests","allowNo":false},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"detectOpenHandles":{"name":"detectOpenHandles","type":"boolean","char":"d","description":"Detect Open Handles","allowNo":false},"testFilter":{"name":"testFilter","type":"option","char":"t","description":"Filter tests by suite or test name"},"watch":{"name":"watch","type":"boolean","description":"Watch files for changes and rerun tests related to changed files.","allowNo":false},"watchAll":{"name":"watchAll","type":"boolean","description":"Watch files for changes and rerun all tests.","allowNo":false},"database":{"name":"database","type":"option","description":"Run on specified database. Default is saltcorn_test"}},"args":[{"name":"package","description":"which package to run tests for"}]},"run-trigger":{"id":"run-trigger","description":"Run a trigger","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"trigger","description":"trigger name","required":true}]},"scheduler":{"id":"scheduler","description":"Run the Saltcorn scheduler","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Start the Saltcorn server","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":3000},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Verbose","allowNo":false},"watchReaper":{"name":"watchReaper","type":"boolean","char":"r","description":"Watch reaper","allowNo":false},"dev":{"name":"dev","type":"boolean","char":"d","description":"Run in dev mode and re-start on file changes","allowNo":false},"addschema":{"name":"addschema","type":"boolean","char":"a","description":"Add schema if missing","allowNo":false},"nomigrate":{"name":"nomigrate","type":"boolean","char":"n","description":"No migrations","allowNo":false},"noscheduler":{"name":"noscheduler","type":"boolean","char":"s","description":"No scheduler","allowNo":false},"subdomain_offset":{"name":"subdomain_offset","type":"option","description":"Number of parts to remove to access subdomain in 'multi_tenant' mode"}},"args":[]},"set-cfg":{"id":"set-cfg","description":"Set a configuration value. The supplied value (argument, or file stdin) will be parsed as JSON. If this fails, it is stored as a string.","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"plugin":{"name":"plugin","type":"option","char":"p","description":"plugin"},"file":{"name":"file","type":"option","char":"f","description":"file"},"stdin":{"name":"stdin","type":"boolean","char":"i","description":"read value from stdin","allowNo":false}},"args":[{"name":"key","description":"Configuration key","required":false},{"name":"value","description":"Configuration value (JSON or string)"}]},"setup-benchmark":{"id":"setup-benchmark","description":"Setup an instance for benchmarking","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[]},"setup":{"id":"setup","description":"Set up a new system\n...\nThis will attempt to install or connect a database, and set up a\nconfiguration file\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"coverage":{"name":"coverage","type":"boolean","char":"c","description":"Coverage","allowNo":false}},"args":[]},"take-snapshot":{"id":"take-snapshot","description":"Print a current snapshout to stdout","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"},"fresh":{"name":"fresh","type":"boolean","char":"f","description":"fresh","allowNo":false}},"args":[]},"transform-field":{"id":"transform-field","description":"transform an existing field by applying a calculated expression","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"expression","description":"expression to calculate field","required":true},{"name":"field","description":"field name","required":true},{"name":"table","description":"table name","required":true},{"name":"tenant","description":"tenant name","required":false}]},"dev:localize-plugin":{"id":"dev:localize-plugin","description":"Convert plugin to local plugin","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{"unlocalize":{"name":"unlocalize","type":"boolean","char":"u","description":"Unlocalize plugin (local to npm)","allowNo":false},"tenant":{"name":"tenant","type":"option","char":"t","description":"tenant"}},"args":[{"name":"plugin","description":"Current plugin name","required":true},{"name":"path","description":"Absolute path to local plugin"}]},"dev:make-migration":{"id":"dev:make-migration","description":"Create a new blank Database structure migration file.\nThese migrations update database structure.\nYou should not normally need to run this\nunless you are a developer.\n","usage":"make-migration","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"dev:post-release":{"id":"dev:post-release","description":"Post-release tasks: docker and vagrant builds","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"task","description":"What to do","options":["docker","vagrant","all","none"]}]},"dev:release":{"id":"dev:release","description":"Release a new saltcorn version","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"version","description":"New version number","required":true}]},"dev:test-plugin":{"id":"dev:test-plugin","description":"Test a plugin\n...\nExtra documentation goes here\n","pluginName":"@saltcorn/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin package","required":true}]}}}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@saltcorn/cli",
|
|
3
3
|
"description": "Command-line interface for Saltcorn, open-source no-code platform",
|
|
4
4
|
"homepage": "https://saltcorn.com",
|
|
5
|
-
"version": "0.8.6
|
|
5
|
+
"version": "0.8.6",
|
|
6
6
|
"author": "Tom Nielsen @glutamate",
|
|
7
7
|
"bin": {
|
|
8
8
|
"saltcorn": "./bin/saltcorn"
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"@oclif/config": "^1.18.3",
|
|
14
14
|
"@oclif/plugin-plugins": "^2.1.0",
|
|
15
15
|
"@oclif/plugin-help": "^3.3.1",
|
|
16
|
-
"@saltcorn/admin-models": "0.8.6
|
|
17
|
-
"@saltcorn/data": "0.8.6
|
|
18
|
-
"@saltcorn/mobile-app": "0.8.6
|
|
19
|
-
"@saltcorn/mobile-builder": "0.8.6
|
|
20
|
-
"@saltcorn/server": "0.8.6
|
|
16
|
+
"@saltcorn/admin-models": "0.8.6",
|
|
17
|
+
"@saltcorn/data": "0.8.6",
|
|
18
|
+
"@saltcorn/mobile-app": "0.8.6",
|
|
19
|
+
"@saltcorn/mobile-builder": "0.8.6",
|
|
20
|
+
"@saltcorn/server": "0.8.6",
|
|
21
21
|
"cli-ux": "^5.6.7",
|
|
22
22
|
"contractis": "^0.1.0",
|
|
23
23
|
"dateformat": "^3.0.3",
|
|
@@ -55,7 +55,12 @@
|
|
|
55
55
|
"bin": "saltcorn",
|
|
56
56
|
"plugins": [
|
|
57
57
|
"@oclif/plugin-help"
|
|
58
|
-
]
|
|
58
|
+
],
|
|
59
|
+
"topics": {
|
|
60
|
+
"dev": {
|
|
61
|
+
"description": "Tools for core and plugin developers"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
59
64
|
},
|
|
60
65
|
"repository": "github:saltcorn/saltcorn",
|
|
61
66
|
"scripts": {
|
|
@@ -73,6 +73,9 @@ class BuildAppCommand extends Command {
|
|
|
73
73
|
if (!user && flags.userEmail)
|
|
74
74
|
throw new Error(`The user '${flags.userEmail}' does not exist'`);
|
|
75
75
|
const builder = new MobileBuilder({
|
|
76
|
+
appName: flags.appName,
|
|
77
|
+
appVersion: flags.appVersion,
|
|
78
|
+
appIcon: flags.appIcon,
|
|
76
79
|
templateDir: mobileAppDir,
|
|
77
80
|
buildDir: flags.buildDirectory,
|
|
78
81
|
cliDir: path.join(__dirname, "../.."),
|
|
@@ -82,11 +85,11 @@ class BuildAppCommand extends Command {
|
|
|
82
85
|
entryPoint: flags.entryPoint,
|
|
83
86
|
entryPointType: flags.entryPointType ? flags.entryPointType : "view",
|
|
84
87
|
serverURL: flags.serverURL,
|
|
88
|
+
splashPage: flags.splashPage,
|
|
85
89
|
allowOfflineMode: flags.allowOfflineMode,
|
|
86
90
|
plugins: await this.uniquePlugins(),
|
|
87
91
|
copyTargetDir: flags.copyAppDirectory,
|
|
88
92
|
user,
|
|
89
|
-
copyFileName: flags.appFileName,
|
|
90
93
|
buildForEmulator: flags.buildForEmulator,
|
|
91
94
|
tenantAppName: flags.tenantAppName,
|
|
92
95
|
});
|
|
@@ -156,16 +159,33 @@ BuildAppCommand.flags = {
|
|
|
156
159
|
char: "u",
|
|
157
160
|
description: "Email of the user building the app",
|
|
158
161
|
}),
|
|
159
|
-
|
|
160
|
-
name: "app
|
|
161
|
-
|
|
162
|
-
description: "
|
|
162
|
+
appName: flags.string({
|
|
163
|
+
name: "app name",
|
|
164
|
+
string: "appName",
|
|
165
|
+
description: "Name of the mobile app (default SaltcornMobileApp)",
|
|
166
|
+
}),
|
|
167
|
+
appVersion: flags.string({
|
|
168
|
+
name: "app version",
|
|
169
|
+
string: "appVersion",
|
|
170
|
+
description: "Version of the mobile app (default 1.0.0)",
|
|
171
|
+
}),
|
|
172
|
+
appIcon: flags.string({
|
|
173
|
+
name: "app icon",
|
|
174
|
+
string: "appIcon",
|
|
175
|
+
description:
|
|
176
|
+
"A png that will be used as launcher icon. The default is a png of a saltcorn symbol.",
|
|
163
177
|
}),
|
|
164
178
|
serverURL: flags.string({
|
|
165
179
|
name: "server URL",
|
|
166
180
|
char: "s",
|
|
167
181
|
description: "URL to a saltcorn server",
|
|
168
182
|
}),
|
|
183
|
+
splashPage: flags.string({
|
|
184
|
+
name: "splash page",
|
|
185
|
+
string: "splashPage",
|
|
186
|
+
description:
|
|
187
|
+
"Name of a page that should be shown while the app is loading.",
|
|
188
|
+
}),
|
|
169
189
|
allowOfflineMode: flags.boolean({
|
|
170
190
|
name: "Allow offline mode",
|
|
171
191
|
string: "allowOfflineMode",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { Command } = require("@oclif/command");
|
|
1
|
+
const { Command, flags } = require("@oclif/command");
|
|
2
2
|
const { join } = require("path");
|
|
3
3
|
const { spawnSync } = require("child_process");
|
|
4
4
|
|
|
@@ -8,27 +8,23 @@ const { spawnSync } = require("child_process");
|
|
|
8
8
|
* Please make sure docker is callable without sudo (see rootless mode, or add the user to the docker group).
|
|
9
9
|
*/
|
|
10
10
|
class BuildCordovaBuilder extends Command {
|
|
11
|
-
run() {
|
|
11
|
+
async run() {
|
|
12
|
+
const { flags } = this.parse(BuildCordovaBuilder);
|
|
12
13
|
const dockerDir = join(
|
|
13
14
|
require.resolve("@saltcorn/mobile-builder"),
|
|
14
15
|
"..",
|
|
15
16
|
"..",
|
|
16
17
|
"docker"
|
|
17
18
|
);
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"-f",
|
|
26
|
-
join(dockerDir, "Dockerfile"),
|
|
27
|
-
"-t",
|
|
28
|
-
"saltcorn/cordova-builder",
|
|
29
|
-
],
|
|
30
|
-
{ cwd: ".", stdio: "inherit" }
|
|
19
|
+
const dArgs = ["build", dockerDir, "--network", "host"];
|
|
20
|
+
if (flags.buildClean) dArgs.push("--no-cache");
|
|
21
|
+
dArgs.push(
|
|
22
|
+
"-f",
|
|
23
|
+
join(dockerDir, "Dockerfile"),
|
|
24
|
+
"-t",
|
|
25
|
+
"saltcorn/cordova-builder"
|
|
31
26
|
);
|
|
27
|
+
const result = spawnSync("docker", dArgs, { cwd: ".", stdio: "inherit" });
|
|
32
28
|
if (result.error) console.log(result.error.toString());
|
|
33
29
|
}
|
|
34
30
|
}
|
|
@@ -41,4 +37,13 @@ BuildCordovaBuilder.help =
|
|
|
41
37
|
"This image is used in the 'build-app' command to run the cordova commands. " +
|
|
42
38
|
"Please make sure docker is callable without using root (see rootless mode, or add the user to the docker group).";
|
|
43
39
|
|
|
40
|
+
BuildCordovaBuilder.flags = {
|
|
41
|
+
buildClean: flags.boolean({
|
|
42
|
+
name: "build clean",
|
|
43
|
+
string: "clean",
|
|
44
|
+
description: "run a clean build with --no-cache",
|
|
45
|
+
default: false,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
|
|
44
49
|
module.exports = BuildCordovaBuilder;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-cli
|
|
3
|
+
* @module commands/post-release
|
|
4
|
+
*/
|
|
5
|
+
const { Command, flags } = require("@oclif/command");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const fsp = fs.promises;
|
|
8
|
+
const { spawnSync, spawn } = require("child_process");
|
|
9
|
+
const { sleep } = require("../../common");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const fetch = require("node-fetch");
|
|
12
|
+
const { exitCode } = require("process");
|
|
13
|
+
|
|
14
|
+
const runWithOutput = (cmd, args, opts = {}) =>
|
|
15
|
+
new Promise(function (resolve, reject) {
|
|
16
|
+
const stdouterrs = [];
|
|
17
|
+
let exitCode;
|
|
18
|
+
const child = spawn(cmd, args, {
|
|
19
|
+
stdio: "pipe",
|
|
20
|
+
...opts,
|
|
21
|
+
});
|
|
22
|
+
child.stdout.on("data", (data) => {
|
|
23
|
+
console.log(data.toString());
|
|
24
|
+
stdouterrs.push(data.toString());
|
|
25
|
+
});
|
|
26
|
+
child.stderr.on("data", (data) => {
|
|
27
|
+
console.error(data.toString());
|
|
28
|
+
stdouterrs.push(data.toString());
|
|
29
|
+
});
|
|
30
|
+
child.on("exit", function (code, signal) {
|
|
31
|
+
exitCode = code;
|
|
32
|
+
resolve({ output: stdouterrs.join(""), exitCode });
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* PostReleaseCommand Class
|
|
38
|
+
* @extends oclif.Command
|
|
39
|
+
* @category saltcorn-cli
|
|
40
|
+
*/
|
|
41
|
+
class PostReleaseCommand extends Command {
|
|
42
|
+
get baseRepoDir() {
|
|
43
|
+
return path.join(__dirname, "..", "..", "..", "..", "..");
|
|
44
|
+
}
|
|
45
|
+
async docker() {
|
|
46
|
+
spawnSync("bash", ["deploy/docker_build_push.sh"], {
|
|
47
|
+
stdio: "inherit",
|
|
48
|
+
cwd: this.baseRepoDir,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
async vagrant() {
|
|
52
|
+
const token = process.env.SALTCORN_RELEASE_REPORT_TOKEN;
|
|
53
|
+
if (!token) {
|
|
54
|
+
console.error("Token not found in env var SALTCORN_RELEASE_REPORT_TOKEN");
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
const fres = await fetch("https://releases.saltcorn.com/api/Release", {
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: {
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
Authorization: `Bearer ${token}`,
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
body: JSON.stringify({
|
|
65
|
+
version: this.version,
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
const jresp = await fres.json();
|
|
69
|
+
const release_id = jresp.success;
|
|
70
|
+
if (!release_id) {
|
|
71
|
+
console.error("cannot insert");
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const vagrantDir = path.join(
|
|
76
|
+
this.baseRepoDir,
|
|
77
|
+
"deploy",
|
|
78
|
+
"vagrant-test-install"
|
|
79
|
+
);
|
|
80
|
+
const dirs = fs.readdirSync(vagrantDir);
|
|
81
|
+
for (const dir of dirs) {
|
|
82
|
+
console.log(dir);
|
|
83
|
+
const cwd = path.join(vagrantDir, dir);
|
|
84
|
+
|
|
85
|
+
const stat = await fsp.stat(cwd);
|
|
86
|
+
if (!stat.isDirectory()) continue;
|
|
87
|
+
const runres = await runWithOutput("vagrant", ["up"], {
|
|
88
|
+
cwd,
|
|
89
|
+
});
|
|
90
|
+
spawnSync("vagrant", ["destroy", "-f"], {
|
|
91
|
+
stdio: "inherit",
|
|
92
|
+
cwd,
|
|
93
|
+
});
|
|
94
|
+
const fres1 = await fetch(
|
|
95
|
+
"https://releases.saltcorn.com/api/Build Result",
|
|
96
|
+
{
|
|
97
|
+
method: "POST",
|
|
98
|
+
headers: {
|
|
99
|
+
"Content-Type": "application/json",
|
|
100
|
+
Authorization: `Bearer ${token}`,
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
body: JSON.stringify({
|
|
104
|
+
build_output: runres.output,
|
|
105
|
+
pass: runres.exitCode === 0,
|
|
106
|
+
name: dir,
|
|
107
|
+
release: release_id,
|
|
108
|
+
vagrantfile: `https://github.com/saltcorn/saltcorn/blob/v${this.version}/deploy/vagrant-test-install/${dir}/Vagrantfile`,
|
|
109
|
+
}),
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @returns {Promise<void>}
|
|
117
|
+
*/
|
|
118
|
+
async run() {
|
|
119
|
+
const {
|
|
120
|
+
args: { task },
|
|
121
|
+
} = this.parse(PostReleaseCommand);
|
|
122
|
+
this.version = require(path.join(
|
|
123
|
+
__dirname,
|
|
124
|
+
"..",
|
|
125
|
+
"..",
|
|
126
|
+
"..",
|
|
127
|
+
"package.json"
|
|
128
|
+
)).version;
|
|
129
|
+
console.log("Version", this.version);
|
|
130
|
+
if (!this.version) this.exit(1);
|
|
131
|
+
if (!task || task === "docker" || task === "all") await this.docker();
|
|
132
|
+
|
|
133
|
+
if (!task || task === "vagrant" || task === "all") await this.vagrant();
|
|
134
|
+
this.exit(0);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @type {string}
|
|
140
|
+
*/
|
|
141
|
+
PostReleaseCommand.description = `Post-release tasks: docker and vagrant builds`;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @type {object}
|
|
145
|
+
*/
|
|
146
|
+
PostReleaseCommand.args = [
|
|
147
|
+
{
|
|
148
|
+
name: "task",
|
|
149
|
+
options: ["docker", "vagrant", "all", "none"],
|
|
150
|
+
description: "What to do",
|
|
151
|
+
},
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
module.exports = PostReleaseCommand;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
const { Command, flags } = require("@oclif/command");
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const { spawnSync } = require("child_process");
|
|
8
|
-
const { sleep } = require("
|
|
8
|
+
const { sleep } = require("../../common");
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* ReleaseCommand Class
|
|
@@ -73,7 +73,7 @@ class ReleaseCommand extends Command {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const updatePkgJson = (dir) => {
|
|
76
|
-
const json = require(
|
|
76
|
+
const json = require(`../../../../${dir}/package.json`);
|
|
77
77
|
json.version = version;
|
|
78
78
|
if (json.dependencies || json.devDependencies)
|
|
79
79
|
Object.keys(pkgs).forEach((dpkgnm) => {
|
|
@@ -101,7 +101,7 @@ class ReleaseCommand extends Command {
|
|
|
101
101
|
cwd: `packages/${dir}/`,
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
const rootPackageJson = require(
|
|
104
|
+
const rootPackageJson = require(`../../../../../package.json`);
|
|
105
105
|
|
|
106
106
|
compileTsFiles();
|
|
107
107
|
//for each package:
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
const { Command, flags } = require("@oclif/command");
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param {object[]} ps
|
|
8
|
+
*
|
|
9
|
+
* @param {object[]} ps
|
|
10
10
|
* @returns {object}
|
|
11
11
|
*/
|
|
12
12
|
const lastPath = (ps) =>
|
|
@@ -16,7 +16,7 @@ const lastPath = (ps) =>
|
|
|
16
16
|
* TestPluginCommand Class
|
|
17
17
|
* @extends oclif.Command
|
|
18
18
|
* @category saltcorn-cli
|
|
19
|
-
*/
|
|
19
|
+
*/
|
|
20
20
|
class TestPluginCommand extends Command {
|
|
21
21
|
/**
|
|
22
22
|
* @returns {Promise<void>}
|
|
@@ -51,8 +51,8 @@ class SetupBenchmarkCommand extends Command {
|
|
|
51
51
|
const user = await User.findOne({});
|
|
52
52
|
// insert rows
|
|
53
53
|
const Table = require("@saltcorn/data/models/table");
|
|
54
|
-
const threads =
|
|
55
|
-
const replies =
|
|
54
|
+
const threads = Table.findOne({ name: "Threads" });
|
|
55
|
+
const replies = Table.findOne({ name: "Replies" });
|
|
56
56
|
const thread_id = await threads.insertRow({
|
|
57
57
|
title: "How fast is Saltcorn?",
|
|
58
58
|
body: "How fast is it really?",
|
|
@@ -31,8 +31,8 @@ class TransformFieldCommand extends Command {
|
|
|
31
31
|
}
|
|
32
32
|
const tenant = args.tenant || db.connectObj.default_schema;
|
|
33
33
|
await db.runWithTenant(tenant, async () => {
|
|
34
|
-
const table =
|
|
35
|
-
const fields =
|
|
34
|
+
const table = Table.findOne({ name: args.table });
|
|
35
|
+
const fields = table.getFields();
|
|
36
36
|
const field = fields.find((f) => f.name === args.field);
|
|
37
37
|
if (!field) {
|
|
38
38
|
console.error("field not found");
|
|
File without changes
|