vite-plugin-cpp-loader 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.js +2 -2
- package/dist/declarations.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/manifest.d.ts +1 -1
- package/dist/moduleTemplate.d.ts +1 -1
- package/dist/parser.d.ts +1 -1
- package/package.json +1 -1
package/dist/compiler.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SpawnOptions } from 'node:child_process';
|
|
2
|
-
import type { CompileResult, CppLoaderOptions } from './types';
|
|
2
|
+
import type { CompileResult, CppLoaderOptions } from './types.js';
|
|
3
3
|
export interface ResolvedOptions extends Required<CppLoaderOptions> {
|
|
4
4
|
cacheDir: string;
|
|
5
5
|
}
|
package/dist/compiler.js
CHANGED
|
@@ -2,8 +2,8 @@ import { spawn } from 'node:child_process';
|
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { promises as fs } from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { readManifest, scheduleManifestWrite, isCacheValid } from './manifest';
|
|
6
|
-
import { extractTopLevelFunctionNames, buildAutoBindings } from './parser';
|
|
5
|
+
import { readManifest, scheduleManifestWrite, isCacheValid } from './manifest.js';
|
|
6
|
+
import { extractTopLevelFunctionNames, buildAutoBindings } from './parser.js';
|
|
7
7
|
const inFlight = new Map();
|
|
8
8
|
export function defaultSpawn(cmd, args, opts) {
|
|
9
9
|
return new Promise((resolve, reject) => {
|
package/dist/declarations.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CppFunction } from './types';
|
|
1
|
+
import type { CppFunction } from './types.js';
|
|
2
2
|
export declare function generateDeclarations(functions: CppFunction[]): string;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { compile } from './compiler';
|
|
4
|
-
import { extractFunctions } from './parser';
|
|
5
|
-
import { generateDeclarations } from './declarations';
|
|
6
|
-
import { generateModule } from './moduleTemplate';
|
|
7
|
-
import { generateCppProperties } from './vscode';
|
|
3
|
+
import { compile } from './compiler.js';
|
|
4
|
+
import { extractFunctions } from './parser.js';
|
|
5
|
+
import { generateDeclarations } from './declarations.js';
|
|
6
|
+
import { generateModule } from './moduleTemplate.js';
|
|
7
|
+
import { generateCppProperties } from './vscode.js';
|
|
8
8
|
const DEFAULT_CACHE_DIR = 'node_modules/.cpp-wasm';
|
|
9
9
|
const DEFAULT_OPT_LEVEL = 'O2';
|
|
10
10
|
export default function cppLoader(options = {}) {
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CacheManifest } from './types';
|
|
1
|
+
import type { CacheManifest } from './types.js';
|
|
2
2
|
export declare function readManifest(cacheDir: string, readFile: (p: string) => Promise<Buffer | string>): Promise<CacheManifest>;
|
|
3
3
|
export declare function scheduleManifestWrite(cacheDir: string, manifest: CacheManifest, writeFile: (p: string, data: string) => Promise<void>): void;
|
|
4
4
|
export declare function isCacheValid(entry: CacheManifest[string] | undefined, hash: string, stat: (p: string) => Promise<unknown>): Promise<boolean>;
|
package/dist/moduleTemplate.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CppFunction } from './types';
|
|
1
|
+
import type { CppFunction } from './types.js';
|
|
2
2
|
export declare function generateModule(jsPath: string, functions: CppFunction[]): string;
|
package/dist/parser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CppFunction } from './types';
|
|
1
|
+
import type { CppFunction } from './types.js';
|
|
2
2
|
export declare const CPP_TO_TS: Record<string, string>;
|
|
3
3
|
export declare function parseTsd(tsdContent: string): CppFunction[];
|
|
4
4
|
export declare function parseRegexFallback(cppSource: string): CppFunction[];
|
package/package.json
CHANGED