rsc-kit 0.30.48 → 0.30.49

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/README.md CHANGED
@@ -32,6 +32,11 @@ typecheck after a route was added. `--check` writes nothing and exits
32
32
  non-zero when the committed `rsc-host.json` or route types are no longer what
33
33
  the backend and the routes produce — a CI step.
34
34
 
35
+ **`rsc-kit make:form contactSend`** writes `forms/contact.ts`: a public form
36
+ drawn from a Laravel or Go action in `rsc-host.json`, with the generated action
37
+ imported ([Public forms](https://docs.rsc-kit.dev/guides/public-forms)).
38
+ `--name` picks the form's name, and `--force` writes over a file that is there.
39
+
35
40
  Name the tag: `bunx rsc-kit init` reuses whatever copy bunx downloaded first,
36
41
  while `bunx rsc-kit@latest init` fetches the current one.
37
42
 
package/dist/index.js CHANGED
@@ -18,6 +18,10 @@ const HELP = `
18
18
  rsc-kit info [--json] what a build of this app will produce, before
19
19
  building: a server (and its compile step and
20
20
  binary) or a static export (and its folder)
21
+ rsc-kit make:form <action> write forms/<name>.ts: a public form drawn
22
+ from a backend action in rsc-host.json;
23
+ --name to choose its name, --force to
24
+ write over one that is there
21
25
  rsc-kit agents bring the rsc-kit section of AGENTS.md up to
22
26
  this version's rules; review it in git.
23
27
  An older section without a stamp needs
@@ -83,6 +87,26 @@ else if (command === 'info') {
83
87
  exit(1);
84
88
  }
85
89
  }
90
+ else if (command === 'make:form') {
91
+ // A public form from a backend action: the file the docs write by hand,
92
+ // with the generated action imported, for Laravel and Go alike.
93
+ const { makeForm } = await import('@rsc-kit/core/typegen');
94
+ const action = rest.find((arg) => !arg.startsWith('--'));
95
+ const at = rest.indexOf('--name');
96
+ const name = at >= 0 ? rest[at + 1] : undefined;
97
+ if (!action) {
98
+ stdout.write('\n rsc-kit make:form needs an action: rsc-kit make:form contactSend\n\n');
99
+ exit(1);
100
+ }
101
+ try {
102
+ const file = await makeForm(process.cwd(), action, { ...(name ? { name } : {}), force: rest.includes('--force') });
103
+ stdout.write(` Wrote ${file.slice(process.cwd().length + 1)}\n`);
104
+ }
105
+ catch (error) {
106
+ stdout.write(`\n rsc-kit make:form: ${error instanceof Error ? error.message : String(error)}\n\n`);
107
+ exit(1);
108
+ }
109
+ }
86
110
  else if (command === 'agents') {
87
111
  // The rules an agent follows here, as this version writes them. Only the
88
112
  // marked section changes; the app's own instructions around it are left be.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsc-kit",
3
- "version": "0.30.48",
3
+ "version": "0.30.49",
4
4
  "type": "module",
5
5
  "description": "The rsc-kit command line: add it to a project, and freeze what can be frozen.",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "homepage": "https://rsc-kit.dev",
29
29
  "dependencies": {
30
- "@rsc-kit/core": "^0.30.48",
31
- "create-rsc-kit": "^0.30.48"
30
+ "@rsc-kit/core": "^0.30.49",
31
+ "create-rsc-kit": "^0.30.49"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^24.0.0",