Skip to content

Commit

Permalink
imports using aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
funwithtriangles committed Nov 7, 2024
1 parent 90b7960 commit bf39813
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions packages/engine/importSketchModule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SketchConfig, SketchModule, SketchModuleItem } from '@hedron/engine/store/types'
import { createUniqueId } from '@hedron/engine/utils/createUniqueId'
import { SketchConfig, SketchModule, SketchModuleItem } from '@store/types'
import { createUniqueId } from '@utils/createUniqueId'

export const importSketchModule = async (
baseUrl: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HedronEngine as _HedronEngine } from '@hedron/engine/HedronEngine'
import { EngineState as _EngineState, Param as _Param } from '@hedron/engine/store/types'
import { EngineState as _EngineState, Param as _Param } from '@store/types'

export const HedronEngine = _HedronEngine
export type EngineState = _EngineState
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/store/actionCreators/addSketch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SetterCreator, NodeTypes } from '@hedron/engine/store/types'
import { createUniqueId } from '@hedron/engine/utils/createUniqueId'
import { SetterCreator, NodeTypes } from '@store/types'
import { createUniqueId } from '@utils/createUniqueId'

export const createAddSketch: SetterCreator<'addSketch'> = (setState) => (moduleId: string) => {
const newSketchId = createUniqueId()
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/store/actionCreators/deleteSketch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SetterCreator } from '@hedron/engine/store/types'
import { SetterCreator } from '@store/types'

export const createDeleteSketch: SetterCreator<'deleteSketch'> =
(setState) => (instanceId: string) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/store/actionCreators/deleteSketchModule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SetterCreator } from '@hedron/engine/store/types'
import { SetterCreator } from '@store/types'

export const createDeleteSketchModule: SetterCreator<'deleteSketchModule'> =
(setState) => (moduleId) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/store/actionCreators/loadProject.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EngineData, SetterCreator } from '@hedron/engine/store/types'
import { EngineData, SetterCreator } from '@store/types'

export const createLoadProject: SetterCreator<'loadProject'> =
(setState) => (project: EngineData) =>
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/store/actionCreators/reset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { initialState } from '@hedron/engine/store/initialState'
import { SetterCreator } from '@hedron/engine/store/types'
import { initialState } from '@store/initialState'
import { SetterCreator } from '@store/types'

export const createReset: SetterCreator<'reset'> = (setState) => () => {
setState(() => initialState)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SetterCreator } from '@hedron/engine/store/types'
import { SetterCreator } from '@store/types'

export const createSetSketchModuleItem: SetterCreator<'setSketchModuleItem'> =
(setState) => (newItem) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/store/actionCreators/updateNodeValue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SetterCreator } from '@hedron/engine/store/types'
import { SetterCreator } from '@store/types'

export const createUpdateNodeValue: SetterCreator<'updateNodeValue'> =
(setState) => (nodeId, value) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/store/actionCreators/updateSketchParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeTypes, SetterCreator } from '@hedron/engine/store/types'
import { createUniqueId } from '@hedron/engine/utils/createUniqueId'
import { NodeTypes, SetterCreator } from '@store/types'
import { createUniqueId } from '@utils/createUniqueId'

