Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ant/spread
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-c-martin committed Apr 21, 2024
2 parents 2621d09 + 959dbbb commit 71e5e63
Show file tree
Hide file tree
Showing 211 changed files with 8,221 additions and 6,238 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
uses: actions/setup-dotnet@v4

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3
uses: microsoft/setup-msbuild@v2

- name: Build Bicep.sln
run: dotnet build --configuration release
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update-baselines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
main:
name: Update Baselines
runs-on: ubuntu-latest
permissions:
contents: write

env:
# don't print dotnet logo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-notices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
node-version: 18

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3
uses: microsoft/setup-msbuild@v2

- name: Build Bicep.sln
run: dotnet build --configuration Release
Expand Down
21 changes: 16 additions & 5 deletions docs/experimental/jsonrpc-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ The `jsonrpc` command allows you to run the Bicep CLI in a JSONRPC server mode.

This makes it possible to build libraries which interact with Bicep files programatically in non-.NET languages.

## Format
The wire format used to send/recieve input/output is header-delimited, meaning the following format is expected, where `\r` and `\n` refer to carriage return and line feed characters:

`Content-Length: <length>\r\n\r\n<message>\r\n\r\n`

* `<length>` is the length of the `<message>` string, including the trailing `\r\n\r\n`.
* `<message>` is the raw JSON message.

### Example
`Content-Length: 72\r\n\r\n{"jsonrpc": "2.0", "id": 0, "method": "bicep/version", "params": {}}\r\n\r\n`

## Usage (named pipe)
`bicep jsonrpc --pipe <named_pipe>`

Runs the JSONRPC server connected to a named pipe.
Connects to an existing named pipe as a JSONRPC client. See here for some examples: [C#](https://github.com/Azure/bicep/blob/096c32f9d5c42bfb85dff550f72f3fe16f8142c7/src/Bicep.Cli.IntegrationTests/JsonRpcCommandTests.cs#L24-L50) and [node.js](https://github.com/anthony-c-martin/bicep-node/blob/4769e402f2d2c1da8d27df86cb3d62677e7a7456/src/utils/jsonrpc.ts#L117-L151).

### Arguments
`<named_pipe>` A named pipe to connect the JSONRPC server to.
`<named_pipe>` An existing named pipe to connect the JSONRPC client to.

### Examples
#### Connecting to a named pipe (OSX/Linux)
Expand All @@ -23,10 +34,10 @@ Runs the JSONRPC server connected to a named pipe.
## Usage (TCP socket)
`bicep jsonrpc --socket <tcp_socket>`

Runs the JSONRPC server connected to a TCP socket.
Connects to an existing TCP socket as a JSONRPC client.

### Arguments
`<tcp_socket>` A socket number to connect the JSONRPC server to.
`<tcp_socket>` A socket number to connect the JSONRPC client to.

### Examples
#### Connecting to a TCP socket
Expand Down Expand Up @@ -200,4 +211,4 @@ See [`jsonrpc.test.ts`](../../src/Bicep.Cli.E2eTests/src/jsonrpc.test.ts) for an
```

## Raising bugs or feature requests
Please raise bug reports or feature requests under [Bicep Issues](https://github.com/Azure/bicep/issues) as usual.
Please raise bug reports or feature requests under [Bicep Issues](https://github.com/Azure/bicep/issues) as usual.
1 change: 1 addition & 0 deletions src/Bicep.Cli.E2eTests/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
assertFunctionNames: ["expect*", "invokingBicepCommand"],
},
],
"jest/prefer-importing-jest-globals": "off",
},
},
{
Expand Down
Loading

0 comments on commit 71e5e63

Please sign in to comment.