aktion-runtime 0.5.5 → 0.5.7

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 (37) hide show
  1. package/README.md +120 -15
  2. package/dist/aktion.iife.js +42 -42
  3. package/dist/aktion.iife.js.map +1 -1
  4. package/dist/aktion.js +12655 -12123
  5. package/dist/aktion.js.map +1 -1
  6. package/dist/aktion.umd.cjs +42 -42
  7. package/dist/aktion.umd.cjs.map +1 -1
  8. package/dist/language.js +1348 -98
  9. package/dist/language.js.map +1 -1
  10. package/dist/plugin.cjs +12 -2
  11. package/dist/plugin.cjs.map +1 -1
  12. package/dist/plugin.js +12 -2
  13. package/dist/plugin.js.map +1 -1
  14. package/dist/system_prompt.txt +40 -8
  15. package/dist/system_prompt_chat.txt +2 -1
  16. package/dist/testing.js +15415 -14698
  17. package/dist/testing.js.map +1 -1
  18. package/dist/types/element.d.ts +0 -1
  19. package/dist/types/language/builtins.d.ts +52 -0
  20. package/dist/types/language/index.d.ts +5 -2
  21. package/dist/types/language-api.d.ts +5 -1
  22. package/dist/types/library/components/helpers.d.ts +0 -5
  23. package/dist/types/library/components/wrappers.d.ts +1 -0
  24. package/dist/types/parser/types.d.ts +0 -1
  25. package/dist/types/runtime/effects.d.ts +1 -18
  26. package/dist/types/runtime/evaluator.d.ts +46 -5
  27. package/dist/types/runtime/http.d.ts +41 -0
  28. package/dist/types/runtime/index.d.ts +2 -1
  29. package/dist/types/runtime/router.d.ts +28 -2
  30. package/dist/types/runtime/toast.d.ts +45 -0
  31. package/dist/types/runtime/util.d.ts +11 -1
  32. package/dist/types/tooling/index.d.ts +6 -0
  33. package/dist/types/tooling/language-service.d.ts +10 -5
  34. package/dist/types/tooling/navigation.d.ts +91 -0
  35. package/dist/types/tooling/semantic-tokens.d.ts +24 -0
  36. package/dist/types/tooling/signature-help.d.ts +21 -0
  37. package/package.json +1 -1
package/dist/plugin.js CHANGED
@@ -587,7 +587,6 @@ function parseFunctionDecl(ctx) {
587
587
  kind: "ActionDeclaration",
588
588
  name: nameTok.value,
589
589
  params,
590
- optimistic: false,
591
590
  body,
592
591
  loc: { line: start.line, column: start.column }
593
592
  };
@@ -2590,7 +2589,7 @@ function aktionPlugin(options = {}) {
2590
2589
  if (w.severity === "warning") this.warn(w.message);
2591
2590
  }
2592
2591
  const moduleCode = emitModule(program, code, cleanId, runtimeModuleId) + (isServe ? HMR_FOOTER : "");
2593
- return { code: moduleCode, map: { mappings: "" } };
2592
+ return { code: moduleCode, map: buildSourceMap(moduleCode, cleanId, code) };
2594
2593
  }
2595
2594
  };
2596
2595
  }
@@ -2621,6 +2620,17 @@ function nodeResolver() {
2621
2620
  function hasEntryBinding(program) {
2622
2621
  return program.statements.some((s) => s.kind === "Assignment" && s.identifier === "aktion");
2623
2622
  }
2623
+ function buildSourceMap(generated, sourcePath, source) {
2624
+ const lineCount = generated.split("\n").length;
2625
+ const mappings = new Array(lineCount).fill("AAAA").join(";");
2626
+ return {
2627
+ version: 3,
2628
+ sources: [sourcePath],
2629
+ sourcesContent: [source],
2630
+ names: [],
2631
+ mappings
2632
+ };
2633
+ }
2624
2634
  function emitModule(program, source, path, runtimeModuleId) {
2625
2635
  const programLiteral = JSON.stringify(JSON.stringify(program));
2626
2636
  return `// Generated by the Aktion Vite plugin — do not edit by hand.