@quatronic/qore 0.3.0-test.9b506a3 → 0.3.1-rc.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.
Files changed (3) hide show
  1. package/README.md +8 -160
  2. package/dist/cli.js +1428 -2847
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -243,24 +243,6 @@ itself, or it fails with "Not inside a module repository"). `--app` is
243
243
  refused in a workspace root: an app is already implied by
244
244
  `qore.workspace.json`.
245
245
 
246
- **Shared checkouts.** In the shared layout the modules start from
247
- `modules/<slug>`. A module that another app's `qore dev` already runs from
248
- the same checkout, with its port listening, is not started a second time:
249
-
250
- - a **backend** is reused (`<module> running in qore dev for <app> (pid
251
- <pid>)`) and listed with that app's URL in the summary. This needs the
252
- portal capability `module.local-env-app-neutral`; without it the module is
253
- listed under `! Not running:` as `running in qore dev for <app>`;
254
- - a **frontend** is never reused, because its environment is per app: it is
255
- listed as not running the same way.
256
-
257
- A reused module is only watched. When its port is free for two checks in a
258
- row, qore prints `<module> stopped with qore dev for <app> — restart qore
259
- dev to run it here` (a `reused-stopped` event with `--json`) and does not
260
- restart it. If every module is reused, nothing starts: `qore dev` just
261
- watches, exits `0` once they have all stopped, and `130` (or 128 + signal)
262
- on Ctrl+C or a signal.
263
-
264
246
  **Ports never move.** If `PORT` (or, for a workspace, a `db:up`'s
265
247
  `DB_PORT`) is already taken, `qore dev` fails with `QORE_PORT_IN_USE`
266
248
  naming the port and, when it can determine one, the process already
@@ -454,9 +436,7 @@ likely, suggests `qore login --portal staging`.
454
436
  With `--json`, stdout is one document: `{"projectsRoot": "<path>|null",
455
437
  "steps": {"root"|"login"|"tenant"|"clone": {"status", "detail?"}}}`.
456
438
 
457
- Apps clone into `<root>/<tenant>/apps/<app>/` and their modules into
458
- `<root>/<tenant>/modules/<module>`, shared by every app of the tenant that
459
- uses them (see "Shared module checkouts" below). A checkout outside the
439
+ Apps clone into `<root>/<tenant>/<app>/<module>`. A checkout outside the
460
440
  folder registers itself the first time you use it (`qore clone <app> <dir>`,
461
441
  `qore dev`, ...); a registered checkout that was deleted is dropped. With a
462
442
  projects folder set, `qore dev`, `qore env pull`, `qore run` and `qore status`
@@ -472,12 +452,9 @@ qore config root --unset # clear it; known projects stay findable
472
452
 
473
453
  ### Workspaces
474
454
 
475
- `qore clone` sets up a local directory for an app and its modules, each in
476
- its own repository; `qore sync` keeps them in step with the app afterwards.
477
- With a projects folder set, modules are shared between apps (next section);
478
- without one, or with an explicit `qore clone <app> <dir>`, the directory
479
- holds the module repositories itself and the rest of this section applies
480
- as written.
455
+ `qore clone` sets up a local directory holding one or more of an app's
456
+ modules, each in its own repository; `qore sync` keeps that directory in
457
+ step with the app afterwards.
481
458
 
482
459
  ```sh
483
460
  qore clone <app> # clones every module of <app> into ./<app-slug>
@@ -489,15 +466,11 @@ qore env pull # no trust prompt — a clone made by qore is alre
489
466
  cd ..
490
467
  qore sync # clone any module that's new, fetch the rest
491
468
  qore sync --pull # ...and fast-forward every clean repository with an upstream
492
- qore code [app] [-- <claude args>] # start Claude Code in the app's frontend, every module added (--add-dir)
493
469
  ```
494
470
 
