@sealcode/sealgen 0.17.21 → 0.17.22
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { toPascalCase } from "js-convert-case";
|
|
2
2
|
import prompts from "prompts";
|
|
3
3
|
import extract_fields_from_collection from "../utils/extract-fields-from-collection.js";
|
|
4
|
+
import { formatWithPrettier } from "../utils/prettier.js";
|
|
4
5
|
import { listCollections } from "../utils/list-collections.js";
|
|
5
6
|
async function jddEditorTemplate(actionName) {
|
|
6
7
|
const response = await prompts([
|
|
@@ -42,7 +43,7 @@ async function jddEditorTemplate(actionName) {
|
|
|
42
43
|
process.exit(13);
|
|
43
44
|
}
|
|
44
45
|
const collectionClassName = toPascalCase(collection_name);
|
|
45
|
-
return `import type { Context } from "koa";
|
|
46
|
+
return await formatWithPrettier(`import type { Context } from "koa";
|
|
46
47
|
import type { FieldNames } from "sealious";
|
|
47
48
|
import { TempstreamJSX } from "tempstream";
|
|
48
49
|
import type ${collectionClassName} from "src/back/collections/${collection_name}.js";
|
|
@@ -72,8 +73,7 @@ export default new (class JDDCreatePreviewPage extends EditJDDField<${collection
|
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
75
|
})({ html, registry, makeJDDContext, defaultHead });
|
|
75
|
-
|
|
76
|
-
`;
|
|
76
|
+
`);
|
|
77
77
|
}
|
|
78
78
|
export {
|
|
79
79
|
jddEditorTemplate
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { toPascalCase } from "js-convert-case";
|
|
2
2
|
import prompts from "prompts";
|
|
3
3
|
import extract_fields_from_collection from "../utils/extract-fields-from-collection.js";
|
|
4
|
+
import { formatWithPrettier } from "../utils/prettier.js";
|
|
4
5
|
|
|
5
6
|
import { listCollections } from "../utils/list-collections.js";
|
|
6
7
|
|
|
@@ -54,7 +55,7 @@ export async function jddEditorTemplate(actionName: string) {
|
|
|
54
55
|
|
|
55
56
|
const collectionClassName = toPascalCase(collection_name);
|
|
56
57
|
|
|
57
|
-
return `import type { Context } from "koa";
|
|
58
|
+
return await formatWithPrettier(`import type { Context } from "koa";
|
|
58
59
|
import type { FieldNames } from "sealious";
|
|
59
60
|
import { TempstreamJSX } from "tempstream";
|
|
60
61
|
import type ${collectionClassName} from "src/back/collections/${collection_name}.js";
|
|
@@ -84,6 +85,5 @@ export default new (class JDDCreatePreviewPage extends EditJDDField<${collection
|
|
|
84
85
|
);
|
|
85
86
|
}
|
|
86
87
|
})({ html, registry, makeJDDContext, defaultHead });
|
|
87
|
-
|
|
88
|
-
`;
|
|
88
|
+
`);
|
|
89
89
|
}
|