ruby-anything 0.2.0 → 0.2.2
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/.claude-plugin/marketplace.json +12 -12
- package/.claude-plugin/plugin.json +10 -2
- package/README.md +32 -1
- package/adapters/node/harness.mjs +3 -1
- package/adapters/node/package-lock.json +26 -26
- package/adapters/node/package.json +7 -7
- package/adapters/polyglot/harness.py +350 -350
- package/adapters/polyglot/lang_csharp.py +222 -222
- package/adapters/polyglot/lang_java.py +510 -510
- package/adapters/polyglot/lang_rust.py +430 -430
- package/adapters/polyglot/lang_swift.py +337 -337
- package/docs/test-results.md +92 -0
- package/package.json +6 -4
- package/src/adapters.js +63 -63
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ruby-anything",
|
|
3
|
-
"owner": { "name": "PortPilot" },
|
|
4
|
-
"description": "ruby-anything: migrate any app to Ruby on Rails one piece at a time, and prove it still behaves the same.",
|
|
5
|
-
"plugins": [
|
|
6
|
-
{
|
|
7
|
-
"name": "ruby-anything",
|
|
8
|
-
"source": "./",
|
|
9
|
-
"description": "Migrate any app to Rails + Hotwire + Tailwind + daisyUI, checked against the original's recorded behavior. Needs the ruby-anything CLI on PATH (npm i -g ruby-anything)."
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ruby-anything",
|
|
3
|
+
"owner": { "name": "PortPilot" },
|
|
4
|
+
"description": "ruby-anything: migrate any app to Ruby on Rails one piece at a time, and prove it still behaves the same.",
|
|
5
|
+
"plugins": [
|
|
6
|
+
{
|
|
7
|
+
"name": "ruby-anything",
|
|
8
|
+
"source": "./",
|
|
9
|
+
"description": "Migrate any app to Rails + Hotwire + Tailwind + daisyUI, checked against the original's recorded behavior. Needs the ruby-anything CLI on PATH (npm i -g ruby-anything)."
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruby-anything",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Migrate any app to Ruby on Rails 8 with Hotwire, Tailwind and daisyUI, one piece at a time, checked against the original's recorded behavior at every step. Needs the ruby-anything CLI on PATH (npm i -g ruby-anything).",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"keywords": [
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ruby",
|
|
8
|
+
"rails",
|
|
9
|
+
"hotwire",
|
|
10
|
+
"daisyui",
|
|
11
|
+
"migration",
|
|
12
|
+
"mcp"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://ruby-anything.vercel.app"
|
|
7
15
|
}
|
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<a href="https://www.npmjs.com/package/ruby-anything"><img src="https://img.shields.io/npm/v/ruby-anything?style=flat&colorA=111111&colorB=a51c1c&label=npm" alt="npm version"></a>
|
|
5
5
|
<a href="https://www.npmjs.com/package/ruby-anything"><img src="https://img.shields.io/npm/d18m/ruby-anything?style=flat&colorA=111111&colorB=a51c1c&label=npm%20downloads" alt="npm downloads"></a>
|
|
6
|
+
<a href="https://github.com/akkisavi/ruby-anything/actions/workflows/ruby-anything.yml"><img src="https://github.com/akkisavi/ruby-anything/actions/workflows/ruby-anything.yml/badge.svg?branch=master" alt="tests"></a>
|
|
6
7
|
<a href="#license"><img src="https://img.shields.io/badge/license-MIT-111111?style=flat&colorA=111111&colorB=a51c1c" alt="MIT license"></a>
|
|
7
8
|
</p>
|
|
8
9
|
|
|
@@ -10,11 +11,19 @@
|
|
|
10
11
|
Migrate your app to Ruby on Rails, and prove it still behaves the same.
|
|
11
12
|
</p>
|
|
12
13
|
|
|
14
|
+
<p align="center">
|
|
15
|
+
<b>Website and docs:</b> <a href="https://ruby-anything.vercel.app">ruby-anything.vercel.app</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
13
18
|
<p align="center">
|
|
14
19
|
Rails 8 · Hotwire (Turbo + Stimulus) · Tailwind CSS · daisyUI<br>
|
|
15
20
|
from TypeScript, JavaScript, Python, Go, Java/Spring Boot, Kotlin, C#, PHP, Rust and Swift
|
|
16
21
|
</p>
|
|
17
22
|
|
|
23
|
+
<p align="center">
|
|
24
|
+
Inspired by <a href="https://github.com/erkamyaman/rust-anything">rust-anything</a> by <a href="https://github.com/erkamyaman">erkamyaman</a> 🦀 ➜ 💎
|
|
25
|
+
</p>
|
|
26
|
+
|
|
18
27
|
## Quick start
|
|
19
28
|
|
|
20
29
|
Paste this into your coding agent:
|
|
@@ -86,6 +95,18 @@ Everything it writes lives in `<repo>/rails/`: the Rails app, and `rails/port/`
|
|
|
86
95
|
| `ruby-anything app lift <repo>` | Remove the proxy once nothing falls back |
|
|
87
96
|
| `ruby-anything setup \| doctor \| mcp` | Install for agents, check runtimes, MCP server |
|
|
88
97
|
|
|
98
|
+
## Tested
|
|
99
|
+
|
|
100
|
+
Every push runs the end-to-end suite on **Ubuntu, Windows and macOS** in
|
|
101
|
+
[GitHub Actions](https://github.com/akkisavi/ruby-anything/actions/workflows/ruby-anything.yml).
|
|
102
|
+
It drives real Python and Node originals through the recorders, real Ruby ports through the
|
|
103
|
+
replay harness, and real HTTP, SMTP and SQLite for side effects. It checks both that a correct
|
|
104
|
+
port passes and that a wrong one is caught: half-up vs banker's rounding, `1` vs `1.0`, a
|
|
105
|
+
forgotten email, a wrong exit code, an edited recording, a recorded answer pasted into the port.
|
|
106
|
+
|
|
107
|
+
**22 of 22 pass.** Every test, with its result and time: [test results](docs/test-results.md)
|
|
108
|
+
(regenerate with `npm run test:report`).
|
|
109
|
+
|
|
89
110
|
## In CI
|
|
90
111
|
|
|
91
112
|
```yaml
|
|
@@ -94,8 +115,18 @@ Everything it writes lives in `<repo>/rails/`: the Rails app, and `rails/port/`
|
|
|
94
115
|
app: "true" # also bin/rails test, rubocop, brakeman and the full replay
|
|
95
116
|
```
|
|
96
117
|
|
|
118
|
+
## Inspiration and credits
|
|
119
|
+
|
|
120
|
+
Ruby Anything is inspired by **[rust-anything](https://github.com/erkamyaman/rust-anything)** by
|
|
121
|
+
**[erkamyaman](https://github.com/erkamyaman)**, which migrates apps to Rust the same way. The
|
|
122
|
+
core ideas come from it: the original's recorded behavior is the spec, a `gate` that refuses
|
|
123
|
+
shortcuts, one piece at a time behind a front door, a `go` command and an agent skill that guides
|
|
124
|
+
the work. Ruby Anything applies them to Ruby on Rails with Hotwire, Tailwind and daisyUI.
|
|
125
|
+
If you're moving code to Rust, use rust-anything, and give it a ⭐.
|
|
126
|
+
|
|
127
|
+
The recorders are PortPilot's language adapters.
|
|
128
|
+
|
|
97
129
|
## License
|
|
98
130
|
|
|
99
131
|
Licensed under [MIT](./LICENSE). Ports and generated code in your repository are yours.
|
|
100
132
|
|
|
101
|
-
Inspired by [rust-anything](https://github.com/erkamyaman/rust-anything) by Erkam Yaman, which does the same for Rust. The recorders are PortPilot's language adapters.
|
|
@@ -11,6 +11,7 @@ import path from 'node:path';
|
|
|
11
11
|
import os from 'node:os';
|
|
12
12
|
import crypto from 'node:crypto';
|
|
13
13
|
import { pathToFileURL } from 'node:url';
|
|
14
|
+
import { createRequire } from 'node:module';
|
|
14
15
|
|
|
15
16
|
const SRC = process.env.PORTPILOT_SRC || '/work/src';
|
|
16
17
|
const realWrite = process.stdout.write.bind(process.stdout);
|
|
@@ -71,7 +72,8 @@ let tsMirror = null;
|
|
|
71
72
|
async function mirrorFor(file) {
|
|
72
73
|
if (!/\.m?ts$/.test(file)) return file;
|
|
73
74
|
if (!tsMirror) {
|
|
74
|
-
|
|
75
|
+
// Resolved like any dependency: this folder's node_modules in development, the package's when installed.
|
|
76
|
+
const ts = createRequire(import.meta.url)('typescript');
|
|
75
77
|
tsMirror = fs.mkdtempSync(path.join(os.tmpdir(), 'pp-ts-'));
|
|
76
78
|
fs.writeFileSync(path.join(tsMirror, 'package.json'), '{"type":"module"}');
|
|
77
79
|
for (const src of walk(SRC)) {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "portpilot-node-adapter",
|
|
3
|
-
"lockfileVersion": 3,
|
|
4
|
-
"requires": true,
|
|
5
|
-
"packages": {
|
|
6
|
-
"": {
|
|
7
|
-
"name": "portpilot-node-adapter",
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"typescript": "5.9.3"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"node_modules/typescript": {
|
|
13
|
-
"version": "5.9.3",
|
|
14
|
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
15
|
-
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
16
|
-
"license": "Apache-2.0",
|
|
17
|
-
"bin": {
|
|
18
|
-
"tsc": "bin/tsc",
|
|
19
|
-
"tsserver": "bin/tsserver"
|
|
20
|
-
},
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=14.17"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "portpilot-node-adapter",
|
|
3
|
+
"lockfileVersion": 3,
|
|
4
|
+
"requires": true,
|
|
5
|
+
"packages": {
|
|
6
|
+
"": {
|
|
7
|
+
"name": "portpilot-node-adapter",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"typescript": "5.9.3"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"node_modules/typescript": {
|
|
13
|
+
"version": "5.9.3",
|
|
14
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
15
|
+
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"bin": {
|
|
18
|
+
"tsc": "bin/tsc",
|
|
19
|
+
"tsserver": "bin/tsserver"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=14.17"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "portpilot-node-adapter",
|
|
3
|
-
"private": true,
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Sandbox-side JS/TS adapter. TypeScript is transpiled with the official compiler before import.",
|
|
6
|
-
"dependencies": { "typescript": "5.9.3" }
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "portpilot-node-adapter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Sandbox-side JS/TS adapter. TypeScript is transpiled with the official compiler before import.",
|
|
6
|
+
"dependencies": { "typescript": "5.9.3" }
|
|
7
|
+
}
|