From: Chris Duncan Date: Mon, 13 Jan 2025 14:52:16 +0000 (-0800) Subject: Scrap imports since it is messing up definition files. X-Git-Tag: v1.2.3~3 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=48f911e9b6ef4b5a1b48a0c9e9002b42d45c6b76;p=nano-pow.git Scrap imports since it is messing up definition files. --- diff --git a/package.json b/package.json index f48e4df..240ece6 100644 --- a/package.json +++ b/package.json @@ -42,10 +42,6 @@ "scripts": { "build": "rm -rf dist && tsc && node esbuild.mjs" }, - "imports": { - "#classes": "./src/classes/index.js", - "#shaders": "./src/shaders/index.js" - }, "devDependencies": { "@types/node": "^22.10.5", "@webgpu/types": "^0.1.52", diff --git a/src/classes/gl.ts b/src/classes/gl.ts index ab97502..f4e16fa 100644 --- a/src/classes/gl.ts +++ b/src/classes/gl.ts @@ -2,7 +2,7 @@ // SPDX-FileContributor: Ben Green // SPDX-License-Identifier: GPL-3.0-or-later AND MIT -import { NanoPowGlFragmentShader, NanoPowGlVertexShader } from '#shaders' +import { NanoPowGlFragmentShader, NanoPowGlVertexShader } from '../shaders' export class NanoPowGl { /** Used to set canvas size. Must be a multiple of 256. */ @@ -37,7 +37,7 @@ export class NanoPowGl { ]) /** Compile */ - static async init() { + static async init () { this.#gl = new OffscreenCanvas(this.#WORKLOAD, this.#WORKLOAD).getContext('webgl2') if (this.#gl == null) throw new Error('WebGL 2 is required') this.#gl.clearColor(0, 0, 0, 1) diff --git a/src/classes/gpu.ts b/src/classes/gpu.ts index a493d12..addc51d 100644 --- a/src/classes/gpu.ts +++ b/src/classes/gpu.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later /// -import { NanoPowGpuComputeShader } from '#shaders' +import { NanoPowGpuComputeShader } from '../shaders' /** * Nano proof-of-work using WebGPU. @@ -108,7 +108,7 @@ export class NanoPowGpu { // Reset `nonce` and `found` to 0u in WORK before each calculation this.#device.queue.writeBuffer(this.#gpuBuffer, 0, new Uint32Array([0, 0, 0])) - // Bind UBO read and GPU write buffers + // Bind UBO read and GPU write buffers const bindGroup = this.#device.createBindGroup({ layout: this.#bindGroupLayout, entries: [ diff --git a/src/main.ts b/src/main.ts index 695da14..780bca0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: 2025 Chris Duncan // SPDX-License-Identifier: GPL-3.0-or-later -import { NanoPow, NanoPowGl, NanoPowGpu } from "#classes" +import { NanoPow, NanoPowGl, NanoPowGpu } from "./classes" export { NanoPow, NanoPowGl, NanoPowGpu } export default NanoPow