@codama/renderers-js 1.4.0 → 1.4.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/README.md +13 -14
- package/dist/index.browser.cjs +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +1 -1
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.react-native.mjs +1 -1
- package/dist/index.react-native.mjs.map +1 -1
- package/package.json +36 -22
package/README.md
CHANGED
|
@@ -15,24 +15,23 @@ This package generates JavaScript clients from your Codama IDLs. The generated c
|
|
|
15
15
|
pnpm install @codama/renderers-js
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
> [!NOTE]
|
|
19
|
-
> This package is **not** included in the main [`codama`](../library) package.
|
|
20
|
-
>
|
|
21
|
-
> However, note that the [`renderers`](../renderers) package re-exports the `renderVisitor` function of this package as `renderJavaScriptVisitor`.
|
|
22
|
-
|
|
23
18
|
## Usage
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
Add the following script to your Codama configuration file.
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"scripts": {
|
|
25
|
+
"js": {
|
|
26
|
+
"from": "@codama/renderers-js",
|
|
27
|
+
"args": ["clients/js/src/generated"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
34
31
|
```
|
|
35
32
|
|
|
33
|
+
An object can be passed as a second argument to further configure the renderer. See the [Options](#options) section below for more details.
|
|
34
|
+
|
|
36
35
|
## Options
|
|
37
36
|
|
|
38
37
|
The `renderVisitor` accepts the following options.
|
package/dist/index.browser.cjs
CHANGED
|
@@ -817,7 +817,7 @@ function getDiscriminatorConditionFragment(scope) {
|
|
|
817
817
|
}),
|
|
818
818
|
(c) => c.join(" && ")
|
|
819
819
|
),
|
|
820
|
-
(f) => (0, import_renderers_core2.mapFragmentContent)(f, (c) => `if (${c}) { ${scope.ifTrue}
|
|
820
|
+
(f) => (0, import_renderers_core2.mapFragmentContent)(f, (c) => `if (${c}) { ${scope.ifTrue} }`)
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
823
|
function getSizeConditionFragment(discriminator, scope) {
|