Skip to content

Commit

Permalink
refactor(compiler): reorganize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Jan 18, 2025
1 parent f0ce8fb commit 69a49a3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions packages/compiler/src/codegen/generateContracts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type * as aeria from 'aeria'
import type * as AST from '../ast.js'
import { errorSchema, type Property, resultSchema } from 'aeria'
import type * as AST from '../ast'
import { getProperties, propertyToSchema, stringify, UnquotedSymbol, type StringifyProperty } from './utils'
import type aeria from 'aeria'
import { getProperties, propertyToSchema, stringify, UnquotedSymbol, type StringifyProperty } from './utils.js'

export const generateContracts = (ast: AST.Node[]) => {
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler/src/codegen/generateExports.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as AST from '../ast'
import { resizeFirstChar, getExtendName, getCollectionId } from './utils'
import type * as AST from '../ast.js'
import { resizeFirstChar, getExtendName, getCollectionId } from './utils.js'

type SymbolToExport = {
id: string
Expand Down
11 changes: 5 additions & 6 deletions packages/compiler/src/codegen/generateJSCollections.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type Collection, type Property } from 'aeria'
import type * as AST from '../ast'
import { makeASTImports, getProperties, stringify, aeriaPackageName, getExtendName, getCollectionId, type StringifyProperty, UnquotedSymbol } from './utils'
import type aeria from 'aeria'
import type * as aeria from 'aeria'
import type * as AST from '../ast.js'
import { makeASTImports, getProperties, stringify, aeriaPackageName, getExtendName, getCollectionId, type StringifyProperty, UnquotedSymbol } from './utils.js'

const initialImportedFunctions = [
'extendCollection',
Expand Down Expand Up @@ -45,10 +44,10 @@ const makeJSCollections = (ast: AST.Node[], modifiedSymbols: Record<string, stri
}

const makeJSCollectionSchema = (collectionNode: AST.CollectionNode, collectionId: string) => {
const collectionSchema: Omit<Collection, 'item' | 'functions'> & { functions?: StringifyProperty } = {
const collectionSchema: Omit<aeria.Collection, 'item' | 'functions'> & { functions?: StringifyProperty } = {
description: {
$id: collectionId,
properties: getProperties(collectionNode.properties) as Record<string, Property>,
properties: getProperties(collectionNode.properties) as Record<string, aeria.Property>,
},
}

Expand Down
6 changes: 3 additions & 3 deletions packages/compiler/src/codegen/generateTSCollections.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Collection, type Property } from 'aeria'
import type * as AST from '../ast'
import { getProperties, stringify, makeASTImports, resizeFirstChar, aeriaPackageName, getCollectionId, type StringifyProperty, UnquotedSymbol } from './utils'
import type { Collection, Property } from 'aeria'
import type * as AST from '../ast.js'
import { getProperties, stringify, makeASTImports, resizeFirstChar, aeriaPackageName, getCollectionId, type StringifyProperty, UnquotedSymbol } from './utils.js'

const initialImportedTypes = [
'Collection',
Expand Down

0 comments on commit 69a49a3

Please sign in to comment.