Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into project-orgnames
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField authored Jun 19, 2024
2 parents ab74817 + 268f18b commit 1008e5b
Show file tree
Hide file tree
Showing 46 changed files with 186 additions and 138 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.cjs

This file was deleted.

52 changes: 52 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
})

export default [
{
ignores: ['packages/server/upload', 'packages/server/upload_test', '**/*.js', 'packages/projects/projects/**/*']
},
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended'),
{
plugins: {
'@typescript-eslint': typescriptEslint
},

languageOptions: {
globals: {
...globals.browser,
...globals.node
},

parser: tsParser
},

rules: {
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'prefer-const': 'warn',
'no-async-promise-executor': 'off',
'no-useless-escape': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-fallthrough': 'off'
}
}
]
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
]
},
"devDependencies": {
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.5.0",
"@ianvs/prettier-plugin-sort-imports": "4.1.0",
"@swc/core": "1.3.41",
"@testing-library/react": "15.0.4",
Expand All @@ -114,12 +116,13 @@
"@types/mocha": "10.0.1",
"@types/primus": "^7.3.6",
"@types/three": "0.158.0",
"@typescript-eslint/eslint-plugin": "5.56.0",
"@typescript-eslint/parser": "5.56.0",
"@typescript-eslint/eslint-plugin": "7.13.1",
"@typescript-eslint/parser": "7.13.1",
"concurrently": "7.6.0",
"deep-object-diff": "^1.1.9",
"depcheck": "1.4.3",
"eslint": "8.36.0",
"eslint": "9.5.0",
"globals": "15.6.0",
"jsdom": "^21.1.1",
"kill-port": "2.0.1",
"lerna": "6.5.1",
Expand Down Expand Up @@ -156,6 +159,6 @@
"patch-package": "^6.5.1",
"three": "0.158.0",
"ts-node": "10.9.1",
"typescript": "5.0.2"
"typescript": "5.4.5"
}
}
2 changes: 1 addition & 1 deletion packages/client-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"react-router-dom": "6.9.0",
"recovery": "^0.2.6",
"tick-tock": "^1.0.0",
"typescript": "5.0.2",
"typescript": "5.4.5",
"util": "^0.12.5",
"uuid": "9.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/client-core/src/world/ClientModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import { UserUISystem } from '../user/UserUISystem'
import './ClientNetworkModule'

