@sealcode/sealgen 0.14.6 → 0.14.8
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.
- package/dist/esbuild-plugins/load-assets.js +3 -1
- package/dist/generate-routes.js +1 -1
- package/dist/templates/collection.js +2 -1
- package/dist/templates/jdd-component.js +4 -4
- package/package.json +1 -1
- package/src/esbuild-plugins/load-assets.ts +3 -1
- package/src/generate-routes.ts +1 -1
- package/src/templates/collection.ts +2 -1
- package/src/templates/jdd-component.ts +4 -4
- package/tsconfig.json +1 -1
|
@@ -33,6 +33,8 @@ const load_assets_plugin = {
|
|
|
33
33
|
args.path
|
|
34
34
|
)}";
|
|
35
35
|
|
|
36
|
+
const path = "${args.path}";
|
|
37
|
+
|
|
36
38
|
import fs from "fs";
|
|
37
39
|
let buffer_promise = null;
|
|
38
40
|
|
|
@@ -52,7 +54,7 @@ export const getBase64 = async function(){
|
|
|
52
54
|
return buffer.toString("base64");
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
export default { getContent, url, getBase64, getBuffer };
|
|
57
|
+
export default { getContent, url, getBase64, getBuffer, path };
|
|
56
58
|
`;
|
|
57
59
|
return {
|
|
58
60
|
contents
|
package/dist/generate-routes.js
CHANGED
|
@@ -53,7 +53,7 @@ async function generateRoutes() {
|
|
|
53
53
|
);
|
|
54
54
|
const routes_content = `// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
|
|
55
55
|
|
|
56
|
-
import Router from "@koa/router";
|
|
56
|
+
import type Router from "@koa/router";
|
|
57
57
|
import { mount } from "@sealcode/sealgen";
|
|
58
58
|
import * as URLs from "./urls.js"
|
|
59
59
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function collectionTemplate(collection_name) {
|
|
2
|
-
return `import {
|
|
2
|
+
return `import type { App, Policy } from "sealious";
|
|
3
|
+
import { Collection, FieldTypes, Policies } from "sealious";
|
|
3
4
|
|
|
4
5
|
export default class ${collection_name} extends Collection {
|
|
5
6
|
fields = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { toKebabCase, toPascalCase } from "js-convert-case";
|
|
2
2
|
function jddComponentTemplate(component_name) {
|
|
3
|
-
return `import { FlatTemplatable
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
ComponentArguments,
|
|
3
|
+
return `import type { FlatTemplatable } from "tempstream";
|
|
4
|
+
import { TempstreamJSX } from "tempstream";
|
|
5
|
+
import type {
|
|
7
6
|
ExtractStructuredComponentArgumentsValues,
|
|
8
7
|
JDDContext,
|
|
9
8
|
} from "@sealcode/jdd";
|
|
9
|
+
import { Component, ComponentArguments } from "@sealcode/jdd";
|
|
10
10
|
|
|
11
11
|
const component_arguments = {
|
|
12
12
|
title: new ComponentArguments.ShortText(),
|
package/package.json
CHANGED
|
@@ -38,6 +38,8 @@ export const load_assets_plugin = {
|
|
|
38
38
|
args.path
|
|
39
39
|
)}";
|
|
40
40
|
|
|
41
|
+
const path = "${args.path}";
|
|
42
|
+
|
|
41
43
|
import fs from "fs";
|
|
42
44
|
let buffer_promise = null;
|
|
43
45
|
|
|
@@ -57,7 +59,7 @@ export const getBase64 = async function(){
|
|
|
57
59
|
return buffer.toString("base64");
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
export default { getContent, url, getBase64, getBuffer };
|
|
62
|
+
export default { getContent, url, getBase64, getBuffer, path };
|
|
61
63
|
`;
|
|
62
64
|
return {
|
|
63
65
|
contents,
|
package/src/generate-routes.ts
CHANGED
|
@@ -72,7 +72,7 @@ export async function generateRoutes(): Promise<void> {
|
|
|
72
72
|
|
|
73
73
|
const routes_content = `// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
|
|
74
74
|
|
|
75
|
-
import Router from "@koa/router";
|
|
75
|
+
import type Router from "@koa/router";
|
|
76
76
|
import { mount } from "@sealcode/sealgen";
|
|
77
77
|
import * as URLs from "./urls.js"
|
|
78
78
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function collectionTemplate(collection_name: string) {
|
|
2
|
-
return `import {
|
|
2
|
+
return `import type { App, Policy } from "sealious";
|
|
3
|
+
import { Collection, FieldTypes, Policies } from "sealious";
|
|
3
4
|
|
|
4
5
|
export default class ${collection_name} extends Collection {
|
|
5
6
|
fields = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { toKebabCase, toPascalCase } from "js-convert-case";
|
|
2
2
|
|
|
3
3
|
export function jddComponentTemplate(component_name: string) {
|
|
4
|
-
return `import { FlatTemplatable
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
ComponentArguments,
|
|
4
|
+
return `import type { FlatTemplatable } from "tempstream";
|
|
5
|
+
import { TempstreamJSX } from "tempstream";
|
|
6
|
+
import type {
|
|
8
7
|
ExtractStructuredComponentArgumentsValues,
|
|
9
8
|
JDDContext,
|
|
10
9
|
} from "@sealcode/jdd";
|
|
10
|
+
import { Component, ComponentArguments } from "@sealcode/jdd";
|
|
11
11
|
|
|
12
12
|
const component_arguments = {
|
|
13
13
|
title: new ComponentArguments.ShortText(),
|