495
471
  - **Where it clones.** Without `[dir]` and with a projects folder set, `qore
496
- clone` puts the app folder at `<root>/<tenant>/apps/<app>` and its modules
497
- in `<root>/<tenant>/modules/`. Without a projects folder it behaves as
498
- described above and prints a tip to run `qore init`; with an explicit `[dir]`
499
- it clones into `<dir>` as before, and with a projects folder set the tip
500
- says that `qore init` shares modules between apps.
472
+ clone` uses `<root>/<tenant>/<app>`. Without a projects folder it behaves as
473
+ described above and prints a tip to run `qore init`.
501
474
  - **`--protocol https|ssh`** picks the clone URL (default `https`). `ssh`
502
475
  rewrites `https://github.com/o/r` to `git@github.com:o/r.git`; your own
503
476
  git `insteadOf` config still applies on top of either.
@@ -517,8 +490,7 @@ qore code [app] [-- <claude args>] # start Claude Code in the app's frontend, e
517
490
  table only when run in the directory that holds `qore.workspace.json`
518
491
  itself (not inside one of its module repositories, which shows that
519
492
  module).
520
- - **Nothing is ever deleted, moved or overwritten** (in this layout; the
521
- shared layout moves and removes only with your consent, below). A present module
493
+ - **Nothing is ever deleted, moved or overwritten.** A present module
522
494
  directory is left exactly as it is; `sync` only fetches into it, and
523
495
  only fast-forwards with `--pull`, and only when the tree is clean and has
524
496
  an upstream — a dirty tree, one with no upstream, or one that would need
@@ -649,130 +621,6 @@ the usual single `{"ok":...}` document. An `exit` event carries an optional
649
621
  as ` → ...`) when the module crashed early with a non-zero code and no
650
622
  signal — never on a signalled or graceful exit.
651
623
 
