-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade to last data model release (hasvariant) #14
Comments
So I'm building the TS connector w/ the updates to Basically, the And regarding the CHANGELOG, I don't think I realized this wasn't pegged to any release for the data model. I was planning to point to the data model's release tag in the TS release and commit history, and to link to the data model's CHANGELOG from the TS CHANGELOG. That way there would be a definite set of properties, interfaces, etc that can be identified with and pegged to the TypeScript release. Would it make sense to give |
For the Ruby version we link to the used data-model commit: I'm wondering if it would make sense to declare the data model as Git submodule. Then the data-model commit would be tracked in the Git history as well. |
Ah yes, that would work too.
I was having the same thought. It would make sense and save a couple steps since it's already part of the normal procedure to clone the repo into the project anyways. |
Yes Normally the generator should not produce errors when new methods are introduced. Can I see the definition of the methods producing errors? @jgaehring To link the data-model to a generation I also just write into the changelog. I'm open to other solutions and a Git submodule can be a good idea. |
Ah, okay, then there it is a bug in the setter generation. Here's the setter's definition:
(with syntax highlighting:) Seems clear to me now that it's missing a condition for |
@lecoqlibre, does this look like a correct implementation for the public setVariants(variants: IDefinedProduct[]): void {
const store = new ConnectorStoreMap();
variants.forEach(variant => {
this.addSemanticPropertyReference('dfc-b:hasVariant', variant, true);
store.set(variant);
});
this.connector.setDefaultStore(store);
} If so, we should add I can update this from the code generator if that looks right to you. Hopefully I will have more time tomorrow, but if not, by next week. |
@jgaehring I'm wondering why you reassign a store to the connector in the method body? Setters are supposed to use the store of the object settled in the constructor. |
@jgaehring We may have not a multiple setter yet. You should check that the |
So I rebuilt the TS libary based on our discussions, and it looks pretty good to me, passing no fewer tests than usual. Here's the latest commit that fixes the setter issue in the But I only just now noticed there's a bunch of src files that are missing since the previous alpha-9 build of the TS library: jamie@xps-13-9300:~/Code/datafoodconsortium/connector-typescript$ git status src/ | grep deleted:
deleted: src/Contactable.ts
deleted: src/Emailable.ts
deleted: src/IAllergenDimension.ts
deleted: src/ICertification.ts
deleted: src/ICharacteristicDimension.ts
deleted: src/IClaim.ts
deleted: src/IGeographicalOrigin.ts
deleted: src/INatureOrigin.ts
deleted: src/INutrientDimension.ts
deleted: src/IPartOrigin.ts
deleted: src/IPhysicalDimension.ts
deleted: src/IProductType.ts
deleted: src/IUnit.ts
deleted: src/Identifiable.ts
deleted: src/Supplier.ts
deleted: src/index.ts
deleted: src/terms.ts This is a bit alarming, but perhaps these are just relics from some outdated model or something? You can view the full diffs for the generated TS and transpiled JS here: v1.0.0-alpha.9...jgaehring:rc-alpha-10 I may not have much time to take a look at this closely or run further builds tomorrow, but the downstream consumers of the TS library do have the branch URL they can pull directly from GH via their package.json. So if it works for them an other ppl are cofortable with puling the trigger, I can open a PR that can get merged in and tagged (someone else may need to publish to npm, don't think I have permission), or perhaps @lecoqlibre would be able to pull from my codegen fork to see what's the matter with those missing src files, the run the build again locally and merge/tag/publish/etc. |
The current changelog is on the next branch :
https://github.com/datafoodconsortium/data-model-uml/blob/next/CHANGELOG.md
The text was updated successfully, but these errors were encountered: