rejox 0.1.0__tar.gz

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 (130) hide show
  1. rejox-0.1.0/.gitignore +74 -0
  2. rejox-0.1.0/LICENSE +105 -0
  3. rejox-0.1.0/PKG-INFO +133 -0
  4. rejox-0.1.0/README.md +96 -0
  5. rejox-0.1.0/codemod-worker/package-lock.json +888 -0
  6. rejox-0.1.0/codemod-worker/package.json +22 -0
  7. rejox-0.1.0/codemod-worker/src/apply.ts +157 -0
  8. rejox-0.1.0/codemod-worker/src/check.ts +20 -0
  9. rejox-0.1.0/codemod-worker/src/convert.ts +131 -0
  10. rejox-0.1.0/codemod-worker/src/css.ts +94 -0
  11. rejox-0.1.0/codemod-worker/src/cssmodule.ts +120 -0
  12. rejox-0.1.0/codemod-worker/src/index.ts +57 -0
  13. rejox-0.1.0/codemod-worker/src/main.ts +32 -0
  14. rejox-0.1.0/codemod-worker/src/maps.ts +64 -0
  15. rejox-0.1.0/codemod-worker/src/transforms/attributes.ts +47 -0
  16. rejox-0.1.0/codemod-worker/src/transforms/elements.ts +101 -0
  17. rejox-0.1.0/codemod-worker/src/transforms/env.ts +122 -0
  18. rejox-0.1.0/codemod-worker/src/transforms/events.ts +105 -0
  19. rejox-0.1.0/codemod-worker/src/transforms/globals.ts +131 -0
  20. rejox-0.1.0/codemod-worker/src/transforms/images.ts +222 -0
  21. rejox-0.1.0/codemod-worker/src/transforms/imports.ts +173 -0
  22. rejox-0.1.0/codemod-worker/src/transforms/navigation.ts +271 -0
  23. rejox-0.1.0/codemod-worker/src/transforms/propsTypes.ts +100 -0
  24. rejox-0.1.0/codemod-worker/src/transforms/storage.ts +488 -0
  25. rejox-0.1.0/codemod-worker/src/transforms/styles.ts +197 -0
  26. rejox-0.1.0/codemod-worker/src/transforms/text.ts +57 -0
  27. rejox-0.1.0/codemod-worker/src/types.ts +71 -0
  28. rejox-0.1.0/codemod-worker/src/util.ts +236 -0
  29. rejox-0.1.0/codemod-worker/tsconfig.json +16 -0
  30. rejox-0.1.0/hatch_build.py +16 -0
  31. rejox-0.1.0/parser-worker/package-lock.json +836 -0
  32. rejox-0.1.0/parser-worker/package.json +23 -0
  33. rejox-0.1.0/parser-worker/src/extractors/api.ts +166 -0
  34. rejox-0.1.0/parser-worker/src/extractors/components.ts +257 -0
  35. rejox-0.1.0/parser-worker/src/extractors/conversion.ts +234 -0
  36. rejox-0.1.0/parser-worker/src/extractors/entry.ts +299 -0
  37. rejox-0.1.0/parser-worker/src/extractors/hooks.ts +55 -0
  38. rejox-0.1.0/parser-worker/src/extractors/imports.ts +70 -0
  39. rejox-0.1.0/parser-worker/src/extractors/routes.ts +144 -0
  40. rejox-0.1.0/parser-worker/src/extractors/state.ts +136 -0
  41. rejox-0.1.0/parser-worker/src/extractors/stylesheets.ts +75 -0
  42. rejox-0.1.0/parser-worker/src/extractors/styling.ts +138 -0
  43. rejox-0.1.0/parser-worker/src/index.ts +432 -0
  44. rejox-0.1.0/parser-worker/src/types.ts +271 -0
  45. rejox-0.1.0/parser-worker/src/util.ts +120 -0
  46. rejox-0.1.0/parser-worker/src/walk.ts +112 -0
  47. rejox-0.1.0/parser-worker/tsconfig.json +16 -0
  48. rejox-0.1.0/pyproject.toml +100 -0
  49. rejox-0.1.0/scripts/bundle_workers.py +109 -0
  50. rejox-0.1.0/src/rejox/__init__.py +1 -0
  51. rejox-0.1.0/src/rejox/ai/__init__.py +0 -0
  52. rejox-0.1.0/src/rejox/ai/cache.py +262 -0
  53. rejox-0.1.0/src/rejox/ai/config.py +65 -0
  54. rejox-0.1.0/src/rejox/ai/css/__init__.py +29 -0
  55. rejox-0.1.0/src/rejox/ai/css/models.py +63 -0
  56. rejox-0.1.0/src/rejox/ai/css/parser.py +59 -0
  57. rejox-0.1.0/src/rejox/ai/css/property_map.py +284 -0
  58. rejox-0.1.0/src/rejox/ai/css/resolver.py +215 -0
  59. rejox-0.1.0/src/rejox/ai/navigation/__init__.py +52 -0
  60. rejox-0.1.0/src/rejox/ai/navigation/active.py +45 -0
  61. rejox-0.1.0/src/rejox/ai/navigation/generator.py +297 -0
  62. rejox-0.1.0/src/rejox/ai/navigation/models.py +104 -0
  63. rejox-0.1.0/src/rejox/ai/navigation/resolver.py +241 -0
  64. rejox-0.1.0/src/rejox/ai/provider.py +155 -0
  65. rejox-0.1.0/src/rejox/ai/schemas.py +104 -0
  66. rejox-0.1.0/src/rejox/ai/styling/__init__.py +31 -0
  67. rejox-0.1.0/src/rejox/ai/styling/colors.py +58 -0
  68. rejox-0.1.0/src/rejox/ai/styling/known_map.py +221 -0
  69. rejox-0.1.0/src/rejox/ai/styling/models.py +108 -0
  70. rejox-0.1.0/src/rejox/ai/styling/patterns.py +202 -0
  71. rejox-0.1.0/src/rejox/ai/styling/resolver.py +287 -0
  72. rejox-0.1.0/src/rejox/cli.py +1077 -0
  73. rejox-0.1.0/src/rejox/models/__init__.py +6 -0
  74. rejox-0.1.0/src/rejox/models/analysis.py +210 -0
  75. rejox-0.1.0/src/rejox/models/emission.py +62 -0
  76. rejox-0.1.0/src/rejox/models/ingest.py +55 -0
  77. rejox-0.1.0/src/rejox/models/jobs.py +182 -0
  78. rejox-0.1.0/src/rejox/models/knowledge_graph.py +291 -0
  79. rejox-0.1.0/src/rejox/models/migrate.py +35 -0
  80. rejox-0.1.0/src/rejox/models/plan.py +123 -0
  81. rejox-0.1.0/src/rejox/models/summary.py +46 -0
  82. rejox-0.1.0/src/rejox/models/transformation.py +36 -0
  83. rejox-0.1.0/src/rejox/models/validation.py +140 -0
  84. rejox-0.1.0/src/rejox/paths.py +17 -0
  85. rejox-0.1.0/src/rejox/pipeline/__init__.py +5 -0
  86. rejox-0.1.0/src/rejox/pipeline/analyzer.py +163 -0
  87. rejox-0.1.0/src/rejox/pipeline/emit.py +855 -0
  88. rejox-0.1.0/src/rejox/pipeline/ingest.py +356 -0
  89. rejox-0.1.0/src/rejox/pipeline/intelligence.py +106 -0
  90. rejox-0.1.0/src/rejox/pipeline/migrate.py +296 -0
  91. rejox-0.1.0/src/rejox/pipeline/planner.py +674 -0
  92. rejox-0.1.0/src/rejox/pipeline/repair.py +256 -0
  93. rejox-0.1.0/src/rejox/pipeline/reporter.py +6 -0
  94. rejox-0.1.0/src/rejox/pipeline/resolve_apply.py +209 -0
  95. rejox-0.1.0/src/rejox/pipeline/rules/__init__.py +6 -0
  96. rejox-0.1.0/src/rejox/pipeline/rules/codes.py +49 -0
  97. rejox-0.1.0/src/rejox/pipeline/rules/components.py +289 -0
  98. rejox-0.1.0/src/rejox/pipeline/rules/domains.py +250 -0
  99. rejox-0.1.0/src/rejox/pipeline/rules/libraries.py +204 -0
  100. rejox-0.1.0/src/rejox/pipeline/rules/parsing.py +98 -0
  101. rejox-0.1.0/src/rejox/pipeline/rules/routing.py +76 -0
  102. rejox-0.1.0/src/rejox/pipeline/rules/scoring.py +388 -0
  103. rejox-0.1.0/src/rejox/pipeline/rules/styling.py +198 -0
  104. rejox-0.1.0/src/rejox/pipeline/sandbox.py +329 -0
  105. rejox-0.1.0/src/rejox/pipeline/scaffold.py +311 -0
  106. rejox-0.1.0/src/rejox/pipeline/showcase.py +480 -0
  107. rejox-0.1.0/src/rejox/pipeline/templates/App.tsx.tmpl +11 -0
  108. rejox-0.1.0/src/rejox/pipeline/templates/app.json.tmpl +15 -0
  109. rejox-0.1.0/src/rejox/pipeline/templates/babel.config.js.tmpl +8 -0
  110. rejox-0.1.0/src/rejox/pipeline/templates/expo-env.d.ts.tmpl +36 -0
  111. rejox-0.1.0/src/rejox/pipeline/templates/global.css.tmpl +3 -0
  112. rejox-0.1.0/src/rejox/pipeline/templates/index.ts.tmpl +5 -0
  113. rejox-0.1.0/src/rejox/pipeline/templates/metro.config.js.tmpl +5 -0
  114. rejox-0.1.0/src/rejox/pipeline/templates/nativewind-env.d.ts.tmpl +1 -0
  115. rejox-0.1.0/src/rejox/pipeline/templates/package.json.tmpl +15 -0
  116. rejox-0.1.0/src/rejox/pipeline/templates/tailwind.config.js.tmpl +13 -0
  117. rejox-0.1.0/src/rejox/pipeline/templates/tsconfig.json.tmpl +10 -0
  118. rejox-0.1.0/src/rejox/pipeline/transformer.py +155 -0
  119. rejox-0.1.0/src/rejox/pipeline/validator.py +681 -0
  120. rejox-0.1.0/src/rejox/pipeline/workspace.py +248 -0
  121. rejox-0.1.0/src/rejox/server/__init__.py +1 -0
  122. rejox-0.1.0/src/rejox/server/jobs.py +487 -0
  123. rejox-0.1.0/src/rejox/server/logs.py +123 -0
  124. rejox-0.1.0/src/rejox/server/main.py +625 -0
  125. rejox-0.1.0/src/rejox/server/queue.py +204 -0
  126. rejox-0.1.0/src/rejox/server/retention.py +98 -0
  127. rejox-0.1.0/src/rejox/server/security.py +442 -0
  128. rejox-0.1.0/src/rejox/server/sessions.py +211 -0
  129. rejox-0.1.0/src/rejox/server/worker.py +73 -0
  130. rejox-0.1.0/src/rejox/workers.py +79 -0