export {
AvatarUISystem,
AvatarSpawnSystem,
AvatarUISystem,
LoadingUISystem,
MediaControlSystem,
UserUISystem,
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/utils/getEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const isJsDom = () =>
navigator.userAgent.includes('Node.js') ||
navigator.userAgent.includes('jsdom')

export { isBrowser, isWebWorker, isClient, isJsDom }
export { isBrowser, isClient, isJsDom, isWebWorker }

// ==== //

Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/utils/validateSceneName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ Ethereal Engine. All Rights Reserved.
// eslint-disable-next-line no-control-regex
const invalidFileNameRegex = /[_<>:"/\\|?*\u0000-\u001F]/g
const windowsReservedNameRegex = /^(con|prn|aux|nul|com\d|lpt\d)$/i
const validSceneNameRegex = /^[a-zA-Z0-9][a-zA-Z0-9_\-\s]{1,62}[a-zA-Z0-9_\-]$/

export default function isValidSceneName(sceneName: string) {
return (
sceneName.length >= 3 &&
sceneName.length <= 64 &&
!invalidFileNameRegex.test(sceneName) &&
!windowsReservedNameRegex.test(sceneName)
!windowsReservedNameRegex.test(sceneName) &&
validSceneNameRegex.test(sceneName)
)
}
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"react-virtualized-auto-sizer": "1.0.7",
"react-window": "1.8.8",
"reactflow": "^11.10.1",
"typescript": "5.0.2",
"typescript": "5.4.5",
"use-http": "1.0.27",
"uuid": "9.0.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/EditorModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import { ObjectGridSnapSystem } from './systems/ObjectGridSnapSystem'
import { UploadRequestSystem } from './systems/UploadRequestSystem'

export {
EditorInstanceNetworkingSystem,
EditorControlSystem,
EditorInstanceNetworkingSystem,
GizmoSystem,
HighlightSystem,
ModelHandlingSystem,
ObjectGridSnapSystem,
UploadRequestSystem,
RenderInfoSystem
RenderInfoSystem,
UploadRequestSystem
}
3 changes: 1 addition & 2 deletions packages/editor/src/components/assets/SceneAssetsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-case-declarations */
/*
CPAL-1.0 License
Expand Down Expand Up @@ -190,7 +189,7 @@ const SceneAssetsPanel = () => {
useEffect(() => {
const staticResourcesFindApi = () => {
const query = {
key: { $like: `%${searchText.value}%` || undefined },
key: { $like: `%${searchText.value}%` },
$sort: { mimeType: 1 },
$limit: 10000,
project: projectName.value!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ export function* heirarchyTreeWalker(sceneID: string, treeNode: Entity): Generat
const entityTreeComponent = getComponent(entityNode as Entity, EntityTreeComponent)

// treat entites with all helper children as leaf nodes
const allhelperChildren =
false || entityTreeComponent.children.every((child) => !hasComponent(child, SourceComponent))
const allhelperChildren = entityTreeComponent.children.every((child) => !hasComponent(child, SourceComponent))

yield {
isLeaf: entityTreeComponent.children.length === 0 || allhelperChildren,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const InputFieldForValue = ({
valueType
}: Pick<InputSocketProps, 'choices' | 'value' | 'defaultValue' | 'name' | 'onChange' | 'valueType'>) => {
const showChoices = choices?.length
const inputVal = String(value) ?? defaultValue ?? ''
const inputVal = String(value) // ?? defaultValue ?? ''
const inputSocketStyle = {
backgroundColor: 'var(--panelCards)',
cursor: 'pointer',
Expand Down
32 changes: 16 additions & 16 deletions packages/editor/src/constants/GizmoPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,28 +420,28 @@ function setupGizmo(gizmoMap) {
}

export {
gizmoTranslate,
pickerTranslate,
helperTranslate,
GizmoMaterial,
gizmoMaterialProperties,
gizmoPlane,
gizmoRotate,
pickerRotate,
helperRotate,
gizmoScale,
pickerScale,
gizmoTranslate,
helperRotate,
helperScale,
setupGizmo,
GizmoMaterial,
gizmoMaterialProperties,
matInvisible,
helperTranslate,
matBlue,
matBlueTransparent,
matGray,
matGreen,
matGreenTransparent,
matHelper,
matInvisible,
matRed,
matGreen,
matBlue,
matRedTransparent,
matGreenTransparent,
matBlueTransparent,
matWhiteTransparent,
matYellowTransparent,
matGray,
gizmoPlane
pickerRotate,
pickerScale,
pickerTranslate,
setupGizmo
}
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ describe('EditorControlFunctions', () => {
const sourceID = getComponent(nodeEntity, SourceComponent)

EditorControlFunctions.modifyProperty([nodeEntity], SplineComponent, {
[`elements.${1}.position`]: {
[`elements.${1}.position` as string]: {
x: 10,
y: 10,
z: 10
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"three.quarks": "^0.11.2",
"troika-three-text": "^0.49.0",
"ts-matches": "5.3.0",
"typescript": "5.0.2",
"typescript": "5.4.5",
"uuid": "9.0.0",
"web-worker": "1.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ export async function combineMaterials(document: Document) {
if (eeMat !== null && cachedEEMat !== null) {
return (
eeMat.prototype === cachedEEMat.prototype &&
((eeMat.args === cachedEEMat.args) === null || (cachedEEMat.args && eeMat.args?.equals(cachedEEMat.args)))
((eeMat.args === cachedEEMat.args && eeMat.args === null) ||
(cachedEEMat.args && eeMat.args?.equals(cachedEEMat.args)))
)
} else return material.equals(cachedMaterial)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/src/interaction/MediaModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ import { AudioAnalysisSystem } from '../audio/systems/AudioAnalysisSystem'
import { MediaSystem } from '../audio/systems/MediaSystem'
import { PositionalAudioSystem } from '../audio/systems/PositionalAudioSystem'

export { MediaSystem, PositionalAudioSystem, AudioAnalysisSystem }
export { AudioAnalysisSystem, MediaSystem, PositionalAudioSystem }
2 changes: 1 addition & 1 deletion packages/engine/src/mocap/MocapModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Ethereal Engine. All Rights Reserved.
import { MotionCaptureInputSystem } from './MotionCaptureInputSystem'
import { MotionCaptureSystem } from './MotionCaptureSystem'

export { MotionCaptureSystem, MotionCaptureInputSystem }
export { MotionCaptureInputSystem, MotionCaptureSystem }
2 changes: 1 addition & 1 deletion packages/engine/src/scene/SceneModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ export {
EnvironmentSystem,
FogSystem,
MaterialLibrarySystem,
MeshBVHSystem,
MountPointSystem,
NoiseOffsetSystem,
MeshBVHSystem,
ParticleSystem,
PortalSystem,
SceneKillHeightSystem,
Expand Down
2 changes: 1 addition & 1 deletion packages/instanceserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"ps-list": "7.2.0",
"trace-unhandled": "2.0.1",
"ts-node": "10.9.1",
"typescript": "5.0.2",
"typescript": "5.4.5",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/instanceserver/src/InstanceServerModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ import { MediasoupRecordingSystem } from './MediasoupRecordingSystem'
import { MediasoupServerSystem } from './MediasoupServerSystem'
import { ServerHostNetworkSystem } from './ServerHostNetworkSystem'

export { MediasoupServerSystem, ServerHostNetworkSystem, MediasoupRecordingSystem }
export { MediasoupRecordingSystem, MediasoupServerSystem, ServerHostNetworkSystem }
2 changes: 1 addition & 1 deletion packages/matchmaking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"axios": "1.3.4",
"node-fetch": "2.6.9",
"ts-node": "10.9.1",
"typescript": "5.0.2"
"typescript": "5.4.5"
},
"devDependencies": {
"@types/mocha": "10.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/matchmaking/src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ function deleteTicket(ticketId: string): Promise<void> {
.then((result) => {})
}

export { createTicket, getTicket, deleteTicket, getTicketsAssignment }
export { createTicket, deleteTicket, getTicket, getTicketsAssignment }
2 changes: 1 addition & 1 deletion packages/server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"slugify": "1.6.5",
"swagger-ui-dist": "^4.12.0",
"trace-unhandled": "2.0.1",
"typescript": "5.0.2",
"typescript": "5.4.5",
"uint8arrays": "^3.0.0",
"universal-analytics": "^0.5.3",
"uuid": "9.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ export const patchSingleProjectResourcesJson = async (app: Application, id: stri
}
}

const body = Buffer.from(JSON.stringify(resourcesJson, null, 2))
const sortedResourcesJson = Object.fromEntries(
Object.entries(resourcesJson).sort(([a], [b]) => {
return a.localeCompare(b)
})
)

const body = Buffer.from(JSON.stringify(sortedResourcesJson, null, 2))

await storageProvider.putObject(
{
Expand Down Expand Up @@ -309,7 +315,13 @@ export const patchSingleProjectResourcesJson = async (app: Application, id: stri
thumbnailMode: resource.thumbnailMode ?? undefined
}

const body = Buffer.from(JSON.stringify(resourcesJson, null, 2))
const sortedResourcesJson = Object.fromEntries(
Object.entries(resourcesJson).sort(([a], [b]) => {
return a.localeCompare(b)
})
)

const body = Buffer.from(JSON.stringify(sortedResourcesJson, null, 2))

await storageProvider.putObject(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ export const getProjectCommits = async (
}

export const findBuilderTags = async (): Promise<Array<ProjectBuilderTagsType>> => {
const builderRepo = `${process.env.SOURCE_REPO_URL}/${process.env.SOURCE_REPO_NAME_STEM}-builder` || ''
const builderRepo = `${process.env.SOURCE_REPO_URL}/${process.env.SOURCE_REPO_NAME_STEM}-builder`
const publicECRExec = publicECRRepoRegex.exec(builderRepo)
const privateECRExec = privateECRRepoRegex.exec(builderRepo)
if (publicECRExec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const server = {
hub: JSON.stringify({
endpoint: process.env.HUB_ENDPOINT
}),
url: '' || (null! as string),
url: '',
certPath: appRootPath.path.toString() + '/' + process.env.CERT,
keyPath: appRootPath.path.toString() + '/' + process.env.KEY,
gitPem: '',
Expand Down
Loading

0 comments on commit 1008e5b

Please sign in to comment.