@jigx/sdk-tools 1.2.0-next.2 → 1.2.0-next.3

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.
Files changed (2) hide show
  1. package/README.md +16 -51
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,69 +1,34 @@
1
1
  # @jigx/sdk-tools
2
2
 
3
- CLI for solution-designers to scaffold, build, and deploy Jigx Applications. Provides the `jigx` command with `create`, `build`, `login`, `init`, `deploy`, `whoami`, and `logout` verbs, backed by `@jigx/core-sdk` builders.
3
+ `jigx` CLI for solution designers to scaffold, build, and deploy Jigx Applications (backed by `@jigx/core-sdk` builders).
4
4
 
5
5
  ## Requirements
6
6
 
7
- - **Node.js ≥22** — install from [nodejs.org](https://nodejs.org/) or `brew install node`.
7
+ Node.js >=22. `jigx create` runs `npm install` in the new project; swap to yarn/pnpm afterwards if preferred.
8
8
 
9
- No package manager is required globally: `jigx create` runs `npm install` (which ships with Node) inside the new project. After scaffolding you can swap to yarn or pnpm in that project if you prefer.
10
-
11
- ## Onboarding
9
+ ## Quick start
12
10
 
13
11
  ```bash
14
- npm i -g @jigx/sdk-tools@next # 1. one-time per machine: puts `jigx` on PATH
15
- jigx create # 2. prompts → scaffolds <cwd>/<applicationName>, runs npm install
12
+ npm i -g @jigx/sdk-tools@next # once per machine
13
+ jigx create # scaffolds <cwd>/<applicationName>
16
14
  cd <applicationName>
17
- jigx deploy # 3. first run: interactive login + init, then deploys to prod
15
+ jigx deploy # first run: login + init inline, then deploy to prod
18
16
  ```
19
17
 
20
- On first `jigx deploy`, the CLI:
21
-
22
- 1. Detects no cached **RefreshToken** and runs `jigx login` inline (Cognito email + password). Stores the refresh token at `~/.jigx/refresh-tokens.json`.
23
- 2. Detects no **OrganizationBinding** in `<projectRoot>/jigx.json` and runs `jigx init` inline (Organization picker). Writes the binding to `jigx.json`.
24
- 3. Builds, then deploys content to the prod environment.
25
-
26
- Subsequent deploys reuse both artifacts and skip straight to build + deploy. Pass `--env dev` to target staging, `--env clf-dev` for the Cloudflare dev stamp, or `--env clf-prod` for the Cloudflare prod stamp.
27
-
28
- ## Commands
29
-
30
- | Command | What it does |
31
- | --- | --- |
32
- | `jigx create` | Prompts for Title → Name → Type, scaffolds a new Application project, runs `npm install`. |
33
- | `jigx build` | Compiles `src/app.ts` into `build/output.json` plus the canonical Builder folder layout under `build/app/` for inspection. |
34
- | `jigx login` | Signs in to Cognito (interactive email + password) and caches a refresh token in `~/.jigx/refresh-tokens.json`. |
35
- | `jigx init` | Picks an Organization for the current environment and writes the binding to `<projectRoot>/jigx.json`. |
36
- | `jigx deploy` | Builds, then deploys content. Defaults to prod. Pass `--env dev` for staging, `--env clf-dev` for the Cloudflare dev stamp, or `--env clf-prod` for the Cloudflare prod stamp. Auto-runs `jigx login` and `jigx init` if needed (TTY only). |
37
- | `jigx whoami` | Prints the live User identity and the project's Organization binding for the chosen environment. |
38
- | `jigx logout` | Clears cached refresh tokens for one env or all envs. |
39
-
40
- ## Auth model
41
-
42
- Three commands compose the auth flow:
18
+ Commands: `create`, `build`, `login`, `init`, `deploy`, `whoami`, `logout`. Run `jigx --help` for options.
43
19
 
44
- 1. **`jigx login`** — interactive Cognito SRP sign-in. Stores a long-lived refresh token at `~/.jigx/refresh-tokens.json`, file mode `0o600`, dir mode `0o700`. Keyed by `<env>:<userPoolId>` so dev and prod entries never collide.
45
- 2. **`jigx init`** — picks an Organization from the User's memberships and writes `<projectRoot>/jigx.json` (`{ "<env>": { "organizationId": "..." } }`). `jigx.json` is a per-project, per-environment binding and is intentionally committable — multiple developers on the same project share the same Organization mapping.
46
- 3. **`jigx deploy`** — refreshes a Cognito ID token from the cached refresh token, looks up the Organization in `jigx.json`, and `Bearer`s the ID token at the Strata API.
20
+ `--env dev` (staging), `--env clf-dev`, `--env clf-prod` target other environments; default is prod. `jigx init --org <id>` skips the Organization picker.
47
21
 
48
- In TTY mode, `jigx deploy` fills in missing pieces inline by invoking `jigx login` or `jigx init` as needed. In non-TTY mode (CI), missing pieces surface as typed errors naming the exact command to run.
22
+ ## Auth
49
23
 
50
- ## Limitations
24
+ - `jigx login`: Cognito email + password; refresh token cached at `~/.jigx/refresh-tokens.json` (keyed per env).
25
+ - `jigx init`: writes the Organization binding to `<projectRoot>/jigx.json` (per env, safe to commit).
26
+ - `jigx deploy` runs login/init inline when missing (TTY only). Non-TTY (CI) fails with the command to run.
51
27
 
52
- - **No CI / non-interactive auth.** The auth flow assumes a TTY for the email + password prompt. There is no service-account / API-key path. CI deploys must pre-populate `~/.jigx/refresh-tokens.json` from a prior interactive `jigx login` (out of scope for the CLI).
53
- - **No SSO.** Users whose Jigx accounts are managed by an external IdP cannot use `jigx login` today.
54
-
55
- See [ADR-0002](../../docs/adr/0002-sdk-tools-cognito-only-auth.md) for the rationale.
28
+ Limitations: no CI/non-interactive auth (pre-populate `~/.jigx/refresh-tokens.json` from an interactive login), no SSO. Rationale: [ADR-0002](../../docs/adr/0002-sdk-tools-cognito-only-auth.md).
56
29
 
57
30
  ## Troubleshooting
58
31
 
59
- ### `jigx: command not found`
60
-
61
- `@jigx/sdk-tools` is not installed globally. Run `npm i -g @jigx/sdk-tools@next` and retry.
62
-
63
- ### `Not authenticated. Run jigx login.`
64
-
65
- `~/.jigx/refresh-tokens.json` is missing or the cached refresh token has expired/been revoked. Run `jigx login` (add `--env dev` for staging or `--env clf-dev` for the Cloudflare dev stamp) and retry.
66
-
67
- ### `No Organization configured for env "<env>".`
68
-
69
- `<projectRoot>/jigx.json` has no binding for the requested environment. Run `jigx init` (add `--env dev` for staging or `--env clf-dev` for the Cloudflare dev stamp, optionally `--org <id>` to skip the picker).
32
+ - `jigx: command not found`: install globally (above).
33
+ - `Not authenticated. Run jigx login.`: refresh token missing/expired/revoked; run `jigx login` (with the same `--env`).
34
+ - `No Organization configured for env "<env>".`: run `jigx init` (with the same `--env`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jigx/sdk-tools",
3
- "version": "1.2.0-next.2",
3
+ "version": "1.2.0-next.3",
4
4
  "description": "Jigx SDK toolkit (jigx CLI) — scaffold, build, and publish Jigx Application projects",
5
5
  "license": "ISC",
6
6
  "type": "module",