rejox-0.1.0/.gitignore ADDED
@@ -0,0 +1,74 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # Python
7
+ venv/
8
+ .venv/
9
+ __pycache__/
10
+ *.py[cod]
11
+ *.egg-info/
12
+ .pytest_cache/
13
+
14
+ # Builds
15
+ dist/
16
+ build/
17
+ *.tsbuildinfo
18
+ # esbuild bundles of the Node workers (backend/scripts/bundle_workers.py)
19
+ backend/src/rejox/_workers/
20
+
21
+ # Playwright (E2E) — artifacts and generated fixtures
22
+ test-results/
23
+ playwright-report/
24
+ playwright/.cache/
25
+ frontend/e2e/fixtures/
26
+
27
+ # Environment
28
+ .env
29
+ .env.*
30
+ !.env.example
31
+
32
+ # Logs
33
+ *.log
34
+ npm-debug.log*
35
+ yarn-debug.log*
36
+ yarn-error.log*
37
+
38
+ # Editor / OS
39
+ .DS_Store
40
+ .idea/
41
+ .vscode/
42
+ *.swp
43
+
44
+ # Claude Code local settings
45
+ .claude
46
+
47
+ # Uploads / working data
48
+ uploads/
49
+ tmp/
50
+
51
+ # Rejox emission working directory
52
+ .rejox-out/
53
+
54
+ # Run workspaces (ingested uploads + emitted output, one dir per run)
55
+ .rejox-workspaces/
56
+
57
+ # AI resolution cache (local SQLite)
58
+ *.sqlite3
59
+
60
+
61
+ CLAUDE.md
62
+ vibe.md
63
+ reactjs-principles.md
64
+
65
+ rejox-docs.md
66
+ rejox-package-plan.md
67
+
68
+ # Hardening diagnosis clones (throwaway)
69
+ hardening-projects/
70
+
71
+ # graphify knowledge graph (local)
72
+ graphify-out/
73
+
74
+ .gitattributes
rejox-0.1.0/LICENSE ADDED
@@ -0,0 +1,105 @@
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Ashraf Jarabeah
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
rejox-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,133 @@
1
+ Metadata-Version: 2.5
2
+ Name: rejox
3
+ Version: 0.1.0
4
+ Summary: Rejox — AI migration engineer: React → React Native. CLI + pipeline.
5
+ Project-URL: Homepage, https://github.com/ashrafjr-n/REJOX
6
+ Project-URL: Repository, https://github.com/ashrafjr-n/REJOX
7
+ Project-URL: Issues, https://github.com/ashrafjr-n/REJOX/issues
8
+ Project-URL: Changelog, https://github.com/ashrafjr-n/REJOX/blob/master/backend/CHANGELOG.md
9
+ Author: Ashraf
10
+ License-Expression: FSL-1.1-ALv2
11
+ License-File: LICENSE
12
+ Keywords: ast,cli,codemod,migration,react,react-native
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: POSIX
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Code Generators
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: click<9,>=8.1
23
+ Requires-Dist: google-genai<2,>=1.15.0
24
+ Requires-Dist: pydantic<3,>=2.10
25
+ Requires-Dist: rich<14,>=13.9.4
26
+ Requires-Dist: typer<1,>=0.26.8
27
+ Provides-Extra: dev
28
+ Requires-Dist: httpx<1,>=0.28.1; extra == 'dev'
29
+ Requires-Dist: pytest<9,>=8.3.4; extra == 'dev'
30
+ Provides-Extra: server
31
+ Requires-Dist: fastapi<1,>=0.115.6; extra == 'server'
32
+ Requires-Dist: python-multipart<1,>=0.0.20; extra == 'server'
33
+ Requires-Dist: redis<6,>=5.2.1; extra == 'server'
34
+ Requires-Dist: rq<3,>=2.1.0; extra == 'server'
35
+ Requires-Dist: uvicorn[standard]<1,>=0.34.0; extra == 'server'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # rejox
39
+
40
+ **AI-assisted migration from React (web) to React Native.** Rejox resolves by
41
+ rules whatever rules can resolve, and invokes AI only where genuine reasoning
42
+ is required — at most **one LLM call** per migration. It builds a knowledge
43
+ graph of a React project, scores its migratability, plans the work, performs
44
+ the migration with deterministic AST transforms, validates the output with the
45
+ real toolchain (`tsc` + Metro), and hands back a working React Native project.
46
+
47
+ See the [project repository](https://github.com/ashrafjr-n/REJOX) for the full
48
+ docs, architecture notes and the web app. This README covers the `rejox` CLI
49
+ as distributed on PyPI.
50
+
51
+ ## Install
52
+
53
+ ```bash
54
+ uvx rejox migrate ./my-react-app # try it without installing
55
+ pip install rejox # or install the CLI
56
+ ```
57
+
58
+ **Requirements:** Python 3.11+, and Node 20+ on `PATH` (the deterministic
59
+ parser/codemod workers run in Node; `npm` is needed only if you're building
60
+ from an sdist rather than a prebuilt wheel).
61
+
62
+ `pip install rejox` installs the CLI only. The web service (FastAPI, job
63
+ queue) is a separate extra:
64
+
65
+ ```bash
66
+ pip install "rejox[server]"
67
+ ```
68
+
69
+ ## Usage
70
+
71
+ ```bash
72
+ rejox doctor # checks Node 20+, npm and the worker bundles
73
+ rejox migrate ./my-react-app
74
+ ```
75
+
76
+ ```
77
+ rejox migrate <project-path> [--out <dir>] [--force] [--yes] [--no-validate] [--json]
78
+ ```
79
+
80
+ | Flag | Meaning |
81
+ | --- | --- |
82
+ | `--out <dir>` | Where to write the React Native project (default: `./<project>-native`). |
83
+ | `--force` | Write into `--out` even if it is not empty (files already there are kept). |
84
+ | `--yes`, `-y`, `--no-input` | Accept every recommended answer without prompting. Implied when stdin is not a terminal. |
85
+ | `--no-validate` | Skip the `tsc` + Metro validation stage (fast). |
86
+ | `--json` | Print a machine-readable summary on stdout (progress goes to stderr). Implies `--no-input`. |
87
+
88
+ `rejox --version` prints the version; `rejox --debug migrate …` shows the full
89
+ traceback if Rejox itself fails.
90
+
91
+ **Exit codes** — stable, for scripts and CI:
92
+
93
+ | Code | Meaning |
94
+ | --- | --- |
95
+ | `0` | Migrated; validation passed (or was skipped with `--no-validate`). |
96
+ | `1` | Migrated, but validation (`tsc` / Metro) failed. |
97
+ | `2` | Usage error (bad flag, missing project, non-empty `--out` without `--force`). |
98
+ | `3` | Environment: Node 20+, `npm` or a worker bundle is missing — run `rejox doctor`. |
99
+ | `4` | Input refused: the project has no React components to migrate. |
100
+ | `70` | Internal error in Rejox; re-run with `--debug` for the traceback. |
101
+
102
+ ## AI is optional
103
+
104
+ Rejox makes **at most one LLM call** per migration — the navigator *shape*
105
+ decision, the one genuine design judgment. Everything else is deterministic.
106
+
107
+ - `GEMINI_API_KEY=…` → the real provider (Gemini, via `google-genai`) makes
108
+ that one call.
109
+ - `REJOX_AI_PROVIDER=fake` → an offline provider makes it deterministically
110
+ (no network), useful for demos and CI.
111
+ - Neither set → **AI disabled**: the navigator defaults to a stack and the
112
+ rest of the pipeline is unchanged. Rejox is fully usable with zero AI.
113
+
114
+ If a build fails validation, a **repair loop** may send the offending line and
115
+ its compiler/bundler diagnostic to the LLM (never the whole file), capped at
116
+ two rounds. Your source code is never uploaded anywhere except in that one
117
+ line-level repair prompt, and only when a `GEMINI_API_KEY` is set.
118
+
119
+ ## Where rejox writes
120
+
121
+ Nothing is written inside the install directory. Run workspaces and the AI
122
+ response cache live in `$XDG_CACHE_HOME/rejox` (`~/.cache/rejox` by default),
123
+ overridable with `REJOX_WORKSPACE_ROOT` and `REJOX_AI_CACHE`.
124
+
125
+ ## Platforms
126
+
127
+ Linux and macOS. Windows is not supported yet.
128
+
129
+ ## License
130
+
131
+ [FSL-1.1-ALv2](https://github.com/ashrafjr-n/REJOX/blob/master/LICENSE) —
132
+ free to use; converts to Apache-2.0 two years after each version's release.
133
+ See [`CHANGELOG.md`](CHANGELOG.md) for release history.
rejox-0.1.0/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # rejox
2
+
3
+ **AI-assisted migration from React (web) to React Native.** Rejox resolves by
4
+ rules whatever rules can resolve, and invokes AI only where genuine reasoning
5
+ is required — at most **one LLM call** per migration. It builds a knowledge
6
+ graph of a React project, scores its migratability, plans the work, performs
7
+ the migration with deterministic AST transforms, validates the output with the
8
+ real toolchain (`tsc` + Metro), and hands back a working React Native project.
9
+
10
+ See the [project repository](https://github.com/ashrafjr-n/REJOX) for the full
11
+ docs, architecture notes and the web app. This README covers the `rejox` CLI
12
+ as distributed on PyPI.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ uvx rejox migrate ./my-react-app # try it without installing
18
+ pip install rejox # or install the CLI
19
+ ```
20
+
21
+ **Requirements:** Python 3.11+, and Node 20+ on `PATH` (the deterministic
22
+ parser/codemod workers run in Node; `npm` is needed only if you're building
23
+ from an sdist rather than a prebuilt wheel).
24
+
25
+ `pip install rejox` installs the CLI only. The web service (FastAPI, job
26
+ queue) is a separate extra:
27
+
28
+ ```bash
29
+ pip install "rejox[server]"
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```bash
35
+ rejox doctor # checks Node 20+, npm and the worker bundles
36
+ rejox migrate ./my-react-app
37
+ ```
38
+
39
+ ```
40
+ rejox migrate <project-path> [--out <dir>] [--force] [--yes] [--no-validate] [--json]
41
+ ```
42
+
43
+ | Flag | Meaning |
44
+ | --- | --- |
45
+ | `--out <dir>` | Where to write the React Native project (default: `./<project>-native`). |
46
+ | `--force` | Write into `--out` even if it is not empty (files already there are kept). |
47
+ | `--yes`, `-y`, `--no-input` | Accept every recommended answer without prompting. Implied when stdin is not a terminal. |
48
+ | `--no-validate` | Skip the `tsc` + Metro validation stage (fast). |
49
+ | `--json` | Print a machine-readable summary on stdout (progress goes to stderr). Implies `--no-input`. |
50
+
51
+ `rejox --version` prints the version; `rejox --debug migrate …` shows the full
52
+ traceback if Rejox itself fails.
53
+
54
+ **Exit codes** — stable, for scripts and CI:
55
+
56
+ | Code | Meaning |
57
+ | --- | --- |
58
+ | `0` | Migrated; validation passed (or was skipped with `--no-validate`). |
59
+ | `1` | Migrated, but validation (`tsc` / Metro) failed. |
60
+ | `2` | Usage error (bad flag, missing project, non-empty `--out` without `--force`). |
61
+ | `3` | Environment: Node 20+, `npm` or a worker bundle is missing — run `rejox doctor`. |
62
+ | `4` | Input refused: the project has no React components to migrate. |
63
+ | `70` | Internal error in Rejox; re-run with `--debug` for the traceback. |
64
+
65
+ ## AI is optional
66
+
67
+ Rejox makes **at most one LLM call** per migration — the navigator *shape*
68
+ decision, the one genuine design judgment. Everything else is deterministic.
69
+
70
+ - `GEMINI_API_KEY=…` → the real provider (Gemini, via `google-genai`) makes
71
+ that one call.
72
+ - `REJOX_AI_PROVIDER=fake` → an offline provider makes it deterministically
73
+ (no network), useful for demos and CI.
74
+ - Neither set → **AI disabled**: the navigator defaults to a stack and the
75
+ rest of the pipeline is unchanged. Rejox is fully usable with zero AI.
76
+
77
+ If a build fails validation, a **repair loop** may send the offending line and
78
+ its compiler/bundler diagnostic to the LLM (never the whole file), capped at
79
+ two rounds. Your source code is never uploaded anywhere except in that one
80
+ line-level repair prompt, and only when a `GEMINI_API_KEY` is set.
81
+
82
+ ## Where rejox writes
83
+
84
+ Nothing is written inside the install directory. Run workspaces and the AI
85
+ response cache live in `$XDG_CACHE_HOME/rejox` (`~/.cache/rejox` by default),
86
+ overridable with `REJOX_WORKSPACE_ROOT` and `REJOX_AI_CACHE`.
87
+
88
+ ## Platforms
89
+
90
+ Linux and macOS. Windows is not supported yet.
91
+
92
+ ## License
93
+
94
+ [FSL-1.1-ALv2](https://github.com/ashrafjr-n/REJOX/blob/master/LICENSE) —
95
+ free to use; converts to Apache-2.0 two years after each version's release.
96
+ See [`CHANGELOG.md`](CHANGELOG.md) for release history.