Dev Setup
=========

To use in development, you should first:

  yarn install
  yarn build

Which generates the js file in dist/.  Then, you should do

  yarn link

Which adds the bin file to the yarn global bin (the location of the global bin is
at `yarn global bin`.)

If you see the symlink there but can't execute it, you'll need to set the permission
correctly

  chmod +x `yarn global bin`/plasmic

Debugging
=========

Example invocation:

    DEBUG_CHDIR=/path/to/target/project \
        PLASMIC_DEFAULT_HOST=http://localhost:3003 \
        PLASMIC_DISABLE_AUTH_SEARCH=1 \
        npx tsx src/index.ts \
        --auth ~/.plasmic.dev.auth \
        sync

This runs the source in-place from the .ts files so that you can debug the unmangled source code in Chrome devtools.

- `DEBUG_CHDIR`: First cd's into the target directory (which typically has its own node_modules etc., so it's tricky to try to run the source from there).
- `PLASMIC_DEFAULT_HOST`: Point to your localhost app server (even if you don't already have an auth file set up).
- `--auth`: Reference your own alternate auth file, if you already have one.
- `PLASMIC_DISABLE_AUTH_SEARCH`: Prevent auto-searching home and parent dirs for a `.plasmic.auth` file. Useful if you want to not provide any `--auth` (you probably won't use both `--auth` and this together).

Extra hidden API
================

Additional environment variables, primarily used by PlasmicLoader.

- `PLASMIC_LOADER`: runs in "PlasmicLoader mode."
- `QUIET`: suppress various output, especially confirmations and subprocesses.