@ollie-shop/cli 1.1.0 → 1.2.1

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/.env.example CHANGED
@@ -1,3 +1,6 @@
1
1
  # Required for all authenticated commands (store, version, component, whoami)
2
2
  OLLIE_SUPABASE_URL=http://127.0.0.1:54321
3
3
  OLLIE_SUPABASE_ANON_KEY=your-anon-key-here
4
+
5
+ # Required for deploy and status commands
6
+ OLLIE_BUILDER_URL=https://builder.ollie.shop
@@ -1,5 +1,5 @@
1
1
 
2
- > @ollie-shop/cli@1.1.0 build /home/runner/work/ollie-shop/ollie-shop/packages/cli
2
+ > @ollie-shop/cli@1.2.1 build /home/runner/work/ollie-shop/ollie-shop/packages/cli
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,5 +9,5 @@
9
9
  CLI Target: node22
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
- ESM dist/index.js 64.35 KB
13
- ESM ⚡️ Build success in 202ms
12
+ ESM dist/index.js 78.88 KB
13
+ ESM ⚡️ Build success in 157ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ollie-shop/cli
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - aaf2730: Bake prod Supabase + builder defaults into the CLI so `ollieshop` runs with zero env setup.
8
+
9
+ Agent commands (`whoami`, `store`, `version`, `component`, `function`, `deploy`, `status`) previously threw `Missing required environment variable: OLLIE_SUPABASE_URL` unless the user had exported `OLLIE_SUPABASE_URL`, `OLLIE_SUPABASE_ANON_KEY`, and `OLLIE_BUILDER_URL` in their shell first. All three values are public, so the friction was pure onboarding overhead.
10
+
11
+ `packages/cli/src/utils/supabase.ts` now holds a `PROD_DEFAULTS` const and an `envOrDefault()` helper. Env vars still win when set, so devs pointing the CLI at local Supabase (`http://127.0.0.1:54321`) or a non-prod project are unaffected. Fresh contributors can now run `ollieshop login && ollieshop whoami` without any shell setup.
12
+
13
+ ## 1.2.0
14
+
15
+ ### Minor Changes
16
+
17
+ - f8fa27d: add business-rule command
18
+
3
19
  ## 1.1.0
4
20
 
5
21
  ### Minor Changes
package/CONTEXT.md CHANGED
@@ -21,6 +21,7 @@ Set these before running authenticated commands (or use a `.env` file):
21
21
  ```
22
22
  OLLIE_SUPABASE_URL=http://127.0.0.1:54321
23
23
  OLLIE_SUPABASE_ANON_KEY=<your-anon-key>
24
+ OLLIE_BUILDER_URL=https://builder.ollie.shop
24
25
  ```
25
26
 
26
27
  The CLI will throw a clear error if a required env var is missing. See `.env.example` for reference.
@@ -49,12 +50,29 @@ ollieshop init --store-id <STORE_ID> --version-id <VERSION_ID>
49
50
  # 6. Register components
50
51
  ollieshop component create --data '{"versionId":"<VERSION_ID>","name":"FreeShippingBar","slot":"cart_header_full_page","active":true}' -o json
51
52
 
52
- # 7. List resources
53
+ # 7. Deploy component (bundle + upload + build)
54
+ ollieshop deploy --component-id <COMPONENT_ID> --name FreeShippingBar --wait -o json
55
+
56
+ # 8. Check build status
57
+ ollieshop status --build-id <BUILD_ID> -o json
58
+ ollieshop status --build-id <BUILD_ID> --wait --timeout 300 -o json
59
+
60
+ # 9. List resources
53
61
  ollieshop store list -o json --fields id,name,platform
54
62
  ollieshop version list --store-id <STORE_ID> -o json --fields id,name,active
55
63
  ollieshop component list --store-id <STORE_ID> -o json --fields id,name,slot,active
