@abide/abide 0.118.0 → 0.120.0

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 (150) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/abide.ts +74 -11
  3. package/docs/REGISTRY.md +5 -4
  4. package/docs/RULEBOOK.md +35 -0
  5. package/docs/abide.md +363 -127
  6. package/package.json +1 -1
  7. package/scaffold/src/getGreeting.test.ts +1 -0
  8. package/scaffold/src/index.abide +4 -1
  9. package/scaffold/src/index.test.ts +2 -0
  10. package/scaffold/src/layout.abide +6 -6
  11. package/src/compiler/Lowering.ts +20 -2
  12. package/src/compiler/PositionTable.ts +1 -0
  13. package/src/compiler/Refusals.ts +1 -0
  14. package/src/compiler/TypeSession.ts +11 -8
  15. package/src/compiler/aliasedSymbol.ts +1 -1
  16. package/src/compiler/ambientReadsIn.ts +1 -0
  17. package/src/compiler/appLayout.ts +4 -2
  18. package/src/compiler/argsDefaultsIn.ts +1 -0
  19. package/src/compiler/argsSchemaOf.ts +1 -0
  20. package/src/compiler/checkApp.ts +3 -1
  21. package/src/compiler/checkedShadow.ts +2 -1
  22. package/src/compiler/classifyRead.ts +1 -0
  23. package/src/compiler/classifyTemplate.ts +1 -0
  24. package/src/compiler/compileApp.ts +4 -2
  25. package/src/compiler/compiledEntry.ts +1 -0
  26. package/src/compiler/componentGraph.ts +1 -0
  27. package/src/compiler/declaredExports.ts +4 -2
  28. package/src/compiler/emitClient.ts +19 -14
  29. package/src/compiler/emitComponent.ts +1 -0
  30. package/src/compiler/emitSource.ts +2 -1
  31. package/src/compiler/formatAbide.ts +857 -0
  32. package/src/compiler/formatDiagnosis.ts +1 -0
  33. package/src/compiler/handlersUnder.ts +2 -1
  34. package/src/compiler/hookCalls.ts +1 -0
  35. package/src/compiler/lineOf.ts +17 -0
  36. package/src/compiler/matchersOf.ts +13 -3
  37. package/src/compiler/mountsOf.ts +2 -0
  38. package/src/compiler/paramFile.ts +1 -0
  39. package/src/compiler/parseAbide.ts +48 -28
  40. package/src/compiler/projectShadow.ts +10 -3
  41. package/src/compiler/reactiveOptions.ts +1 -0
  42. package/src/compiler/reactiveTypes.ts +2 -1
  43. package/src/compiler/readsIn.ts +3 -2
  44. package/src/compiler/renderMarkup.ts +3 -2
  45. package/src/compiler/resolverIn.ts +2 -0
  46. package/src/compiler/sameTemplate.ts +150 -0
  47. package/src/compiler/scaffold.ts +4 -11
  48. package/src/compiler/serveLanguage.ts +46 -19
  49. package/src/compiler/sharedModuleWrites.ts +2 -1
  50. package/src/compiler/sourceMapOf.ts +1 -0
  51. package/src/compiler/splitImports.ts +2 -0
  52. package/src/compiler/templateWarnings.ts +2 -2
  53. package/src/compiler/trackingWarnings.ts +1 -0
  54. package/src/compiler/writeDefaultProject.ts +5 -1
  55. package/src/server/BRIDGE_SCHEME.ts +3 -0
  56. package/src/server/BRIDGE_VERSION.ts +1 -1
  57. package/src/server/abideModules.ts +2 -0
  58. package/src/server/answerFailure.ts +1 -0
  59. package/src/server/answerRequest.ts +15 -14
  60. package/src/server/answerRpc.ts +3 -2
  61. package/src/server/answerSocket.ts +2 -1
  62. package/src/server/answerValue.ts +1 -0
  63. package/src/server/answerWorker.ts +1 -0
  64. package/src/server/appTree.ts +3 -1
  65. package/src/server/argsFor.ts +1 -0
  66. package/src/server/assistant.ts +2 -1
  67. package/src/server/banner.ts +2 -0
  68. package/src/server/bridgeRelay.ts +1 -0
  69. package/src/server/callerOf.ts +1 -0
  70. package/src/server/claudeApi.ts +1 -0
  71. package/src/server/claudeCode.ts +30 -14
  72. package/src/server/clientBundle.ts +1 -0
  73. package/src/server/coerceArgs.ts +1 -2
  74. package/src/server/commands.ts +9 -0
  75. package/src/server/compressAnswer.ts +2 -1
  76. package/src/server/config.ts +2 -0
  77. package/src/server/createApp.ts +4 -2
  78. package/src/server/crossingOrigin.ts +1 -0
  79. package/src/server/csp.ts +1 -0
  80. package/src/server/deferredBuilds.ts +1 -0
  81. package/src/server/derivedArgs.ts +1 -0
  82. package/src/server/devWorker.ts +2 -1
  83. package/src/server/faceOf.ts +2 -7
  84. package/src/server/generatedSurfaces.ts +5 -1
  85. package/src/server/hooks.ts +1 -0
  86. package/src/server/iconAccent.ts +1 -1
  87. package/src/server/installServer.ts +1 -0
  88. package/src/server/installSourceMaps.ts +1 -0
  89. package/src/server/launcherPage.ts +2 -2
  90. package/src/server/manifestOf.ts +1 -0
  91. package/src/server/muxUpgrade.ts +1 -0
  92. package/src/server/nativeMenu.ts +2 -0
  93. package/src/server/principal.ts +2 -1
  94. package/src/server/remote.ts +1 -0
  95. package/src/server/render.ts +3 -3
  96. package/src/server/renderComponent.ts +1 -0
  97. package/src/server/reportHealth.ts +1 -0
  98. package/src/server/requestScope.ts +3 -1
  99. package/src/server/runDesktop.ts +3 -2
  100. package/src/server/seedBuffer.ts +1 -0
  101. package/src/server/serveDev.ts +3 -2
  102. package/src/server/shell.ts +2 -0
  103. package/src/server/streamEvent.ts +1 -0
  104. package/src/server/surfaceOf.ts +1 -0
  105. package/src/server/testBuild.ts +1 -0
  106. package/src/server/testMount.ts +1 -0
  107. package/src/server/trace.ts +2 -0
  108. package/src/server/withAbideSources.ts +1 -0
  109. package/src/shared/Attributes.ts +12 -8
  110. package/src/shared/cookies.ts +1 -1
  111. package/src/shared/escapeText.ts +1 -1
  112. package/src/shared/index.ts +1 -5
  113. package/src/shared/jsonSchema.ts +1 -3
  114. package/src/shared/menuBridge.ts +1 -2
  115. package/src/shared/outbox.ts +1 -1
  116. package/src/shared/reactive/Keyed.ts +2 -2
  117. package/src/shared/reactive/Reactive.ts +12 -16
  118. package/src/shared/reactive/index.ts +3 -4
  119. package/src/shared/reactive/isReactive.ts +1 -1
  120. package/src/shared/reactive/scoped.ts +2 -2
  121. package/src/shared/reactive/share.ts +1 -1
  122. package/src/shared/reactive/watch.ts +4 -4
  123. package/src/shared/refuse.ts +1 -1
  124. package/src/shared/rpc.ts +8 -11
  125. package/src/shared/url.ts +1 -1
  126. package/src/shared/validateJson.ts +1 -1
  127. package/src/ui/ArmRegion.ts +1 -0
  128. package/src/ui/Level.ts +1 -0
  129. package/src/ui/List.ts +1 -0
  130. package/src/ui/RawRun.ts +1 -0
  131. package/src/ui/Router.ts +1 -0
  132. package/src/ui/TryRegion.ts +1 -0
  133. package/src/ui/adoptWalk.ts +2 -1
  134. package/src/ui/bindElement.ts +1 -0
  135. package/src/ui/bindFiles.ts +1 -0
  136. package/src/ui/bindGroup.ts +1 -0
  137. package/src/ui/bindProperty.ts +1 -0
  138. package/src/ui/bindSpread.ts +1 -0
  139. package/src/ui/index.ts +1 -6
  140. package/src/ui/outboxQueue.ts +1 -1
  141. package/src/ui/parseMarkup.ts +2 -1
  142. package/src/ui/reconcile.ts +2 -1
  143. package/src/ui/reconcileHead.ts +1 -0
  144. package/src/ui/regions.ts +2 -1
  145. package/src/ui/registerWorker.ts +1 -0
  146. package/src/ui/rows.ts +1 -0
  147. package/src/ui/setMarkup.ts +1 -0
  148. package/src/ui/setText.ts +1 -0
  149. package/src/ui/socketWire.ts +4 -3
  150. package/src/ui/wire.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abide/abide",
