protocolbuffers / protocolbuffers/protobuf-javascript
Unexpected `.` in generated file names results in `buf` warning
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 471
- Forks
- 91
- Ø Merge
- 3 Std. 57 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
When using the plugin v3.21.2 through buf on Linux (Ubuntu), I'm getting the following warning:
Warning: Generated file name "./some/path/to/file/my_message_pb.js" does not conform to the Protobuf generation specification. Note that the file name must be relative, use "/" instead of "", and not use "." or ".." as part of the file name. Buf will continue without error here, but please raise an issue with the maintainer of the plugin and reference https://github.com/protocolbuffers/protobuf/blob/95e6c5b4746dd7474d540ce4fb375e3f79a086f8/src/google/protobuf/compiler/plugin.proto#L122
...which is rather self-explanatory. I suspect this might be because of the . at the beginning.
The buf command I was using is the following:
buf generate /path/to/protos --template buf.gen.yaml -o /output/location
(i.e. I used full path for both - input and output paths)
buf generation template is
version: v1
plugins:
- name: js
out: .
opt: import_style=commonjs
I tried changing out to not be . to no avail.
There are no warnings when plugin is used through protoc directly, but I think the buf is right that returned file path should not have . components.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere die Warnung mit dem gezeigten buf generate-Befehl, der buf.gen.yaml-Vorlage und dem Plugin v3.21.2 unter Linux und vergleiche den generierten Pfad mit der direkten protoc-Ausgabe. Verfolge die Plugin-Ausgabe anhand der referenzierten Generierungsspezifikation von plugin.proto; abgeschlossen ist die Arbeit, wenn buf einen relativen Dateinamen ohne eine führende "."-Komponente erhält und keine Warnung mehr ausgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100