56
64
  ```
57
65
 
66
+ ## Deploy Workflow
67
+
68
+ The `deploy` command bundles a component directory into a zip, uploads it to the Builder service, and optionally waits for the build to complete.
69
+
70
+ 1. `ollieshop deploy --component-id <UUID> --name <ComponentName> --dry-run -o json` — validate and show bundle size
71
+ 2. `ollieshop deploy --component-id <UUID> --name <ComponentName> --wait -o json` — upload and poll until done
72
+ 3. `ollieshop status --build-id <BUILD_ID> --wait -o json` — poll an existing build
73
+
74
+ Terminal build statuses: `SUCCEEDED`, `FAILED`, `STOPPED`, `TIMED_OUT`, `FAULT`
75
+
58
76
  ## Response Format
59
77
 
60
78
  All commands return:
package/README.md CHANGED
@@ -38,6 +38,7 @@ ollieshop store list -o json --fields id,name,platform
38
38
  |----------|----------|-------------|
39
39
  | `OLLIE_SUPABASE_URL` | Yes (agent commands) | Supabase project URL |
40
40
  | `OLLIE_SUPABASE_ANON_KEY` | Yes (agent commands) | Supabase anon/public key |
41
+ | `OLLIE_BUILDER_URL` | Yes (deploy/status) | Builder service URL |
41
42
 
42
43
  See `.env.example` for reference. The CLI will throw a clear error if a required variable is missing.
43
44
 
@@ -105,6 +106,33 @@ ollieshop component list --store-id <STORE_UUID> -o json --fields id,name,slot,a
105
106
  ollieshop component create --version-id <VERSION_UUID> --name FreeShippingBar --slot cart_header_full_page -o json
106
107
  ```
107
108
 
109
+ #### `deploy`
110
+
111
+ Bundle a component directory into a zip and upload to the Builder service.
112
+
113
+ ```bash
114
+ # Dry-run: validate and show bundle size
115
+ ollieshop deploy --component-id <UUID> --name FreeShippingBar --dry-run -o json
116
+
117
+ # Deploy and wait for build to complete
118
+ ollieshop deploy --component-id <UUID> --name FreeShippingBar --wait -o json
119
+
120
+ # Deploy a function
121
+ ollieshop deploy --function-id <UUID> --name myHook --wait -o json
122
+ ```
123
+
124
+ #### `status`
125
+
126
+ Check or poll a build status.
127
+
128
+ ```bash
129
+ # One-shot status check
130
+ ollieshop status --build-id <BUILD_ID> -o json
131
+
132
+ # Poll until terminal status
133
+ ollieshop status --build-id <BUILD_ID> --wait --timeout 300 -o json
134
+ ```
135
+
108
136
  #### `schema`
109
137
 
110
138
  Introspect resource schemas at runtime. Returns JSON Schema definitions for all available resources and actions.
@@ -175,12 +203,14 @@ src/
175
203
  ├── index.tsx # Entry point — routes to agent or interactive commands
176
204
  ├── cli.tsx # Ink app for interactive commands
177
205
  ├── commands/
178
- │ ├── whoami.ts # Agent: show current user
179
- │ ├── store-cmd.ts # Agent: store CRUD
180
- │ ├── version-cmd.ts # Agent: version CRUD
181
- │ ├── component-cmd.ts# Agent: component CRUD
182
- │ ├── schema-cmd.ts # Agent: schema introspection
183
- │ ├── init-cmd.ts # Agent: write ollie.json
206
+ │ ├── whoami.ts # Agent: show current user
207
+ │ ├── store-cmd.ts # Agent: store CRUD
208
+ │ ├── version-cmd.ts # Agent: version CRUD
209
+ │ ├── component-cmd.ts # Agent: component CRUD
210
+ │ ├── deploy-cmd.ts # Agent: bundle + upload builds
211
+ │ ├── status-cmd.ts # Agent: check/poll build status
212
+ │ ├── schema-cmd.ts # Agent: schema introspection
213
+ │ ├── init-cmd.ts # Agent: write ollie.json
184
214
  │ ├── help.tsx # Interactive: help display
185
215
  │ ├── login.tsx # Interactive: browser auth
186
216
  │ └── start.tsx # Interactive: dev server
@@ -188,12 +218,14 @@ src/
188
218
  │ ├── store.ts # Store business logic + Supabase queries
189
219
  │ ├── version.ts # Version business logic + Supabase queries
190
220
  │ ├── component.ts # Component business logic + Supabase queries
221
+ │ ├── deploy.ts # Builder API client (upload, status, poll)
191
222
  │ └── schema.ts # Zod schemas + JSON Schema generation
192
223
  └── utils/
193
224
  ├── parse-args.ts # CLI argument parser (flags, subcommands, positional)
194
225
  ├── output.ts # JSON/pretty output formatter + field filtering
195
226
  ├── validate.ts # UUID, required, enum, resource name validators
196
- ├── supabase.ts # Authenticated Supabase client + org resolution
227
+ ├── supabase.ts # Authenticated Supabase client + builder URL + org resolution
228
+ ├── bundle.ts # Component zip bundler (archiver)
197
229
  ├── auth.ts # Browser auth flow + credential storage
198
230
  └── config.ts # ollie.json config loader/saver
199
231
  ```