wslc-wip 0.18.2 → 1.0.0

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +150 -120
  3. data/lib/wip/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f4750c407f5fe6be96d5e079e090d8d8a9aea434479bbbfcfe628db1ba1b993
4
- data.tar.gz: e3a71ba96464b059bcfb04e48c4512848f56564efa91aa0a05f6efbf4380e8aa
3
+ metadata.gz: 91983f52ddbbc2b2ce8eff75cd94534f9e32525d006ff7388152ac24a199ee15
4
+ data.tar.gz: c50b1311d33cbe16d94b1e050ce63f31c054bdd4850285728a3680d0c87e3390
5
5
  SHA512:
6
- metadata.gz: adf6898a0e0bb8f15cc755fd64f6d7a86abfcadb915c2cf934171276ea80a76671fb423c57778c89b120684a4db211dc540f6e87e3d154b9c989e24bdbfe2904
7
- data.tar.gz: a871127bfbc45d40c43e08efe282e134b2e021df7af7c9209fe60c443e1158b13a8b7f7328664c453fe1ffce30c51b3ee8cc77d2b39a78c92298de303e8be7bc
6
+ metadata.gz: 1f5fd382e2c88dbee58c8835be090e6aefd885f4d938d1d4543ac821f1822e4fc55c8f0da384e69d4d874b40382dcfc9e1914aec4c330b0a8b1173ff1518cff1
7
+ data.tar.gz: 9751c65c89c31c0d0f7e27ed28f27c4deece06ed15c780a900f608ba89df3cd9b16aae3c85faad058a4fb3363e5fe30ee30b29030fca6cdd22f828cad8bcc1a0
data/README.md CHANGED
@@ -7,6 +7,26 @@
7
7
 
8
8
  Homepage: https://wslc-wip.slidict.com/
9
9
 