3
- "version": "0.118.0",
3
+ "version": "0.120.0",
4
4
  "type": "module",
5
5
  "description": "Isomorphic type-safe framework for reactive async interfaces for humans and machines",
6
6
  "license": "MIT",
@@ -1,4 +1,5 @@
1
1
  import { expect, test } from 'bun:test'
2
+
2
3
  import getGreeting from './getGreeting.handler.ts'
3
4
 
4
5
  test('the handler answers with the name it is given', async () => {
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import { reactive } from '@abide/abide'
3
+
3
4
  import getGreeting from '#src/getGreeting.handler.ts'
4
5
 
5
6
  let count = reactive(0)
@@ -11,5 +12,7 @@ const greeting = reactive(() => getGreeting({ name: 'world' }))
11
12
  <main>
12
13
  <h1>{greeting}</h1>
13
14
  <p>Clicked {count} times.</p>
14
- <button onclick={() => { count = count + 1 }}>Click</button>
15
+ <button onclick={() => {
16
+ count = count + 1
17
+ }}>Click</button>
15
18
  </main>
@@ -1,6 +1,8 @@
1
1
  import { expect, test } from 'bun:test'
2
+
2
3
  import { flushSync } from '@abide/abide'
3
4
  import { measure, mount } from '@abide/harness/abide'
5
+
4
6
  import Index from './index.abide'
5
7
 
6
8
  test('a click rewrites the count and builds nothing', async () => {
@@ -8,11 +8,11 @@ onStart(async (start) => {
8
8
  </script>
9
9
 
10
10
  <html lang="en">
11
- <head>
12
- <meta charset="utf-8" />
13
- <meta name="viewport" content="width=device-width, initial-scale=1" />
14
- </head>
11
+ <head>
12
+ <meta charset="utf-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
14
+ </head>
15
15
  <body>
16
- <slot/>
17
- </body>
16
+ <slot />
17
+ </body>
18
18
  </html>
@@ -1,15 +1,17 @@
1
1
  import { SyntaxKind } from 'typescript/unstable/ast'
2
+
2
3
  import type { CheckerAnswer } from './CheckerAnswer.ts'
3
4
  import type { Read } from './classifyRead.ts'
4
5
  import { holdsSlot } from './classifyTemplate.ts'
5
6
  import type { Finding } from './Finding.ts'
6
- import type { AbideFile } from './parseAbide.ts'
7
+ import { type AbideFile, scriptBodies } from './parseAbide.ts'
7
8
  import {
8
9
  type Origin,
9
10
  type Projection,
10
11
  projectShadow,
11
12
  type Span,
12
13
  } from './projectShadow.ts'
14
+ import { importedNames } from './splitImports.ts'
13
15
  import type { InlineComponent, Setup, TemplateNode } from './TemplateNode.ts'
14
16
  import { nesting, type Token, tokenize } from './tokenize.ts'
15
17
 
@@ -82,6 +84,11 @@ export class Lowering {
82
84
  * rather than called, whose forwarding arrow takes an untyped rest.
83
85
  */
84
86
  readonly checking: boolean
87
+ /**
88
+ * Whether a script imports abide's own `raw`, which a checked lowering then leaves a template's
89
+ * `raw(x)` calling — the same function, and the import read where the author reads it.
90
+ */
91
+ private readonly importsRaw: boolean
85
92
  /**
86
93
  * The names a checked lowering read, each with whether it was read through a props accessor.
87
94
  *
@@ -133,6 +140,7 @@ export class Lowering {
133
140
  this.answer = answer
134
141
  this.holdsSlot = holdsSlot(file.template)
135
142
  this.checking = checking
143
+ this.importsRaw = importsAbideRaw(file)
136
144
  this.chunks = chunks
137
145
  this.routed = routed
138
146
  }
@@ -804,7 +812,9 @@ export class Lowering {
804
812
  // template are the same object. The read exists only where a template expression held
805
813
  // the call (`expressionFacts`), so a `<script>`'s `raw` stays the file's.
806
814
  case 'raw':
807
- return this.use('raw')
815
+ return this.checking && this.importsRaw
816
+ ? undefined
817
+ : this.use('raw')
808
818
  // 27.13 — the call bound to a name, for the checker to read the defaults' type off.
809
819
  case 'config':
810
820
  return this.checking
@@ -897,6 +907,14 @@ export class Lowering {
897
907
  }
898
908
  }
899
909
 
910
+ function importsAbideRaw(file: AbideFile): boolean {
911
+ for (const body of scriptBodies(file))
912
+ for (const { name, specifier } of importedNames(body))
913
+ if (name === 'raw' && specifier.startsWith('@abide/abide'))
914
+ return true
915
+ return false
916
+ }
917
+
900
918
  function isRawCallee(read: Read): boolean {
901
919
  return read.shape === 'raw'
902
920
  }
@@ -1,4 +1,5 @@
1
1
  import type { Node } from 'typescript/unstable/ast'
2
+
2
3
  import type { Span } from './projectShadow.ts'
3
4
 
4
5
  /**
@@ -1,4 +1,5 @@
1
1
  import { resolve } from 'node:path' // bun exposes no path helpers of its own
2
+
2
3
  import { formatDiagnosis } from './formatDiagnosis.ts'
3
4
  import { diagnosisAt } from './lineOf.ts'
4
5
  import { PositionedRefusal } from './PositionedRefusal.ts'
@@ -1,5 +1,6 @@
1
1
  import { type Dirent, readdirSync, realpathSync, statSync } from 'node:fs' // Bun exposes no sync directory listing or realpath of its own
2
2
  import { basename, dirname, join, resolve } from 'node:path' // Bun exposes no path helpers of its own
3
+
3
4
  import {
4
5
  getTouchingPropertyName,
5
6
  type Node,
@@ -8,7 +9,6 @@ import {
8
9
  } from 'typescript/unstable/ast'
9
10
  import {
10
11
  API,
11
- type Symbol as CheckedSymbol,
12
12
  type Checker,
13
13
  type CompletionEntry,
14
14
  type CompletionInfo,
@@ -17,31 +17,34 @@ import {
17
17
  type Project,
18
18
  SignatureKind,
19
19
  type Snapshot,
20
+ type Symbol as CheckedSymbol,
20
21
  SymbolFlags,
21
22
  type Type,
22
23
  } from 'typescript/unstable/async'
24
+
23
25
  import { placeOf } from '#server/placement.ts'
24
26
  import { parseRoutePattern } from '#shared/routePattern.ts'
27
+
25
28
  import { aliasedSymbol } from './aliasedSymbol.ts'
26
29
  import { AMBIENT_SOURCES, ambientReadsIn } from './ambientReadsIn.ts'
27
30
  import type { AppLayout, AppRoute, PlacedSource } from './appLayout.ts'
28
31
  import { argsDefaultsIn } from './argsDefaultsIn.ts'
29
- import { type CheckerAnswer, UNCHECKED } from './CheckerAnswer.ts'
30
32
  import {
33
+ checkedShadow,
31
34
  COMPONENT_MODULE,
32
35
  COMPONENT_STAND_IN,
33
- checkedShadow,
34
36
  moduleConfigShadow,
35
37
  } from './checkedShadow.ts'
38
+ import { type CheckerAnswer, UNCHECKED } from './CheckerAnswer.ts'
36
39
  import type { Finding } from './Finding.ts'
37
40
  import { isIgnored } from './isIgnored.ts'
38
- import { CHECKED_VALUES } from './Lowering.ts'
39
41
  import { diagnosisAt, lineOf } from './lineOf.ts'
42
+ import { CHECKED_VALUES } from './Lowering.ts'
40
43
  import type { AbideFile } from './parseAbide.ts'
41
44
  import { projectShadow, type Span } from './projectShadow.ts'
42
45
  import { type Abide, abideIn, isReactiveType } from './reactiveTypes.ts'
43
- import type { ParsedSource, ReadSource } from './readSources.ts'
44
46
  import { readsIn, type ShadowSpans } from './readsIn.ts'
47
+ import type { ParsedSource, ReadSource } from './readSources.ts'
45
48
  import {
46
49
  CHECKED_SUFFIX,
47
50
  mapForward,
@@ -1604,7 +1607,8 @@ function routesDeclaration(
1604
1607
  /** The union of the literals an anchored matcher source alternates between, or `undefined`. */
1605
1608
  function literalsOf(source: string | undefined): string | undefined {
1606
1609
  const body = source?.match(/^\^\(\?!\\\.\\\.\?\$\)\(\?:(.*)\)\$$/)?.[1]
1607
- if (body === undefined || !/^[\w~-]+(?:\|[\w~-]+)*$/.test(body)) return undefined
1610
+ if (body === undefined || !/^[\w~-]+(?:\|[\w~-]+)*$/.test(body))
1611
+ return undefined
1608
1612
  return body
1609
1613
  .split('|')
1610
1614
  .map((literal) => JSON.stringify(literal))
@@ -1802,8 +1806,7 @@ const CATEGORIES = ['warning', 'error', 'suggestion', 'message'] as const
1802
1806
  function flatten(diagnostic: {
1803
1807
  text: string
1804
1808
  messageChain?:
1805
- | readonly { text: string; messageChain?: unknown }[]
1806
- | undefined
1809
+ readonly { text: string; messageChain?: unknown }[] | undefined
1807
1810
  }): string {
1808
1811
  let message = diagnostic.text
1809
1812
  const chain = diagnostic.messageChain ?? []
@@ -1,6 +1,6 @@
1
1
  import {
2
- type Symbol as CheckedSymbol,
3
2
  type Checker,
3
+ type Symbol as CheckedSymbol,
4
4
  SymbolFlags,
5
5
  } from 'typescript/unstable/async'
6
6
 
@@ -10,6 +10,7 @@ import {
10
10
  isPropertyAssignment,
11
11
  } from 'typescript/unstable/ast/is'
12
12
  import type { Checker } from 'typescript/unstable/async'
13
+
13
14
  import { aliasedSymbol } from './aliasedSymbol.ts'
14
15
  import {
15
16
  isWrittenInPlace,
@@ -1,4 +1,5 @@
1
1
  import { relative as relativeTo } from 'node:path' // bun exposes no path helpers of its own
2
+
2
3
  import { appFiles } from '#server/appTree.ts'
3
4
  import { type Placement, placement, routeOf } from '#server/placement.ts'
4
5
  import {
@@ -13,14 +14,15 @@ import {
13
14
  parseRoutePattern,
14
15
  type Segment,
15
16
  } from '#shared/routePattern.ts'
17
+
16
18
  import { abideImportsOf, componentGraph } from './componentGraph.ts'
17
19
  import type { HandlerFile } from './handlersUnder.ts'
18
20
  import { hookCalls, hooksIn } from './hookCalls.ts'
19
- import { type MountedTree, matchersOf } from './matchersOf.ts'
21
+ import { matchersOf, type MountedTree } from './matchersOf.ts'
20
22
  import { mountsOf } from './mountsOf.ts'
21
23
  import { type AbideFile, scriptBodies } from './parseAbide.ts'
22
- import { Refusals } from './Refusals.ts'
23
24
  import { type ParsedSource, parseSources } from './readSources.ts'
25
+ import { Refusals } from './Refusals.ts'
24
26
  import { resolverIn } from './resolverIn.ts'
25
27
  import { attributedImports } from './splitImports.ts'
26
28
  import type { Diagnosis } from './TypeSession.ts'
@@ -16,6 +16,7 @@ import {
16
16
  isStringLiteral,
17
17
  } from 'typescript/unstable/ast/is'
18
18
  import { type Checker, SymbolFlags, type Type } from 'typescript/unstable/async'
19
+
19
20
  import type { Finding } from './Finding.ts'
20
21
  import { optionNamed, reactiveOptions } from './reactiveOptions.ts'
21
22
 
@@ -18,6 +18,7 @@ import {
18
18
  type TypeReference,
19
19
  type UnionOrIntersectionType,
20
20
  } from 'typescript/unstable/async'
21
+
21
22
  import type { JsonValue } from '#shared/JsonValue.ts'
22
23
 
23
24
  type Schema = { [keyword: string]: JsonValue }
@@ -1,12 +1,14 @@
1
1
  import { relative } from 'node:path' // bun exposes no path helpers of its own
2
+
2
3
  import { type Placement, placement } from '#server/placement.ts'
4
+
3
5
  import type { PlacedSource } from './appLayout.ts'
4
6
  import { type AppChecker, compiled } from './compileApp.ts'
5
7
  import { abideImportsOf } from './componentGraph.ts'
6
8
  import { hooksIn } from './hookCalls.ts'
7
9
  import { parseAbide, scriptBodies } from './parseAbide.ts'
8
- import { Refusals } from './Refusals.ts'
9
10
  import { parseSources, readSources } from './readSources.ts'
11
+ import { Refusals } from './Refusals.ts'
10
12
  import type { Diagnosis } from './TypeSession.ts'
11
13
 
12
14
  /**
@@ -1,4 +1,5 @@
1
1
  import { SERVER_SPECIFIER } from '#shared/SPECIFIERS.ts'
2
+
2
3
  import type { CheckerAnswer } from './CheckerAnswer.ts'
3
4
  import type { Finding } from './Finding.ts'
4
5
  import { hookCalls } from './hookCalls.ts'
@@ -10,8 +11,8 @@ import {
10
11
  Lowering,
11
12
  type Routed,
12
13
  } from './Lowering.ts'
13
- import { holdsReactive } from './PositionTable.ts'
14
14
  import type { AbideFile } from './parseAbide.ts'
15
+ import { holdsReactive } from './PositionTable.ts'
15
16
  import { NO_PROPS, type Origin, type Span } from './projectShadow.ts'
16
17
  import { CHECKED_SUFFIX } from './ShadowMap.ts'
17
18
  import { abideImports } from './splitImports.ts'
@@ -17,6 +17,7 @@ import {
17
17
  isPropertyAccessExpression,
18
18
  isShorthandPropertyAssignment,
19
19
  } from 'typescript/unstable/ast/is'
20
+
20
21
  import type { Span } from './projectShadow.ts'
21
22
  import { REACTIVE_MEMBERS } from './REACTIVE_MEMBERS.ts'
22
23
 
@@ -3,6 +3,7 @@ import { escapeAttribute, escapeQuote } from '#shared/escapeText.ts'
3
3
  import { isEventName } from '#shared/isEventName.ts'
4
4
  import { safeUrl } from '#shared/safeUrl.ts'
5
5
  import { URL_ATTRIBUTES } from '#shared/URL_ATTRIBUTES.ts'
6
+
6
7
  import { decodeCharacterReferences } from './decodeCharacterReferences.ts'
7
8
  import {
8
9
  type Attribute,
@@ -1,5 +1,6 @@
1
1
  import { realpathSync } from 'node:fs' // bun exposes no sync realpath of its own
2
2
  import { dirname, posix } from 'node:path' // bun exposes no path helpers of its own
3
+
3
4
  import {
4
5
  type Compilation,
5
6
  type CompiledFile,
@@ -13,10 +14,11 @@ import { VIRTUAL_DIRECTORY } from '#server/VIRTUAL_DIRECTORY.ts'
13
14
  import { CLIENT_ADDRESS } from '#shared/ADDRESSES.ts'
14
15
  import type { JsonValue } from '#shared/JsonValue.ts'
15
16
  import { ROUTING_SPECIFIER, WIRE_SPECIFIER } from '#shared/SPECIFIERS.ts'
17
+
16
18
  import {
17
19
  type AppLayout,
18
- type AppRoute,
19
20
  appLayout,
21
+ type AppRoute,
20
22
  type PlacedSource,
21
23
  shapeOf,
22
24
  } from './appLayout.ts'
@@ -25,8 +27,8 @@ import { handlersUnder } from './handlersUnder.ts'
25
27
  import { isAbideSpecifier } from './hookCalls.ts'
26
28
  import { nearest } from './nearest.ts'
27
29
  import { projectShadow } from './projectShadow.ts'
28
- import { Refusals } from './Refusals.ts'
29
30
  import { type ReadSource, readSources } from './readSources.ts'
31
+ import { Refusals } from './Refusals.ts'
30
32
  import { respecified } from './splitImports.ts'
31
33
  import { type Diagnosis, TypeSession } from './TypeSession.ts'
32
34
  import { writeDefaultProject } from './writeDefaultProject.ts'
@@ -2,6 +2,7 @@ import { tablePath } from '#server/abideModules.ts'
2
2
  import type { AppPackage } from '#server/config.ts'
3
3
  import type { SourceMaps } from '#server/installSourceMaps.ts'
4
4
  import { SERVER_TABLE } from '#server/TABLES.ts'
5
+
5
6
  import abidePackage from '../../package.json' with { type: 'json' }
6
7
 
7
8
  // What the executable starts from: `abide compile`'s, and `abide bundle`'s window over it (38.70).
@@ -1,4 +1,5 @@
1
1
  import { dirname } from 'node:path' // bun exposes no path helpers of its own
2
+
2
3
  import { type AbideFile, scriptBodies } from './parseAbide.ts'
3
4
  import { abideImports } from './splitImports.ts'
4
5
 
@@ -14,18 +14,19 @@ import {
14
14
  isVariableDeclaration,
15
15
  } from 'typescript/unstable/ast/is'
16
16
  import {
17
- type Symbol as CheckedSymbol,
18
17
  type Checker,
19
18
  ObjectFlags,
20
19
  type ObjectType,
21
20
  type Project,
22
21
  SignatureKind,
22
+ type Symbol as CheckedSymbol,
23
23
  SymbolFlags,
24
24
  type Type,
25
25
  TypeFlags,
26
26
  type TypeReference,
27
27
  type UnionOrIntersectionType,
28
28
  } from 'typescript/unstable/async'
29
+
29
30
  import type { Mount } from '#server/answerRpc.ts'
30
31
  import type { CopyOptions } from '#shared/CopyOptions.ts'
31
32
  import {
@@ -33,6 +34,7 @@ import {
33
34
  defaultsInSource,
34
35
  } from '#shared/reactive/parameterDefaults.ts'
35
36
  import type { Method } from '#shared/rpc.ts'
37
+
36
38
  import { aliasedSymbol } from './aliasedSymbol.ts'
37
39
  import { defaultedMembers, parameterPattern } from './argsDefaultsIn.ts'
38
40
  import {
@@ -42,7 +44,6 @@ import {
42
44
  type Walk,
43
45
  } from './argsSchemaOf.ts'
44
46
  import { diagnosisAt } from './lineOf.ts'
45
- import type { Refusals } from './Refusals.ts'
46
47
  import { isReactiveCall, METHODS, optionNamed } from './reactiveOptions.ts'
47
48
  import {
48
49
  abideIn,
@@ -50,6 +51,7 @@ import {
50
51
  isReactiveMember,
51
52
  valueTypeOf,
52
53
  } from './reactiveTypes.ts'
54
+ import type { Refusals } from './Refusals.ts'
53
55
  import type { Diagnosis } from './TypeSession.ts'
54
56
 
55
57
  /**
@@ -1,3 +1,4 @@
1
+ import { anchorMarkup } from '#shared/anchorMarkup.ts'
1
2
  import {
2
3
  RAW_CLOSE,
3
4
  RAW_OPEN,
@@ -5,7 +6,6 @@ import {
5
6
  REGION_OPEN,
6
7
  ROW_OPEN,
7
8
  } from '#shared/ANCHORS.ts'
8
- import { anchorMarkup } from '#shared/anchorMarkup.ts'
9
9
  import { CHILDREN } from '#shared/CHILDREN.ts'
10
10
  import { FOREIGN_ATTRIBUTES } from '#shared/FOREIGN_ATTRIBUTES.ts'
11
11
  import {
@@ -13,22 +13,23 @@ import {
13
13
  INTEGRATION_POINTS,
14
14
  } from '#shared/INTEGRATION_POINTS.ts'
15
15
  import { RUNTIME_SPECIFIER, SHARED_SPECIFIER } from '#shared/SPECIFIERS.ts'
16
+
16
17
  import { type CheckerAnswer, UNCHECKED } from './CheckerAnswer.ts'
17
- import {
18
- Cursor,
19
- type PlacedNode,
20
- placeTemplate,
21
- REGION_ROOT,
22
- ROW_ROOT,
23
- } from './Cursor.ts'
24
18
  import {
25
19
  type ClassifiedAttribute,
26
20
  classifyAttributes,
27
21
  isBound,
28
22
  isSingleRooted,
29
- type MergeGroup,
30
23
  isSlot,
24
+ type MergeGroup,
31
25
  } from './classifyTemplate.ts'
26
+ import {
27
+ Cursor,
28
+ type PlacedNode,
29
+ placeTemplate,
30
+ REGION_ROOT,
31
+ ROW_ROOT,
32
+ } from './Cursor.ts'
32
33
  import { decodeCharacterReferences } from './decodeCharacterReferences.ts'
33
34
  import { moduleImports } from './emitComponent.ts'
34
35
  import { invocationProps, passedName } from './invocationProps.ts'
@@ -41,8 +42,8 @@ import {
41
42
  } from './Lowering.ts'
42
43
  import type { AbideFile } from './parseAbide.ts'
43
44
  import {
44
- CLIENT_LANE,
45
45
  chosenArm,
46
+ CLIENT_LANE,
46
47
  headSink,
47
48
  mergedValue,
48
49
  renderMarkup,
@@ -1313,7 +1314,8 @@ function emitInvocation(
1313
1314
  // 32.34, 32.35 — A TAG CHOOSING BY A VALUE IS AN `{#if}` WHOSE ARMS ARE COMPONENTS
1314
1315
  // (`ChosenRegion`): the watch reads which, and the region swaps.
1315
1316
  const name = region.claim('dc')
1316
- region.lines.push(`const ${name} = new ${lowering.use('ChosenRegion')}(${lowering.use('regionFound')}(${at.name}), ${SCOPE}, { ${props.join(', ')} }, ${SHARE_AT})
1317
+ region.lines
1318
+ .push(`const ${name} = new ${lowering.use('ChosenRegion')}(${lowering.use('regionFound')}(${at.name}), ${SCOPE}, { ${props.join(', ')} }, ${SHARE_AT})
1317
1319
  ${SCOPE}.watch(() => ${name}.show(${chosen}))`)
1318
1320
  }
1319
1321
 
@@ -1336,7 +1338,8 @@ function emitSlot(at: PlacedNode, region: RegionEmission): void {
1336
1338
  // THE EMPTY REGION IS THE ONE THE SERVER DID NOT PAINT — a child built in the browser (32.17)
1337
1339
  // or a page navigated to (30.7). Filled from whichever side owns what goes there, and then
1338
1340
  // mounted from the same side, so the markup and the bindings can never come from two.
1339
- region.lines.push(`const ${name} = ${lowering.use('regionFound')}(${at.name})
1341
+ region.lines
1342
+ .push(`const ${name} = ${lowering.use('regionFound')}(${at.name})
1340
1343
  const ${name}_kids = ${PROPS}[${JSON.stringify(CHILDREN)}] === undefined ? undefined : ${PROPS}[${JSON.stringify(CHILDREN)}]()
1341
1344
  ${lowering.use('fillEmpty')}(${name}, ${name}_kids === undefined ? ${name}_build : ${name}_kids.build)
1342
1345
  ${SCOPE}.own(${name}_kids === undefined ? ${name}_mount(${name}) : ${name}_kids.mount(${name}))`)
@@ -1384,7 +1387,8 @@ function emitBlock(
1384
1387
  // it takes can never change, and a watch over it is a reader that can never wake. Unproven, the
1385
1388
  // watch stays, and tracking decides what it reads.
1386
1389
  const show = `${name}.show(${take})`
1387
- region.lines.push(`const ${name} = new ${lowering.use('ArmRegion')}(${lowering.use('regionFound')}(${at.name}), ${SCOPE}, ${name}_arms, ${mounted})
1390
+ region.lines
1391
+ .push(`const ${name} = new ${lowering.use('ArmRegion')}(${lowering.use('regionFound')}(${at.name}), ${SCOPE}, ${name}_arms, ${mounted})
1388
1392
  ${lowering.isLiveChain(block.branches) ? `${SCOPE}.watch(() => ${show})` : show}`)
1389
1393
  }
1390
1394
 
@@ -1414,7 +1418,8 @@ function emitTry(
1414
1418
  )
1415
1419
 
1416
1420
  // ONE UNIT, for `emitBlock`'s reason. What the body and the catch do is `TryRegion`'s.
1417
- region.lines.push(`const ${name} = new ${lowering.use('TryRegion')}(${lowering.use('regionFound')}(${at.name}), ${SCOPE}, ${name}_arms)
1421
+ region.lines
1422
+ .push(`const ${name} = new ${lowering.use('TryRegion')}(${lowering.use('regionFound')}(${at.name}), ${SCOPE}, ${name}_arms)
1418
1423
  ${SCOPE}.watch(() => ${name}.follow())`)
1419
1424
  }
1420
1425
 
@@ -1,5 +1,6 @@
1
1
  import type { JsonValue } from '#shared/JsonValue.ts'
2
2
  import { SERVER_SPECIFIER, SHARED_SPECIFIER } from '#shared/SPECIFIERS.ts'
3
+
3
4
  import { type CheckerAnswer, UNCHECKED } from './CheckerAnswer.ts'
4
5
  import { Cursor, placeTemplate } from './Cursor.ts'
5
6
  import { type LoweredChunk, Lowering, PROPS } from './Lowering.ts'
@@ -1,6 +1,7 @@
1
1
  import { STYLE_QUERY } from '#server/MODULE_QUERIES.ts'
2
- import type { JsonValue } from '#shared/JsonValue.ts'
3
2
  import type { Placement } from '#server/placement.ts'
3
+ import type { JsonValue } from '#shared/JsonValue.ts'
4
+
4
5
  import type { CheckerAnswer } from './CheckerAnswer.ts'
5
6
  import { emitClient } from './emitClient.ts'
6
7
  import { emitComponent } from './emitComponent.ts'