ruby-anything 0.2.0 → 0.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +9 -2
- package/README.md +15 -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/adapters/ruby/harness.rb +134 -0
- package/package.json +3 -3
- package/src/adapters.js +60 -63
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruby-anything",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
+
]
|
|
7
14
|
}
|
package/README.md
CHANGED
|
@@ -15,6 +15,10 @@ Rails 8 · Hotwire (Turbo + Stimulus) · Tailwind CSS · daisyUI<br>
|
|
|
15
15
|
from TypeScript, JavaScript, Python, Go, Java/Spring Boot, Kotlin, C#, PHP, Rust and Swift
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
+
<p align="center">
|
|
19
|
+
Inspired by <a href="https://github.com/erkamyaman/rust-anything">rust-anything</a> by <a href="https://github.com/erkamyaman">erkamyaman</a> 🦀 ➜ 💎
|
|
20
|
+
</p>
|
|
21
|
+
|
|
18
22
|
## Quick start
|
|
19
23
|
|
|
20
24
|
Paste this into your coding agent:
|
|
@@ -94,8 +98,18 @@ Everything it writes lives in `<repo>/rails/`: the Rails app, and `rails/port/`
|
|
|
94
98
|
app: "true" # also bin/rails test, rubocop, brakeman and the full replay
|
|
95
99
|
```
|
|
96
100
|
|
|
101
|
+
## Inspiration and credits
|
|
102
|
+
|
|
103
|
+
Ruby Anything is inspired by **[rust-anything](https://github.com/erkamyaman/rust-anything)** by
|
|
104
|
+
**[erkamyaman](https://github.com/erkamyaman)**, which migrates apps to Rust the same way. The
|
|
105
|
+
core ideas come from it: the original's recorded behavior is the spec, a `gate` that refuses
|
|
106
|
+
shortcuts, one piece at a time behind a front door, a `go` command and an agent skill that guides
|
|
107
|
+
the work. Ruby Anything applies them to Ruby on Rails with Hotwire, Tailwind and daisyUI.
|
|
108
|
+
If you're moving code to Rust, use rust-anything, and give it a ⭐.
|
|
109
|
+
|
|
110
|
+
The recorders are PortPilot's language adapters.
|
|
111
|
+
|
|
97
112
|
## License
|
|
98
113
|
|
|
99
114
|
Licensed under [MIT](./LICENSE). Ports and generated code in your repository are yours.
|
|
100
115
|
|
|
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
|
+
}
|