Skip to content

Commit

Permalink
Fixed types import
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed May 22, 2024
1 parent debd5a4 commit 12adbb1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "tsc -p tsconfig.json --noEmit && eslint src",
"build": "npx build --package=@zenfs/core --globalName ZenFS_Emscripten --entry src/index.ts",
"build": "npx build --package=@zenfs/core --globalName ZenFS_Emscripten --entry src/index.ts --",
"build:docs": "typedoc --out docs --name 'ZenFS Emscripten' src/index.ts",
"prepublishOnly": "npm run build",
"postinstall": "patch-package"
Expand Down
1 change: 0 additions & 1 deletion src/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { File } from '@zenfs/core/file.js';
import { FileSystem, FileSystemMetadata, Sync } from '@zenfs/core/filesystem.js';
import { FileType, Stats } from '@zenfs/core/stats.js';
import { Buffer } from 'buffer';
import './emscripten.js';

/**
* @hidden
Expand Down
10 changes: 10 additions & 0 deletions src/emscripten.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
This is for types only.
By exporting a named export, and using `import type`, we avoid build errors
*/

import 'emscripten';

import EmFS = FS;

export type { EmFS };
4 changes: 1 addition & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import zfs, { Errno, parseFlag, type Stats } from '@zenfs/core';
import 'emscripten'; // Note: this is for types only.

import EmFS = FS;
import type { EmFS } from './emscripten.js';

interface Mount extends EmFS.Mount {
opts: { root?: string };
Expand Down

0 comments on commit 12adbb1

Please sign in to comment.