typespec-rust-emitter 0.10.0 → 0.10.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/AGENTS.md +14 -20
- package/justfile +5 -15
- package/package.json +1 -1
- package/.env +0 -1
package/AGENTS.md
CHANGED
|
@@ -8,20 +8,12 @@ TypeSpec emitter generating idiomatic Rust code (structs, enums, server traits).
|
|
|
8
8
|
# Build -> test (lint runs automatically)
|
|
9
9
|
npm run build && npm test
|
|
10
10
|
|
|
11
|
-
# Run tests only
|
|
12
|
-
npm test
|
|
13
|
-
|
|
14
|
-
# Single test: node --test 'dist/test/hello.test.js' --test-name-pattern="emits model"
|
|
15
|
-
|
|
16
11
|
# Lint & format (run after every change)
|
|
17
12
|
npm run lint
|
|
18
13
|
npm run format
|
|
19
14
|
|
|
20
|
-
# Compile TypeSpec to Rust
|
|
21
|
-
cd example && tsp compile .
|
|
22
|
-
|
|
23
15
|
# Verify Rust compiles
|
|
24
|
-
|
|
16
|
+
just check-rust
|
|
25
17
|
```
|
|
26
18
|
|
|
27
19
|
## Project Layout
|
|
@@ -35,24 +27,26 @@ cd example/output-rust && cargo check
|
|
|
35
27
|
| `example/lib/` | Demo TypeSpec specs |
|
|
36
28
|
| `example/output-rust/` | Generated Rust |
|
|
37
29
|
|
|
38
|
-
##
|
|
30
|
+
## Workflows
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
For each task you complete,
|
|
33
|
+
please confirm there are no errors by writing a test for your task,
|
|
34
|
+
then running `npm test` and `just check-rust`.
|
|
35
|
+
After ensuring everything works as expected, run `npm run format` and `npm run lint`
|
|
36
|
+
and ensure there are no linting errors or warnings.
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
Next, increment the version in package.json,
|
|
39
|
+
write the changelog of what you did,
|
|
40
|
+
then run `just publish` to publish the new version to the npm registry.
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- Import order: `@typespec/*`, external, internal
|
|
42
|
+
Finally, run `git add -A`, `git commit`, `git tag vx.x.x`, `git push` to push the commit,
|
|
43
|
+
and `git push --tags` to push the tags to the remote.
|
|
50
44
|
|
|
51
45
|
## Release (let user handle)
|
|
52
46
|
|
|
53
47
|
When releasing a new version:
|
|
54
48
|
1. Bump `version` in `package.json`
|
|
55
49
|
2. Update `CHANGELOG.md` (include issue refs)
|
|
56
|
-
3. Run `just publish`
|
|
50
|
+
3. Run `just publish`
|
|
57
51
|
|
|
58
|
-
Do not publish yourself—inform user when ready for release.
|
|
52
|
+
Do not publish yourself—inform user when ready for release.
|
package/justfile
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
set dotenv-load := true
|
|
2
2
|
|
|
3
|
-
build:
|
|
4
|
-
npm run build
|
|
5
|
-
|
|
6
|
-
install:
|
|
7
|
-
npm install
|
|
8
|
-
cd example && npm install
|
|
9
|
-
|
|
10
|
-
compile: install
|
|
11
|
-
cd example && rm -rf output-rust/src/generated && mkdir -p output-rust/src/generated && tsp compile . && echo 'pub mod server;' > output-rust/src/generated/mod.rs && echo 'pub mod types;' >> output-rust/src/generated/mod.rs
|
|
12
|
-
|
|
13
|
-
test:
|
|
14
|
-
npm test
|
|
15
|
-
|
|
16
3
|
check-rust:
|
|
17
|
-
cd example
|
|
4
|
+
cd example && tsp compile . && cd output-rust && cargo check && cargo clippy
|
|
18
5
|
|
|
19
6
|
publish:
|
|
20
|
-
npm run build && npm publish
|
|
7
|
+
npm run build && npm publish --access=public
|
|
8
|
+
|
|
9
|
+
npm +ARGS='':
|
|
10
|
+
npm {{ARGS}}
|
package/package.json
CHANGED
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
NPM_TOKEN=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
|