-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Hedron dependency exports (#468)
* monorepo with lerna * update GH checks file * cleanup checks file * separate packages * package @hedron namespace * lint fix * deps alphabetical * fix gh actions * eslint global * config cleanup * config fixes * linting * type fixes etc * gh action fix * removed generated js files (no idea...) * imports using aliases * tsc noEmit * update gitignore * engine package setup * eslintignore * top level run dev script * update readme * various dev fixes * TS fixes * PR check fix * DialogId moved out of @hedron/engine * globalVars cleanup attempt * deps from hedron globals * generated * dep upgrades and peer depedencies for engine * remove THREE_EXTRAS and `three-stdlib` from engine
- Loading branch information
1 parent
fcc8888
commit 9499751
Showing
16 changed files
with
13,178 additions
and
8,724 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.5.3.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
"lint": "lerna run lint", | ||
"format": "prettier --write ." | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@electron-toolkit/eslint-config-prettier": "^2.0.0", | ||
"@electron-toolkit/eslint-config-ts": "^2.0.0", | ||
|
@@ -32,5 +31,6 @@ | |
"lerna": "^8.1.9", | ||
"prettier": "^3.3.2", | ||
"typescript": "^5.5.2" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 2 additions & 18 deletions
20
packages/desktop/src/renderer/globalVars.ts → packages/engine/src/globalVars.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,16 @@ | ||
import * as THREE from 'three' | ||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js' | ||
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js' | ||
import * as postprocessing from 'postprocessing' | ||
|
||
// Third party dependencies exposed globally for sketch development | ||
// Needs to also be exported so can be used by type definition files | ||
export const dependencies = { | ||
// Declaring THREE as a global var, so that sketches can use the same instance of three.js as Hedron does | ||
// This keeps the library versions matched and also prevents strange things from happening when the library | ||
// code is being read from different sources | ||
THREE: { | ||
...THREE, | ||
// For convenience, also requiring some common three extras | ||
GLTFLoader, | ||
OrbitControls, | ||
}, | ||
// Other useful libraries | ||
THREE, | ||
postprocessing, | ||
} | ||
|
||
declare global { | ||
interface Window { | ||
HEDRON: { | ||
dependencies: typeof dependencies | ||
} | ||
} | ||
} | ||
|
||
// @ts-expect-error --- | ||
window.HEDRON = { | ||
dependencies, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './HedronEngine' | ||
export type * from '@store/types' | ||
export * from '@store/types' | ||
import './globalVars' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
declare global { | ||
interface Window { | ||
HEDRON: { | ||
dependencies: { | ||
THREE: typeof import('three') | ||
postprocessing: typeof import('postprocessing') | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Ensure it's treated as a module by exporting an empty object. | ||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.