652
- ### Shared module checkouts
653
-
654
- With a projects folder (`qore init`), a tenant's apps share their modules.
655
- A module is cloned once, however many apps use it:
656
-
657
- ```
658
- <root>/<tenant>/modules/<slug>/ one checkout per module (the real repository)
659
- <root>/<tenant>/apps/<app>/ one folder per app, holding no code
660
- <root>/@<portal>/<tenant>/... the same, for a non-production portal
661
- ```
662
-
663
- Without a projects folder, and for `qore clone <app> <dir>`, nothing
664
- changes: the module repositories sit in the workspace directory as before.
665
-
666
- **The app folder** holds `qore.workspace.json` and files that make the
667
- app's modules open together in an editor or Claude Code. `qore clone` and
668
- `qore sync` write them from the portal's module list:
669
-
670
- | File | Purpose |
671
- |---|---|
672
- | `<app>.code-workspace` | VS Code / Cursor: the app folder plus every module in `../../modules/` |
673
- | `.idea/` (`modules.xml`, `<app>.iml`, `vcs.xml`) | WebStorm: the same modules as content roots and Git roots |
674
- | `CLAUDE.md` | which modules the app has, where they are, and which other apps share them |
675
- | `.claude/settings.json` | `permissions.additionalDirectories` for the modules |
676
-
677
- Only what qore owns is rewritten; the rest is yours. In `CLAUDE.md` that is
678
- the block between `<!-- qore:app:start -->` and `<!-- qore:app:end -->` —
679
- write anything you like outside it. In `.code-workspace` qore sets
680
- `folders` and keeps every other key (settings, extensions). In
681
- `.claude/settings.json` it keeps every other key, and any
682
- `additionalDirectories` entry of your own as long as it is not under
683
- `../../modules/`. Your indentation and line endings are kept. A file qore
684
- merges into (`<app>.code-workspace`, `.claude/settings.json`, `CLAUDE.md`)
685
- that is a symlink, or that cannot be parsed, is skipped and named in the
686
- output, never overwritten. The three `.idea` files and `qore.workspace.json`
687
- are qore's alone and are rewritten whole, edits included (qore still never
688
- writes through a symlink). A sync that changes nothing rewrites nothing.
689
-
690
- **Opening an app.**
691
-
692
- - VS Code or Cursor: open `apps/<app>/<app>.code-workspace`.
693
- - WebStorm: open `apps/<app>/` as the project.
694
- - Claude Code: `qore code <app>` (see "`qore code`" below). Plain `claude`
695
- in the app folder is not enough: the folder holds no code, and Claude's
696
- search does not reach other directories unless they are added with
697
- `--add-dir`, which `qore code` does for you.
698
-
699
- **Commands inside `modules/<slug>`.** There is no `qore.workspace.json`
700
- there, so qore asks which apps list the module. One app: it is used. Several:
701
- an interactive run asks, otherwise pass `--app <slug>`. When the portal
702
- puts the module in more apps than are cloned here and one of the cloned
703
- ones is used, qore says so on stderr: `Using app <app> (the only app here
704
- using <module>; also in <apps> — pass --app to choose).`
705
-
706
- **`qore sync`** works for the whole tenant, not only the app you are in:
707
- it reads every app folder of the tenant that it can access, clones what is
708
- missing into `modules/`, fetches every checkout once, and rewrites every
709
- readable app's view files. An app folder it cannot read or access is
710
- reported and left alone, and its modules still count as used.
711
-
712
- **Converting the old layout.** Apps cloned before this layout hold real
713
- repositories at `<tenant>/<app>/<module>`. `qore sync` (or `qore clone` of
714
- such an app) converts what it finds:
715
-
716
- - a module checkout is moved to `modules/<slug>` (when several apps hold a
717
- copy you choose which one moves);
718
- - another app's copy of the same module is removed — only when it is clean;
719
- - the old app folder is retired: `qore.workspace.json` moves to
720
- `apps/<app>/` and a `README.md` stays behind saying where everything
721
- went (an existing README is kept, and reported).
722
-
723
- **Qore asks first**, once, listing every path it would change. Without
724
- your yes nothing is moved or removed and sync reports the changes as kept;
725
- it never asks with `--json`, `--no-input` or without a terminal, so run
726
- `qore sync` interactively to convert. A duplicate is **clean** when it has
727
- no uncommitted changes (untracked files that are not git-ignored count,
728
- whatever your `status.showUntrackedFiles` says), no commits that are not
729
- pushed (a detached HEAD counts), no stashes, and no linked worktrees (`git
730
- worktree add`, inside the clone or elsewhere); when git cannot tell, it is
731
- not clean. A clone with linked worktrees, or one that is itself a linked
732
- worktree, is never removed or moved: move it by hand, then run `git worktree
733
- repair`. A copy that is not clean is kept, with
734
- the reason, and you decide what to do with it. If a move fails — an
735
- editor or a running dev server can hold the folder, notably on Windows —
736
- the error says to stop `qore dev` for the app and run `qore sync` again.
737
- A checkout in `modules/` that no app uses any more is reported as `not used
738
- by any app — left in place`; qore never deletes it.
739
-
740
- Known limits:
741
-
742
- - `qore clone` of an app whose shared module still sits in another app's
743
- old-layout folder clones it a second time into `modules/`; the next
744
- `qore sync` offers to remove the old copy.
745
- - A module cloned by `qore dev` shows in an app's view files after the
746
- next `qore sync`.
747
-
748
- #### `qore code`
749
-
750
- ```sh
751
- qore code # the app you are in
752
- qore code <app> # an app of the tenant you are in
753
- qore code <app> -- --resume # arguments after -- go to claude
754
- ```
755
-
756
- Starts Claude Code in the app's frontend module, with every other module of
757
- the app and the app folder added (`--add-dir`), and sets
758
- `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1` so Claude reads the added
759
- modules' `CLAUDE.md` files. An app without a frontend starts in the app
760
- folder. The module list comes from the portal.
761
-
762
- - **Which app.** `<app>` is looked up in the tenant of the current
763
- directory, else in the projects folder (a slug cloned in several places
764
- asks you to run it from inside one). Without `<app>`: from an app folder,
765
- that app; from `modules/<slug>`, the app that uses the module (a picker
766
- when several do, otherwise `Pass an app: used by …`).
767
- - It needs a projects folder and the shared layout. An old-layout
768
- workspace asks you to run `qore sync` first (`qore code needs the shared
769
- layout: run qore sync to convert this workspace.`); modules not cloned yet
770
- are listed with `Run qore sync first.`
771
- - `claude` not found: `QORE_TOOL_MISSING`, "Install Claude Code: npm i -g
772
- @anthropic-ai/claude-code". Otherwise `claude`'s own exit code (or
773
- 128 + signal) is `qore code`'s.
774
- - No `--json`.
775
-
776
624
  ### `--json`
