@sealcode/sealgen 0.15.1 → 0.15.3

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.
Files changed (200) hide show
  1. package/.eslintrc.cjs +38 -0
  2. package/.xunit +53 -0
  3. package/@types/src/page/stateful-page.d.ts +4 -2
  4. package/build.js +1 -1
  5. package/{dist → lib}/add-route.test.js +2 -2
  6. package/{dist → lib}/build.js +3 -3
  7. package/{dist → lib}/builder.js +3 -0
  8. package/lib/cli.js +39 -0
  9. package/{dist → lib}/esbuild-plugins/load-assets.js +2 -2
  10. package/{dist → lib}/forms/controls/array.js +1 -2
  11. package/{dist → lib}/forms/controls/autocomplete.js +8 -10
  12. package/{dist → lib}/forms/controls/checkboxed-list-input.test.js +3 -2
  13. package/{dist → lib}/forms/controls/collapsible-field-group.js +2 -1
  14. package/{dist → lib}/forms/controls/editable-collection-subset.js +6 -4
  15. package/{dist → lib}/forms/controls/field-group.js +1 -1
  16. package/{dist → lib}/forms/controls/file.js +2 -5
  17. package/{dist → lib}/forms/controls/form-control.js +2 -1
  18. package/{dist → lib}/forms/controls/photo.js +1 -1
  19. package/{dist → lib}/forms/controls/photo.test.js +5 -7
  20. package/{dist → lib}/forms/controls/textarea.js +1 -1
  21. package/{dist → lib}/forms/fields/boolean.test.js +0 -1
  22. package/{dist → lib}/forms/fields/field.js +2 -5
  23. package/{dist → lib}/forms/fields/file.js +8 -2
  24. package/{dist → lib}/forms/fields/structured-array.js +1 -1
  25. package/{dist → lib}/forms/form.test.js +8 -9
  26. package/{dist → lib}/forms/multiform.test.js +14 -14
  27. package/{dist → lib}/generate-components.js +1 -1
  28. package/{dist → lib}/generate-routes.test.js +1 -0
  29. package/{dist → lib}/generate-stimulus.js +1 -1
  30. package/lib/index.js +25 -0
  31. package/{dist → lib}/mount.js +4 -3
  32. package/{dist → lib}/notifier.js +3 -1
  33. package/{dist → lib}/page/list.js +1 -1
  34. package/{dist → lib}/page/mountable-with-fields.js +1 -1
  35. package/{dist → lib}/page/sealious-list.js +2 -2
  36. package/{dist → lib}/page/stateful-page.js +37 -19
  37. package/{dist → lib}/templates/jdd-component.js +2 -2
  38. package/{dist → lib}/utils/extract-fields-from-collection.js +16 -1
  39. package/package.json +19 -14
  40. package/src/add-route.test.ts +2 -2
  41. package/src/add-route.ts +2 -2
  42. package/src/build.ts +3 -3
  43. package/src/builder.ts +3 -2
  44. package/src/esbuild-plugins/load-assets.ts +5 -4
  45. package/src/esbuild-plugins/rewrite-asset-imports.ts +4 -3
  46. package/src/forms/controls/array.ts +5 -3
  47. package/src/forms/controls/autocomplete.ts +2 -2
  48. package/src/forms/controls/checkbox-group.ts +1 -5
  49. package/src/forms/controls/checkboxed-list-input.test.ts +3 -2
  50. package/src/forms/controls/checkboxed-list-input.ts +0 -1
  51. package/src/forms/controls/collapsible-field-group.ts +4 -2
  52. package/src/forms/controls/derived.ts +1 -1
  53. package/src/forms/controls/dropdown.ts +3 -3
  54. package/src/forms/controls/editable-collection-subset.ts +10 -4
  55. package/src/forms/controls/field-group.ts +1 -1
  56. package/src/forms/controls/file.ts +1 -1
  57. package/src/forms/controls/form-control.ts +2 -1
  58. package/src/forms/controls/hidden-input.ts +0 -2
  59. package/src/forms/controls/multiple-files.ts +8 -5
  60. package/src/forms/controls/number.ts +1 -1
  61. package/src/forms/controls/photo.test.ts +6 -7
  62. package/src/forms/controls/photo.ts +3 -6
  63. package/src/forms/controls/simple-input.ts +3 -5
  64. package/src/forms/controls/textarea.ts +3 -8
  65. package/src/forms/controls/tickable.ts +2 -4
  66. package/src/forms/fields/boolean.test.ts +0 -1
  67. package/src/forms/fields/existing-sealious-value.ts +1 -0
  68. package/src/forms/fields/field.ts +5 -8
  69. package/src/forms/fields/file.ts +13 -6
  70. package/src/forms/fields/structured-array.ts +2 -2
  71. package/src/forms/form.test.ts +9 -10
  72. package/src/forms/form.ts +1 -1
  73. package/src/forms/multiform.test.ts +14 -14
  74. package/src/forms/multiform.ts +2 -1
  75. package/src/generate-components.ts +1 -2
  76. package/src/generate-routes.test.ts +1 -0
  77. package/src/generate-stimulus.ts +1 -1
  78. package/src/get-fonts.ts +2 -0
  79. package/src/mount.ts +8 -3
  80. package/src/notifier.ts +3 -1
  81. package/src/page/list.ts +1 -1
  82. package/src/page/mountable-with-fields.ts +3 -1
  83. package/src/page/sealious-list.ts +3 -2
  84. package/src/page/stateful-page.ts +53 -24
  85. package/src/templates/jdd-component.ts +2 -2
  86. package/src/utils/extract-fields-from-collection.ts +19 -1
  87. package/src/utils/translate.ts +1 -1
  88. package/src/utils/utils.ts +2 -0
  89. package/test.cjs +54 -0
  90. package/tsconfig.json +3 -4
  91. package/dist/back/routes/sample.page.js +0 -17
  92. package/dist/back/routes/sample.test.js +0 -39
  93. package/dist/hehe.test.js +0 -7
  94. package/dist/sample-index.js +0 -3
  95. package/dist/sample-lib.js +0 -9
  96. package/dist/vitest.config.js +0 -23
  97. package/src/vitest.config.ts +0 -21
  98. /package/{dist → lib}/add-collection.js +0 -0
  99. /package/{dist → lib}/add-jdd-component.js +0 -0
  100. /package/{dist → lib}/add-route.js +0 -0
  101. /package/{dist → lib}/components/components.js +0 -0
  102. /package/{dist → lib}/components/tabs.js +0 -0
  103. /package/{dist → lib}/components/toggle-modal.js +0 -0
  104. /package/{dist → lib}/embeddable-file-extensions.js +0 -0
  105. /package/{dist → lib}/esbuild-plugins/rewrite-asset-imports.js +0 -0
  106. /package/{dist → lib}/example.test.js +0 -0
  107. /package/{dist → lib}/find-css-includes.js +0 -0
  108. /package/{dist → lib}/forms/controls/big-radio-group.js +0 -0
  109. /package/{dist → lib}/forms/controls/checkbox-group.js +0 -0
  110. /package/{dist → lib}/forms/controls/checkbox.js +0 -0
  111. /package/{dist → lib}/forms/controls/checkboxed-list-input.js +0 -0
  112. /package/{dist → lib}/forms/controls/collapsible-checkbox-group.js +0 -0
  113. /package/{dist → lib}/forms/controls/controls.js +0 -0
  114. /package/{dist → lib}/forms/controls/derived-frame.js +0 -0
  115. /package/{dist → lib}/forms/controls/derived.js +0 -0
  116. /package/{dist → lib}/forms/controls/dropdown.js +0 -0
  117. /package/{dist → lib}/forms/controls/form-field-control.js +0 -0
  118. /package/{dist → lib}/forms/controls/form-header.js +0 -0
  119. /package/{dist → lib}/forms/controls/form-paragraph.js +0 -0
  120. /package/{dist → lib}/forms/controls/frame.js +0 -0
  121. /package/{dist → lib}/forms/controls/hidden-input.js +0 -0
  122. /package/{dist → lib}/forms/controls/html.js +0 -0
  123. /package/{dist → lib}/forms/controls/multiple-files.js +0 -0
  124. /package/{dist → lib}/forms/controls/multiple-photos.js +0 -0
  125. /package/{dist → lib}/forms/controls/number.js +0 -0
  126. /package/{dist → lib}/forms/controls/radio.js +0 -0
  127. /package/{dist → lib}/forms/controls/reverse-single-reference.js +0 -0
  128. /package/{dist → lib}/forms/controls/simple-input.js +0 -0
  129. /package/{dist → lib}/forms/controls/tickable.js +0 -0
  130. /package/{dist → lib}/forms/fields/boolean.js +0 -0
  131. /package/{dist → lib}/forms/fields/checkboxed-list.js +0 -0
  132. /package/{dist → lib}/forms/fields/collection-field.js +0 -0
  133. /package/{dist → lib}/forms/fields/email.js +0 -0
  134. /package/{dist → lib}/forms/fields/email.test.js +0 -0
  135. /package/{dist → lib}/forms/fields/enum-multiple.js +0 -0
  136. /package/{dist → lib}/forms/fields/enum-multiple.test.js +0 -0
  137. /package/{dist → lib}/forms/fields/enum.js +0 -0
  138. /package/{dist → lib}/forms/fields/enum.test.js +0 -0
  139. /package/{dist → lib}/forms/fields/existing-sealious-value.js +0 -0
  140. /package/{dist → lib}/forms/fields/fields.js +0 -0
  141. /package/{dist → lib}/forms/fields/multiple-files.js +0 -0
  142. /package/{dist → lib}/forms/fields/number.js +0 -0
  143. /package/{dist → lib}/forms/fields/number.test.js +0 -0
  144. /package/{dist → lib}/forms/fields/pick-from-list.js +0 -0
  145. /package/{dist → lib}/forms/fields/pick-from-list.test.js +0 -0
  146. /package/{dist → lib}/forms/fields/proxy-field.js +0 -0
  147. /package/{dist → lib}/forms/fields/regexp.js +0 -0
  148. /package/{dist → lib}/forms/fields/regexp.test.js +0 -0
  149. /package/{dist → lib}/forms/fields/reverse-single-reference.js +0 -0
  150. /package/{dist → lib}/forms/fields/simple-form-field.js +0 -0
  151. /package/{dist → lib}/forms/form-types.js +0 -0
  152. /package/{dist → lib}/forms/form.js +0 -0
  153. /package/{dist → lib}/forms/multiform.js +0 -0
  154. /package/{dist → lib}/generate-collections.js +0 -0
  155. /package/{dist → lib}/generate-routes.js +0 -0
  156. /package/{dist → lib}/get-fonts.js +0 -0
  157. /package/{dist → lib}/koa.d.js +0 -0
  158. /package/{dist → lib}/make-env.js +0 -0
  159. /package/{dist → lib}/make-hidden-inputs.js +0 -0
  160. /package/{dist → lib}/page/access-control.js +0 -0
  161. /package/{dist → lib}/page/default-list-filters.js +0 -0
  162. /package/{dist → lib}/page/mountable.js +0 -0
  163. /package/{dist → lib}/page/page.js +0 -0
  164. /package/{dist → lib}/page/props-parser.js +0 -0
  165. /package/{dist → lib}/run.js +0 -0
  166. /package/{dist → lib}/sanitize.js +0 -0
  167. /package/{dist → lib}/target-locreq.js +0 -0
  168. /package/{dist → lib}/templates/collection.js +0 -0
  169. /package/{dist → lib}/templates/form.js +0 -0
  170. /package/{dist → lib}/templates/list.js +0 -0
  171. /package/{dist → lib}/templates/long-running-process.js +0 -0
  172. /package/{dist → lib}/templates/multiform.js +0 -0
  173. /package/{dist → lib}/templates/page.js +0 -0
  174. /package/{dist → lib}/templates/post.js +0 -0
  175. /package/{dist → lib}/templates/redirect.js +0 -0
  176. /package/{dist → lib}/templates/route-test.js +0 -0
  177. /package/{dist → lib}/templates/stateful-page.js +0 -0
  178. /package/{dist → lib}/templates/stimulus-controller.js +0 -0
  179. /package/{dist → lib}/templates/templates.js +0 -0
  180. /package/{dist → lib}/test_utils/locator_is_visible.js +0 -0
  181. /package/{dist → lib}/utils/assert-throws.js +0 -0
  182. /package/{dist → lib}/utils/base64.js +0 -0
  183. /package/{dist → lib}/utils/browser-creator.js +0 -0
  184. /package/{dist → lib}/utils/escape-url-params.js +0 -0
  185. /package/{dist → lib}/utils/exec.js +0 -0
  186. /package/{dist → lib}/utils/format-external-url.js +0 -0
  187. /package/{dist → lib}/utils/import-path.js +0 -0
  188. /package/{dist → lib}/utils/input-wrapper.js +0 -0
  189. /package/{dist → lib}/utils/list-collections.js +0 -0
  190. /package/{dist → lib}/utils/make-slug.js +0 -0
  191. /package/{dist → lib}/utils/module-dirname.js +0 -0
  192. /package/{dist → lib}/utils/natural-numbers.js +0 -0
  193. /package/{dist → lib}/utils/prettier.js +0 -0
  194. /package/{dist → lib}/utils/question.js +0 -0
  195. /package/{dist → lib}/utils/render-attributes.js +0 -0
  196. /package/{dist → lib}/utils/sleep.js +0 -0
  197. /package/{dist → lib}/utils/translate.js +0 -0
  198. /package/{dist → lib}/utils/url-with-new-params.js +0 -0
  199. /package/{dist → lib}/utils/utils.js +0 -0
  200. /package/{dist → lib}/utils/walk.js +0 -0
