@etherealengine/common
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -56,2 +56,10 @@ # Change Log | ||
**Note:** Version bump only for package @etherealengine/common | ||
**Note:** Version bump only for package @xrengine/common | ||
@@ -58,0 +66,0 @@ |
@@ -30,3 +30,2 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface ServiceTypes {} |
{ | ||
"name": "@etherealengine/common", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"main": "lib/common.umd.js", | ||
@@ -28,3 +28,3 @@ "module": "lib/common.es.js", | ||
}, | ||
"gitHead": "0feb543315062e51548b551ce6d50f7c14e2eb38" | ||
"gitHead": "a47246eab112a1d8b70d91d874a41482a37ee38a" | ||
} |
@@ -30,3 +30,3 @@ /* | ||
const localBuildOrDev = | ||
globalThis.process.env['APP_ENV'] === 'development' || globalThis.process.env['VITE_LOCAL_BUILD'] === 'true' | ||
globalThis.process.env.APP_ENV === 'development' || globalThis.process.env.VITE_LOCAL_BUILD === 'true' | ||
@@ -41,3 +41,3 @@ export function validateEmail(email: string): boolean { | ||
export const isDev = globalThis.process.env['APP_ENV'] === 'development' | ||
export const isDev = globalThis.process.env.APP_ENV === 'development' | ||
@@ -48,42 +48,44 @@ /** | ||
const client = { | ||
appEnv: globalThis.process.env['APP_ENV'], | ||
nodeEnv: globalThis.process.env['NODE_ENV'], | ||
localNginx: globalThis.process.env['VITE_LOCAL_NGINX'], | ||
localBuild: globalThis.process.env['VITE_LOCAL_BUILD'], | ||
appEnv: globalThis.process.env.APP_ENV, | ||
nodeEnv: globalThis.process.env.NODE_ENV, | ||
localNginx: globalThis.process.env.VITE_LOCAL_NGINX, | ||
localBuild: globalThis.process.env.VITE_LOCAL_BUILD, | ||
localBuildOrDev, | ||
clientUrl: | ||
localBuildOrDev && globalThis.process.env['VITE_LOCAL_NGINX'] !== 'true' | ||
? `https://${globalThis.process.env['VITE_APP_HOST']}:${globalThis.process.env['VITE_APP_PORT']}` | ||
: `https://${globalThis.process.env['VITE_APP_HOST']}`, | ||
serverHost: globalThis.process.env['VITE_SERVER_HOST'], | ||
localBuildOrDev && globalThis.process.env.VITE_LOCAL_NGINX !== 'true' | ||
? `https://${globalThis.process.env.VITE_APP_HOST}:${globalThis.process.env.VITE_APP_PORT}` | ||
: `https://${globalThis.process.env.VITE_APP_HOST}`, | ||
serverHost: globalThis.process.env.VITE_SERVER_HOST, | ||
serverUrl: | ||
localBuildOrDev && globalThis.process.env['VITE_LOCAL_NGINX'] !== 'true' | ||
? `https://${globalThis.process.env['VITE_SERVER_HOST']}:${globalThis.process.env['VITE_SERVER_PORT']}` | ||
: `https://${globalThis.process.env['VITE_SERVER_HOST']}`, | ||
localBuildOrDev && globalThis.process.env.VITE_LOCAL_NGINX !== 'true' | ||
? `https://${globalThis.process.env.VITE_SERVER_HOST}:${globalThis.process.env.VITE_SERVER_PORT}` | ||
: `https://${globalThis.process.env.VITE_SERVER_HOST}`, | ||
instanceserverUrl: | ||
localBuildOrDev && globalThis.process.env['VITE_LOCAL_NGINX'] !== 'true' | ||
? `https://${globalThis.process.env['VITE_INSTANCESERVER_HOST']}:${globalThis.process.env['VITE_INSTANCESERVER_PORT']}` | ||
: `https://${globalThis.process.env['VITE_INSTANCESERVER_HOST']}`, | ||
localBuildOrDev && globalThis.process.env.VITE_LOCAL_NGINX !== 'true' | ||
? `https://${globalThis.process.env.VITE_INSTANCESERVER_HOST}:${globalThis.process.env.VITE_INSTANCESERVER_PORT}` | ||
: `https://${globalThis.process.env.VITE_INSTANCESERVER_HOST}`, | ||
fileServer: | ||
(globalThis.process.env['TEST'] === 'true' | ||
? globalThis.process.env['VITE_TEST_FILE_SERVER'] | ||
: globalThis.process.env['VITE_FILE_SERVER']) ?? 'https://localhost:8642', | ||
mediatorServer: globalThis.process.env['VITE_MEDIATOR_SERVER'], | ||
(globalThis.process.env.TEST === 'true' | ||
? globalThis.process.env.VITE_TEST_FILE_SERVER | ||
: globalThis.process.env.VITE_FILE_SERVER) ?? 'https://localhost:8642', | ||
mediatorServer: globalThis.process.env.VITE_MEDIATOR_SERVER, | ||
cors: { | ||
proxyUrl: | ||
localBuildOrDev && globalThis.process.env['VITE_LOCAL_NGINX'] !== 'true' | ||
? `https://${process.env['VITE_SERVER_HOST']}:${process.env['VITE_CORS_SERVER_PORT']}` | ||
: `https://${process.env['VITE_SERVER_HOST']}/cors-proxy`, | ||
serverPort: globalThis.process.env['VITE_CORS_SERVER_PORT'] | ||
localBuildOrDev && globalThis.process.env.VITE_LOCAL_NGINX !== 'true' | ||
? `https://${globalThis.process.env.VITE_SERVER_HOST}:${globalThis.process.env.VITE_CORS_SERVER_PORT}` | ||
: `https://${globalThis.process.env.VITE_SERVER_HOST}/cors-proxy`, | ||
serverPort: globalThis.process.env.VITE_CORS_SERVER_PORT | ||
}, | ||
logs: { | ||
forceClientAggregate: globalThis.process.env['VITE_FORCE_CLIENT_LOG_AGGREGATE'], | ||
disabled: globalThis.process.env['VITE_DISABLE_LOG'] | ||
forceClientAggregate: globalThis.process.env.VITE_FORCE_CLIENT_LOG_AGGREGATE, | ||
disabled: globalThis.process.env.VITE_DISABLE_LOG | ||
}, | ||
rootRedirect: globalThis.process.env['VITE_ROOT_REDIRECT'], | ||
tosAddress: globalThis.process.env['VITE_TERMS_OF_SERVICE_ADDRESS'], | ||
readyPlayerMeUrl: globalThis.process.env['VITE_READY_PLAYER_ME_URL'], | ||
key8thWall: globalThis.process.env['VITE_8TH_WALL']!, | ||
featherStoreKey: globalThis.process.env['VITE_FEATHERS_STORE_KEY'], | ||
gaMeasurementId: globalThis.process.env['VITE_GA_MEASUREMENT_ID'] | ||
rootRedirect: globalThis.process.env.VITE_ROOT_REDIRECT, | ||
tosAddress: globalThis.process.env.VITE_TERMS_OF_SERVICE_ADDRESS, | ||
readyPlayerMeUrl: globalThis.process.env.VITE_READY_PLAYER_ME_URL, | ||
avaturnUrl: globalThis.process.env.VITE_AVATURN_URL, | ||
avaturnAPI: globalThis.process.env.VITE_AVATURN_API, | ||
key8thWall: globalThis.process.env.VITE_8TH_WALL!, | ||
featherStoreKey: globalThis.process.env.VITE_FEATHERS_STORE_KEY, | ||
gaMeasurementId: globalThis.process.env.VITE_GA_MEASUREMENT_ID | ||
} | ||
@@ -90,0 +92,0 @@ |
@@ -40,3 +40,2 @@ /* | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {} | ||
@@ -43,0 +42,0 @@ |
@@ -26,7 +26,4 @@ /* | ||
import { | ||
IdentityProviderType, | ||
identityProviderPath | ||
} from '@etherealengine/engine/src/schemas/user/identity-provider.schema' | ||
import { UserID } from '@etherealengine/engine/src/schemas/user/user.schema' | ||
import { IdentityProviderType, identityProviderPath } from '@etherealengine/common/src/schema.type.module' | ||
import { UserID } from '../schemas/user/user.schema' | ||
@@ -33,0 +30,0 @@ export interface AuthUser { |
@@ -26,3 +26,3 @@ /* | ||
import { UserID } from '@etherealengine/engine/src/schemas/user/user.schema' | ||
import { UserID } from '../schemas/user/user.schema' | ||
import { OpaqueType } from './OpaqueType' | ||
@@ -29,0 +29,0 @@ |
@@ -26,7 +26,8 @@ /* | ||
import { UserID } from '@etherealengine/engine/src/schemas/user/user.schema' | ||
import { AvatarID } from '@etherealengine/common/src/schema.type.module' | ||
import { UserID } from '../schemas/user/user.schema' | ||
export type AvatarUploadArgsType = { | ||
avatarName: string | ||
avatarId: string | ||
avatarId: AvatarID | ||
isPublic: boolean | ||
@@ -39,2 +40,3 @@ } | ||
userId?: UserID | ||
path?: string | ||
args: string | AvatarUploadArgsType | ||
@@ -41,0 +43,0 @@ } |
@@ -10,3 +10,3 @@ /* | ||
and 15 have been added to cover use of software over a computer network and | ||
provide for limited attribution for the Original Developer. In addition, | ||
provide for limited attribution for the Original Developer. In addition, | ||
Exhibit A has been modified to be consistent with Exhibit B. | ||
@@ -33,2 +33,3 @@ | ||
export const CommonKnownContentTypes = { | ||
material: 'model/material', | ||
xre: 'prefab/xre', | ||
@@ -51,3 +52,4 @@ gltf: 'model/gltf', | ||
js: 'application/octet-stream', | ||
json: 'application/json' | ||
json: 'application/json', | ||
bin: 'application/octet-stream' | ||
} | ||
@@ -57,2 +59,3 @@ | ||
'prefab/xre': 'xre', | ||
'model/material': 'material', | ||
'model/gltf': 'gltf', | ||
@@ -59,0 +62,0 @@ 'model/gltf-binary': 'glb', |
@@ -73,1 +73,73 @@ /* | ||
} | ||
export function pathJoin(...parts: string[]): string { | ||
const separator = '/' | ||
return parts | ||
.map((part, index) => { | ||
// If it's the first part, we only want to remove trailing slashes | ||
if (index === 0) { | ||
while (part.endsWith(separator)) { | ||
part = part.substring(0, part.length - 1) | ||
} | ||
} | ||
// If it's the last part, we only want to remove leading slashes | ||
else if (index === parts.length - 1) { | ||
if (part) { | ||
while (part.startsWith(separator)) { | ||
part = part.substring(1) | ||
} | ||
} | ||
} | ||
// For all other parts, remove leading and trailing slashes | ||
else { | ||
if (part) { | ||
while (part.startsWith(separator)) { | ||
part = part.substring(1) | ||
} | ||
while (part.endsWith(separator)) { | ||
part = part.substring(0, part.length - 1) | ||
} | ||
} | ||
} | ||
return part | ||
}) | ||
.join(separator) | ||
} | ||
export function baseName(path: string): string { | ||
return path.split(/[\\/]/).pop()! | ||
} | ||
export function relativePathTo(src: string, dst: string): string { | ||
const normalizePath = (path: string) => path.split('/').filter(Boolean) | ||
const srcSegments = normalizePath(src) | ||
const dstSegments = normalizePath(dst) | ||
let commonIndex = 0 | ||
// Find common path segments | ||
while ( | ||
srcSegments[commonIndex] === dstSegments[commonIndex] && | ||
commonIndex < Math.min(srcSegments.length, dstSegments.length) | ||
) { | ||
commonIndex++ | ||
} | ||
// Calculate the number of '../' needed | ||
let relativePathArray: string[] = [] | ||
for (let i = commonIndex; i < srcSegments.length; i++) { | ||
relativePathArray.push('..') | ||
} | ||
// Append the destination path | ||
relativePathArray = relativePathArray.concat(dstSegments.slice(commonIndex)) | ||
// Handle the special case where src and dst are the same directory | ||
if (relativePathArray.length === 0) { | ||
return '.' | ||
} | ||
return relativePathArray.join('/') | ||
} |
@@ -32,2 +32,3 @@ /* | ||
it('guessContentType', () => { | ||
assert(guessContentType('https://mydomain.com/myfile.material.gltf'), 'model/material') | ||
assert(guessContentType('https://mydomain.com/myfile.gltf'), 'model/gltf') | ||
@@ -34,0 +35,0 @@ assert(guessContentType('https://mydomain.com/myfile.glb'), 'model/gltf-binary') |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
425719
161
8939
1