diff --git a/.config/vite.config.js b/.config/vite.config.js index 8028dff5..88877822 100644 --- a/.config/vite.config.js +++ b/.config/vite.config.js @@ -1,7 +1,8 @@ -import { readFileSync, readdirSync, rmSync } from 'node:fs' +import { readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs' import { dirname, resolve } from 'node:path' import { fileURLToPath } from 'node:url' +import { parse } from 'acorn' import { rollup } from 'rollup' import dts from 'rollup-plugin-dts' import { defineConfig } from 'vite' @@ -11,7 +12,8 @@ const packageJsonPath = process.env.npm_package_json || resolve(root, 'package.j const packageRoot = dirname(packageJsonPath) const pkg = JSON.parse(readFileSync(packageJsonPath).toString()) const isRootPackage = packageRoot === root -const packageName = pkg.name.split('/').at(-1) +const libraryName = toLibraryName(pkg.name) +const packageGlobals = getPackageGlobals() const entry = isRootPackage ? resolve(root, 'src/index.js') : resolve(packageRoot, 'index.js') @@ -47,17 +49,19 @@ export default defineConfig({ } } : {}), plugins: [ + jsCommentStripPlugin(), declarationBundlePlugin() ], build: { outDir: resolve(packageRoot, 'dist'), lib: { entry, - formats: ['es'], - fileName: () => 'index.module.js' + name: libraryName, + formats: ['es', 'umd'], + fileName: (format) => `index.${format === 'es' ? 'module' : format}.js` }, - target: 'es2020', - minify: 'esbuild', + target: 'esnext', + minify: false, esbuild: { keepNames: true }, @@ -65,12 +69,29 @@ export default defineConfig({ external: isPackageExternal, output: { banner, - exports: 'named' + exports: 'named', + globals: packageGlobals } } } }) +function jsCommentStripPlugin() { + return { + name: 'js-comment-strip', + apply: 'build', + /** + * @param {string} code + */ + async renderChunk(code) { + const bannerPrefix = code.startsWith(banner) ? banner : '' + const body = bannerPrefix ? code.slice(bannerPrefix.length) : code + + return `${bannerPrefix}${stripJsComments(body)}` + } + } +} + function declarationBundlePlugin() { return { name: 'declaration-bundle', @@ -104,6 +125,7 @@ function declarationBundlePlugin() { file: resolve(packageRoot, 'dist/index.d.ts'), format: 'es' }) + stripImportJsdocComments(resolve(packageRoot, 'dist/index.d.ts')) await bundle.close() if (isRootPackage) { rmSync(resolve(packageRoot, 'types'), { recursive: true, force: true }) @@ -112,6 +134,68 @@ function declarationBundlePlugin() { } } +/** + * Removes line and block comments from generated JavaScript chunks. + * The bundle banner is injected after renderChunk, so it stays intact. + * + * @param {string} code + * @returns {string} + */ +function stripJsComments(code) { + /** @type {{ block: boolean, start: number, end: number }[]} */ + const comments = [] + + parse(code, { + ecmaVersion: 'latest', + onComment(block, _text, start, end) { + comments.push({ block, start, end }) + }, + sourceType: 'module' + }) + + if (!comments.length) { + return code + } + + let stripped = '' + let cursor = 0 + + for (const comment of comments) { + stripped += code.slice(cursor, comment.start) + + if (comment.block) { + const left = code[comment.start - 1] + const right = code[comment.end] + + if (left && right && !/\s/.test(left) && !/\s/.test(right)) { + stripped += ' ' + } + } + + cursor = comment.end + } + + stripped += code.slice(cursor) + + return stripped +} + +/** + * Removes JSDoc import-only comment blocks from generated declaration files. + * + * @param {string} filePath + */ +function stripImportJsdocComments(filePath) { + const contents = readFileSync(filePath, 'utf8') + const stripped = contents.replace(/\/\*\*[\s\S]*?\*\//g, (block) => ( + block.includes('@import') ? '' : block + )) + + if (stripped !== contents) { + writeFileSync(filePath, stripped) + } +} + function getPackageDeclarationPaths() { return Object.fromEntries( readdirSync(resolve(root, 'packages'), { withFileTypes: true }) @@ -122,3 +206,33 @@ function getPackageDeclarationPaths() { ]) ) } + +/** + * Returns the UMD global names for workspace packages. + * + * @returns {Record} + */ +function getPackageGlobals() { + return Object.fromEntries( + readdirSync(resolve(root, 'packages'), { withFileTypes: true }) + .filter((entry) => entry.isDirectory()) + .map(({ name }) => [ + `@wimaengine/${name}`, + toLibraryName(`@wimaengine/${name}`) + ]) + ) +} + +/** + * Converts a package name to a valid UMD global identifier. + * + * @param {string} name + * @returns {string} + */ +function toLibraryName(name) { + return name + .replace(/^@/, '') + .replace(/\//g, '_') + .replace(/-/g, '_') + .toUpperCase() +} diff --git a/.github/workflows/pull-lint.yml b/.github/workflows/pull-lint.yml index 033b480f..da7e2391 100644 --- a/.github/workflows/pull-lint.yml +++ b/.github/workflows/pull-lint.yml @@ -13,6 +13,7 @@ jobs: outputs: source: ${{ steps.filter.outputs.source }} examples: ${{ steps.filter.outputs.examples }} + config: ${{ steps.filter.outputs.config }} steps: - uses: actions/checkout@v7 with: @@ -28,9 +29,17 @@ jobs: - 'addons/**' examples: - 'examples/**' + config: + - '.config/**' + - '.github/workflows/**' + - 'package.json' + - 'package-lock.json' + - 'scripts/**' + - 'turbo.json' + - 'tsconfig.json' lint-source: needs: changes - if: needs.changes.outputs.source == 'true' + if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.config == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -39,18 +48,20 @@ jobs: node-version: 24 cache: npm - run: npm ci + - run: npm run build - run: npm run lint:src-dry -- --max-warnings=0 lint-examples: needs: changes - if: needs.changes.outputs.examples == 'true' + if: ${{ needs.changes.outputs.examples == 'true' || needs.changes.outputs.config == 'true' }} runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v6 with: node-version: 24 cache: npm - run: npm ci + - run: npm run build - run: npm run lint:examples-dry -- --max-warnings=0 tests: needs: compiles @@ -62,6 +73,7 @@ jobs: node-version: 24 cache: npm - run: npm ci + - run: npm run build - run: npm run test builds: needs: compiles @@ -76,9 +88,9 @@ jobs: - run: npm run build compiles: needs: changes - if: needs.changes.outputs.source == 'true' + if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.config == 'true' }} runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v6 with: diff --git a/package.json b/package.json index 6e8aa6d2..c0af9a17 100644 --- a/package.json +++ b/package.json @@ -2,18 +2,19 @@ "name": "wima", "version": "0.3.0", "description": "An ECS driven modular game engine.", - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, "type": "module", "license": "SEE LICENSE in LICENSE.txt", - "main": "./dist/index.module.js", + "main": "./dist/index.umd.js", "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.module.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "author": "Wima engine contributors", @@ -35,7 +36,7 @@ "build:docs": "npm run typedoc", "types": "turbo run types //#types:root", "test": "turbo run test", - "build": "npm run clean:build && turbo run build && turbo run //#build:root //#build:docs", + "build": "turbo run build && turbo run //#build:root //#build:docs", "lint": "npm run lint:src && npm run lint:examples", "version": "changeset version", "check:release-version": "node scripts/check-release-version.js", @@ -49,7 +50,7 @@ "tsc:lint": "tsc -p .config/tsc.lint.json", "watch:src": "vite build --watch --config .config/vite.config.js", "watch:docs": "npm run typedoc -- --watch", - "clean:build": "rm -rf dist types packages/*/types" + "clean:build": "rm -rf dist types packages/*/types packages/*/dist" }, "keywords": [ "game", diff --git a/packages/animation/package.json b/packages/animation/package.json index 4b397698..a538b39f 100644 --- a/packages/animation/package.json +++ b/packages/animation/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/app/package.json b/packages/app/package.json index 25e3438c..afdad168 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/asset/package.json b/packages/asset/package.json index 732a8131..b3de6361 100644 --- a/packages/asset/package.json +++ b/packages/asset/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/asset/tests/handle.test.js b/packages/asset/tests/handle.test.js index 15e2aa23..70be8dbd 100644 --- a/packages/asset/tests/handle.test.js +++ b/packages/asset/tests/handle.test.js @@ -1,10 +1,7 @@ import { deepStrictEqual, strictEqual } from "assert"; import { test, describe } from "vitest"; -import { Assets } from "../src/resources"; -import { AssetServer } from "../src/resources"; +import { AssetServer, Assets } from "../src/resources"; import { World } from "@wimaengine/ecs"; -import { AssetSceneMap } from "@wimaengine/scene"; -import { typeid } from "@wimaengine/type"; describe('Testing `Handle`',()=>{ test('`Handle` clone is same as original', () => { @@ -205,26 +202,4 @@ describe('Testing `Handle`',()=>{ strictEqual(snapshot.asset, '/assets/text/sample.txt') deepStrictEqual(restored.id(), handle.id()) }) - - test('`Handle` snapshot restores through the scene asset map when no path is registered.', () => { - const world = new World() - const assets = new Assets(String) - const server = new AssetServer() - world.setResource(server) - const sceneMap = new AssetSceneMap() - world.setResource(sceneMap) - server.registerAsset(assets) - - const sourceHandle = assets.add('Wima engine') - const mappedHandle = assets.add('Mapped asset') - const sceneAssetId = sourceHandle.id() - const snapshot = sourceHandle.toSnapshot(world) - - sceneMap.set(sceneAssetId, typeid(String), sourceHandle.index, mappedHandle) - - const restored = snapshot.fromSnapshot(world, sceneAssetId) - - strictEqual(snapshot.asset, sourceHandle.index) - deepStrictEqual(restored.id(), mappedHandle.id()) - }) }) diff --git a/packages/audio/package.json b/packages/audio/package.json index d33cd49f..a620b906 100644 --- a/packages/audio/package.json +++ b/packages/audio/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/broadphase/package.json b/packages/broadphase/package.json index cde44482..46742b86 100644 --- a/packages/broadphase/package.json +++ b/packages/broadphase/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/color/package.json b/packages/color/package.json index 9ef4942c..1f55e2f1 100644 --- a/packages/color/package.json +++ b/packages/color/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/command/package.json b/packages/command/package.json index cd73cd75..31b9c05d 100644 --- a/packages/command/package.json +++ b/packages/command/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/core/package.json b/packages/core/package.json index 2e181518..bd42afa5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/damping/package.json b/packages/damping/package.json index 957f052c..812b9833 100644 --- a/packages/damping/package.json +++ b/packages/damping/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/datastructures/package.json b/packages/datastructures/package.json index 3372697b..3b51fbdc 100644 --- a/packages/datastructures/package.json +++ b/packages/datastructures/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "dependencies": { "vifaa": "^0.4.0" diff --git a/packages/device/package.json b/packages/device/package.json index b6cb41da..992cd71a 100644 --- a/packages/device/package.json +++ b/packages/device/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/diagnostic/package.json b/packages/diagnostic/package.json index 26b79649..ca8968b0 100644 --- a/packages/diagnostic/package.json +++ b/packages/diagnostic/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/ecs/package.json b/packages/ecs/package.json index 8776b161..bf3c7592 100644 --- a/packages/ecs/package.json +++ b/packages/ecs/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "dependencies": { "@wimaengine/datastructures": "0.3.0", diff --git a/packages/emitter/package.json b/packages/emitter/package.json index dde50c7f..b04ea15a 100644 --- a/packages/emitter/package.json +++ b/packages/emitter/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/event/package.json b/packages/event/package.json index 3c8d1066..7ae263ef 100644 --- a/packages/event/package.json +++ b/packages/event/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/geometry/package.json b/packages/geometry/package.json index cdbfca1d..acc20a23 100644 --- a/packages/geometry/package.json +++ b/packages/geometry/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/gizmo/package.json b/packages/gizmo/package.json index 06af18e1..fedfbac2 100644 --- a/packages/gizmo/package.json +++ b/packages/gizmo/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/gravity/package.json b/packages/gravity/package.json index b1b888d6..a08dab04 100644 --- a/packages/gravity/package.json +++ b/packages/gravity/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/hierarchy/package.json b/packages/hierarchy/package.json index 510f24d7..8df2a7f7 100644 --- a/packages/hierarchy/package.json +++ b/packages/hierarchy/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/input-core/package.json b/packages/input-core/package.json index b8d7d060..44528c13 100644 --- a/packages/input-core/package.json +++ b/packages/input-core/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/input/package.json b/packages/input/package.json index 15f08a46..805a4836 100644 --- a/packages/input/package.json +++ b/packages/input/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/integrator/package.json b/packages/integrator/package.json index b1346838..921b8d36 100644 --- a/packages/integrator/package.json +++ b/packages/integrator/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/keyboard/package.json b/packages/keyboard/package.json index 5db97cbb..d30f8e92 100644 --- a/packages/keyboard/package.json +++ b/packages/keyboard/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/logger/package.json b/packages/logger/package.json index ee45b5c6..c5524b71 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/math/package.json b/packages/math/package.json index d8ae770f..0f3a1de4 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/misc/package.json b/packages/misc/package.json index 71b763cf..c17bf41e 100644 --- a/packages/misc/package.json +++ b/packages/misc/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/mouse/package.json b/packages/mouse/package.json index b4adbd6f..51729603 100644 --- a/packages/mouse/package.json +++ b/packages/mouse/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/movable/package.json b/packages/movable/package.json index 634150ca..8445de5c 100644 --- a/packages/movable/package.json +++ b/packages/movable/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/name/package.json b/packages/name/package.json index d935c1d2..17088df1 100644 --- a/packages/name/package.json +++ b/packages/name/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/narrowphase/package.json b/packages/narrowphase/package.json index b3181841..65510de4 100644 --- a/packages/narrowphase/package.json +++ b/packages/narrowphase/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/noise/package.json b/packages/noise/package.json index 6487b598..c7324353 100644 --- a/packages/noise/package.json +++ b/packages/noise/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/physics/package.json b/packages/physics/package.json index 4ec2b46b..c86284af 100644 --- a/packages/physics/package.json +++ b/packages/physics/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/profiler/package.json b/packages/profiler/package.json index 391b2b37..114fdd46 100644 --- a/packages/profiler/package.json +++ b/packages/profiler/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/reflect/package.json b/packages/reflect/package.json index 3628d260..b2489598 100644 --- a/packages/reflect/package.json +++ b/packages/reflect/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/relationship/package.json b/packages/relationship/package.json index 07a3f87d..546acdbf 100644 --- a/packages/relationship/package.json +++ b/packages/relationship/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/render-canvas2d/package.json b/packages/render-canvas2d/package.json index f559e7db..c3e1a29e 100644 --- a/packages/render-canvas2d/package.json +++ b/packages/render-canvas2d/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/render-core/package.json b/packages/render-core/package.json index 79946f1a..4b4d07d1 100644 --- a/packages/render-core/package.json +++ b/packages/render-core/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/render-webgl/package.json b/packages/render-webgl/package.json index 39308aa1..02ef54b1 100644 --- a/packages/render-webgl/package.json +++ b/packages/render-webgl/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/scene/package.json b/packages/scene/package.json index bfbcef6b..56da6ccf 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/scene/tests/resources/assetmap.test.js b/packages/scene/tests/resources/assetmap.test.js index c4f3174e..7a7798e0 100644 --- a/packages/scene/tests/resources/assetmap.test.js +++ b/packages/scene/tests/resources/assetmap.test.js @@ -1,6 +1,7 @@ import { deepStrictEqual, strictEqual } from 'assert' import { test, describe } from 'vitest' -import { Assets } from '@wimaengine/asset' +import { AssetServer, Assets } from '@wimaengine/asset' +import { World } from '@wimaengine/ecs' import { AssetSceneMap } from '../../src/resources' import { typeid } from '@wimaengine/type' @@ -48,4 +49,26 @@ describe.sequential('Testing `AssetSceneMap`', () => { strictEqual(sceneMap.get(sceneAssetId, typeid(String), 0), undefined) strictEqual(sceneMap.get(sceneAssetId, typeid(Number), 0) !== undefined, true) }) + + test('`Handle` snapshot restores through the scene asset map when no path is registered.', () => { + const world = new World() + const assets = new Assets(String) + const server = new AssetServer() + world.setResource(server) + const sceneMap = new AssetSceneMap() + world.setResource(sceneMap) + server.registerAsset(assets) + + const sourceHandle = assets.add('Wima engine') + const mappedHandle = assets.add('Mapped asset') + const sceneAssetId = sourceHandle.id() + const snapshot = sourceHandle.toSnapshot(world) + + sceneMap.set(sceneAssetId, typeid(String), sourceHandle.index, mappedHandle) + + const restored = snapshot.fromSnapshot(world, sceneAssetId) + + strictEqual(snapshot.asset, sourceHandle.index) + deepStrictEqual(restored.id(), mappedHandle.id()) + }) }) diff --git a/packages/schedule/package.json b/packages/schedule/package.json index 579f7529..6e6a1b9f 100644 --- a/packages/schedule/package.json +++ b/packages/schedule/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "dependencies": { "@wimaengine/datastructures": "0.3.0", diff --git a/packages/storage/package.json b/packages/storage/package.json index cc446cd6..d889bbf9 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/time/package.json b/packages/time/package.json index d7d5287a..902eaa0d 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/touch/package.json b/packages/touch/package.json index ae2de266..7dac3040 100644 --- a/packages/touch/package.json +++ b/packages/touch/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/transform/package.json b/packages/transform/package.json index 7b919222..bf9e8b8e 100644 --- a/packages/transform/package.json +++ b/packages/transform/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/tween/package.json b/packages/tween/package.json index 2de7685e..49858093 100644 --- a/packages/tween/package.json +++ b/packages/tween/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/type/package.json b/packages/type/package.json index 1a826e90..458655a2 100644 --- a/packages/type/package.json +++ b/packages/type/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/utils/package.json b/packages/utils/package.json index edece9f2..e2986a5b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/window-dom/package.json b/packages/window-dom/package.json index ea4fe196..1c3d0e0a 100644 --- a/packages/window-dom/package.json +++ b/packages/window-dom/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/packages/window/package.json b/packages/window/package.json index b453d234..caf65512 100644 --- a/packages/window/package.json +++ b/packages/window/package.json @@ -9,24 +9,20 @@ "type": "git", "url": "https://github.com/wimaengine/wima.git" }, - "homepage": "https://wimaengine.github.io/wima/", + "homepage": "https://wimaengine.org", "bugs": { "url": "https://github.com/wimaengine/wima/issues" }, - "main": "./index.js", + "main": "./dist/index.umd.js", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./index.js" - }, - "./src": { - "types": "./dist/src/index.d.ts", - "import": "./src/index.js" + "import": "./dist/index.module.js", + "require": "./dist/index.umd.js" } }, "files": [ - "index.js", - "src" + "dist" ], "scripts": { "build": "vite build --config ../../.config/vite.config.js", diff --git a/turbo.json b/turbo.json index e66ba915..68a708cc 100644 --- a/turbo.json +++ b/turbo.json @@ -11,9 +11,15 @@ ] }, "test": { + "dependsOn": [ + "^build" + ], "outputs": [] }, "types": { + "dependsOn": [ + "^build" + ], "outputs": [ "types/**" ]