@@ -1,39 +0,0 @@
1
- import { withProdApp } from "../test_utils/with-prod-app.js";
2
- import { VERY_LONG_TEST_TIMEOUT, webhintURL } from "../test_utils/webhint.js";
3
- import { SampleURL } from "./urls.js";
4
- import { getBrowser } from "../test_utils/browser-creator.js";
5
- describe("Sample webhint", () => {
6
- it(
7
- "doesn't crash",
8
- async function() {
9
- return withProdApp(async ({ base_url, rest_api }) => {
10
- await rest_api.get(SampleURL);
11
- await webhintURL(base_url + SampleURL);
12
- });
13
- },
14
- VERY_LONG_TEST_TIMEOUT
15
- );
16
- });
17
- describe("Sample", () => {
18
- let page;
19
- let browser;
20
- let context;
21
- beforeEach(async () => {
22
- browser = await getBrowser();
23
- context = await browser.newContext();
24
- page = await context.newPage();
25
- });
26
- afterEach(async () => {
27
- await context.close();
28
- });
29
- it(
30
- "works as expected",
31
- async function() {
32
- return withProdApp(async ({ base_url }) => {
33
- await page.goto(base_url + SampleURL);
34
- });
35
- },
36
- VERY_LONG_TEST_TIMEOUT
37
- );
38
- });
39
- //# sourceMappingURL=sample.test.js.map
package/dist/hehe.test.js DELETED
@@ -1,7 +0,0 @@
1
- import { hehe } from "./sample-lib.js";
2
- describe("hehe", () => {
3
- it("hehe", () => {
4
- hehe.hehe;
5
- });
6
- });
7
- //# sourceMappingURL=hehe.test.js.map
@@ -1,3 +0,0 @@
1
- import { hehe } from "./sample-lib.js";
2
- hehe.hehe();
3
- //# sourceMappingURL=sample-index.js.map
@@ -1,9 +0,0 @@
1
- class hehe {
2
- static hehe() {
3
- console.log("hehe");
4
- }
5
- }
6
- export {
7
- hehe
8
- };
9
- //# sourceMappingURL=sample-lib.js.map
@@ -1,23 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
- const exclude = ["node_modules", "lib", "dist"];
3
- var vitest_config_default = defineConfig({
4
- test: {
5
- testTimeout: 1e4,
6
- exclude,
7
- globals: true,
8
- coverage: {
9
- exclude,
10
- enabled: true,
11
- all: true,
12
- include: ["dist/**", "test?(-*).?(c|m)[jt]s?(x)"]
13
- },
14
- sequence: { setupFiles: "list" },
15
- maxConcurrency: 1,
16
- pool: "threads",
17
- poolOptions: { threads: { maxThreads: 1, minThreads: 1 } }
18
- }
19
- });
20
- export {
21
- vitest_config_default as default
22
- };
23
- //# sourceMappingURL=vitest.config.js.map
@@ -1,21 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
-
3
- const exclude = ["node_modules", "lib", "dist"];
4
-
5
- export default defineConfig({
6
- test: {
7
- testTimeout: 10000,
8
- exclude,
9
- globals: true,
10
- coverage: {
11
- exclude,
12
- enabled: true,
13
- all: true,
14
- include: ["dist/**", "test?(-*).?(c|m)[jt]s?(x)"],
15
- },
16
- sequence: { setupFiles: "list" },
17
- maxConcurrency: 1,
18
- pool: "threads",
19
- poolOptions: { threads: { maxThreads: 1, minThreads: 1 } },
20
- },
21
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes