Skip to content

AI-native design editor. Open-source Figma alternative.

refactor: move prefixed sibling files into domain folders (#1242)

Danila Poyarkove8b84b33d5da
diff --git a/packages/core/src/editor/history/snapshot-graph.ts b/packages/core/src/editor/history/snapshot/graph.ts
similarity index 93%
rename from packages/core/src/editor/history/snapshot-graph.ts
rename to packages/core/src/editor/history/snapshot/graph.ts
index 79102fa7b..fd57dab97 100644
--- a/packages/core/src/editor/history/snapshot-graph.ts
+++ b/packages/core/src/editor/history/snapshot/graph.ts
@@ -2,10 +2,10 @@ import { uniq } from 'es-toolkit/array'
import type { SceneGraph } from '@open-pencil/scene-graph'
+import { applyDocumentChange, type DocumentChange } from '#core/editor/history/document-change'
import { extractPageContext } from '#core/io/subgraph'
-import { applyDocumentChange, type DocumentChange } from './document-change'
-import type { PageSnapshot } from './snapshot'
+import type { PageSnapshot } from './page'
function pageContext(source: SceneGraph, pageId: string, nodeIds: string[]): SceneGraph {
const graph = extractPageContext(source, pageId, nodeIds)
diff --git a/packages/core/src/editor/history/snapshot.ts b/packages/core/src/editor/history/snapshot/page.ts
similarity index 100%
rename from packages/core/src/editor/history/snapshot.ts
rename to packages/core/src/editor/history/snapshot/page.ts
diff --git a/packages/core/src/editor/index.ts b/packages/core/src/editor/index.ts
index 39a194f09..b1d53485a 100644
--- a/packages/core/src/editor/index.ts
+++ b/packages/core/src/editor/index.ts
@@ -24,8 +24,8 @@ export {
export { createDefaultEditorState, createEditor } from './create'
export { executeAtomicTool } from './history/atomic-tool'
export { isEmptyDocumentChange, type DocumentChange } from './history/document-change'
-export type { PageSnapshot } from './history/snapshot'
-export { graphFromDocumentChange, graphFromPageSnapshot } from './history/snapshot-graph'
+export type { PageSnapshot } from './history/snapshot/page'
+export { graphFromDocumentChange, graphFromPageSnapshot } from './history/snapshot/graph'
export type { ClipboardPayload, ClipboardSnapshot } from './clipboard/copy'
export { resolvePasteTarget } from './clipboard/paste/target'
export { playIslandRoots } from './play/islands'
diff --git a/packages/core/src/editor/nudge.ts b/packages/core/src/editor/nudge.ts
index aa18918ca..820e36423 100644
--- a/packages/core/src/editor/nudge.ts
+++ b/packages/core/src/editor/nudge.ts
@@ -4,7 +4,7 @@ import type { SceneNode } from '@open-pencil/scene-graph'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { collectNodePositions, pushPositionUndo } from './history/position'
-import { fitEnclosingGroupsWithUndo } from './structure/group-bounds'
+import { fitEnclosingGroupsWithUndo } from './structure/group/bounds'
import type { EditorContext } from './types'
const NUDGE_COMMIT_DELAY = 300
diff --git a/packages/core/src/editor/structure.ts b/packages/core/src/editor/structure.ts
index dbddaacf2..f12885886 100644
--- a/packages/core/src/editor/structure.ts
+++ b/packages/core/src/editor/structure.ts
@@ -3,7 +3,7 @@ import { pick } from 'es-toolkit'
import { createsComponentCycle, TRANSFORM_FIELDS, type SceneNode } from '@open-pencil/scene-graph'
import { acceptingParent, acceptsChildren, prepareSlotEdits } from '#core/editor/components/slots'
-import { fitEnclosingGroupsWithUndo } from '#core/editor/structure/group-bounds'
+import { fitEnclosingGroupsWithUndo } from '#core/editor/structure/group/bounds'
import { wrapInAutoLayout as wrapInAutoLayoutImpl } from './structure/auto-layout-wrap'
import {
@@ -15,7 +15,7 @@ import {
flattenSelected as flattenSelectedImpl,
outlineStrokeSelected as outlineStrokeSelectedImpl
} from './structure/flatten'
-import { ungroupSelected as ungroupImpl } from './structure/group'
+import { ungroupSelected as ungroupImpl } from './structure/group/ungroup'
import { createLayerTypeActions } from './structure/layer-type'
import {
defaultNodeName,
diff --git a/packages/core/src/editor/structure/group-bounds.ts b/packages/core/src/editor/structure/group/bounds.ts
similarity index 100%
rename from packages/core/src/editor/structure/group-bounds.ts
rename to packages/core/src/editor/structure/group/bounds.ts
diff --git a/packages/core/src/editor/structure/group.ts b/packages/core/src/editor/structure/group/ungroup.ts
similarity index 100%
rename from packages/core/src/editor/structure/group.ts
rename to packages/core/src/editor/structure/group/ungroup.ts
diff --git a/packages/core/src/editor/undo.ts b/packages/core/src/editor/undo.ts
index 72db8f1ac..af75b0201 100644
--- a/packages/core/src/editor/undo.ts
+++ b/packages/core/src/editor/undo.ts
@@ -19,7 +19,7 @@ import {
restorePageFromSnapshot as restorePageSnapshot,
snapshotPage as createPageSnapshot,
type PageSnapshot
-} from './history/snapshot'
+} from './history/snapshot/page'
import { restoreSubtree, snapshotSubtree } from './history/subtree'
import type { EditorContext } from './types'
diff --git a/packages/core/src/figma-api/index.ts b/packages/core/src/figma-api/index.ts
index 36bc4dd99..cef9fc043 100644
--- a/packages/core/src/figma-api/index.ts
+++ b/packages/core/src/figma-api/index.ts
@@ -22,7 +22,7 @@ import { IS_BROWSER, type InterfaceTheme } from '#core/constants'
import { newLayerDefaults } from '#core/editor/shapes/defaults'
import { booleanOperationPaints, createBooleanOperation } from '#core/editor/structure/boolean'
import { wrapNodes } from '#core/editor/structure/container-wrap'
-import { ungroupNode } from '#core/editor/structure/group'
+import { ungroupNode } from '#core/editor/structure/group/ungroup'
import { setDefaultPageBackground } from '#core/figma-api/page-backgrounds'
import { iconify, type IconProvider } from '#core/icons'
import type { RasterCodec } from '#core/io/formats/raster'
diff --git a/packages/core/src/io/formats/design-tokens/apply.ts b/packages/core/src/io/formats/design-tokens/apply.ts
index 040255e0b..940e68e2b 100644
--- a/packages/core/src/io/formats/design-tokens/apply.ts
+++ b/packages/core/src/io/formats/design-tokens/apply.ts
@@ -20,7 +20,7 @@ import { randomHex } from '@open-pencil/scene-graph/random'
import { reconcileVariableLayouts } from '#core/layout/variables'
import type { AliasTarget, PlannedCollection, PlannedVariable, TokenImportPlan } from './plan'
-import type { PlannedStyle } from './plan-styles'
+import type { PlannedStyle } from './plan/styles'
/** Token fields an import sets; `undefined` clears one. */
export interface ImportedTokenFields {
diff --git a/packages/core/src/io/formats/design-tokens/index.ts b/packages/core/src/io/formats/design-tokens/index.ts
index b913da308..6b3f89454 100644
--- a/packages/core/src/io/formats/design-tokens/index.ts
+++ b/packages/core/src/io/formats/design-tokens/index.ts
@@ -34,7 +34,7 @@ export {
type TokenImportOptions,
type TokenImportPlan
} from './plan'
-export type { PlannedStyle } from './plan-styles'
+export type { PlannedStyle } from './plan/styles'
export {
applyTokenImport,
importTokensIntoGraph,
diff --git a/packages/core/src/io/formats/design-tokens/plan.ts b/packages/core/src/io/formats/design-tokens/plan/index.ts
similarity index 98%
rename from packages/core/src/io/formats/design-tokens/plan.ts
rename to packages/core/src/io/formats/design-tokens/plan/index.ts
index bfc8e74ed..3728007a7 100644
--- a/packages/core/src/io/formats/design-tokens/plan.ts
+++ b/packages/core/src/io/formats/design-tokens/plan/index.ts
@@ -18,10 +18,15 @@ import {
type DecodedValue,
type DecodedVariable,
type DecodeFailure
-} from './decode'
-import { pathName } from './paths'
-import { planStyles, type PlannedStyle } from './plan-styles'
-import type { DesignTokenBundle, ReadCollection, ReadToken } from './read'
+} from '#core/io/formats/design-tokens/decode'
+import { pathName } from '#core/io/formats/design-tokens/paths'
+import type {
+ DesignTokenBundle,
+ ReadCollection,
+ ReadToken
+} from '#core/io/formats/design-tokens/read'
+
+import { planStyles, type PlannedStyle } from './styles'
/** Where an imported collection goes: a new collection, an existing one, or nowhere. */
export type CollectionTarget =
diff --git a/packages/core/src/io/formats/design-tokens/plan-styles.ts b/packages/core/src/io/formats/design-tokens/plan/styles.ts
similarity index 96%
rename from packages/core/src/io/formats/design-tokens/plan-styles.ts
rename to packages/core/src/io/formats/design-tokens/plan/styles.ts
index 0bb456325..1f2f81db2 100644
--- a/packages/core/src/io/formats/design-tokens/plan-styles.ts
+++ b/packages/core/src/io/formats/design-tokens/plan/styles.ts
@@ -10,18 +10,18 @@ import {
} from '@open-pencil/scene-graph'
import { tryParseFigmaEffects } from '#core/figma-api/effects'
-
import {
decodeColor,
decodeDimension,
decodeFontFamily,
decodeFontWeight,
referencePath
-} from './decode'
-import type { AliasTarget, ImportSkip, ResolvedReference } from './plan'
-import type { DesignTokenBundle, ReadToken } from './read'
-import { isShadow, shadowTokenValue, typographyValue } from './styles'
-import { OPENPENCIL_EXTENSION } from './types'
+} from '#core/io/formats/design-tokens/decode'
+import type { DesignTokenBundle, ReadToken } from '#core/io/formats/design-tokens/read'
+import { isShadow, shadowTokenValue, typographyValue } from '#core/io/formats/design-tokens/styles'
+import { OPENPENCIL_EXTENSION } from '#core/io/formats/design-tokens/types'
+
+import type { AliasTarget, ImportSkip, ResolvedReference } from './'
/** A text or effect style the import makes or updates. */
export interface PlannedStyle {
diff --git a/packages/core/src/io/formats/fig/export/patch/fields.ts b/packages/core/src/io/formats/fig/export/patch/fields.ts
index 65963c5af..1f769b4c9 100644
--- a/packages/core/src/io/formats/fig/export/patch/fields.ts
+++ b/packages/core/src/io/formats/fig/export/patch/fields.ts
@@ -15,7 +15,7 @@ import type { SceneGraph } from '@open-pencil/scene-graph'
import { prepareFigExport, type FigExportSetup } from '#core/io/formats/fig/export/setup'
import { cloneSceneGraphForFigExport } from '#core/kiwi/fig/parse/transfer'
-import { archiveBaseline, type ArchiveBaseline } from '#core/kiwi/fig/session/archive-changes'
+import { archiveBaseline, type ArchiveBaseline } from '#core/kiwi/fig/session/archive/changes'
/** Writes the records of these layers, as the patch writes the document's. */
export type RecordWriter = (
diff --git a/packages/core/src/io/formats/fig/export/patch/index.ts b/packages/core/src/io/formats/fig/export/patch/index.ts
index a1357cf98..df61d061f 100644
--- a/packages/core/src/io/formats/fig/export/patch/index.ts
+++ b/packages/core/src/io/formats/fig/export/patch/index.ts
@@ -26,8 +26,8 @@ import {
} from '#core/io/formats/fig/export/setup'
import { appendVariableNodeChanges } from '#core/io/formats/fig/export/variables'
import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-import { figArchive, type FigArchiveAccess } from '#core/kiwi/fig/session/archive'
-import { archiveChanges, type ArchiveChangeSummary } from '#core/kiwi/fig/session/archive-changes'
+import { figArchive, type FigArchiveAccess } from '#core/kiwi/fig/session/archive/access'
+import { archiveChanges, type ArchiveChangeSummary } from '#core/kiwi/fig/session/archive/changes'
import {
isReaderPagePending,
populateFigPage,
diff --git a/packages/core/src/io/formats/fig/read.ts b/packages/core/src/io/formats/fig/read.ts
index e81097ce5..09254497d 100644
--- a/packages/core/src/io/formats/fig/read.ts
+++ b/packages/core/src/io/formats/fig/read.ts
@@ -11,7 +11,7 @@ import {
localFigArchive,
registerFigArchive,
workerFigArchive
-} from '#core/kiwi/fig/session/archive'
+} from '#core/kiwi/fig/session/archive/access'
import { createFigSessionWorker } from '#core/kiwi/fig/session/client'
import {
registerReaderRecovery,
diff --git a/packages/core/src/kiwi/fig/population/client.ts b/packages/core/src/kiwi/fig/population/client.ts
index 25b4a54d1..468e9df8a 100644
--- a/packages/core/src/kiwi/fig/population/client.ts
+++ b/packages/core/src/kiwi/fig/population/client.ts
@@ -1,8 +1,8 @@
import type { SceneGraph } from '@open-pencil/scene-graph'
import { randomHex } from '@open-pencil/scene-graph/random'
-import { releaseFigArchive } from '#core/kiwi/fig/session/archive'
-import { archiveChanges, trackArchiveChanges } from '#core/kiwi/fig/session/archive-changes'
+import { releaseFigArchive } from '#core/kiwi/fig/session/archive/access'
+import { archiveChanges, trackArchiveChanges } from '#core/kiwi/fig/session/archive/changes'
import { updateReaderRecovery, releaseReaderRecovery } from '#core/kiwi/fig/session/document-state'
import type { FigSessionResponse } from '#core/kiwi/fig/session/protocol'
diff --git a/packages/core/src/kiwi/fig/session/archive.ts b/packages/core/src/kiwi/fig/session/archive/access.ts
similarity index 100%
rename from packages/core/src/kiwi/fig/session/archive.ts
rename to packages/core/src/kiwi/fig/session/archive/access.ts
diff --git a/packages/core/src/kiwi/fig/session/archive-changes.ts b/packages/core/src/kiwi/fig/session/archive/changes.ts
similarity index 100%
rename from packages/core/src/kiwi/fig/session/archive-changes.ts
rename to packages/core/src/kiwi/fig/session/archive/changes.ts
diff --git a/packages/core/src/kiwi/fig/session/worker.ts b/packages/core/src/kiwi/fig/session/worker.ts
index abb284294..cb1182eed 100644
--- a/packages/core/src/kiwi/fig/session/worker.ts
+++ b/packages/core/src/kiwi/fig/session/worker.ts
@@ -1,5 +1,5 @@
import { serializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
-import { createFigArchiveOperations } from '#core/kiwi/fig/session/archive'
+import { createFigArchiveOperations } from '#core/kiwi/fig/session/archive/access'
import type {
FigSessionOpenRequest,
FigSessionRequest,
diff --git a/packages/core/src/tools/registry.ts b/packages/core/src/tools/registry.ts
deleted file mode 100644
index e51d30d04..000000000
--- a/packages/core/src/tools/registry.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { CORE_TOOLS } from './registry-core'
-import { EXTENDED_TOOLS } from './registry-extended'
-import type { ToolDef } from './schema'
-
-export { CORE_TOOLS } from './registry-core'
-export { EXTENDED_TOOLS } from './registry-extended'
-
-/** All tools combined — used by MCP server and CLI. */
-export const ALL_TOOLS: ToolDef[] = [...CORE_TOOLS, ...EXTENDED_TOOLS]
diff --git a/packages/core/src/tools/registry-core.ts b/packages/core/src/tools/registry/core.ts
similarity index 66%
rename from packages/core/src/tools/registry-core.ts
rename to packages/core/src/tools/registry/core.ts
index a18cea2e1..62033f4d9 100644
--- a/packages/core/src/tools/registry-core.ts
+++ b/packages/core/src/tools/registry/core.ts
@@ -1,7 +1,7 @@
-import { diffChanges, diffCreate, diffVisual, evalCode } from './analyze'
-import { calc } from './calc'
-import { render } from './create'
-import { describe } from './describe'
+import { diffChanges, diffCreate, diffVisual, evalCode } from '#core/tools/analyze'
+import { calc } from '#core/tools/calc'
+import { render } from '#core/tools/create'
+import { describe } from '#core/tools/describe'
import {
setFill,
setLayout,
@@ -11,12 +11,12 @@ import {
setText,
setTextProperties,
updateNode
-} from './modify'
-import { diffJSX, findNodes, getJSX, getNode, getSelection } from './read'
-import type { ToolDef } from './schema'
-import { stockPhoto } from './stock-photo'
-import { batchUpdate, deleteNode, nodeResize, reparentNode } from './structure'
-import { viewportZoomToFit } from './vector'
+} from '#core/tools/modify'
+import { diffJSX, findNodes, getJSX, getNode, getSelection } from '#core/tools/read'
+import type { ToolDef } from '#core/tools/schema'
+import { stockPhoto } from '#core/tools/stock-photo'
+import { batchUpdate, deleteNode, nodeResize, reparentNode } from '#core/tools/structure'
+import { viewportZoomToFit } from '#core/tools/vector'
/**
* Core tools registered by default in AI chat (26 tools, ~5K schema tokens).
diff --git a/packages/core/src/tools/registry-extended.ts b/packages/core/src/tools/registry/extended.ts
similarity index 90%
rename from packages/core/src/tools/registry-extended.ts
rename to packages/core/src/tools/registry/extended.ts
index 694148721..8a5a2a10f 100644
--- a/packages/core/src/tools/registry-extended.ts
+++ b/packages/core/src/tools/registry/extended.ts
@@ -8,9 +8,9 @@ import {
diffShow,
lint,
lintFix
-} from './analyze'
-import { designToComponentMap, designToTokens, importDesignTokens } from './codegen'
-import { addComment, getComments, replyToComment, resolveComment } from './comments'
+} from '#core/tools/analyze'
+import { designToComponentMap, designToTokens, importDesignTokens } from '#core/tools/codegen'
+import { addComment, getComments, replyToComment, resolveComment } from '#core/tools/comments'
import {
createComponent,
createInstance,
@@ -27,7 +27,7 @@ import {
insertIcon,
searchIconsTool,
setBehaviour
-} from './create'
+} from '#core/tools/create'
import {
setBlend,
setConstraints,
@@ -42,7 +42,7 @@ import {
setStrokeAlign,
setTextResize,
setVisible
-} from './modify'
+} from '#core/tools/modify'
import {
getComponents,
getCurrentPage,
@@ -57,9 +57,9 @@ import {
queryNodes,
selectNodes,
switchPage
-} from './read'
-import type { ToolDef } from './schema'
-import { getStatuses, setStatus } from './statuses'
+} from '#core/tools/read'
+import type { ToolDef } from '#core/tools/schema'
+import { getStatuses, setStatus } from '#core/tools/statuses'
import {
arrangeNodes,
cloneNode,
@@ -75,7 +75,7 @@ import {
nodeTree,
renameNode,
ungroupNode
-} from './structure'
+} from '#core/tools/structure'
import {
bindVariable,
createCollection,
@@ -89,7 +89,7 @@ import {
listVariables,
setVariable,
unbindVariable
-} from './variables'
+} from '#core/tools/variables'
import {
booleanExclude,
booleanIntersect,
@@ -105,7 +105,7 @@ import {
pathSet,
viewportGet,
viewportSet
-} from './vector'
+} from '#core/tools/vector'
/**
* Extended tools not in CORE_TOOLS — variables, vector ops, analysis,
diff --git a/packages/core/src/tools/registry/index.ts b/packages/core/src/tools/registry/index.ts
new file mode 100644
index 000000000..a0ca52c67
--- /dev/null
+++ b/packages/core/src/tools/registry/index.ts
@@ -0,0 +1,10 @@
+import type { ToolDef } from '#core/tools/schema'
+
+import { CORE_TOOLS } from './core'
+import { EXTENDED_TOOLS } from './extended'
+
+export { CORE_TOOLS } from './core'
+export { EXTENDED_TOOLS } from './extended'
+
+/** All tools combined — used by MCP server and CLI. */
+export const ALL_TOOLS: ToolDef[] = [...CORE_TOOLS, ...EXTENDED_TOOLS]
diff --git a/packages/core/tests/canvas/text/derived.test.ts b/packages/core/tests/canvas/text/derived/decorations.test.ts
similarity index 100%
rename from packages/core/tests/canvas/text/derived.test.ts
rename to packages/core/tests/canvas/text/derived/decorations.test.ts
diff --git a/packages/core/tests/canvas/text/derived-glyphs.test.ts b/packages/core/tests/canvas/text/derived/glyphs.test.ts
similarity index 100%
rename from packages/core/tests/canvas/text/derived-glyphs.test.ts
rename to packages/core/tests/canvas/text/derived/glyphs.test.ts
diff --git a/packages/core/tests/editor/graph/events-integration.test.ts b/packages/core/tests/editor/graph/events/pictures.test.ts
similarity index 100%
rename from packages/core/tests/editor/graph/events-integration.test.ts
rename to packages/core/tests/editor/graph/events/pictures.test.ts
diff --git a/packages/core/tests/editor/graph/events.test.ts b/packages/core/tests/editor/graph/events/renderer.test.ts
similarity index 100%
rename from packages/core/tests/editor/graph/events.test.ts
rename to packages/core/tests/editor/graph/events/renderer.test.ts
diff --git a/packages/core/tests/io/formats/fig/export/patch/index.test.ts b/packages/core/tests/io/formats/fig/export/patch/index.test.ts
index 686e1683a..dd96f82a9 100644
--- a/packages/core/tests/io/formats/fig/export/patch/index.test.ts
+++ b/packages/core/tests/io/formats/fig/export/patch/index.test.ts
@@ -12,7 +12,7 @@ import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { computeImageHash, getSharedStyles, type SceneNode } from '@open-pencil/scene-graph'
import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
-import { releaseFigArchive } from '#core/kiwi/fig/session/archive'
+import { releaseFigArchive } from '#core/kiwi/fig/session/archive/access'
import {
hasPendingReaderPages,
populateFigInternalPages
diff --git a/packages/core/tests/io/formats/fig/session/archive-changes.test.ts b/packages/core/tests/io/formats/fig/session/archive-changes.test.ts
index a5c96e015..fd78c0e56 100644
--- a/packages/core/tests/io/formats/fig/session/archive-changes.test.ts
+++ b/packages/core/tests/io/formats/fig/session/archive-changes.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { computeAllLayouts, exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
-import { archiveChanges } from '#core/kiwi/fig/session/archive-changes'
+import { archiveChanges } from '#core/kiwi/fig/session/archive/changes'
/** A row whose saved child positions are not where auto layout puts them. */
async function openRow() {
diff --git a/tests/app/libraries/update.test.ts b/packages/core/tests/library/update.test.ts
similarity index 100%
rename from tests/app/libraries/update.test.ts
rename to packages/core/tests/library/update.test.ts
diff --git a/packages/dom-css/src/runtime/headless.ts b/packages/dom-css/src/runtime/headless/runtime.ts
similarity index 92%
rename from packages/dom-css/src/runtime/headless.ts
rename to packages/dom-css/src/runtime/headless/runtime.ts
index 0818ab6ea..903e9afb0 100644
--- a/packages/dom-css/src/runtime/headless.ts
+++ b/packages/dom-css/src/runtime/headless/runtime.ts
@@ -1,10 +1,10 @@
+import { serializeHTML } from '#dom-css/export/html'
+import { INLINE_TAGS } from '#dom-css/import/flow'
+import { parseStyleAttribute } from '#dom-css/import/style-attribute'
+import type { CSSRuntime, DesignDocument, DesignElement, DesignNode } from '#dom-css/types'
import { parseFragment, type DefaultTreeAdapterTypes } from 'parse5'
-import { serializeHTML } from '../export/html'
-import { INLINE_TAGS } from '../import/flow'
-import { parseStyleAttribute } from '../import/style-attribute'
-import type { CSSRuntime, DesignDocument, DesignElement, DesignNode } from '../types'
-import { computeHeadlessStyles } from './headless-css'
+import { computeHeadlessStyles } from './styles'
function attrsToRecord(attrs: DefaultTreeAdapterTypes.Element['attrs']): Record<string, string> {
const result: Record<string, string> = {}
diff --git a/packages/dom-css/src/runtime/headless-css.ts b/packages/dom-css/src/runtime/headless/styles.ts
similarity index 98%
rename from packages/dom-css/src/runtime/headless-css.ts
rename to packages/dom-css/src/runtime/headless/styles.ts
index 0bd0eb7cb..c9dbd6eb1 100644
--- a/packages/dom-css/src/runtime/headless-css.ts
+++ b/packages/dom-css/src/runtime/headless/styles.ts
@@ -1,3 +1,9 @@
+import type {
+ DesignDocument,
+ DesignElement,
+ DesignNode,
+ DesignStyleDeclaration
+} from '#dom-css/types'
import {
parse,
type CSSGroupingRuleLike,
@@ -8,8 +14,6 @@ import {
import { tryParseColor } from '@open-pencil/scene-graph/color'
import { parseCSSNumber, splitCSSValue } from '@open-pencil/scene-graph/css'
-import type { DesignDocument, DesignElement, DesignNode, DesignStyleDeclaration } from '../types'
-
interface HeadlessCSSRule {
selector: string
specificity: number
diff --git a/packages/dom-css/src/runtime/index.ts b/packages/dom-css/src/runtime/index.ts
index 0ef6ee693..103714daa 100644
--- a/packages/dom-css/src/runtime/index.ts
+++ b/packages/dom-css/src/runtime/index.ts
@@ -1,10 +1,10 @@
import type { CSSRuntime } from '../types'
import { createBrowserCSSRuntime } from './browser'
-import { createHeadlessCSSRuntime } from './headless'
+import { createHeadlessCSSRuntime } from './headless/runtime'
export { createBrowserCSSRuntime } from './browser'
export type { BrowserCSSRuntimeOptions } from './browser'
-export { createHeadlessCSSRuntime } from './headless'
+export { createHeadlessCSSRuntime } from './headless/runtime'
export function createCSSRuntime(): CSSRuntime {
return typeof document !== 'undefined' ? createBrowserCSSRuntime() : createHeadlessCSSRuntime()
diff --git a/packages/vue/src/canvas/tools/input.ts b/packages/vue/src/canvas/tools/input.ts
index a70375b5f..d8678bb06 100644
--- a/packages/vue/src/canvas/tools/input.ts
+++ b/packages/vue/src/canvas/tools/input.ts
@@ -6,7 +6,7 @@ import { startPenInput } from '#vue/canvas/pen/input'
import { startPencilInput } from '#vue/canvas/pencil/input'
import { HAND_GRAB_CURSOR } from '#vue/editor/tool-cursor'
import { startShapeDraw, startTextDraw } from '#vue/shared/input/draw'
-import { startPanDrag } from '#vue/shared/input/pan'
+import { startPanDrag } from '#vue/shared/input/pan/drag'
import { handleSelectDown } from '#vue/shared/input/select'
import type { HitTestFns } from '#vue/shared/input/select'
import { startStickyPlace } from '#vue/shared/input/sticky/place'
diff --git a/packages/vue/src/canvas/useCanvasInput.ts b/packages/vue/src/canvas/useCanvasInput.ts
index 16134cc0f..9c1efa238 100644
--- a/packages/vue/src/canvas/useCanvasInput.ts
+++ b/packages/vue/src/canvas/useCanvasInput.ts
@@ -22,8 +22,8 @@ import {
import { resolveAutoLayoutHover } from '#vue/shared/input/auto-layout-hover'
import { createClickCounter } from '#vue/shared/input/click-count'
import { handleDrawMove } from '#vue/shared/input/draw'
-import { handleMoveMove, handleMoveUp } from '#vue/shared/input/move'
-import { setupPanZoom } from '#vue/shared/input/pan-zoom'
+import { handleMoveMove, handleMoveUp } from '#vue/shared/input/move/drag'
+import { setupPanZoom } from '#vue/shared/input/pan/zoom'
import { applyResize, cancelResizePreview, commitResizePreview } from '#vue/shared/input/resize'
import { updateHoverCursor } from '#vue/shared/input/select'
import { resolveShapeHandleHover } from '#vue/shared/input/shape-handles'
diff --git a/packages/vue/src/shared/input/move.ts b/packages/vue/src/shared/input/move/drag.ts
similarity index 99%
rename from packages/vue/src/shared/input/move.ts
rename to packages/vue/src/shared/input/move/drag.ts
index 11e8da489..999df6803 100644
--- a/packages/vue/src/shared/input/move.ts
+++ b/packages/vue/src/shared/input/move/drag.ts
@@ -15,7 +15,7 @@ export { duplicateAndDrag } from '#vue/shared/input/duplicate-drag'
import type { Editor } from '@open-pencil/core/editor'
import { flowBlockBounds, flowOrder, flowSlot, type FlowDrag } from '#vue/shared/input/flow-reorder'
-import { applyMoveSnap } from '#vue/shared/input/move-snap'
+import { applyMoveSnap } from '#vue/shared/input/move/snap'
import type { DragMove } from '#vue/shared/input/types'
const AUTO_LAYOUT_REORDER_CLICK_SLOP = 3
diff --git a/packages/vue/src/shared/input/move-snap.ts b/packages/vue/src/shared/input/move/snap.ts
similarity index 100%
rename from packages/vue/src/shared/input/move-snap.ts
rename to packages/vue/src/shared/input/move/snap.ts
diff --git a/packages/vue/src/shared/input/pan.ts b/packages/vue/src/shared/input/pan/drag.ts
similarity index 100%
rename from packages/vue/src/shared/input/pan.ts
rename to packages/vue/src/shared/input/pan/drag.ts
diff --git a/packages/vue/src/shared/input/pan-zoom.ts b/packages/vue/src/shared/input/pan/zoom.ts
similarity index 100%
rename from packages/vue/src/shared/input/pan-zoom.ts
rename to packages/vue/src/shared/input/pan/zoom.ts
diff --git a/packages/vue/tests/shared/input/move/containers.test.ts b/packages/vue/tests/shared/input/move/containers.test.ts
index 02d7b7008..bd7c16ed5 100644
--- a/packages/vue/tests/shared/input/move/containers.test.ts
+++ b/packages/vue/tests/shared/input/move/containers.test.ts
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
import { autoLayoutInsertIndex } from '#vue/shared/input/auto-layout'
-import { handleMoveMove, handleMoveUp } from '#vue/shared/input/move'
+import { handleMoveMove, handleMoveUp } from '#vue/shared/input/move/drag'
import {
clickSelectsInside,
createSelectionMoveDrag,
diff --git a/packages/vue/tests/shared/input/move/harness.ts b/packages/vue/tests/shared/input/move/harness.ts
index 79b661d12..f1200fc7c 100644
--- a/packages/vue/tests/shared/input/move/harness.ts
+++ b/packages/vue/tests/shared/input/move/harness.ts
@@ -1,7 +1,7 @@
import { createEditor } from '@open-pencil/core/editor'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { handleMoveMove, handleMoveUp, type MoveModifiers } from '#vue/shared/input/move'
+import { handleMoveMove, handleMoveUp, type MoveModifiers } from '#vue/shared/input/move/drag'
import { createSelectionMoveDrag } from '#vue/shared/input/select/move'
import type { DragMove } from '#vue/shared/input/types'
diff --git a/src/app/diagnostics/events/index.ts b/src/app/diagnostics/events/index.ts
index e22e14cf0..5671e6985 100644
--- a/src/app/diagnostics/events/index.ts
+++ b/src/app/diagnostics/events/index.ts
@@ -7,6 +7,6 @@ export {
export { recordDocumentFailure } from './document'
export { preparationDurationBucket, recordPreparationOutcome } from './preparation'
export { recordRuntimeError, type RuntimeErrorSource } from './runtime'
-export { recordStorageFailure } from './storage'
+export { recordStorageFailure } from './storage/failure'
export { recordACPTransportFailure, recordMCPConnectionFailure } from './transport'
-export { storageOperationForJob } from './storage-operation'
+export { storageOperationForJob } from './storage/operation'
diff --git a/src/app/diagnostics/events/storage.ts b/src/app/diagnostics/events/storage/failure.ts
similarity index 82%
rename from src/app/diagnostics/events/storage.ts
rename to src/app/diagnostics/events/storage/failure.ts
index 3b5129225..f73faa263 100644
--- a/src/app/diagnostics/events/storage.ts
+++ b/src/app/diagnostics/events/storage/failure.ts
@@ -1,7 +1,7 @@
import * as v from 'valibot'
-import { recordDiagnostic } from '../recorder'
-import type { DiagnosticEventInput } from '../types'
+import { recordDiagnostic } from '@/app/diagnostics/recorder'
+import type { DiagnosticEventInput } from '@/app/diagnostics/types'
const storageFailureSchema = v.object({
operation: v.picklist(['upload', 'download', 'delete', 'list']),
diff --git a/src/app/diagnostics/events/storage-operation.ts b/src/app/diagnostics/events/storage/operation.ts
similarity index 100%
rename from src/app/diagnostics/events/storage-operation.ts
rename to src/app/diagnostics/events/storage/operation.ts
diff --git a/src/app/diagnostics/events/transport-index.ts b/src/app/diagnostics/events/transport-index.ts
deleted file mode 100644
index f397d1f4b..000000000
--- a/src/app/diagnostics/events/transport-index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { recordACPTransportFailure, recordMCPConnectionFailure } from './transport'
diff --git a/src/app/document/io/create.ts b/src/app/document/io/create.ts
index 114079878..d4fd3f510 100644
--- a/src/app/document/io/create.ts
+++ b/src/app/document/io/create.ts
@@ -4,9 +4,12 @@ import { prefetchFigmaSchema } from '@open-pencil/core/kiwi'
import { createDocumentViewportActions, downloadBlob } from '@/app/document/io/browser'
import { createDOMOpenActions } from '@/app/document/io/dom'
import { createOpenActions, createReloadActions } from '@/app/document/io/read'
-import { createDocumentSourceActions, createDocumentSourceState } from '@/app/document/io/source'
+import {
+ createDocumentSourceActions,
+ createDocumentSourceState
+} from '@/app/document/io/source/actions'
import type { ViewportSize } from '@/app/document/io/types'
-import { createFileWatcher } from '@/app/document/io/watch'
+import { createFileWatcher } from '@/app/document/io/watch/watcher'
import type { EditorPreparationController } from '@/app/editor/preparation/controller'
type DocumentIOState = EditorState & {
diff --git a/src/app/document/io/save.ts b/src/app/document/io/save/actions.ts
similarity index 99%
rename from src/app/document/io/save.ts
rename to src/app/document/io/save/actions.ts
index e0030d96f..0d669c6ce 100644
--- a/src/app/document/io/save.ts
+++ b/src/app/document/io/save/actions.ts
@@ -3,7 +3,7 @@ import { filesMessages } from '@open-pencil/vue'
import { downloadBlob } from '@/app/document/io/browser'
import { documentNameFromFigPath } from '@/app/document/io/names'
-import { chooseBrowserFigSaveHandle, chooseTauriFigSavePath } from '@/app/document/io/save-targets'
+import { chooseBrowserFigSaveHandle, chooseTauriFigSavePath } from '@/app/document/io/save/targets'
import type { DocumentSourceAccess } from '@/app/document/io/types'
import { createDocumentWriter } from '@/app/document/io/write'
import { IS_TAURI } from '@/constants'
diff --git a/src/app/document/io/save-targets.ts b/src/app/document/io/save/targets.ts
similarity index 100%
rename from src/app/document/io/save-targets.ts
rename to src/app/document/io/save/targets.ts
diff --git a/src/app/document/io/source.ts b/src/app/document/io/source/actions.ts
similarity index 99%
rename from src/app/document/io/source.ts
rename to src/app/document/io/source/actions.ts
index 3a8f3da48..99bcd9eeb 100644
--- a/src/app/document/io/source.ts
+++ b/src/app/document/io/source/actions.ts
@@ -8,8 +8,8 @@ import {
downloadNameFromPath,
figDownloadName
} from '@/app/document/io/names'
-import { createSaveActions } from '@/app/document/io/save'
-import { createDocumentSourceState } from '@/app/document/io/source-state'
+import { createSaveActions } from '@/app/document/io/save/actions'
+import { createDocumentSourceState } from '@/app/document/io/source/state'
import type { DocumentSourceAccess } from '@/app/document/io/types'
import { createDocumentRecovery } from '@/app/document/recovery'
import { recoveryEnabled } from '@/app/document/recovery/preferences'
diff --git a/src/app/document/io/source-state.ts b/src/app/document/io/source/state.ts
similarity index 100%
rename from src/app/document/io/source-state.ts
rename to src/app/document/io/source/state.ts
diff --git a/src/app/document/io/watch-targets.ts b/src/app/document/io/watch/targets.ts
similarity index 100%
rename from src/app/document/io/watch-targets.ts
rename to src/app/document/io/watch/targets.ts
diff --git a/src/app/document/io/watch.ts b/src/app/document/io/watch/watcher.ts
similarity index 98%
rename from src/app/document/io/watch.ts
rename to src/app/document/io/watch/watcher.ts
index e0cad25ea..477c7b254 100644
--- a/src/app/document/io/watch.ts
+++ b/src/app/document/io/watch/watcher.ts
@@ -1,4 +1,4 @@
-import { watchBrowserFile, watchTauriFile } from '@/app/document/io/watch-targets'
+import { watchBrowserFile, watchTauriFile } from '@/app/document/io/watch/targets'
import { IS_TAURI } from '@/constants'
type FileWatchOptions = {
diff --git a/src/app/editor/canvas/menu/actions.ts b/src/app/editor/canvas/menu/actions.ts
index 23b1ebc40..3bbbb8766 100644
--- a/src/app/editor/canvas/menu/actions.ts
+++ b/src/app/editor/canvas/menu/actions.ts
@@ -3,7 +3,7 @@ import type { Ref } from 'vue'
import { nodeToXPath } from '@open-pencil/core/xpath'
import type { EditorStore } from '@/app/editor/active-store'
-import { pasteClipboardToReplace } from '@/app/editor/clipboard/paste-to-replace'
+import { pasteClipboardToReplace } from '@/app/editor/clipboard/paste/replace'
import { executeClipboardCommand } from '@/app/editor/clipboard/system'
import { createTextClipboard } from '@/app/editor/clipboard/text'
import { canVectorizeImageNode, vectorizeImageNode } from '@/app/editor/vectorize'
diff --git a/src/app/editor/clipboard/paste.ts b/src/app/editor/clipboard/paste/content.ts
similarity index 95%
rename from src/app/editor/clipboard/paste.ts
rename to src/app/editor/clipboard/paste/content.ts
index 5738044c0..5d7d3493b 100644
--- a/src/app/editor/clipboard/paste.ts
+++ b/src/app/editor/clipboard/paste/content.ts
@@ -2,7 +2,7 @@ import type { Editor } from '@open-pencil/core/editor'
import { isSVGMarkup } from '@open-pencil/core/io'
import type { Vector } from '@open-pencil/scene-graph/primitives'
-import { matchingClipboardSnapshot } from './memory'
+import { matchingClipboardSnapshot } from '../memory'
export async function pasteClipboardHTML(
editor: Editor,
diff --git a/src/app/editor/clipboard/paste-to-replace.ts b/src/app/editor/clipboard/paste/replace.ts
similarity index 99%
rename from src/app/editor/clipboard/paste-to-replace.ts
rename to src/app/editor/clipboard/paste/replace.ts
index 7e2730080..a8dc0f48a 100644
--- a/src/app/editor/clipboard/paste-to-replace.ts
+++ b/src/app/editor/clipboard/paste/replace.ts
@@ -1,7 +1,7 @@
import type { EditorStore } from '@/app/editor/active-store'
import { isDesignClipboardHTML } from '@/app/editor/clipboard/html'
import { getInMemoryClipboardHTML } from '@/app/editor/clipboard/memory'
-import { pasteClipboardHTML } from '@/app/editor/clipboard/paste'
+import { pasteClipboardHTML } from '@/app/editor/clipboard/paste/content'
import { notificationMessages } from '@/app/i18n/notifications'
import { toast } from '@/app/shell/ui'
import { readTauriClipboardText } from '@/app/tauri/clipboard'
diff --git a/src/app/editor/clipboard/system/browser.ts b/src/app/editor/clipboard/system/browser.ts
index ee97aad45..02d955eb4 100644
--- a/src/app/editor/clipboard/system/browser.ts
+++ b/src/app/editor/clipboard/system/browser.ts
@@ -9,7 +9,7 @@ import {
getInMemoryClipboardHTML,
setInMemoryClipboardPayload
} from '@/app/editor/clipboard/memory'
-import { pasteClipboardHTML, pasteSVGText } from '@/app/editor/clipboard/paste'
+import { pasteClipboardHTML, pasteSVGText } from '@/app/editor/clipboard/paste/content'
import type {
BrowserClipboardIO,
BrowserClipboardReadResult,
diff --git a/src/app/editor/clipboard/system/tauri.ts b/src/app/editor/clipboard/system/tauri.ts
index e7edcaf98..bb6d3515b 100644
--- a/src/app/editor/clipboard/system/tauri.ts
+++ b/src/app/editor/clipboard/system/tauri.ts
@@ -7,7 +7,7 @@ import {
getInMemoryClipboardHTML,
setInMemoryClipboardPayload
} from '@/app/editor/clipboard/memory'
-import { pasteClipboardHTML, pasteSVGText } from '@/app/editor/clipboard/paste'
+import { pasteClipboardHTML, pasteSVGText } from '@/app/editor/clipboard/paste/content'
import type { SystemClipboard } from '@/app/editor/clipboard/system/types'
import {
readTauriClipboardText,
diff --git a/src/app/editor/mobile-clipboard/index.ts b/src/app/editor/mobile-clipboard/index.ts
index e4f9f177c..82792ff32 100644
--- a/src/app/editor/mobile-clipboard/index.ts
+++ b/src/app/editor/mobile-clipboard/index.ts
@@ -4,7 +4,7 @@ import {
getInMemoryClipboardHTML,
setInMemoryClipboardPayload
} from '@/app/editor/clipboard/memory'
-import { pasteClipboardHTML } from '@/app/editor/clipboard/paste'
+import { pasteClipboardHTML } from '@/app/editor/clipboard/paste/content'
/** Explicit in-app mobile clipboard; shares the same typed capture and paste dispatch. */
export function createMobileClipboardActions(editor: Editor) {
diff --git a/src/app/shell/keyboard/clipboard.ts b/src/app/shell/keyboard/clipboard.ts
index 494fe96b7..f1c622145 100644
--- a/src/app/shell/keyboard/clipboard.ts
+++ b/src/app/shell/keyboard/clipboard.ts
@@ -6,7 +6,7 @@ import { extractImageFilesFromClipboard } from '@open-pencil/vue'
import type { EditorStore } from '@/app/editor/active-store'
import { isDesignClipboardHTML } from '@/app/editor/clipboard/html'
import { getInMemoryClipboardHTML } from '@/app/editor/clipboard/memory'
-import { pasteClipboardHTML, pastePoint, pasteSVGText } from '@/app/editor/clipboard/paste'
+import { pasteClipboardHTML, pastePoint, pasteSVGText } from '@/app/editor/clipboard/paste/content'
import { browserSystemClipboard } from '@/app/editor/clipboard/system/browser'
import { tauriSystemClipboard } from '@/app/editor/clipboard/system/tauri'
import type { SystemClipboard } from '@/app/editor/clipboard/system/types'
diff --git a/src/app/shell/menu/actions/selection.ts b/src/app/shell/menu/actions/selection.ts
index 03799548a..1d7529b74 100644
--- a/src/app/shell/menu/actions/selection.ts
+++ b/src/app/shell/menu/actions/selection.ts
@@ -1,5 +1,5 @@
import type { EditorStore } from '@/app/editor/active-store'
-import { pasteClipboardToReplace } from '@/app/editor/clipboard/paste-to-replace'
+import { pasteClipboardToReplace } from '@/app/editor/clipboard/paste/replace'
import { executeClipboardCommand } from '@/app/editor/clipboard/system'
import { requestRenameSelection } from '@/app/editor/selection/rename-dialog'
import { onCanvasSelection } from '@/app/shell/commands/focused'
diff --git a/src/components/presence/AvatarStack.vue b/src/components/presence/AvatarStack.vue
index 0472bb4aa..c7aeec525 100644
--- a/src/components/presence/AvatarStack.vue
+++ b/src/components/presence/AvatarStack.vue
@@ -3,7 +3,7 @@ import { computed } from 'vue'
import { useCommonMessages } from '@open-pencil/vue'
-import { avatarStack } from '@/theme/collaboration/avatar-stack'
+import { avatarStack } from '@/theme/collaboration/avatar/stack'
import PersonAvatar from './PersonAvatar.vue'
import type { PresencePersonRow } from './rows'
diff --git a/src/components/presence/PersonAvatar.vue b/src/components/presence/PersonAvatar.vue
index 20ec0197e..efe4a9b63 100644
--- a/src/components/presence/PersonAvatar.vue
+++ b/src/components/presence/PersonAvatar.vue
@@ -6,8 +6,8 @@ import type { Color } from '@open-pencil/scene-graph/primitives'
import { useCollaborationMessages } from '@open-pencil/vue'
import { initials } from '@/app/presence/initials'
-import { avatar } from '@/theme/collaboration/avatar'
-import { avatarStack } from '@/theme/collaboration/avatar-stack'
+import { avatar } from '@/theme/collaboration/avatar/person'
+import { avatarStack } from '@/theme/collaboration/avatar/stack'
import type { PresenceVoice } from './rows'
diff --git a/src/components/presence/PresenceList.vue b/src/components/presence/PresenceList.vue
index 0b42cc068..65f664904 100644
--- a/src/components/presence/PresenceList.vue
+++ b/src/components/presence/PresenceList.vue
@@ -5,7 +5,7 @@ import { useI18n, useInlineRename } from '@open-pencil/vue'
import { initials } from '@/app/presence/initials'
import type { FollowTarget } from '@/app/presence/types'
import IconButton from '@/components/ui/button/IconButton.vue'
-import { avatar } from '@/theme/collaboration/avatar'
+import { avatar } from '@/theme/collaboration/avatar/person'
import { presenceList } from '@/theme/collaboration/presence-list'
import { isFollowing, type PresenceAgentRow, type PresencePersonRow } from './rows'
diff --git a/src/components/properties/component-properties/slot/SlotPropertyRow.vue b/src/components/properties/component-properties/slot/SlotPropertyRow.vue
index 0a9557784..731a77e12 100644
--- a/src/components/properties/component-properties/slot/SlotPropertyRow.vue
+++ b/src/components/properties/component-properties/slot/SlotPropertyRow.vue
@@ -14,7 +14,7 @@ import IconButton from '@/components/ui/button/IconButton.vue'
import { menuItem, useMenuUI } from '@/components/ui/menu/menu'
import MenuScrollArea from '@/components/ui/menu/MenuScrollArea.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
-import { panelFieldBase } from '@/theme/panel/field'
+import { panelFieldBase } from '@/theme/panel/field/base'
import AddInstancesPopover from './AddInstancesPopover.vue'
import SlotLimitsPopover from './SlotLimitsPopover.vue'
diff --git a/src/components/ui/input/InputGroup.vue b/src/components/ui/input/InputGroup.vue
index 4a4721e68..0e0bf2a71 100644
--- a/src/components/ui/input/InputGroup.vue
+++ b/src/components/ui/input/InputGroup.vue
@@ -3,7 +3,7 @@ import { tv, type VariantProps } from 'tailwind-variants'
import { computed } from 'vue'
import type { ComponentUI } from '@/components/ui/types'
-import theme from '@/theme/input/input-group'
+import theme from '@/theme/input/group'
const inputGroup = tv(theme)
type InputGroupVariants = VariantProps<typeof inputGroup>
diff --git a/src/components/ui/panel/PanelFieldGroup.vue b/src/components/ui/panel/PanelFieldGroup.vue
index 80a6890dc..bee201c4b 100644
--- a/src/components/ui/panel/PanelFieldGroup.vue
+++ b/src/components/ui/panel/PanelFieldGroup.vue
@@ -3,7 +3,7 @@ import type { ClassValue } from 'tailwind-variants'
import type { VNode } from 'vue'
import type { ComponentUI } from '@/components/ui/types'
-import type { PanelFieldGroupTheme } from '@/theme/panel/field-group'
+import type { PanelFieldGroupTheme } from '@/theme/panel/field/group'
export interface PanelFieldGroupProps {
label?: string
@@ -20,7 +20,7 @@ export interface PanelFieldGroupSlots {
<script setup lang="ts">
import { tv } from 'tailwind-variants'
-import theme from '@/theme/panel/field-group'
+import theme from '@/theme/panel/field/group'
const { label, for: labelFor, class: className, ui } = defineProps<PanelFieldGroupProps>()
defineSlots<PanelFieldGroupSlots>()
diff --git a/src/theme/collaboration/avatar.ts b/src/theme/collaboration/avatar/person.ts
similarity index 100%
rename from src/theme/collaboration/avatar.ts
rename to src/theme/collaboration/avatar/person.ts
diff --git a/src/theme/collaboration/avatar-stack.ts b/src/theme/collaboration/avatar/stack.ts
similarity index 100%
rename from src/theme/collaboration/avatar-stack.ts
rename to src/theme/collaboration/avatar/stack.ts
diff --git a/src/theme/input/input-group.ts b/src/theme/input/group.ts
similarity index 100%
rename from src/theme/input/input-group.ts
rename to src/theme/input/group.ts
diff --git a/src/theme/input/input.ts b/src/theme/input/input.ts
index 67c5dbe83..ad1a7e6bd 100644
--- a/src/theme/input/input.ts
+++ b/src/theme/input/input.ts
@@ -1,4 +1,4 @@
-import { panelFieldBase, panelFieldState } from '../panel/field'
+import { panelFieldBase, panelFieldState } from '../panel/field/base'
const defaultInputBase =
'min-w-0 rounded-md border border-border bg-input text-surface outline-none hover:border-muted/60 focus:border-panel-focus focus:ring-1 focus:ring-accent/25 disabled:cursor-not-allowed disabled:opacity-60'
diff --git a/src/theme/input/number-field.ts b/src/theme/input/number-field.ts
index b26807aa9..0fdfff9e7 100644
--- a/src/theme/input/number-field.ts
+++ b/src/theme/input/number-field.ts
@@ -1,4 +1,4 @@
-import { panelFieldBase } from '../panel/field'
+import { panelFieldBase } from '../panel/field/base'
const numberFieldTheme = {
slots: {
diff --git a/src/theme/panel/field.ts b/src/theme/panel/field/base.ts
similarity index 100%
rename from src/theme/panel/field.ts
rename to src/theme/panel/field/base.ts
diff --git a/src/theme/panel/field-group.ts b/src/theme/panel/field/group.ts
similarity index 100%
rename from src/theme/panel/field-group.ts
rename to src/theme/panel/field/group.ts
diff --git a/src/theme/select/combobox.ts b/src/theme/select/combobox.ts
index a6b456c46..75785e702 100644
--- a/src/theme/select/combobox.ts
+++ b/src/theme/select/combobox.ts
@@ -1,6 +1,6 @@
import { motionStyles } from '../motion/styles'
import { floatingSurface } from '../overlay'
-import { panelFieldBase } from '../panel/field'
+import { panelFieldBase } from '../panel/field/base'
const appComboboxTheme = {
slots: {
diff --git a/src/theme/select/picker.ts b/src/theme/select/picker.ts
index 7c6ece01c..118c1308e 100644
--- a/src/theme/select/picker.ts
+++ b/src/theme/select/picker.ts
@@ -1,6 +1,6 @@
import { motionStyles } from '../motion/styles'
import { floatingSurface } from '../overlay'
-import { panelFieldBase } from '../panel/field'
+import { panelFieldBase } from '../panel/field/base'
/** Choices per row in the grid layout; keyboard navigation moves this many for a row. */
export const APP_PICKER_GRID_COLUMNS = 8
diff --git a/src/theme/select/select.ts b/src/theme/select/select.ts
index 30e7a9287..093d42092 100644
--- a/src/theme/select/select.ts
+++ b/src/theme/select/select.ts
@@ -1,6 +1,6 @@
import { motionStyles } from '../motion/styles'
import { floatingSurface } from '../overlay'
-import { panelFieldBase } from '../panel/field'
+import { panelFieldBase } from '../panel/field/base'
/**
* Every select list shares one row anatomy: a fixed check gutter, so labels never shift between
diff --git a/tests/e2e/canvas/shape-handles/handles.spec.ts b/tests/e2e/canvas/shape-handles/drag.spec.ts
similarity index 100%
rename from tests/e2e/canvas/shape-handles/handles.spec.ts
rename to tests/e2e/canvas/shape-handles/drag.spec.ts
diff --git a/tests/e2e/canvas/shape-handles/handles-visual.spec.ts b/tests/e2e/canvas/shape-handles/visual.spec.ts
similarity index 100%
rename from tests/e2e/canvas/shape-handles/handles-visual.spec.ts
rename to tests/e2e/canvas/shape-handles/visual.spec.ts
diff --git a/tests/e2e/canvas/shape-handles/handles-visual.spec.ts-snapshots/differing-openpencil-darwin.png b/tests/e2e/canvas/shape-handles/visual.spec.ts-snapshots/differing-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/canvas/shape-handles/handles-visual.spec.ts-snapshots/differing-openpencil-darwin.png
rename to tests/e2e/canvas/shape-handles/visual.spec.ts-snapshots/differing-openpencil-darwin.png
diff --git a/tests/e2e/canvas/shape-handles/handles-visual.spec.ts-snapshots/equal-openpencil-darwin.png b/tests/e2e/canvas/shape-handles/visual.spec.ts-snapshots/equal-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/canvas/shape-handles/handles-visual.spec.ts-snapshots/equal-openpencil-darwin.png
rename to tests/e2e/canvas/shape-handles/visual.spec.ts-snapshots/equal-openpencil-darwin.png
diff --git a/tests/e2e/canvas/shape-handles/handles-visual.spec.ts-snapshots/star-openpencil-darwin.png b/tests/e2e/canvas/shape-handles/visual.spec.ts-snapshots/star-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/canvas/shape-handles/handles-visual.spec.ts-snapshots/star-openpencil-darwin.png
rename to tests/e2e/canvas/shape-handles/visual.spec.ts-snapshots/star-openpencil-darwin.png
diff --git a/tests/e2e/collab/agents.spec.ts b/tests/e2e/collab/agents.spec.ts
index ca19ee412..862819f60 100644
--- a/tests/e2e/collab/agents.spec.ts
+++ b/tests/e2e/collab/agents.spec.ts
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test'
-import { startAgent } from '#tests/helpers/collab/agent'
+import { startAgent } from '#tests/helpers/collab/agent/page'
import {
collaborationErrors,
connect,
diff --git a/tests/e2e/properties/panel.spec.ts b/tests/e2e/properties/panel/controls.spec.ts
similarity index 100%
rename from tests/e2e/properties/panel.spec.ts
rename to tests/e2e/properties/panel/controls.spec.ts
diff --git a/tests/e2e/properties/panel-hierarchy.spec.ts b/tests/e2e/properties/panel/hierarchy.spec.ts
similarity index 100%
rename from tests/e2e/properties/panel-hierarchy.spec.ts
rename to tests/e2e/properties/panel/hierarchy.spec.ts
diff --git a/tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/fill-missing-style-openpencil-darwin.png b/tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/fill-missing-style-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/fill-missing-style-openpencil-darwin.png
rename to tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/fill-missing-style-openpencil-darwin.png
diff --git a/tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/layout-frame-openpencil-darwin.png b/tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/layout-frame-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/layout-frame-openpencil-darwin.png
rename to tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/layout-frame-openpencil-darwin.png
diff --git a/tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/layout-rectangle-openpencil-darwin.png b/tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/layout-rectangle-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/layout-rectangle-openpencil-darwin.png
rename to tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/layout-rectangle-openpencil-darwin.png
diff --git a/tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/layout-text-openpencil-darwin.png b/tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/layout-text-openpencil-darwin.png
similarity index 100%
rename from tests/e2e/properties/panel-hierarchy.spec.ts-snapshots/layout-text-openpencil-darwin.png
rename to tests/e2e/properties/panel/hierarchy.spec.ts-snapshots/layout-text-openpencil-darwin.png
diff --git a/tests/e2e/settings/mcp-failure.spec.ts b/tests/e2e/settings/mcp/failure.spec.ts
similarity index 100%
rename from tests/e2e/settings/mcp-failure.spec.ts
rename to tests/e2e/settings/mcp/failure.spec.ts
diff --git a/tests/e2e/settings/mcp.spec.ts b/tests/e2e/settings/mcp/forms.spec.ts
similarity index 100%
rename from tests/e2e/settings/mcp.spec.ts
rename to tests/e2e/settings/mcp/forms.spec.ts
diff --git a/tests/engine/app/ai/model.test.ts b/tests/engine/app/ai/model/providers.test.ts
similarity index 100%
rename from tests/engine/app/ai/model.test.ts
rename to tests/engine/app/ai/model/providers.test.ts
diff --git a/tests/engine/app/ai/model-roles.test.ts b/tests/engine/app/ai/model/roles.test.ts
similarity index 100%
rename from tests/engine/app/ai/model-roles.test.ts
rename to tests/engine/app/ai/model/roles.test.ts
diff --git a/tests/engine/app/ai/model-settings.test.ts b/tests/engine/app/ai/model/settings.test.ts
similarity index 100%
rename from tests/engine/app/ai/model-settings.test.ts
rename to tests/engine/app/ai/model/settings.test.ts
diff --git a/tests/engine/app/clipboard/memory.test.ts b/tests/engine/app/clipboard/memory.test.ts
index 724f580f3..e02d1e9f6 100644
--- a/tests/engine/app/clipboard/memory.test.ts
+++ b/tests/engine/app/clipboard/memory.test.ts
@@ -10,7 +10,7 @@ import {
setInMemoryClipboardHTML,
setInMemoryClipboardPayload
} from '@/app/editor/clipboard/memory'
-import { pasteClipboardToReplace } from '@/app/editor/clipboard/paste-to-replace'
+import { pasteClipboardToReplace } from '@/app/editor/clipboard/paste/replace'
import { executeClipboardCommand, type SystemClipboard } from '@/app/editor/clipboard/system'
import { createBrowserSystemClipboard } from '@/app/editor/clipboard/system/browser'
import type { BrowserClipboardIO, ClipboardPayload } from '@/app/editor/clipboard/system/types'
diff --git a/tests/engine/app/document/io/source-identity.test.ts b/tests/engine/app/document/io/source-identity.test.ts
index c060a32a2..2b59f5fdd 100644
--- a/tests/engine/app/document/io/source-identity.test.ts
+++ b/tests/engine/app/document/io/source-identity.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test, vi } from 'bun:test'
import { createDefaultEditorState } from '@open-pencil/core/editor'
-import { createSaveActions } from '@/app/document/io/save'
-import { createDocumentSourceState } from '@/app/document/io/source-state'
+import { createSaveActions } from '@/app/document/io/save/actions'
+import { createDocumentSourceState } from '@/app/document/io/source/state'
import { asDouble } from '#tests/helpers/doubles'
diff --git a/tests/engine/figma/api/grouping-compat.test.ts b/tests/engine/figma/api/grouping/compat.test.ts
similarity index 99%
rename from tests/engine/figma/api/grouping-compat.test.ts
rename to tests/engine/figma/api/grouping/compat.test.ts
index cd9605fe7..9ff667fa4 100644
--- a/tests/engine/figma/api/grouping-compat.test.ts
+++ b/tests/engine/figma/api/grouping/compat.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { asPageNode, createAPI } from './helpers'
+import { asPageNode, createAPI } from '../helpers'
describe('FigmaAPI grouping compatibility', () => {
test('group accepts parent and index and returns a group node', () => {
diff --git a/tests/engine/figma/api/grouping.test.ts b/tests/engine/figma/api/grouping/group.test.ts
similarity index 95%
rename from tests/engine/figma/api/grouping.test.ts
rename to tests/engine/figma/api/grouping/group.test.ts
index 919436e9a..d1019736f 100644
--- a/tests/engine/figma/api/grouping.test.ts
+++ b/tests/engine/figma/api/grouping/group.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#tests/helpers/assert'
-import { createAPI } from './helpers'
+import { createAPI } from '../helpers'
describe('grouping', () => {
test('group creates GROUP with children', () => {
diff --git a/tests/engine/mcp/webmcp.test.ts b/tests/engine/mcp/webmcp/registration.test.ts
similarity index 100%
rename from tests/engine/mcp/webmcp.test.ts
rename to tests/engine/mcp/webmcp/registration.test.ts
diff --git a/tests/engine/mcp/webmcp-settings.test.ts b/tests/engine/mcp/webmcp/settings.test.ts
similarity index 100%
rename from tests/engine/mcp/webmcp-settings.test.ts
rename to tests/engine/mcp/webmcp/settings.test.ts
diff --git a/tests/engine/render/canvas/text-font-variations.test.ts b/tests/engine/render/canvas/text/font-variations.test.ts
similarity index 100%
rename from tests/engine/render/canvas/text-font-variations.test.ts
rename to tests/engine/render/canvas/text/font-variations.test.ts
diff --git a/tests/engine/render/canvas/text-preparation-cache.test.ts b/tests/engine/render/canvas/text/preparation-cache.test.ts
similarity index 100%
rename from tests/engine/render/canvas/text-preparation-cache.test.ts
rename to tests/engine/render/canvas/text/preparation-cache.test.ts
diff --git a/tests/engine/render/canvas/text.test.ts b/tests/engine/render/canvas/text/render.test.ts
similarity index 99%
rename from tests/engine/render/canvas/text.test.ts
rename to tests/engine/render/canvas/text/render.test.ts
index c391a6fd1..5a0c504b9 100644
--- a/tests/engine/render/canvas/text.test.ts
+++ b/tests/engine/render/canvas/text/render.test.ts
@@ -28,7 +28,7 @@ import { fontFaceDemand, fontResolver, missingGlyphCharacters } from '#core/text
import { expectDefined } from '#tests/helpers/assert'
import { repoPath } from '#tests/helpers/paths'
-import { asDouble, expectRgbaPixels } from './helpers'
+import { asDouble, expectRgbaPixels } from '../helpers'
function createMockCanvas() {
return {
diff --git a/tests/engine/render/canvas/visual/boolean.test.ts b/tests/engine/render/canvas/visual/boolean-matrix.test.ts
similarity index 100%
rename from tests/engine/render/canvas/visual/boolean.test.ts
rename to tests/engine/render/canvas/visual/boolean-matrix.test.ts
diff --git a/tests/engine/tauri/document-io.test.ts b/tests/engine/tauri/document-io.test.ts
index 230fb9829..5574559c3 100644
--- a/tests/engine/tauri/document-io.test.ts
+++ b/tests/engine/tauri/document-io.test.ts
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
import { readReloadSource } from '@/app/document/io/reload-source'
-import { chooseTauriFigSavePath } from '@/app/document/io/save-targets'
+import { chooseTauriFigSavePath } from '@/app/document/io/save/targets'
import { createDocumentWriter } from '@/app/document/io/write'
import { clearTauriMocks, mockTauriIPC } from '#tests/helpers/tauri/mocks'
diff --git a/tests/engine/tauri/file-actions.test.ts b/tests/engine/tauri/file-actions.test.ts
index 0397fc0fc..4ef8dd431 100644
--- a/tests/engine/tauri/file-actions.test.ts
+++ b/tests/engine/tauri/file-actions.test.ts
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
import { saveExportedFile } from '@/app/document/export/files'
-import { watchTauriFile } from '@/app/document/io/watch-targets'
+import { watchTauriFile } from '@/app/document/io/watch/targets'
import { chooseTauriOpenPaths, readTauriDesignFile } from '@/app/shell/menu/files'
import { clearTauriMocks, mockTauriIPC } from '#tests/helpers/tauri/mocks'
diff --git a/tests/engine/text/rtl-auto-layout-input.test.ts b/tests/engine/text/rtl-auto-layout-input.test.ts
index 4be6a6ae6..66ac5e322 100644
--- a/tests/engine/text/rtl-auto-layout-input.test.ts
+++ b/tests/engine/text/rtl-auto-layout-input.test.ts
@@ -4,7 +4,7 @@ import { SceneGraph, computeLayout } from '@open-pencil/core'
import { createEditor } from '@open-pencil/core/editor'
import { computeAutoLayoutIndicatorForFrame } from '#vue/shared/input/auto-layout'
-import { handleMoveUp } from '#vue/shared/input/move'
+import { handleMoveUp } from '#vue/shared/input/move/drag'
import type { DragMove } from '#vue/shared/input/types'
function pageId(graph: SceneGraph) {
diff --git a/tests/engine/vue/input/move-threshold.test.ts b/tests/engine/vue/input/move-threshold.test.ts
index fee607e58..61387a6a3 100644
--- a/tests/engine/vue/input/move-threshold.test.ts
+++ b/tests/engine/vue/input/move-threshold.test.ts
@@ -2,7 +2,11 @@ import { describe, expect, test } from 'bun:test'
import { createEditor } from '@open-pencil/core/editor'
-import { handleMoveMove, handleMoveUp, MOVE_DRAG_START_THRESHOLD_PX } from '#vue/shared/input/move'
+import {
+ handleMoveMove,
+ handleMoveUp,
+ MOVE_DRAG_START_THRESHOLD_PX
+} from '#vue/shared/input/move/drag'
import { createSelectionMoveDrag } from '#vue/shared/input/select/move'
import type { DragMove } from '#vue/shared/input/types'
diff --git a/tests/helpers/collab/agent-browser.ts b/tests/helpers/collab/agent/browser.ts
similarity index 100%
rename from tests/helpers/collab/agent-browser.ts
rename to tests/helpers/collab/agent/browser.ts
diff --git a/tests/helpers/collab/agent.ts b/tests/helpers/collab/agent/page.ts
similarity index 78%
rename from tests/helpers/collab/agent.ts
rename to tests/helpers/collab/agent/page.ts
index c0a848cb7..a4fd6b0a1 100644
--- a/tests/helpers/collab/agent.ts
+++ b/tests/helpers/collab/agent/page.ts
@@ -1,12 +1,12 @@
import type { Page } from '@playwright/test'
-import type * as AgentFixture from './agent-browser'
+import type * as AgentFixture from './browser'
/** Start an agent in the peer's browser; returns its callsign and page. */
export function startAgent(page: Page, pageName: string, x: number, y: number) {
return page.evaluate(
async ({ pageName, x, y }) => {
- const fixturePath = '/tests/helpers/collab/agent-browser.ts'
+ const fixturePath = '/tests/helpers/collab/agent/browser.ts'
const fixture: typeof AgentFixture = await import(fixturePath)
return fixture.startTestAgent(pageName, x, y)
},
diff --git a/tools/checks/architecture/file-prefix-baseline.txt b/tools/checks/architecture/file-prefix-baseline.txt
deleted file mode 100644
index 9355b8707..000000000
--- a/tools/checks/architecture/file-prefix-baseline.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-# Folders that group files by a filename prefix next to a file of that name, from before
-# check:arch caught it. Move a group into its own folder, then delete its line here.
-packages/core/src/editor/history::snapshot
-packages/core/src/editor/structure::group
-packages/core/src/io/formats/design-tokens::plan
-packages/core/src/kiwi/fig/session::archive
-packages/core/src/tools::registry
-packages/core/tests/canvas/text::derived
-packages/core/tests/editor/graph::events
-packages/dom-css/src/runtime::headless
-packages/vue/src/shared/input::move
-packages/vue/src/shared/input::pan
-src/app/diagnostics/events::storage
-src/app/diagnostics/events::transport
-src/app/document/io::save
-src/app/document/io::source
-src/app/document/io::watch
-src/app/editor/clipboard::paste
-src/theme/collaboration::avatar
-src/theme/input::input
-src/theme/panel::field
-tests/app/libraries::update
-tests/e2e/canvas/shape-handles::handles
-tests/e2e/properties::panel
-tests/e2e/settings::mcp
-tests/engine/app/ai::model
-tests/engine/figma/api::grouping
-tests/engine/mcp::webmcp
-tests/engine/render/canvas/visual::boolean
-tests/engine/render/canvas::text
-tests/helpers/collab::agent
diff --git a/tools/checks/architecture/src/steiger-rules/index.ts b/tools/checks/architecture/src/steiger-rules/index.ts
index 6ac6c65b3..eb3acd6c7 100644
--- a/tools/checks/architecture/src/steiger-rules/index.ts
+++ b/tools/checks/architecture/src/steiger-rules/index.ts
@@ -16,10 +16,8 @@ import {
createImportRule,
createTextRule,
filePrefix,
- FILE_PREFIX_BASELINE_PATH,
FILE_PREFIX_GROUP_ALLOWLIST,
fileStem,
- readFilePrefixBaseline,
PACKAGE_ALIASES,
PACKAGE_ALIAS_OWNERS,
relativePath,
@@ -33,8 +31,6 @@ const preferDomainFoldersOverFilenamePrefixes: Rule = {
name: 'open-pencil/prefer-domain-folders-over-filename-prefixes',
check(root) {
const diagnostics: Diagnostic[] = []
- const baseline = readFilePrefixBaseline(root.path)
- const seen = new Set<string>()
for (const folder of collectFolders(root)) {
const folderRel = relativePath(root.path, folder.path)
const groups = new Map<string, string[]>()
@@ -51,25 +47,13 @@ const preferDomainFoldersOverFilenamePrefixes: Rule = {
for (const [prefix, files] of groups) {
// `email.ts` beside `email-runtime.ts` is a domain as much as three `email-*` files are.
if (files.length < 3 && !names.has(prefix)) continue
- const entry = `${folderRel}::${prefix}`
- if (FILE_PREFIX_GROUP_ALLOWLIST.has(entry)) continue
- if (baseline.has(entry)) {
- seen.add(entry)
- continue
- }
+ if (FILE_PREFIX_GROUP_ALLOWLIST.has(`${folderRel}::${prefix}`)) continue
diagnostics.push({
message: `Use a ${prefix}/ domain folder instead of sibling files named ${prefix} and ${prefix}-*.`,
location: { path: folder.path }
})
}
}
- for (const entry of baseline) {
- if (seen.has(entry)) continue
- diagnostics.push({
- message: `${entry} no longer groups files by prefix; remove it from ${FILE_PREFIX_BASELINE_PATH}.`,
- location: { path: path.join(root.path, FILE_PREFIX_BASELINE_PATH) }
- })
- }
return { diagnostics }
}
}
diff --git a/tools/checks/architecture/src/steiger-rules/support.ts b/tools/checks/architecture/src/steiger-rules/support.ts
index 0a2d10c7f..2435d0afa 100644
--- a/tools/checks/architecture/src/steiger-rules/support.ts
+++ b/tools/checks/architecture/src/steiger-rules/support.ts
@@ -203,19 +203,3 @@ export function filePrefix(filePath: string): string | null {
const match = /^([a-z][a-z0-9]+)-[a-z0-9-]+$/.exec(fileStem(filePath))
return match?.[1] ?? null
}
-
-/**
- * Prefix groups that existed before the rule counted a bare `prefix` file, as `folder::prefix`.
- * The list only shrinks: moving a group into its folder means deleting its line.
- */
-export const FILE_PREFIX_BASELINE_PATH = 'tools/checks/architecture/file-prefix-baseline.txt'
-
-export function readFilePrefixBaseline(rootPath: string): Set<string> {
- const text = readFileSync(path.join(rootPath, FILE_PREFIX_BASELINE_PATH), 'utf8')
- return new Set(
- text
- .split('\n')
- .map((line) => line.trim())
- .filter((line) => line && !line.startsWith('#'))
- )
-}
diff --git a/tools/checks/architecture/tests/file-prefixes.test.ts b/tools/checks/architecture/tests/file-prefixes.test.ts
index f18b42965..3c28e51a1 100644
--- a/tools/checks/architecture/tests/file-prefixes.test.ts
+++ b/tools/checks/architecture/tests/file-prefixes.test.ts
@@ -1,20 +1,15 @@
import { expect, test } from 'bun:test'
-import { mkdir, mkdtemp, writeFile } from 'node:fs/promises'
-import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { openPencilArchitecturePlugin } from '../src/steiger-rules/index'
-import { FILE_PREFIX_BASELINE_PATH } from '../src/steiger-rules/support'
const rule = openPencilArchitecturePlugin.ruleDefinitions.find(
(candidate) => candidate.name === 'open-pencil/prefer-domain-folders-over-filename-prefixes'
)
-async function check(files: string[], baseline: string[] = []) {
+function check(files: string[]) {
if (!rule) throw new Error('Missing file prefix rule')
- const root = await mkdtemp(join(tmpdir(), 'open-pencil-file-prefixes-'))
- await mkdir(join(root, 'tools/checks/architecture'), { recursive: true })
- await writeFile(join(root, FILE_PREFIX_BASELINE_PATH), baseline.join('\n'))
+ const root = '/repo'
const folder = join(root, 'src/runtime')
return rule.check({
type: 'folder',
@@ -29,17 +24,13 @@ async function check(files: string[], baseline: string[] = []) {
}).diagnostics.length
}
-test('asks for a folder when a file sits beside files named after it', async () => {
- expect(await check(['email.ts', 'email-runtime.ts'])).toBe(1)
- expect(await check(['auth-failure.ts', 'auth-navigation.ts', 'auth-session.ts'])).toBe(1)
+test('asks for a folder when a file sits beside files named after it', () => {
+ expect(check(['email.ts', 'email-runtime.ts'])).toBe(1)
+ expect(check(['email.test.ts', 'email-runtime.test.ts'])).toBe(1)
+ expect(check(['auth-failure.ts', 'auth-navigation.ts', 'auth-session.ts'])).toBe(1)
})
-test('accepts names that only share a word', async () => {
- expect(await check(['sign-in.ts', 'sign-out.ts'])).toBe(0)
- expect(await check(['email.ts', 'server.ts'])).toBe(0)
-})
-
-test('keeps grandfathered groups until they move, then asks to drop their line', async () => {
- expect(await check(['email.ts', 'email-runtime.ts'], ['src/runtime::email'])).toBe(0)
- expect(await check(['server.ts'], ['src/runtime::email'])).toBe(1)
+test('accepts names that only share a word', () => {
+ expect(check(['sign-in.ts', 'sign-out.ts'])).toBe(0)
+ expect(check(['email.ts', 'server.ts'])).toBe(0)
})
diff --git a/tools/checks/test-homes/engine-baseline.txt b/tools/checks/test-homes/engine-baseline.txt
index a998c3b4d..61b45f998 100644
--- a/tools/checks/test-homes/engine-baseline.txt
+++ b/tools/checks/test-homes/engine-baseline.txt
@@ -9,9 +9,9 @@ tests/engine/app/ai/catalog.test.ts
tests/engine/app/ai/context.test.ts
tests/engine/app/ai/failure.test.ts
tests/engine/app/ai/markdown.test.ts
-tests/engine/app/ai/model-roles.test.ts
-tests/engine/app/ai/model-settings.test.ts
-tests/engine/app/ai/model.test.ts
+tests/engine/app/ai/model/providers.test.ts
+tests/engine/app/ai/model/roles.test.ts
+tests/engine/app/ai/model/settings.test.ts
tests/engine/app/ai/profile-selection.test.ts
tests/engine/app/ai/vision.test.ts
tests/engine/app/automation/child-ready.test.ts
@@ -151,8 +151,8 @@ tests/engine/figma/api/expanded.test.ts
tests/engine/figma/api/find/all-with-criteria.test.ts
tests/engine/figma/api/flatten-renderer.test.ts
tests/engine/figma/api/frozen/arrays.test.ts
-tests/engine/figma/api/grouping-compat.test.ts
-tests/engine/figma/api/grouping.test.ts
+tests/engine/figma/api/grouping/compat.test.ts
+tests/engine/figma/api/grouping/group.test.ts
tests/engine/figma/api/images.test.ts
tests/engine/figma/api/internals/not-exposed.test.ts
tests/engine/figma/api/layout/plugin-compat.test.ts
@@ -325,8 +325,8 @@ tests/engine/mcp/stdio/reconnect.test.ts
tests/engine/mcp/test-support/discovery-isolation.test.ts
tests/engine/mcp/tools.test.ts
tests/engine/mcp/transport/paths.test.ts
-tests/engine/mcp/webmcp-settings.test.ts
-tests/engine/mcp/webmcp.test.ts
+tests/engine/mcp/webmcp/registration.test.ts
+tests/engine/mcp/webmcp/settings.test.ts
tests/engine/pen/file.test.ts
tests/engine/pen/layout.test.ts
tests/engine/pen/var-padding.test.ts
@@ -386,9 +386,9 @@ tests/engine/render/canvas/retained-backing-pixels.test.ts
tests/engine/render/canvas/retained-backing.test.ts
tests/engine/render/canvas/schema-fill-fallback.test.ts
tests/engine/render/canvas/surface-replacement.test.ts
-tests/engine/render/canvas/text-font-variations.test.ts
-tests/engine/render/canvas/text-preparation-cache.test.ts
-tests/engine/render/canvas/text.test.ts
+tests/engine/render/canvas/text/font-variations.test.ts
+tests/engine/render/canvas/text/preparation-cache.test.ts
+tests/engine/render/canvas/text/render.test.ts
tests/engine/render/canvas/tiles/cache.test.ts
tests/engine/render/canvas/tiles/geometry.test.ts
tests/engine/render/canvas/tiles/gold-preview.test.ts
@@ -396,7 +396,7 @@ tests/engine/render/canvas/tiles/planner.test.ts
tests/engine/render/canvas/tiles/render.test.ts
tests/engine/render/canvas/tiles/scheduler.test.ts
tests/engine/render/canvas/variable-modes.test.ts
-tests/engine/render/canvas/visual/boolean.test.ts
+tests/engine/render/canvas/visual/boolean-matrix.test.ts
tests/engine/render/jsx/component/properties.test.ts
tests/engine/render/jsx/component/property-references.test.ts
tests/engine/render/jsx/component/set-properties.test.ts