mobiletto-orm-typedef-gen 2.1.11 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ export type TypeDeclaration = {
7
7
  };
8
8
  export type GenerateOptions = {
9
9
  outfile?: string;
10
+ header?: string;
10
11
  name?: string;
11
12
  disclaimer?: string;
12
13
  prepareContext?: (typeDef: MobilettoOrmTypeDef, ctx: Record<string, unknown>) => Record<string, unknown>;
@@ -114,6 +114,7 @@ export const generate = (typeDef, templatePath, opts) => {
114
114
  fields: decl.fields,
115
115
  fieldNames: Object.keys(decl.fields),
116
116
  disclaimer: decls.length > 0 ? null : disclaimer,
117
+ header: decls.length > 0 ? null : opts === null || opts === void 0 ? void 0 : opts.header,
117
118
  first,
118
119
  root: decl.root || false,
119
120
  });
@@ -1,4 +1,5 @@
1
- {{#if disclaimer}}// {{{ disclaimer }}}
1
+ {{#if disclaimer}}// {{{ disclaimer }}}{{#if header}}
2
+ {{{header}}}{{/if}}
2
3
  {{/if}}export type {{ Name }}Type = {{#if root}}{
3
4
  _meta?: {
4
5
  id: string;
@@ -1,4 +1,5 @@
1
- {{#if disclaimer}}// {{{ disclaimer }}}
1
+ {{#if disclaimer}}// {{{ disclaimer }}}{{#if header}}
2
+ {{{header}}}{{/if}}
2
3
  import * as yup from "yup";{{/if}}
3
4
  export const {{Name}}Schema = yup.object({{{curlyOpen}}}{{#each fields}}
4
5
  {{name}}: {{#if typeIsObject}}{{ ../Name }}_{{name}}Schema{{else}}{{#if typeIsArray}}yup.array().of(yup.{{valueType}}{{else}}yup.{{type}}{{/if}}(){{#if isEnum}}
@@ -7,6 +7,7 @@ export type TypeDeclaration = {
7
7
  };
8
8
  export type GenerateOptions = {
9
9
  outfile?: string;
10
+ header?: string;
10
11
  name?: string;
11
12
  disclaimer?: string;
12
13
  prepareContext?: (typeDef: MobilettoOrmTypeDef, ctx: Record<string, unknown>) => Record<string, unknown>;
@@ -114,6 +114,7 @@ export const generate = (typeDef, templatePath, opts) => {
114
114
  fields: decl.fields,
115
115
  fieldNames: Object.keys(decl.fields),
116
116
  disclaimer: decls.length > 0 ? null : disclaimer,
117
+ header: decls.length > 0 ? null : opts === null || opts === void 0 ? void 0 : opts.header,
117
118
  first,
118
119
  root: decl.root || false,
119
120
  });
@@ -1,4 +1,5 @@
1
- {{#if disclaimer}}// {{{ disclaimer }}}
1
+ {{#if disclaimer}}// {{{ disclaimer }}}{{#if header}}
2
+ {{{header}}}{{/if}}
2
3
  {{/if}}export type {{ Name }}Type = {{#if root}}{
3
4
  _meta?: {
4
5
  id: string;
@@ -1,4 +1,5 @@
1
- {{#if disclaimer}}// {{{ disclaimer }}}
1
+ {{#if disclaimer}}// {{{ disclaimer }}}{{#if header}}
2
+ {{{header}}}{{/if}}
2
3
  import * as yup from "yup";{{/if}}
3
4
  export const {{Name}}Schema = yup.object({{{curlyOpen}}}{{#each fields}}
4
5
  {{name}}: {{#if typeIsObject}}{{ ../Name }}_{{name}}Schema{{else}}{{#if typeIsArray}}yup.array().of(yup.{{valueType}}{{else}}yup.{{type}}{{/if}}(){{#if isEnum}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto-orm-typedef-gen",
3
- "version": "2.1.11",
3
+ "version": "2.1.13",
4
4
  "type": "module",
5
5
  "description": "generate various files based on mobiletto-orm-typedef definitions",
6
6
  "keywords": [
@@ -56,6 +56,6 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "handlebars": "^4.7.7",
59
- "mobiletto-orm-typedef": "^2.1.19"
59
+ "mobiletto-orm-typedef": "^2.1.20"
60
60
  }
61
61
  }