Skip to content

Commit

Permalink
Organize types
Browse files Browse the repository at this point in the history
  • Loading branch information
dabbott committed Jan 27, 2024
1 parent 17e36d9 commit 28e31ff
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/noya-compiler/src/__tests__/compile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
DesignSystemDefinition,
x,
} from '@noya-design-system/protocol';
import { DS } from 'noya-api';
import {
compile,
compileAsync,
Expand All @@ -16,6 +15,7 @@ import {
} from 'noya-compiler';
import {
createResolvedNode,
DS,
FindComponent,
Model,
renderResolvedNode,
Expand Down
2 changes: 1 addition & 1 deletion packages/noya-compiler/src/compileDesignSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
component,
transform,
} from '@noya-design-system/protocol';
import { DSConfig } from 'noya-api';
import {
DSConfig,
FindComponent,
NoyaComponent,
NoyaResolvedNode,
Expand Down
3 changes: 1 addition & 2 deletions packages/noya-compiler/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DesignSystemDefinition } from '@noya-design-system/protocol';
import { DS } from 'noya-api';
import { NoyaComponent } from 'noya-component';
import { DS, NoyaComponent } from 'noya-component';

export interface CompilerConfiguration {
name: string;
Expand Down
6 changes: 2 additions & 4 deletions packages/noya-component/src/componentGroups.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { defineTree } from 'tree-visit';
import { FlatGroupItem, Group, flattenGroups } from './groups';
import { NoyaComponent } from './types';

export type ComponentGroup = Group<NoyaComponent>;
import { FlatGroupItem, flattenGroups } from './groups';
import { ComponentGroup, NoyaComponent } from './types';

export const UNCATEGORIZED = 'uncategorized';

Expand Down
29 changes: 29 additions & 0 deletions packages/noya-component/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
import { ArrayDiffItem } from './arrayDiff';
import { Group } from './groups';

export type ComponentGroup = Group<NoyaComponent>;

export type DSConfig = {
colorMode?: 'light' | 'dark';
colors: {
primary: string;
};
};

export type DSSource = {
type: 'npm';
name: string;
version: string;
};

export type DS = {
source: DSSource;
config: DSConfig;
components?: NoyaComponent[];
groups?: ComponentGroup[];
latestBuildAssetId?: string;
prompt?: {
inputDescription?: string;
pickComponent?: string;
populateTemplate?: string;
};
};

export type NoyaString = {
id: string;
Expand Down

0 comments on commit 28e31ff

Please sign in to comment.