777
625
 
778
626
  Every command accepts `--json`, which prints exactly one JSON document on
@@ -789,7 +637,7 @@ qore whoami --json
789
637
  | Code | Meaning |
790
638
  |------|---------|
791
639
  | 0 | Success |
792
- | 1 | Internal error, `git` is not installed or not on `PATH`, the OS keychain is unavailable/access was denied, or qore itself needs a newer Node (`QORE_NODE_VERSION`, checked by `qore doctor`'s own `node` check against qore's own `process.version`); `qore dev`: its package manager isn't installed (`QORE_PACKAGE_MANAGER`), its install failed (`QORE_INSTALL_FAILED`), Docker is missing (`QORE_DOCKER_MISSING`), not running (`QORE_DOCKER_NOT_RUNNING`) or its compose v2 plugin is missing (`QORE_DOCKER_COMPOSE_MISSING`), a `db:up`/service failed, never became healthy (`QORE_SERVICE_UNHEALTHY`) or its data is incompatible (`QORE_SERVICE_DATA_INCOMPATIBLE`), or the repository's own `engines.node` doesn't match the `node` on `PATH` (`QORE_NODE_VERSION`, a different check from qore's own — `qore doctor`'s `node:<module>` check, run only in a trusted repository); `qore code`: `claude` is not on `PATH` (`QORE_TOOL_MISSING`); or the projects folder isn't writable (`QORE_ROOT_NOT_WRITABLE`, fix its permissions or choose another folder) |
640
+ | 1 | Internal error, `git` is not installed or not on `PATH`, the OS keychain is unavailable/access was denied, or qore itself needs a newer Node (`QORE_NODE_VERSION`, checked by `qore doctor`'s own `node` check against qore's own `process.version`); `qore dev`: its package manager isn't installed (`QORE_PACKAGE_MANAGER`), its install failed (`QORE_INSTALL_FAILED`), Docker is missing (`QORE_DOCKER_MISSING`), not running (`QORE_DOCKER_NOT_RUNNING`) or its compose v2 plugin is missing (`QORE_DOCKER_COMPOSE_MISSING`), a `db:up`/service failed, never became healthy (`QORE_SERVICE_UNHEALTHY`) or its data is incompatible (`QORE_SERVICE_DATA_INCOMPATIBLE`), or the repository's own `engines.node` doesn't match the `node` on `PATH` (`QORE_NODE_VERSION`, a different check from qore's own — `qore doctor`'s `node:<module>` check, run only in a trusted repository); or the projects folder isn't writable (`QORE_ROOT_NOT_WRITABLE`, fix its permissions or choose another folder) |
793
641
  | 2 | Missing or invalid context (e.g. a bad `--portal` value, or no module selected), or the module is part of several apps and no `--app` was given; `qore dev`: a port is already in use (`QORE_PORT_IN_USE`) or the repository's dev setup isn't supported (`QORE_DEV_UNSUPPORTED`); projects folder: not set and not inside a project, for a logged-in user (`QORE_ROOT_NOT_SET`, run `qore init`; logged out with no folder you get the login error, exit 4, and logged out with a folder the local lookup runs first, so an empty folder still gives `QORE_PROJECT_NOT_FOUND`), not usable as a folder (`QORE_ROOT_INVALID`, pick another with `qore init --root <path>`), or no local project matches the reference or the folder holds none (`QORE_PROJECT_NOT_FOUND`, run `qore clone <app>`) |
794
642
  | 4 | Not logged in, session/login expired, login denied, or clock skew |
795
643
  | 5 | Access denied — lost tenant access, resource not found, no developer access |