miqro 6.3.0 → 7.0.2

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 (148) hide show
  1. package/README.md +9 -17
  2. package/build/editor.bundle.js +11601 -10129
  3. package/build/esm/editor/common/log-socket.js +1 -0
  4. package/build/esm/editor/common/templates.js +90 -90
  5. package/build/esm/editor/components/api-preview.js +2 -0
  6. package/build/esm/editor/components/editor.js +2 -0
  7. package/build/esm/editor/components/file-browser.js +1 -0
  8. package/build/esm/editor/components/file-editor-toolbar.js +2 -0
  9. package/build/esm/editor/components/file-editor.js +2 -0
  10. package/build/esm/editor/components/filter-query.js +1 -0
  11. package/build/esm/editor/components/highlight-text-area.js +2 -0
  12. package/build/esm/editor/components/log-viewer.js +2 -0
  13. package/build/esm/editor/components/new-file.js +2 -0
  14. package/build/esm/editor/components/scroll-query.js +1 -0
  15. package/build/esm/editor/components/start-page.js +2 -0
  16. package/build/esm/editor/http/admin/editor/api/fs/delete.api.js +2 -1
  17. package/build/esm/editor/http/admin/editor/api/fs/read.api.js +2 -1
  18. package/build/esm/editor/http/admin/editor/api/fs/rename.api.js +2 -1
  19. package/build/esm/editor/http/admin/editor/api/fs/scan.api.js +2 -1
  20. package/build/esm/editor/http/admin/editor/api/fs/write.api.js +2 -1
  21. package/build/esm/editor/http/admin/editor/api/server/restart.api.js +2 -1
  22. package/build/esm/editor/http/admin/editor/editor.js +2 -1
  23. package/build/esm/editor/http/admin/editor/index.api.js +1 -0
  24. package/build/esm/src/bin/types.js +10 -5
  25. package/build/esm/src/cluster.js +1 -1
  26. package/build/esm/src/common/arguments.d.ts +1 -1
  27. package/build/esm/src/common/arguments.js +28 -14
  28. package/build/esm/src/common/assets.d.ts +1 -1
  29. package/build/esm/src/common/assets.js +34 -13
  30. package/build/esm/src/common/esbuild.d.ts +4 -1
  31. package/build/esm/src/common/esbuild.js +31 -26
  32. package/build/esm/src/common/exit.js +4 -4
  33. package/build/esm/src/common/help.d.ts +1 -1
  34. package/build/esm/src/common/help.js +0 -1
  35. package/build/esm/src/common/jsx.d.ts +2 -3
  36. package/build/esm/src/common/jsx.js +70 -75
  37. package/build/esm/src/common/paths.d.ts +0 -1
  38. package/build/esm/src/common/paths.js +3 -3
  39. package/build/esm/src/common/watch.d.ts +0 -1
  40. package/build/esm/src/common/watch.js +1 -1
  41. package/build/esm/src/inflate/inflate-sea.js +35 -24
  42. package/build/esm/src/inflate/inflate.js +4 -4
  43. package/build/esm/src/inflate/setup-auth.js +1 -1
  44. package/build/esm/src/inflate/setup-cors.js +1 -1
  45. package/build/esm/src/inflate/setup-db.js +2 -2
  46. package/build/esm/src/inflate/setup-error.js +1 -1
  47. package/build/esm/src/inflate/setup-http.js +16 -16
  48. package/build/esm/src/inflate/setup-log.js +1 -1
  49. package/build/esm/src/inflate/setup-middleware.js +1 -1
  50. package/build/esm/src/inflate/setup-server-config.js +1 -1
  51. package/build/esm/src/inflate/setup-ws.js +1 -1
  52. package/build/esm/src/inflate/setup.doc.d.ts +2 -2
  53. package/build/esm/src/inflate/setup.doc.js +23 -2
  54. package/build/esm/src/inflate/utils/sea-utils.js +2 -2
  55. package/build/esm/src/lib.d.ts +10 -1
  56. package/build/esm/src/lib.js +16 -1
  57. package/build/esm/src/main.js +1 -1
  58. package/build/esm/src/services/app.js +3 -4
  59. package/build/esm/src/services/migrations.js +2 -2
  60. package/build/esm/src/services/utils/jwt.d.ts +2 -0
  61. package/build/esm/src/services/utils/jwt.js +23 -0
  62. package/build/esm/src/services/utils/middleware.d.ts +9 -0
  63. package/build/esm/src/services/utils/middleware.js +9 -0
  64. package/build/esm/src/services/utils/server-interface.js +33 -4
  65. package/build/esm/src/types.d.ts +50 -83
  66. package/build/lib.cjs +15684 -15612
  67. package/editor/common/log-socket.tsx +2 -0
  68. package/editor/common/templates.ts +12 -12
  69. package/editor/components/api-preview.tsx +2 -0
  70. package/editor/components/editor.tsx +2 -0
  71. package/editor/components/file-browser.tsx +3 -0
  72. package/editor/components/file-editor-toolbar.tsx +3 -0
  73. package/editor/components/file-editor.tsx +3 -0
  74. package/editor/components/filter-query.tsx +4 -0
  75. package/editor/components/highlight-text-area.tsx +3 -0
  76. package/editor/components/log-viewer.tsx +3 -0
  77. package/editor/components/new-file.tsx +3 -0
  78. package/editor/components/scroll-query.tsx +3 -0
  79. package/editor/components/start-page.tsx +3 -0
  80. package/editor/http/admin/editor/api/fs/delete.api.tsx +2 -2
  81. package/editor/http/admin/editor/api/fs/read.api.tsx +2 -2
  82. package/editor/http/admin/editor/api/fs/rename.api.tsx +2 -2
  83. package/editor/http/admin/editor/api/fs/scan.api.tsx +2 -2
  84. package/editor/http/admin/editor/api/fs/write.api.tsx +2 -2
  85. package/editor/http/admin/editor/api/server/restart.api.tsx +2 -2
  86. package/editor/http/admin/editor/editor.tsx +3 -1
  87. package/editor/http/admin/editor/index.api.tsx +3 -0
  88. package/package.json +6 -8
  89. package/sea/basic-compile.base64.sh +1 -1
  90. package/sea/basic-compile.sh +1 -1
  91. package/sea/install-nodejs.sh +1 -1
  92. package/sea/node.version.tag +1 -1
  93. package/src/bin/types.ts +7 -2
  94. package/src/cluster.ts +1 -1
  95. package/src/common/arguments.ts +27 -10
  96. package/src/common/assets.ts +32 -12
  97. package/src/common/esbuild.ts +11 -3
  98. package/src/common/exit.ts +3 -3
  99. package/src/common/help.ts +0 -1
  100. package/src/common/jsx.ts +50 -35
  101. package/src/common/paths.ts +2 -2
  102. package/src/common/watch.ts +1 -1
  103. package/src/inflate/inflate-sea.ts +35 -24
  104. package/src/inflate/inflate.ts +4 -4
  105. package/src/inflate/setup-auth.ts +1 -1
  106. package/src/inflate/setup-cors.ts +1 -1
  107. package/src/inflate/setup-db.ts +2 -2
  108. package/src/inflate/setup-error.ts +1 -1
  109. package/src/inflate/setup-http.ts +16 -16
  110. package/src/inflate/setup-log.ts +1 -1
  111. package/src/inflate/setup-middleware.ts +1 -1
  112. package/src/inflate/setup-server-config.ts +1 -1
  113. package/src/inflate/setup-ws.ts +1 -1
  114. package/src/inflate/setup.doc.ts +27 -3
  115. package/src/inflate/utils/sea-utils.ts +2 -2
  116. package/src/lib.ts +17 -2
  117. package/src/main.ts +1 -1
  118. package/src/services/app.ts +4 -4
  119. package/src/services/migrations.ts +2 -2
  120. package/src/services/utils/jwt.ts +25 -0
  121. package/src/services/utils/middleware.ts +10 -0
  122. package/src/services/utils/server-interface.ts +37 -7
  123. package/src/types.ts +56 -53
  124. package/.eslintrc +0 -15
  125. package/build/esm/src/services/globals.d.ts +0 -3
  126. package/build/esm/src/services/globals.js +0 -182
  127. package/build/jsx.dom.js +0 -1587
  128. package/build/postject.base64.cjs +0 -1
  129. package/sea/types.json +0 -1
  130. package/src/types/@esbuild.d.ts +0 -1
  131. package/src/types/@miqro/core.d.ts +0 -2
  132. package/src/types/@miqro/jsx.d.ts +0 -2
  133. package/src/types/@miqro/parser.d.ts +0 -2
  134. package/src/types/@miqro/query.d.ts +0 -2
  135. package/src/types/@miqro/request.d.ts +0 -2
  136. package/src/types/@miqro/test.d.ts +0 -2
  137. package/src/types/@miqro.d.ts +0 -1
  138. package/src/types/@types.d.ts +0 -1
  139. package/src/types/browser.globals.d.ts +0 -1
  140. package/src/types/cookie.d.ts +0 -2
  141. package/src/types/globals.d.ts +0 -2
  142. package/src/types/jose.d.ts +0 -2
  143. package/src/types/jsx.globals.d.ts +0 -38
  144. package/src/types/miqro.d.ts +0 -228
  145. package/src/types/postject.d.ts +0 -1
  146. package/src/types/server.globals.d.ts +0 -47
  147. package/tsconfig.json +0 -35
  148. /package/src/services/{globals.ts → globals.ts.ignore} +0 -0
