Use .env.edn
file to set "FLEX_API_BASE_URL"
to point to different environments (local, staging, prod ... )
Set :api-key
in ~/.config/flex-cli/auth.edn
file to quickly change API key (or use flex-cli login
)
-
Create .env.end file.
cp .env.edn.tmpl .env.edn
-
In Emacs:
> cider-jack-in-cljs > Select ClojureScript REPL type: shadow > Select shadow-cljs build: dev > Open browser? what ever
-
In terminal tab:
> yarn install > node target/dev.js (or yarn run dev, which does take same thing)
Now your dev environment is up and running! You can evaluate code in Emacs and Cider is connected to the running application.
To run the CLI with command-line arguments, evaluate in REPL:
(sharetribe.flex-cli.core/main-dev-str "process list -m bike-soil")
Pro tip:
To get rid of the annoying questions when running
cider-jack-in-cljs
, copy the .dir-locals.el
from template file:
> cp .dir-locals.el.tmpl .dir-locals.el
For REPL configuration, refer to: https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive https://gist.github.com/akovantsev/44e2a0e10908785d1f40d3d3bcfff574#file-cursive-shadow-cljs-repl-setup-md
yarn shadow-cljs watch :dev
(shadow/repl :dev)
In another terminal,
yarn run dev
Now, you can use cursive REPL!
The dev
build is configured to do hot code loading.
When you run node target/dev.js
, the process is left running for hot
loading purposes. You will see a log message when new code is loaded.
To run the CLI with new code, evaluate:
(sharetribe.flex-cli.core/main-dev-str "process list -m bike-soil")
yarn run test
Return 0 or 1 exit code based on the result.
in Emacs
yarn run test-autorun
The autorun will keep running the tests when you change any file. See the REPL for test output.
Unfortunately, running CLJS tests using Cider C-c C-t t
is not
supported
Compile release build:
yarn run compile
Run it:
node target/min.js <arguments>
To install the compiled release build:
yarn global add file:$(pwd)
Run it:
flex-cli
Troubleshooting: If nothing happens, press Ctrl+C. You probably ran the other flex command line tool. Restart your terminal and try again.
You can use Verdaccio, a lightweight private NPM registry to test the publish/install/update process with real NPM registry.
See the installation instructions.
After you've installed it and started verdaccio server, you can publish flex-cli to it, e.g.:
npm install -g flex-cli --registry http://localhost:4873
Tip: In case you want to test installation with other machines in your network, do this:
-
Check your IP address in the network (starts with 192.)
-
Start verdaccio server with
-l
option, e.g:verdaccio -l 192.168.1.91:4873
-
In the other machine, use that IP and port as the registry address when running
npm install
.
-
Change package
version
inpackage.json
and insrc/sharetribe/flex_cli/cli_info.cljs
-
Go to the repo root dir
-
Clean the build dir:
yarn run clean
The
target/
directory should be empty now. -
Make a release build:
yarn run release
-
Commit and push
-
Login as
sharetribe
withnpm login
- check credentials from password manager
-
Publish with
npm publish
-
Add a new tag
git tag -a v1.2.3 -m v1.2.3
-
Update
latest
taggit push origin :refs/tags/latest git tag -f -a latest -m latest
-
Push the tag
git push --tags
-
Announce the new version in Slack