- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33
Strip out _virtual_imports packages to support well known types #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -24,6 +24,8 @@ ts_library( | |
| deps = [ | ||
| "//test/proto:pizza_service_ts_proto", | ||
| "//test/proto/common:delivery_person_ts_proto", | ||
| "@npm//google-protobuf", | ||
| "@npm//@types/google-protobuf", | ||
| "@npm//@types/jasmine", | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these need to change? I'd prefer to be as specific as possible so it's easier to trim unused dependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done | ||
| ], | ||
| ) | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import deliveryPersonPb = require('rules_typescript_proto/test/proto/common/delivery_person_pb'); | ||
| import {Timestamp} from 'google-protobuf/google/protobuf/timestamp_pb'; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This proto should be at  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that's the case here. This syntax would load from the npm module  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to say that the google-protobuf version has special code for timestamp conversion and stuff, but then went and researched and the protoc compiler itself adds that in here https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/js/well_known_types_embed.cc Dig-Doug: do you still want this changed to use the non-npm locally generated proto code here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My impression here was that you're trying to test if you can generate a TS protobuf for a proto defined in an external repository. E.g., let's say you wanted to use one of the protos defined in the  Alternatively, you could also handle  For those reasons, I'm leaning towards using the locally generated files. I don't have a strong opinion here, so if there's a reason we should be using the bundled versions instead let me know. | ||
| import * as deliveryPersonPb from 'rules_typescript_proto/test/proto/common/delivery_person_pb'; | ||
| import {PizzaService} from 'rules_typescript_proto/test/proto/pizza_service_pb_service'; | ||
|  | ||
| describe('CommonJs', () => { | ||
|  | @@ -7,6 +8,9 @@ describe('CommonJs', () => { | |
|  | ||
| const person = new deliveryPersonPb.DeliveryPerson(); | ||
| person.setName('Doug'); | ||
| const lastDeliveryTime = new Timestamp(); | ||
| lastDeliveryTime.fromDate(new Date()); | ||
| person.setLastDeliveryTime(lastDeliveryTime); | ||
| expect(person).toBeDefined(); | ||
| }); | ||
|  | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment describing when workspace_root is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done