Skip to content

Commit

Permalink
Cleanup JSX Runtime imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joheredi committed Jan 23, 2025
1 parent 0924029 commit 1723769
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/binder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { memo, untrack } from "@alloy-js/core/jsx-runtime";
import {
computed,
effect,
Expand All @@ -10,6 +9,7 @@ import {
} from "@vue/reactivity";
import { useMemberScope } from "./context/member-scope.js";
import { useScope } from "./context/scope.js";
import { memo, untrack } from "./jsx-runtime.js";
import { refkey, Refkey } from "./refkey.js";
export type Metadata = object;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Declaration.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import { OutputSymbol } from "../binder.js";
import { useContext } from "../context.js";
import { BinderContext } from "../context/binder.js";
import { DeclarationContext } from "../context/declaration.js";
import { Children } from "../jsx-runtime.js";
import { Refkey, refkey } from "../refkey.js";

export interface DeclarationProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Indent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import { useContext } from "../context.js";
import { IndentContext } from "../context/indent.js";
import { Children } from "../jsx-runtime.js";

export interface IndentProps {
children?: Children;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/MemberDeclaration.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import { OutputSymbol, OutputSymbolFlags } from "../binder.js";
import { useContext } from "../context.js";
import { BinderContext } from "../context/binder.js";
import { MemberDeclarationContext } from "../context/member-declaration.js";
import { Children } from "../jsx-runtime.js";
import { Refkey, refkey } from "../refkey.js";

export interface MemberDeclarationProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/MemberScope.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import { OutputSymbol } from "../binder.js";
import { Children } from "../jsx-runtime.js";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { OutputSymbolFlags } from "../binder.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Output.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import {
createOutputBinder,
getSymbolCreator,
SymbolCreator,
} from "../binder.js";
import { BinderContext } from "../context/binder.js";
import { NamePolicyContext } from "../context/name-policy.js";
import { Children } from "../jsx-runtime.js";
import { NamePolicy } from "../name-policy.js";
import { SourceDirectory } from "./SourceDirectory.js";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Scope.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import { OutputScope } from "../binder.js";
import { useContext } from "../context.js";
import { BinderContext } from "../context/binder.js";
import { ScopeContext } from "../context/scope.js";
import { Children } from "../jsx-runtime.js";

export interface ScopeProps {
kind?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/SourceDirectory.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Children, getContext } from "@alloy-js/core/jsx-runtime";
import { shallowReactive } from "@vue/reactivity";
import { join } from "pathe";
import { useContext } from "../context.js";
import { SourceDirectoryContext } from "../context/source-directory.js";
import { Children, getContext } from "../jsx-runtime.js";

export interface SourceDirectoryProps {
path: string;
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/components/SourceFile.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import {
Children,
ComponentDefinition,
getContext,
} from "@alloy-js/core/jsx-runtime";
import { join } from "pathe";
import { useContext } from "../context.js";
import { IndentContext } from "../context/indent.js";
import { SourceDirectoryContext } from "../context/source-directory.js";
import { SourceFileContext } from "../context/source-file.js";
import { Children, ComponentDefinition, getContext } from "../jsx-runtime.js";
import { Refkey } from "../refkey.js";

export interface SourceFileProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { shallowRef } from "@vue/reactivity";
import {
Children,
ComponentDefinition,
effect,
getContext,
untrack,
} from "@alloy-js/core/jsx-runtime";
import { shallowRef } from "@vue/reactivity";
} from "./jsx-runtime.js";

export interface ComponentContext<T> {
id: symbol;
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "@alloy-js/core/jsx-runtime";
export {
computed,
isProxy,
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/render.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { isRef } from "@vue/reactivity";
import { Indent, IndentState } from "./components/Indent.js";
import { useContext } from "./context.js";
import { IndentContext } from "./context/indent.js";
import { SourceFileContext } from "./context/source-file.js";
import {
Child,
Children,
Expand All @@ -10,12 +15,7 @@ import {
pushStack,
root,
untrack,
} from "@alloy-js/core/jsx-runtime";
import { isRef } from "@vue/reactivity";
import { Indent, IndentState } from "./components/Indent.js";
import { useContext } from "./context.js";
import { IndentContext } from "./context/indent.js";
import { SourceFileContext } from "./context/source-file.js";
} from "./jsx-runtime.js";
import { isRefkey } from "./refkey.js";

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { mkdirSync, statSync, writeFileSync } from "node:fs";
import { relative, resolve } from "pathe";
import { code } from "./code.js";
import {
Child,
Children,
ComponentCreator,
ComponentDefinition,
isComponentCreator,
memo,
} from "@alloy-js/core/jsx-runtime";
import { mkdirSync, statSync, writeFileSync } from "node:fs";
import { relative, resolve } from "pathe";
import { code } from "./code.js";
} from "./jsx-runtime.js";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { OutputDirectory, OutputFile, render } from "./render.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/rendering/basic.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Children } from "@alloy-js/core/jsx-runtime";
import { describe, expect, it } from "vitest";
import { Children } from "../../src/jsx-runtime.js";
import "../../testing/extend-expect.js";
describe("string nodes", () => {
it("renders string nodes", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/testing/render.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RenderTextTree, renderTree } from "@alloy-js/core";
import { Children } from "@alloy-js/core/jsx-runtime";
import { Children } from "../src/jsx-runtime.js";

export function printTree(tree: RenderTextTree) {
return (tree as any).flat(Infinity).join("");
Expand Down

0 comments on commit 1723769

Please sign in to comment.