diff --git a/lib/typescript-fetch/modelEnum.mustache b/lib/typescript-fetch/modelEnum.mustache index afd34ea..23b5951 100644 --- a/lib/typescript-fetch/modelEnum.mustache +++ b/lib/typescript-fetch/modelEnum.mustache @@ -3,10 +3,12 @@ * @export * @enum {string} */ -export enum {{classname}} { +export const {{classname}} = { {{#allowableValues}} {{#enumVars}} - {{{name}}} = {{{value}}}{{^@last}},{{/@last}} + {{{name}}}:{{{value}}}{{^@last}},{{/@last}} {{/enumVars}} {{/allowableValues}} -} +} as const + +export type {{classname}} = typeof {{classname}}[keyof typeof {{classname}}] diff --git a/lib/typescript-fetch/modelGeneric.mustache b/lib/typescript-fetch/modelGeneric.mustache index 940602e..c6a3782 100644 --- a/lib/typescript-fetch/modelGeneric.mustache +++ b/lib/typescript-fetch/modelGeneric.mustache @@ -26,16 +26,18 @@ export namespace {{classname}} { {{#vars}} {{#isEnum}} /** - * @export - * @enum {string} - */ - export enum {{enumName}} { + * {{{description}}} + * @export + */ + export const {{enumName}} = { {{#allowableValues}} {{#enumVars}} - {{{name}}} = {{{value}}}{{^@last}},{{/@last}} + {{{name}}}: {{{value}}}{{^@last}},{{/@last}} {{/enumVars}} {{/allowableValues}} - } + } as const + + export type {{enumName}} = typeof {{enumName}}[keyof typeof {{enumName}}] {{/isEnum}} {{/vars}} }{{/hasEnums}} diff --git a/manual-releases.md b/manual-releases.md new file mode 100644 index 0000000..154fc8a --- /dev/null +++ b/manual-releases.md @@ -0,0 +1,44 @@ +# manual-releases + +This project has an automated release set up. So things are only released when +there are useful changes in the code that justify a release. But sometimes +things get messed up one way or another and we need to trigger the release +ourselves. When this happens, simply bump the number below and commit that with +the following commit message based on your needs: + +**Major** + +``` +fix(release): manually release a major version + +There was an issue with a major release, so this manual-releases.md +change is to release a new major version. + +Reference: # + +BREAKING CHANGE: +``` + +**Minor** + +``` +feat(release): manually release a minor version + +There was an issue with a minor release, so this manual-releases.md +change is to release a new minor version. + +Reference: # +``` + +**Patch** + +``` +fix(release): manually release a patch version + +There was an issue with a patch release, so this manual-releases.md +change is to release a new patch version. + +Reference: # +``` + +The number of times we've had to do a manual release is: 1