@bufbuild/protoc-gen-es 0.0.2-alpha.3 → 0.0.5
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 +86 -0
- package/package.json +16 -15
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# @bufbuild/protoc-gen-es
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@bufbuild/protoc-gen-es)
|
|
4
|
+
|
|
5
|
+
A complete implementation of protocol buffers in TypeScript,
|
|
6
|
+
suitable for web browsers and Node.js.
|
|
7
|
+
Learn more at [github.com/bufbuild/protobuf-es](https://github.com/bufbuild/protobuf-es).
|
|
8
|
+
|
|
9
|
+
This is a code generator plugin for `protoc` and [`buf`](https://github.com/bufbuild/buf).
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### With npm
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
npm install @bufbuild/protoc-gen-es
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This will install the code generator plugin in `node_modules/.bin/protoc-gen-es`.
|
|
21
|
+
Note that npm does not add the executable to your `$PATH`. You can do so with:
|
|
22
|
+
|
|
23
|
+
```shell
|
|
24
|
+
PATH=$PATH:$(pwd)/node_modules/.bin
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Note that `protoc-gen-es` is actually just a simple node script that selects the
|
|
28
|
+
correct precompiled binary for your platform. For example, if you are on a 32-bit
|
|
29
|
+
linux machine, the optional dependency `@bufbuild/protoc-gen-es-linux-32` is
|
|
30
|
+
automatically installed by `npm`, and our node script will run it. Note that this
|
|
31
|
+
means you cannot move your `node_modules` directory to a different platform and
|
|
32
|
+
run it. We recommend you run `npm ci` in CI or your docker images instead.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### With yarn
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
yarn add @bufbuild/protoc-gen-es
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Note that yarn v2 does not use a `node_modules` directory anymore. To find the path
|
|
42
|
+
where yarn stores the executable, run `yarn bin protoc-gen-es` (it is "unplugged"
|
|
43
|
+
automatically).
|
|
44
|
+
|
|
45
|
+
Yarn supports installing dependencies for several platforms at the same time, by
|
|
46
|
+
adding the configuration field [`supportedArchitectures`](https://yarnpkg.com/configuration/yarnrc#supportedArchitectures)
|
|
47
|
+
in your `.yarnrc.yml`.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### With go
|
|
51
|
+
|
|
52
|
+
Alternatively, you can install the plugin with `go`:
|
|
53
|
+
|
|
54
|
+
```shell
|
|
55
|
+
go install github.com/bufbuild/protobuf-es/cmd/protoc-gen-es@latest
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If your go environment is set up correctly, the executable is now available on
|
|
59
|
+
your `$PATH`.
|
|
60
|
+
|
|
61
|
+
You can always confirm successful installation with:
|
|
62
|
+
```shell
|
|
63
|
+
protoc-gen-es --version
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Plugin options
|
|
69
|
+
|
|
70
|
+
### `target`
|
|
71
|
+
|
|
72
|
+
This option controls whether the plugin generates JavaScript, TypeScript,
|
|
73
|
+
or TypeScript declaration files.
|
|
74
|
+
|
|
75
|
+
Possible values:
|
|
76
|
+
- `target=js` - generates a `_pb.js` file for every `.proto` input file.
|
|
77
|
+
- `target=ts` - generates a `_pb.ts` file for every `.proto` input file.
|
|
78
|
+
- `target=dts` - generates a `_pb.d.ts` file for every `.proto` input file.
|
|
79
|
+
|
|
80
|
+
Multiple values can be given by separating them with `+`, for example
|
|
81
|
+
`target=js+dts`.
|
|
82
|
+
|
|
83
|
+
By default, we generate JavaScript and TypeScript declaration files, which
|
|
84
|
+
produces the smallest code size. If you prefer to generate TypeScript, use
|
|
85
|
+
`target=ts`.
|
|
86
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protoc-gen-es",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "protoc-gen-es",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
"bin": {
|
|
11
11
|
"protoc-gen-es": "bin/protoc-gen-es"
|
|
12
12
|
},
|
|
13
|
+
"preferUnplugged": true,
|
|
13
14
|
"peerDependencies": {
|
|
14
|
-
"@bufbuild/protobuf": "^0.0.
|
|
15
|
+
"@bufbuild/protobuf": "^0.0.5"
|
|
15
16
|
},
|
|
16
17
|
"peerDependenciesMeta": {
|
|
17
18
|
"@bufbuild/protobuf": {
|
|
@@ -19,18 +20,18 @@
|
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
"optionalDependencies": {
|
|
22
|
-
"@bufbuild/protoc-gen-es-darwin-64": "0.0.
|
|
23
|
-
"@bufbuild/protoc-gen-es-darwin-arm64": "0.0.
|
|
24
|
-
"@bufbuild/protoc-gen-es-windows-64": "0.0.
|
|
25
|
-
"@bufbuild/protoc-gen-es-windows-arm64": "0.0.
|
|
26
|
-
"@bufbuild/protoc-gen-es-windows-32": "0.0.
|
|
27
|
-
"@bufbuild/protoc-gen-es-linux-64": "0.0.
|
|
28
|
-
"@bufbuild/protoc-gen-es-linux-32": "0.0.
|
|
29
|
-
"@bufbuild/protoc-gen-es-linux-arm": "0.0.
|
|
30
|
-
"@bufbuild/protoc-gen-es-linux-arm64": "0.0.
|
|
31
|
-
"@bufbuild/protoc-gen-es-freebsd-64": "0.0.
|
|
32
|
-
"@bufbuild/protoc-gen-es-freebsd-arm64": "0.0.
|
|
33
|
-
"@bufbuild/protoc-gen-es-netbsd-64": "0.0.
|
|
34
|
-
"@bufbuild/protoc-gen-es-openbsd-64": "0.0.
|
|
23
|
+
"@bufbuild/protoc-gen-es-darwin-64": "0.0.5",
|
|
24
|
+
"@bufbuild/protoc-gen-es-darwin-arm64": "0.0.5",
|
|
25
|
+
"@bufbuild/protoc-gen-es-windows-64": "0.0.5",
|
|
26
|
+
"@bufbuild/protoc-gen-es-windows-arm64": "0.0.5",
|
|
27
|
+
"@bufbuild/protoc-gen-es-windows-32": "0.0.5",
|
|
28
|
+
"@bufbuild/protoc-gen-es-linux-64": "0.0.5",
|
|
29
|
+
"@bufbuild/protoc-gen-es-linux-32": "0.0.5",
|
|
30
|
+
"@bufbuild/protoc-gen-es-linux-arm": "0.0.5",
|
|
31
|
+
"@bufbuild/protoc-gen-es-linux-arm64": "0.0.5",
|
|
32
|
+
"@bufbuild/protoc-gen-es-freebsd-64": "0.0.5",
|
|
33
|
+
"@bufbuild/protoc-gen-es-freebsd-arm64": "0.0.5",
|
|
34
|
+
"@bufbuild/protoc-gen-es-netbsd-64": "0.0.5",
|
|
35
|
+
"@bufbuild/protoc-gen-es-openbsd-64": "0.0.5"
|
|
35
36
|
}
|
|
36
37
|
}
|