@sealcode/sealgen 0.14.4 → 0.14.5
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/@types/src/builder.d.ts +36 -0
- package/@types/src/embeddable-file-extensions.d.ts +1 -0
- package/@types/src/esbuild-plugins/load-assets.d.ts +4 -0
- package/@types/src/esbuild-plugins/rewrite-asset-imports.d.ts +4 -0
- package/@types/src/generate-stimulus.d.ts +1 -0
- package/@types/src/page/stateful-page.d.ts +1 -1
- package/@types/src/templates/stimulus-controller.d.ts +1 -0
- package/dist/build.js +29 -213
- package/dist/builder.js +145 -0
- package/dist/cli.js +3 -1
- package/dist/embeddable-file-extensions.js +5 -0
- package/dist/esbuild-plugins/load-assets.js +67 -0
- package/dist/esbuild-plugins/rewrite-asset-imports.js +30 -0
- package/dist/generate-stimulus.js +41 -0
- package/dist/page/stateful-page.js +3 -2
- package/dist/templates/stimulus-controller.js +21 -0
- package/package.json +1 -1
- package/src/build.ts +30 -234
- package/src/builder.ts +176 -0
- package/src/cli.ts +3 -1
- package/src/embeddable-file-extensions.ts +1 -0
- package/src/esbuild-plugins/load-assets.ts +68 -0
- package/src/esbuild-plugins/rewrite-asset-imports.ts +29 -0
- package/src/generate-stimulus.ts +52 -0
- package/src/page/stateful-page.ts +8 -3
- package/src/templates/stimulus-controller.ts +18 -0
|
@@ -66,12 +66,17 @@ export abstract class StatefulPage<
|
|
|
66
66
|
this.wrapInForm(
|
|
67
67
|
state,
|
|
68
68
|
await original_render(ctx, state, inputs)
|
|
69
|
-
)
|
|
69
|
+
),
|
|
70
|
+
state
|
|
70
71
|
);
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
abstract wrapInLayout(
|
|
75
|
+
abstract wrapInLayout(
|
|
76
|
+
ctx: BaseContext,
|
|
77
|
+
content: Templatable,
|
|
78
|
+
state: State
|
|
79
|
+
): Templatable;
|
|
75
80
|
|
|
76
81
|
wrapInForm(state: State, content: Templatable): Templatable {
|
|
77
82
|
return tempstream/* HTML */ `<form action="./" method="POST">
|
|
@@ -218,7 +223,7 @@ export abstract class StatefulPage<
|
|
|
218
223
|
options
|
|
219
224
|
);
|
|
220
225
|
} else if (target.indexOf(item) === -1) {
|
|
221
|
-
destination
|
|
226
|
+
destination[index] = item;
|
|
222
227
|
}
|
|
223
228
|
});
|
|
224
229
|
return destination;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { toKebabCase, toPascalCase } from "js-convert-case";
|
|
2
|
+
|
|
3
|
+
export function jddComponentTemplate(controller_name: string) {
|
|
4
|
+
return `import { Controller } from "stimulus";
|
|
5
|
+
|
|
6
|
+
export default class ${toPascalCase(controller_name)} extends Controller {
|
|
7
|
+
|
|
8
|
+
connect() {
|
|
9
|
+
console.warn(
|
|
10
|
+
"Remove ${toKebabCase(
|
|
11
|
+
controller_name
|
|
12
|
+
)}.stimulus.ts file if your JDD component doesn't need any browser-side logic"
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
`;
|
|
18
|
+
}
|