export const createUpdateSketchParams: SetterCreator<'updateSketchParams'> =
(setState) => (sketchId: string) => {
Expand Down
20 changes: 10 additions & 10 deletions packages/engine/store/engineStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { devtools, subscribeWithSelector } from 'zustand/middleware'
import { immer } from 'zustand/middleware/immer'

import type {} from '@redux-devtools/extension' // required for devtools typing
import { EngineStateWithActions } from '@hedron/engine/store/types'
import { initialState } from '@hedron/engine/store/initialState'
import { createAddSketch } from '@hedron/engine/store/actionCreators/addSketch'
import { createDeleteSketch } from '@hedron/engine/store/actionCreators/deleteSketch'
import { createSetSketchModuleItem } from '@hedron/engine/store/actionCreators/setSketchModuleItem'
import { createDeleteSketchModule } from '@hedron/engine/store/actionCreators/deleteSketchModule'
import { createUpdateSketchParams } from '@hedron/engine/store/actionCreators/updateSketchParams'
import { createUpdateNodeValue } from '@hedron/engine/store/actionCreators/updateNodeValue'
import { createReset } from '@hedron/engine/store/actionCreators/reset'
import { createLoadProject } from '@hedron/engine/store/actionCreators/loadProject'
import { EngineStateWithActions } from '@store/types'
import { initialState } from '@store/initialState'
import { createAddSketch } from '@store/actionCreators/addSketch'
import { createDeleteSketch } from '@store/actionCreators/deleteSketch'
import { createSetSketchModuleItem } from '@store/actionCreators/setSketchModuleItem'
import { createDeleteSketchModule } from '@store/actionCreators/deleteSketchModule'
import { createUpdateSketchParams } from '@store/actionCreators/updateSketchParams'
import { createUpdateNodeValue } from '@store/actionCreators/updateNodeValue'
import { createReset } from '@store/actionCreators/reset'
import { createLoadProject } from '@store/actionCreators/loadProject'

export const createEngineStore = () =>
createStore<EngineStateWithActions>()(
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/store/initialState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EngineState } from '@hedron/engine/store/types'
import { EngineState } from '@store/types'

export const initialState: EngineState = {
isSketchModulesReady: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/store/selectors/getSketchesOfModuleId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EngineState } from '@hedron/engine/store/types'
import { EngineState } from '@store/types'

export const getSketchesOfModuleId = (state: EngineState, moduleId: string) =>
Object.values(state.sketches).filter((sketch) => sketch.moduleId === moduleId)
2 changes: 1 addition & 1 deletion packages/engine/storeListener.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EngineStore } from '@hedron/engine/store/engineStore'
import { EngineStore } from '@store/engineStore'

export const listenToStore = (
store: EngineStore,
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/utils/stripForSave.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EngineState, EngineStateWithActions, EngineData } from '@hedron/engine/store/types'
import { EngineState, EngineStateWithActions, EngineData } from '@store/types'

export const stripForSave = (state: EngineStateWithActions): EngineData => {
// @ts-expect-error ---
Expand Down
4 changes: 2 additions & 2 deletions packages/engine/world/Renderer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import debounce from 'lodash.debounce'
import { EffectComposer } from 'postprocessing'
import { WebGLRenderer } from 'three'
import { EngineScene } from '@hedron/engine/world/EngineScene'
import { engineScenes } from '@hedron/engine/world/scenes'
import { EngineScene } from '@world/EngineScene'
import { engineScenes } from '@world/scenes'

export class Renderer {
public composer: EffectComposer | undefined
Expand Down
6 changes: 3 additions & 3 deletions packages/engine/world/SketchManager.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Group } from 'three'
import { Pass } from 'postprocessing'
import { SketchModule } from '@hedron/engine/store/types'
import { getDebugScene } from '@hedron/engine/world/debugScene'
import { EngineScene } from '@hedron/engine/world/EngineScene'
import { SketchModule } from '@store/types'
import { getDebugScene } from '@world/debugScene'
import { EngineScene } from '@world/EngineScene'

type SketchInstance = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
8 changes: 4 additions & 4 deletions packages/engine/world/debugScene.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// import { BoxGeometry, Mesh, MeshNormalMaterial } from 'three'
import { createUniqueId } from '@hedron/engine/utils/createUniqueId'
import { addScene } from '@hedron/engine/world/scenes'
import { EngineScene } from '@hedron/engine/world/EngineScene'
import { Renderer } from '@hedron/engine/world/Renderer'
import { createUniqueId } from '@utils/createUniqueId'
import { addScene } from '@world/scenes'
import { EngineScene } from '@world/EngineScene'
import { Renderer } from '@world/Renderer'

let debugScene: EngineScene | undefined

Expand Down
2 changes: 1 addition & 1 deletion packages/engine/world/scenes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EngineScene } from '@hedron/engine/world/EngineScene'
import { EngineScene } from '@world/EngineScene'

export const engineScenes = new Map<string, EngineScene>()

Expand Down

0 comments on commit bf39813

Please sign in to comment.