package/README.md CHANGED
@@ -61,6 +61,8 @@ example/
61
61
  ```example/http/index.html.tsx```
62
62
 
63
63
  ```typescript
64
+ import JSX from "@miqro/jsx";
65
+
64
66
  export default (req, res) => {
65
67
  return <html>
66
68
  <body>
@@ -212,6 +214,7 @@ you can also export a request function and customize the route by exporting a ``
212
214
 
213
215
  ```ìndex.html.tsx```
214
216
  ```tsx
217
+ import JSX from "@miqro/jsx";
215
218
  import { ServerRequest, ServerResponse, APIOptions } from "miqro";
216
219
  import { MyComponent } from "./component.js";
217
220
 
@@ -240,14 +243,16 @@ example defining a ```WebComponent``` with ```JSX``` using ```@miqro/jsx```.
240
243
 
241
244
  ```script.min.tsx```
242
245
  ```typescript
246
+ import JSX, { useState, useEffect } from "@miqro/jsx";
247
+ import { define } from "@miqro/jsx-dom";
243
248
  /*
244
249
  basic dynamic component example
245
250
  */
246
251
  export function TickerComponent() {
247
252
  // create a state variable count
248
- const [count, setCount] = jsx.useState(0);
253
+ const [count, setCount] = useState(0);
249
254
  // create a effect with a setTimeout that updates count after 1000ms
250
- jsx.useEffect(() => {
255
+ useEffect(() => {
251
256
  // create the timeout
252
257
  const timeout = setTimeout(() => {
253
258
  setCount(count + 1);
@@ -273,7 +278,7 @@ window.addEventListener("load", async (event) => {
273
278
  <script src="..."></script>
274
279
 
275
280
  */
276
- jsx.define("ticker-tag", TickerComponent, {
281
+ define("ticker-tag", TickerComponent, {
277
282
  shadowInit: false, // or { mode: "closed" | "closed" }
278
283
  //extends: "p";
279
284
  //observedAttributes: ["width", "height", "some-attr"]; // attribues that are observed for changes to re-render the JSX component
@@ -373,7 +378,7 @@ interface ServerRequest extends Request {
373
378
  }
374
379
  ```
