From 6762f2be45f41d3e7ae80531af0fed08dc3c9f1f Mon Sep 17 00:00:00 2001 From: Andrew Desmarais Date: Thu, 9 Jun 2022 16:25:08 -0400 Subject: [PATCH] Updated documentation --- docs/API.md | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 docs/API.md diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..a20d493 --- /dev/null +++ b/docs/API.md @@ -0,0 +1,139 @@ + + +### Table of Contents + +* [DependencyEntry][1] + * [Parameters][2] + * [hasConflictWithMajorVersion][3] + * [Parameters][4] + * [getEs5Urls][5] + * [Parameters][6] + * [getEsmUrls][7] + * [Parameters][8] + * [getCssUrls][9] + * [Parameters][10] +* [Contact][11] + * [Parameters][12] + * [Properties][13] + +## DependencyEntry + +The details of an supporting library for dependency resolution and contact information. + +### Parameters + +* `options` **[object][14]** See below + + * `options.basePath` **[string][15]** The base url for all asset paths + * `options.conflictsWithOtherMajorVersions` **[boolean][16]** This dependency does not implement version namespacing and could break if another instance, even of another major version, is present in the browser context + * `options.contact` **[Contact][17]** The contact information for the owner + * `options.es5` **[Array][18]<[string][15]>?** The file paths needed for ES5 rendering. Either `es5`, `esm`, or both must be provided. + * `options.esm` **[Array][18]<[string][15]>?** The file paths needed for ESM rendering. Either `es5`, `esm`, or both must be provided. + * `options.orchardDependencies` **[Array][18]<[string][15]>?** Package names of other dependencies in the orchard that this directly depends upon + * `options.ownedBy` **[string][15]** The name of the team or group who owns this package + * `options.packageName` **[string][15]** The name of the package published to NPM including the namespace. Eg. @meltwater/volume-by-input-column + * `options.requiresInitialization` **[boolean][16]** This dependency requires needs to be initialized on the page before it can be used + * `options.repo` **[string][15]** The github repo for the package + * `options.versionPath` **[string][15]** The version portion of all asset paths + +### hasConflictWithMajorVersion + +Evaluate whether this dependency has a conflict with the given major version + +#### Parameters + +* `majorVersion` **[number][19]** The major version number (e.g. 13, not 13.0.0) to check + +Returns **[boolean][16]** True if this dependency has a conflict with the given major version; otherwise false + +### getEs5Urls + +Generate ES5 urls used in script tags + +#### Parameters + +* `version` **[string][15]** The full version to be used for ES5 urls + +Returns **[Array][18]<[string][15]>** The urls for all ES5 assets for this dependency + +### getEsmUrls + +Generate ESM urls used in script tags + +#### Parameters + +* `version` **[string][15]** The full version to be used for ESM urls + +Returns **[Array][18]<[string][15]>** The urls for all ESM assets for this dependency + +### getCssUrls + +Generate CSS urls used in style tags + +#### Parameters + +* `version` **[string][15]** The full version to be used for CSS urls + +Returns **[Array][18]<[string][15]>** The urls for all CSS assets for this dependency + +## Contact + +Contact information for the maintainers of an orchard entry + +Each constructor parameter is individually options, but at least one must +be provided. + +### Parameters + +* `$0` **[Object][14]** + + * `$0.email` + * `$0.slack` + * `$0.url` +* `email` **[string][15]** Email address +* `slack` **[string][15]** Slack channel name +* `url` **[string][15]** URL to associate with a particular orchard entry + +### Properties + +* `email` **[string][15]** Email address +* `slack` **[string][15]** Slack channel name +* `url` **[string][15]** URL to associate with a particular orchard entry + +[1]: #dependencyentry + +[2]: #parameters + +[3]: #hasconflictwithmajorversion + +[4]: #parameters-1 + +[5]: #getes5urls + +[6]: #parameters-2 + +[7]: #getesmurls + +[8]: #parameters-3 + +[9]: #getcssurls + +[10]: #parameters-4 + +[11]: #contact + +[12]: #parameters-5 + +[13]: #properties + +[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean + +[17]: #contact + +[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array + +[19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number