10
+ ## Contents
11
+
12
+ - [Which mode should you use?](#which-mode-should-you-use)
13
+ - [Requirements & installation](#requirements--installation)
14
+ - [Quick start](#quick-start)
15
+ - [Configuration](#configuration)
16
+ - [Container mode](#container-mode)
17
+ - [Compose mode](#compose-mode)
18
+ - [Compose mode (native)](#compose-mode-native)
19
+ - [.env](#env)
20
+ - [.dockerignore](#dockerignore)
21
+ - [Source sync](#source-sync)
22
+ - [Commands](#commands)
23
+ - [doctor](#doctor)
24
+ - [Common errors](#common-errors)
25
+ - [Development](#development)
26
+ - [Contributing](#contributing)
27
+ - [Roadmap](#roadmap)
28
+ - [License](#license)
29
+
10
30
  `wip` is a Ruby-built OSS CLI wrapper that brings a [`dip`](https://github.com/bibendi/dip)-like
11
31
  workflow to Microsoft WSLC. It collects a project's container, image, environment variables, and
12
32
  commands into a single `wip.yml`, and forwards them to `wslc.exe` / `wslc` as safe argument arrays
@@ -16,6 +36,19 @@ commands into a single `wip.yml`, and forwards them to `wslc.exe` / `wslc` as sa
16
36
 
17
37
  > **Status:** early release. Expect to track WSLC's own interface as it evolves.
18
38
 
39
+ ## Which mode should you use?
40
+
41
+ `wip.yml` runs in one of three modes, set with `mode:`. Pick the one that matches your project:
42
+
43
+ | Situation | Use |
44
+ |---|---|
45
+ | No `compose.yml` — wip manages containers directly | [`mode: container`](#container-mode) (default) |
46
+ | Have `compose.yml`, don't want to install a third-party tool | [`mode: compose-native`](#compose-mode-native) |
47
+ | Have `compose.yml` and already use/prefer a third-party compose-for-`wslc` tool | [`mode: compose`](#compose-mode) |
48
+
49
+ `wip init` picks `compose-native` automatically when it finds a `compose.yml`/`docker-compose.yml`
50
+ next to it, and `container` otherwise — see [Commands](#commands).
51
+
19
52
  ## Requirements & installation
20
53
 
21
54
  Ruby 3.2+, WSL2, and Microsoft WSLC.
@@ -28,6 +61,9 @@ From source: `bundle install && bundle exec exe/wip version`.
28
61
 
29
62
  ## Quick start
30
63
 
64
+ This walks through `mode: container` (the default). Already have a `compose.yml`? See
65
+ [Which mode should you use?](#which-mode-should-you-use) first.
66
+
31
67
  ```bash
32
68
  gem install wslc-wip
33
69
  cd my-project
@@ -38,16 +74,16 @@ wip up -d
38
74
  wip rails console
39
75
  ```
40
76
 
41
- ## Full configuration example
77
+ ## Configuration
42
78
 
43
79
  Put a `wip.yml` in your project root. Running from a subdirectory walks up to find it, or pass
44
80
  `--config PATH` to point at one explicitly.
45
81
 
82
+ ### Container mode
83
+
46
84
  ```yaml
47
85
  version: 1
48
- mode: container # default. This example is container mode end-to-end — see "Compose mode" below
49
- # for mode: compose, which replaces container:/network:/dependencies: with a
50
- # compose: block instead; the two don't mix within one wip.yml.
86
+ mode: container # default
51
87
  wslc:
52
88
  command: auto # tries wslc.exe, wslc, then System32; an absolute path also works
53
89
  container: app # required once dependencies: has entries; which one `up`/`exec`/`run`/`build`/`commands:`
@@ -112,23 +148,7 @@ sync: # optional; mirror the source into a named volume instead of bind-mounting
112
148
  credential, or auth. Keep real secrets out of the config file and in your runtime environment
113
149
  instead.
114
150
 
115
- ### .env
116
-
117
- Like `docker compose`, `wip` automatically loads a `.env` file next to `wip.yml` (one `KEY=VALUE`
118
- per line; `#` comments, blank lines, `export` prefixes, and quoted values are all supported) and
119
- passes its keys through as container environment variables on `build`, `up`, `run`, `exec`, and
120
- custom commands. `.env` only fills in keys that aren't already set by the primary container's
121
- `env` or a command/dependency's own `env` — those always win on conflict. Pass `--env-file PATH`
122
- to load a different file instead.
123
-
124
- ### .dockerignore
125
-
126
- `wip build` reads `.dockerignore` from the build context and stages a filtered copy of the
127
- context (skipping anything it matches) before handing it to `wslc build`, since `wslc` sends the
128
- context as-is otherwise. If there's no `.dockerignore`, the original context directory is used
129
- directly with no copying.
130
-
131
- ### Dependency containers
151
+ #### Dependency containers
132
152
 
133
153
  `dependencies:` holds every container uniformly — the primary one `container:` points at and any
134
154
  sidecar services (a database, Redis, ...) alongside it. Each entry accepts `image` (required),
@@ -145,6 +165,109 @@ in place). Only the primary container is a target for `exec`/`run`/`build`/`comm
145
165
  are only ever started and stopped, matching Compose's own service-vs-you-exec-into-one-of-them
146
166
  split.
147
167
 
168
+ ### Compose mode
169
+
170
+ If your project already has a real `compose.yml`, don't duplicate it in `dependencies:` — point
171
+ `wip` at it instead:
172
+
173
+ ```yaml
174
+ version: 1
175
+ mode: compose # required to enable compose mode; a compose: block with no mode: compose is an error
176
+ compose:
177
+ service: app # required: which compose service wip run/exec/NAME target
178
+ command: wslc-compose # required: the compose-for-wslc binary/path you have installed
179
+ file: compose.yml # optional; auto-detected next to wip.yml otherwise
180
+ project: myapp # optional; omitted lets the compose tool pick its own default
181
+ ```
182
+
183
+ `compose:` is mutually exclusive with `dependencies:`/`network` — pick one orchestration path per
184
+ project. In compose mode, `wip` becomes a thin bridge to an external compose-for-`wslc` CLI rather
185
+ than reimplementing Compose itself.
186
+
187
+ `wslc` itself has no native Compose support yet (tracked upstream in
188
+ [microsoft/WSL#40948](https://github.com/microsoft/WSL/issues/40948)), and until it does,
189
+ independent third-party tools fill the gap — for example
190
+ [bacarndiaye/wslc-compose](https://github.com/bacarndiaye/wslc-compose) (Python) and
191
+ [inuyume/wslc-compose](https://github.com/inuyume/wslc-compose) (Go), among others. `wslc` is new
192
+ and still evolving, so expect more of these to show up (and existing ones to change) over time.
193
+ `wip` deliberately doesn't pick a winner or default to any of them (unlike `wslc.command`, which
194
+ defaults to `auto` and searches for `wslc.exe`/`wslc`): `compose.command` is required and treats
195
+ every implementation equally — set it to whichever binary name or absolute path you've installed.
196
+ Whichever one you use needs to understand `-f FILE [-p PROJECT] up|down|exec|logs`, the subset of
197
+ the Compose CLI vocabulary `wip` drives. `wip doctor` reports whether the configured command is
198
+ found, its version, and which compose file `wip` resolved.
199
+
200
+ - `wip up`/`wip down` delegate straight to `<compose command> up -d`/`down`.
201
+ - `wip exec`/`wip NAME` (custom `commands:`) run inside `compose.service`.
202
+ - `wip shell` also goes through the bridge: unless `commands.shell` is defined in `wip.yml`, it
203
+ `exec`s `bash` against `compose.service`, falling back to `sh`.
204
+ - `wip logs [-f] [SERVICE...]` is only available in compose mode.
205
+ - `wip run` has no ephemeral-container equivalent in this exec-only vocabulary, so it falls back
206
+ to `exec` against the already-running `compose.service` (wip warns when this happens).
207
+ - `commands:` entries with `type: run`/`type: build` aren't supported in compose mode — use your
208
+ compose tool's own `build`/`up --build` directly; compose owns builds for its own services.
209
+
210
+ ### Compose mode (native)
211
+
212
+ Don't want to install a third-party compose-for-`wslc` tool at all? `mode: compose-native` parses
213
+ `compose.yml` itself and drives `wslc` directly, the same way `mode: container` +`dependencies:`
214
+ already does — no external binary, and `wip run` gets a real ephemeral `wslc run --rm` instead of
215
+ the `exec` fallback above:
216
+
217
+ ```yaml
218
+ version: 1
219
+ mode: compose-native
220
+
221
+ compose:
222
+ service: app # required: which compose service wip run/exec/NAME target
223
+ file: compose.yml # optional; auto-detected next to wip.yml otherwise
224
+ project: myapp # optional; also names wip's own project network (defaults to the wip.yml
225
+ # directory's name) so services can reach each other by name
226
+ ```
227
+
228
+ There's no `compose.command` here (no external binary to name), and no top-level `container:` —
229
+ `compose.service` already names it.
230
+
231
+ This is explicitly a stopgap for as long as `wslc` itself has no native Compose support (tracked
232
+ upstream in [microsoft/WSL#40948](https://github.com/microsoft/WSL/issues/40948)) and third-party
233
+ compose-for-`wslc` tools stay incomplete. It only understands a minimal subset of the Compose spec.
234
+ Within `services.<name>:`, anything outside that subset is a load-time `ConfigError` naming the
235
+ offending key, rather than silently ignored — but everything *outside* `services:` at the document's
236
+ top level (`networks:`, `volumes:`, `configs:`, `secrets:`, ...) is the one exception: it's read by
237
+ real Compose tools, not by `wip`, so `wip` silently ignores it rather than rejecting an otherwise
238
+ valid compose.yml over sections it doesn't need to look at:
239
+
240
+ - Per service: `image`, `build` (string or `{context:, dockerfile:}`; resolved relative to
241
+ `compose.yml`, not wherever `wip` is invoked from), `command` (shell or exec form), `environment`
242
+ (mapping or `KEY=VALUE` array — a mapping value must not be null; host environment pass-through
243
+ isn't supported), `ports`/`volumes` (short syntax only — `"host:container"` strings, not
244
+ long-syntax mappings), `working_dir`, `user`, `depends_on` (ordering only — a `condition:` other
245
+ than `service_started` is rejected, since there's no health-check support). `tty`, `stdin_open`,
246
+ and `networks` are accepted but silently ignored: TTY/stdin allocation is already decided per
247
+ invocation (see "TTY allocation" below), not fixed per service, and every service already shares
248
+ the one project network `compose.project` sets up.
249
+ - `wip logs` takes at most one `SERVICE` (defaulting to `compose.service`) — `wslc logs`, like
250
+ `docker logs`, follows a single container, unlike a real compose tool's multi-service view.
251
+ - `sync:` behaves exactly like `mode: container`'s (falls back to the primary service's own image,
252
+ defaults to `sync.mode: exec`) — none of the external bridge's `sync.image`/`sync.build`
253
+ requirement applies, since wip itself boots every container here.
254
+
255
+ ### .env
256
+
257
+ Like `docker compose`, `wip` automatically loads a `.env` file next to `wip.yml` (one `KEY=VALUE`
258
+ per line; `#` comments, blank lines, `export` prefixes, and quoted values are all supported) and
259
+ passes its keys through as container environment variables on `build`, `up`, `run`, `exec`, and
260
+ custom commands. `.env` only fills in keys that aren't already set by the primary container's
261
+ `env` or a command/dependency's own `env` — those always win on conflict. Pass `--env-file PATH`
262
+ to load a different file instead.
263
+
264
+ ### .dockerignore
265
+
266
+ `wip build` reads `.dockerignore` from the build context and stages a filtered copy of the
267
+ context (skipping anything it matches) before handing it to `wslc build`, since `wslc` sends the
268
+ context as-is otherwise. If there's no `.dockerignore`, the original context directory is used
269
+ directly with no copying.
270
+
148
271
  ### Source sync
149
272
 
150
273
  Bind-mounting the app directory (`.:/app`) is what usually makes a container boot crawl under
@@ -275,93 +398,6 @@ and uses the result, tagged `wip-sync-<container>:latest` by default (`build.tag
275
398
  Prefer managing the image yourself instead? Build and tag it however you like, then set `sync.image`
276
399
  to that tag directly — `sync.build`'s tag wins if both are set, so don't configure both at once.
277
400
 
278
- ### Compose mode
279
-
280
- If your project already has a real `compose.yml`, don't duplicate it in `dependencies:` — point
281
- `wip` at it instead:
282
-
283
- ```yaml
284
- version: 1
285
- mode: compose # required to enable compose mode; a compose: block with no mode: compose is an error
286
- compose:
287
- service: app # required: which compose service wip run/exec/NAME target
288
- command: wslc-compose # required: the compose-for-wslc binary/path you have installed
289
- file: compose.yml # optional; auto-detected next to wip.yml otherwise
290
- project: myapp # optional; omitted lets the compose tool pick its own default
291
- ```
292
-
293
- `compose:` is mutually exclusive with `dependencies:`/`network` — pick one orchestration path per
294
- project. In compose mode, `wip` becomes a thin bridge to an external compose-for-`wslc` CLI rather
295
- than reimplementing Compose itself.
296
-
297
- `wslc` itself has no native Compose support yet (tracked upstream in
298
- [microsoft/WSL#40948](https://github.com/microsoft/WSL/issues/40948)), and until it does,
299
- independent third-party tools fill the gap — for example
300
- [bacarndiaye/wslc-compose](https://github.com/bacarndiaye/wslc-compose) (Python) and
301
- [inuyume/wslc-compose](https://github.com/inuyume/wslc-compose) (Go), among others. `wslc` is new
302
- and still evolving, so expect more of these to show up (and existing ones to change) over time.
303
- `wip` deliberately doesn't pick a winner or default to any of them (unlike `wslc.command`, which
304
- defaults to `auto` and searches for `wslc.exe`/`wslc`): `compose.command` is required and treats
305
- every implementation equally — set it to whichever binary name or absolute path you've installed.
306
- Whichever one you use needs to understand `-f FILE [-p PROJECT] up|down|exec|logs`, the subset of
307
- the Compose CLI vocabulary `wip` drives. `wip doctor` reports whether the configured command is
308
- found, its version, and which compose file `wip` resolved.
309
-
310
- - `wip up`/`wip down` delegate straight to `<compose command> up -d`/`down`.
311
- - `wip exec`/`wip NAME` (custom `commands:`) run inside `compose.service`.
312
- - `wip shell` also goes through the bridge: unless `commands.shell` is defined in `wip.yml`, it
313
- `exec`s `bash` against `compose.service`, falling back to `sh`.
314
- - `wip logs [-f] [SERVICE...]` is only available in compose mode.
315
- - `wip run` has no ephemeral-container equivalent in this exec-only vocabulary, so it falls back
316
- to `exec` against the already-running `compose.service` (wip warns when this happens).
317
- - `commands:` entries with `type: run`/`type: build` aren't supported in compose mode — use your
318
- compose tool's own `build`/`up --build` directly; compose owns builds for its own services.
319
-
320
- ### Compose mode (native)
321
-
322
- Don't want to install a third-party compose-for-`wslc` tool at all? `mode: compose-native` parses
323
- `compose.yml` itself and drives `wslc` directly, the same way `mode: container` +`dependencies:`
324
- already does — no external binary, and `wip run` gets a real ephemeral `wslc run --rm` instead of
325
- the `exec` fallback above:
326
-
327
- ```yaml
328
- version: 1
329
- mode: compose-native
330
-
331
- compose:
332
- service: app # required: which compose service wip run/exec/NAME target
333
- file: compose.yml # optional; auto-detected next to wip.yml otherwise
334
- project: myapp # optional; also names wip's own project network (defaults to the wip.yml
335
- # directory's name) so services can reach each other by name
336
- ```
337
-
338
- There's no `compose.command` here (no external binary to name), and no top-level `container:` —
339
- `compose.service` already names it.
340
-
341
- This is explicitly a stopgap for as long as `wslc` itself has no native Compose support (tracked
342
- upstream in [microsoft/WSL#40948](https://github.com/microsoft/WSL/issues/40948)) and third-party
343
- compose-for-`wslc` tools stay incomplete. It only understands a minimal subset of the Compose spec.
344
- Within `services.<name>:`, anything outside that subset is a load-time `ConfigError` naming the
345
- offending key, rather than silently ignored — but everything *outside* `services:` at the document's
346
- top level (`networks:`, `volumes:`, `configs:`, `secrets:`, ...) is the one exception: it's read by
347
- real Compose tools, not by `wip`, so `wip` silently ignores it rather than rejecting an otherwise
348
- valid compose.yml over sections it doesn't need to look at:
349
-
350
- - Per service: `image`, `build` (string or `{context:, dockerfile:}`; resolved relative to
351
- `compose.yml`, not wherever `wip` is invoked from), `command` (shell or exec form), `environment`
352
- (mapping or `KEY=VALUE` array — a mapping value must not be null; host environment pass-through
353
- isn't supported), `ports`/`volumes` (short syntax only — `"host:container"` strings, not
354
- long-syntax mappings), `working_dir`, `user`, `depends_on` (ordering only — a `condition:` other
355
- than `service_started` is rejected, since there's no health-check support). `tty`, `stdin_open`,
356
- and `networks` are accepted but silently ignored: TTY/stdin allocation is already decided per
357
- invocation (see "TTY allocation" below), not fixed per service, and every service already shares
358
- the one project network `compose.project` sets up.
359
- - `wip logs` takes at most one `SERVICE` (defaulting to `compose.service`) — `wslc logs`, like
360
- `docker logs`, follows a single container, unlike a real compose tool's multi-service view.
361
- - `sync:` behaves exactly like `mode: container`'s (falls back to the primary service's own image,
362
- defaults to `sync.mode: exec`) — none of the external bridge's `sync.image`/`sync.build`
363
- requirement applies, since wip itself boots every container here.
364
-
365
401
  ## Commands
366
402
 
367
403
  | Command | Description |
@@ -494,15 +530,6 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/slidict
494
530
  [CONTRIBUTING.md](CONTRIBUTING.md) for commit conventions, versioning policy, and the PR
495
531
  checklist.
496
532
 
497
- ## Not in the initial release
498
-
499
- Full Compose compatibility isn't reimplemented in `wip` itself — `mode: compose-native` parses
500
- `compose.yml` and drives `wslc` directly, but only covers a minimal subset (see
501
- [Compose mode (native)](#compose-mode-native)); full parity is otherwise available by delegating
502
- to a third-party compose-for-`wslc` tool (see [Compose mode](#compose-mode)). A resident/daemon
503
- process, a GUI, PowerShell-specific tuning, direct registry API/manifest parsing, self-update, and
504
- plugins are all unimplemented.
505
-
506
533
  ## Roadmap
507
534
 
508
535
  `wip` already covers most of what [`dip`](https://github.com/bibendi/dip) adds on top of Compose —
@@ -520,8 +547,11 @@ compose-for-`wslc` tool in [compose mode](#compose-mode) — which of those actu
520
547
  entirely up to the external tool you point `compose.command` at; `wip` only forwards
521
548
  `-f FILE [-p PROJECT] up|down|exec|logs`, so treat that list as what Compose offers, not as
522
549
  something `wip` guarantees. See that section for what compose mode covers
523
- and its current limitations (`run`, and `commands:` of type `run`/`build`). What's still planned
524
- for `wip`, roughly in priority order:
550
+ and its current limitations (`run`, and `commands:` of type `run`/`build`).
551
+
552
+ Beyond Compose parity, a resident/daemon process, a GUI, PowerShell-specific tuning, direct
553
+ registry API/manifest parsing, self-update, and plugins are all unimplemented and not currently
554
+ planned. What's still planned for `wip`, roughly in priority order:
525
555
 
526
556
  1. **`wip provision`** — a dip-style one-shot bootstrap hook (build → up deps → install deps →
527
557
  create/migrate/seed DB) so a new contributor can go from `git clone` to a working environment
@@ -541,7 +571,7 @@ for `wip`, roughly in priority order:
541
571
 
542
572
  Each of these should stay additive to the existing `wip.yml` shape — no breaking changes to
543
573
  `container`, `network`, `commands`, `dependencies`, or `compose` are planned. A resident daemon
544
- and a GUI remain out of scope; see "Not in the initial release" above.
574
+ and a GUI remain out of scope.
545
575
 
546
576
  ## License
547
577
 
data/lib/wip/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wip
4
- VERSION = '0.18.2'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wslc-wip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wip contributors