-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
144 additions
and
104 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
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,40 @@ | ||
import { readdir, readFile, writeFile } from 'node:fs/promises' | ||
|
||
/** | ||
* Adds `.js` when importing the ./src/index.js in the dts | ||
* | ||
* @return {Promise<void>} | ||
*/ | ||
async function patchRootDts() { | ||
const dts = 'dist/index.d.ts' | ||
const content = await readFile(dts, 'utf8') | ||
await writeFile(dts, content.replaceAll('./src/index\'', './src/index.js\'')) | ||
} | ||
|
||
/** | ||
* Fix node10 issue: | ||
* - node10 and bundler will check for d.vue.ts and vue.d.ts file when importing a vue file in a dts | ||
* - node16 will check only for d.vue.ts file, this function will just copy/paste the content of vue.d.ts to d.vue.ts | ||
* | ||
* @param path {String} | ||
* @return {Promise<void>} | ||
*/ | ||
async function patchVueDts(path) { | ||
const files = await readdir(path, { recursive: false }) | ||
for (const file of files) { | ||
if (file.endsWith('.vue.d.ts')) { | ||
await writeFile(`${path}/${file.replace('.vue.d.ts', '.d.vue.ts')}`, await readFile(`${path}/${file}`, 'utf-8'), 'utf-8') | ||
} | ||
} | ||
} | ||
|
||
async function fixNode16() { | ||
await Promise.all([ | ||
patchRootDts(), | ||
patchVueDts('dist/src/components'), | ||
patchVueDts('dist/src/composables/useLoader'), | ||
patchVueDts('dist/src/composables/useTexture'), | ||
]) | ||
} | ||
|
||
fixNode16() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import UseLoader from './useLoader/component.vue' | ||
import UseTexture from './useTexture/component.vue' | ||
|
||
export * from './useCamera/' | ||
export * from './useLoader' | ||
export * from './useLogger' | ||
export * from './useLoop' | ||
export * from './useRaycaster' | ||
export * from './useRenderer/' | ||
export * from './useRenderLoop' | ||
export * from './useSeek' | ||
export * from './useTexture' | ||
export * from './useTresContextProvider' | ||
export * from './useTresEventManager' | ||
export { onTresReady } from './useTresReady' | ||
export * from './useCamera/index.js' | ||
export * from './useLoader/index.js' | ||
export * from './useLogger.js' | ||
export * from './useLoop/index.js' | ||
export * from './useRaycaster/index.js' | ||
export * from './useRenderer/index.js' | ||
export * from './useRenderLoop/index.js' | ||
export * from './useSeek/index.js' | ||
export * from './useTexture/index.js' | ||
export * from './useTresContextProvider/index.js' | ||
export * from './useTresEventManager/index.js' | ||
export { onTresReady } from './useTresReady/index.js' | ||
export { UseLoader, UseTexture } |
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
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
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
2 changes: 1 addition & 1 deletion
2
src/composables/useTresReady/createReadyEventHook/createReadyHook.test.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { registerTresDevtools } from './plugin' | ||
export { registerTresDevtools } from './plugin.js' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { vDistanceTo } from './vDistanceTo' | ||
import { vLightHelper } from './vLightHelper' | ||
import { vLog } from './vLog' | ||
import { vDistanceTo } from './vDistanceTo.js' | ||
import { vLightHelper } from './vLightHelper.js' | ||
import { vLog } from './vLog.js' | ||
|
||
export { vDistanceTo, vLightHelper, vLog } |
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.