@bufbuild/protoc-gen-es 1.1.1 → 1.2.0

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
@@ -15,13 +15,18 @@ npm install @bufbuild/protobuf
15
15
  ```
16
16
 
17
17
  We use peer dependencies to ensure that code generator and runtime library are
18
- compatible with each other. Note that yarn and pnpm only emit a warning in this case.
18
+ compatible with each other. Note that npm installs them automatically, but yarn
19
+ and pnpm do not.
19
20
 
20
21
 
21
22
  ## Generating code
22
23
 
23
24
  ### With buf
24
25
 
26
+ ```bash
27
+ npm install --save-dev @bufbuild/buf
28
+ ```
29
+
25
30
  Add a new configuration file `buf.gen.yaml`:
26
31
 
27
32
  ```yaml
@@ -32,26 +37,15 @@ plugins:
32
37
  # This will invoke protoc-gen-es and write output to src/gen
33
38
  - name: es
34
39
  out: src/gen
35
- opt: target=ts
36
- ```
37
-
38
- Add the following script to your `package.json`:
39
-
40
- ```json
41
- {
42
- "name": "your-package",
43
- "version": "1.0.0",
44
- "scripts": {
45
- "generate": "buf generate"
46
- },
47
- // ...
48
- }
40
+ opt:
41
+ # Add more plugin options here
42
+ - target=ts
49
43
  ```
50
44
 
51
45
  To generate code for all protobuf files within your project, simply run:
52
46
 
53
47
  ```bash
54
- npm run generate
48
+ npx buf generate
55
49
  ```
56
50
 
57
51
  Note that `buf` can generate from various [inputs](https://docs.buf.build/reference/inputs),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Protocol Buffers code generator for ECMAScript",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "preferUnplugged": true,
22
22
  "dependencies": {
23
- "@bufbuild/protoplugin": "1.1.1"
23
+ "@bufbuild/protoplugin": "1.2.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@bufbuild/protobuf": "1.1.1"
26
+ "@bufbuild/protobuf": "1.2.0"
27
27
  },
28
28
  "peerDependenciesMeta": {
29
29
  "@bufbuild/protobuf": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoc-gen-es",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Protocol Buffers code generator for ECMAScript",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "preferUnplugged": true,
22
22
  "dependencies": {
23
- "@bufbuild/protoplugin": "1.1.1"
23
+ "@bufbuild/protoplugin": "1.2.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@bufbuild/protobuf": "1.1.1"
26
+ "@bufbuild/protobuf": "1.2.0"
27
27
  },
28
28
  "peerDependenciesMeta": {
29
29
  "@bufbuild/protobuf": {