XrmDefinitelyTyped icon indicating copy to clipboard operation
XrmDefinitelyTyped copied to clipboard

Split xrm.d.ts into a separate package

Open magesoe opened this issue 6 years ago • 4 comments

Max Ewing has made a blogpost, where he describes a use case for writing typescript that only interfaces with xrm.d.ts. Currently this is done by extracting the generated file and distribute it in some way.

Although this is not the intended way of using XDT, I believe we should support it.

xrm.d.ts is already used separately from the rest of XDT. Therefore it is possible to extract it into a new project and generate a separate package, preferably for each version of the file. This would allow Max Ewing to reference those packages, instead of having to generate it himself.

magesoe avatar May 31 '18 07:05 magesoe

Any news about this enhancement? It would be useful because currently it is a little bit hard to use for example xrm-mock library for testing.

pchren avatar Jan 28 '20 12:01 pchren

There is a problem with directly using the typings from @types/xrm with XrmDefinitelyTyped.

The problem is that XrmDefinitelyTyped does not wish to allow magic strings in getAttribute and getControl, but @types/xrm has to support that. I have not made much effort into splitting up the packages, since it was not an easy fix.

magesoe avatar Jan 28 '20 12:01 magesoe

There is a PR submitted this week ((https://github.com/delegateas/XrmDefinitelyTyped/pull/278)) which allows XrmDT to use a custom namespace (instead of 'Xrm'). While I think the issue here may have other benefits, using a custom namespace avoids the collision between this project and @types/xrm, which I think was a prime motivator for this issue.

majblackburn avatar Jul 22 '22 18:07 majblackburn

It seems this issue has been going on for so long that another project has been created that is pure npm and combines types/xrm with XDT :) https://github.com/OliverFlint/XrmTypesGen

magesoe avatar Aug 05 '22 10:08 magesoe