375
380
 
376
- example using ```req.server``` to access a key in the cache.
381
+ example using ```req.server``` to access a key in the node:cluster synced cache.
377
382
 
378
383
  ```typescript
379
384
  import { ServerRequest, ServerResponse } from "miqro";
@@ -473,22 +478,10 @@ TODO
473
478
 
474
479
  TODO
475
480
 
476
- #### jsx global
477
-
478
- TODO
479
-
480
- #### JSX global
481
-
482
- TODO
483
-
484
481
  #### test global
485
482
 
486
483
  TODO
487
484
 
488
- #### server global
489
-
490
- TODO
491
-
492
485
  ## static web site generator
493
486
 
494
487
  you can also inflate your project to avoid rendering ```http/**/*.html.tsx``` and other files per request. this can be done pre-rendereding with the ```--inflate``` flag.
@@ -593,7 +586,6 @@ CLUSTER_COUNT=10 miqro-cluster --service api/
593
586
  --compile inflates the application and tries to create a NODE SEA binary.
594
587
  --inflate-sea inflates the application with sea compilation scripts.
595
588
  --install-tsconfig creates a tsconfig.json configured to use with --install-types.
596
- --install-types creates and updates the .types/ folder use together with --install-tsconfig.
597
589
 
598
590
  ==environment variables==
599
591