@necpp-engine/wasm 0.1.0
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/COPYING +340 -0
- package/README.md +402 -0
- package/dist/deck.d.ts +4 -0
- package/dist/deck.js +129 -0
- package/dist/errors.d.ts +35 -0
- package/dist/errors.js +57 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +22 -0
- package/dist/loader.d.ts +3 -0
- package/dist/loader.js +144 -0
- package/dist/model.d.ts +21 -0
- package/dist/model.js +702 -0
- package/dist/nec2pp.generated.js +15 -0
- package/dist/nec2pp.wasm +0 -0
- package/dist/state-machine.d.ts +16 -0
- package/dist/state-machine.js +76 -0
- package/dist/types.d.ts +247 -0
- package/dist/types.js +1 -0
- package/dist/versions.d.ts +10 -0
- package/dist/versions.js +10 -0
- package/dist/wasm-internal.d.ts +61 -0
- package/dist/wasm-internal.js +1 -0
- package/dist/worker-client.d.ts +11 -0
- package/dist/worker-client.js +325 -0
- package/dist/worker-entry.d.ts +1 -0
- package/dist/worker-entry.js +93 -0
- package/dist/worker-protocol.d.ts +62 -0
- package/dist/worker-protocol.js +257 -0
- package/dist/worker-runtime.d.ts +14 -0
- package/dist/worker-runtime.js +130 -0
- package/dist/worker.d.ts +5 -0
- package/dist/worker.js +3 -0
- package/package.json +69 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { NecConditioningError, NecError, NecGeometryError, NecInputError, NecPortError, NecRuntimeError, NecSolverError, NecStateError, } from "./errors.js";
|
|
2
|
+
export function isNodeRuntime() {
|
|
3
|
+
const runtime = globalThis;
|
|
4
|
+
return typeof runtime.process === "object"
|
|
5
|
+
&& runtime.process !== null
|
|
6
|
+
&& typeof runtime.process.versions === "object"
|
|
7
|
+
&& runtime.process.versions !== null
|
|
8
|
+
&& typeof runtime.process.versions.node === "string"
|
|
9
|
+
&& typeof runtime.window === "undefined";
|
|
10
|
+
}
|
|
11
|
+
export function isWorkerResponse(value) {
|
|
12
|
+
if (typeof value !== "object" || value === null) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const kind = value.kind;
|
|
16
|
+
return kind === "ok"
|
|
17
|
+
|| kind === "error"
|
|
18
|
+
|| kind === "crash"
|
|
19
|
+
|| kind === "progress";
|
|
20
|
+
}
|
|
21
|
+
function isArrayBuffer(value) {
|
|
22
|
+
return Object.prototype.toString.call(value) === "[object ArrayBuffer]";
|
|
23
|
+
}
|
|
24
|
+
function visitTransferables(value, buffers) {
|
|
25
|
+
if (value === null || value === undefined) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (isArrayBuffer(value)) {
|
|
29
|
+
if (value.byteLength > 0) {
|
|
30
|
+
buffers.add(value);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (ArrayBuffer.isView(value)) {
|
|
35
|
+
const buffer = value.buffer;
|
|
36
|
+
if (isArrayBuffer(buffer) && buffer.byteLength > 0) {
|
|
37
|
+
buffers.add(buffer);
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(value)) {
|
|
42
|
+
for (const item of value) {
|
|
43
|
+
visitTransferables(item, buffers);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (typeof value === "object") {
|
|
48
|
+
for (const item of Object.values(value)) {
|
|
49
|
+
visitTransferables(item, buffers);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Collect unique, non-empty ArrayBuffers owned by a structured-cloneable result. */
|
|
54
|
+
export function collectTransferables(value) {
|
|
55
|
+
const buffers = new Set();
|
|
56
|
+
visitTransferables(value, buffers);
|
|
57
|
+
return [...buffers];
|
|
58
|
+
}
|
|
59
|
+
function errorOptions(details) {
|
|
60
|
+
return details === undefined ? {} : { details };
|
|
61
|
+
}
|
|
62
|
+
export function serializeError(error) {
|
|
63
|
+
if (error instanceof NecStateError) {
|
|
64
|
+
const serialized = {
|
|
65
|
+
name: error.name,
|
|
66
|
+
code: error.code,
|
|
67
|
+
message: error.message,
|
|
68
|
+
operation: error.operation,
|
|
69
|
+
state: error.state,
|
|
70
|
+
};
|
|
71
|
+
return error.details === undefined
|
|
72
|
+
? serialized
|
|
73
|
+
: { ...serialized, details: error.details };
|
|
74
|
+
}
|
|
75
|
+
if (error instanceof NecError) {
|
|
76
|
+
const serialized = {
|
|
77
|
+
name: error.name,
|
|
78
|
+
code: error.code,
|
|
79
|
+
message: error.message,
|
|
80
|
+
};
|
|
81
|
+
return error.details === undefined
|
|
82
|
+
? serialized
|
|
83
|
+
: { ...serialized, details: error.details };
|
|
84
|
+
}
|
|
85
|
+
if (error instanceof Error) {
|
|
86
|
+
return {
|
|
87
|
+
name: "NecRuntimeError",
|
|
88
|
+
code: "NEC_RUNTIME",
|
|
89
|
+
message: error.message,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
name: "NecRuntimeError",
|
|
94
|
+
code: "NEC_RUNTIME",
|
|
95
|
+
message: String(error),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export function reviveError(serialized) {
|
|
99
|
+
switch (serialized.code) {
|
|
100
|
+
case "NEC_STATE":
|
|
101
|
+
return new NecStateError(serialized.operation ?? "unknown", serialized.state ?? "disposed", serialized.message);
|
|
102
|
+
case "NEC_INPUT":
|
|
103
|
+
return new NecInputError(serialized.message, errorOptions(serialized.details));
|
|
104
|
+
case "NEC_GEOMETRY":
|
|
105
|
+
return new NecGeometryError(serialized.message, errorOptions(serialized.details));
|
|
106
|
+
case "NEC_PORT":
|
|
107
|
+
return new NecPortError(serialized.message, errorOptions(serialized.details));
|
|
108
|
+
case "NEC_CONDITIONING":
|
|
109
|
+
return new NecConditioningError(serialized.message, errorOptions(serialized.details));
|
|
110
|
+
case "NEC_SOLVER":
|
|
111
|
+
return new NecSolverError(serialized.message, errorOptions(serialized.details));
|
|
112
|
+
default:
|
|
113
|
+
return new NecRuntimeError(serialized.message, errorOptions(serialized.details));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export function snapshotPorts(ports) {
|
|
117
|
+
return Object.freeze(ports.map((port) => Object.freeze(port.name === undefined
|
|
118
|
+
? { tag: port.tag, segment: port.segment }
|
|
119
|
+
: { tag: port.tag, segment: port.segment, name: port.name })));
|
|
120
|
+
}
|
|
121
|
+
function copyFloat64(value, name) {
|
|
122
|
+
if (Object.prototype.toString.call(value) !== "[object Float64Array]") {
|
|
123
|
+
throw new NecRuntimeError(`Worker result ${name} is not a Float64Array`);
|
|
124
|
+
}
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
export function revivePortSolution(value) {
|
|
128
|
+
const record = value;
|
|
129
|
+
return {
|
|
130
|
+
drive: record.drive,
|
|
131
|
+
frequencyMHz: record.frequencyMHz,
|
|
132
|
+
ports: snapshotPorts(record.ports),
|
|
133
|
+
requested: {
|
|
134
|
+
real: copyFloat64(record.requested.real, "requested.real"),
|
|
135
|
+
imag: copyFloat64(record.requested.imag, "requested.imag"),
|
|
136
|
+
},
|
|
137
|
+
voltages: {
|
|
138
|
+
real: copyFloat64(record.voltages.real, "voltages.real"),
|
|
139
|
+
imag: copyFloat64(record.voltages.imag, "voltages.imag"),
|
|
140
|
+
},
|
|
141
|
+
currents: {
|
|
142
|
+
real: copyFloat64(record.currents.real, "currents.real"),
|
|
143
|
+
imag: copyFloat64(record.currents.imag, "currents.imag"),
|
|
144
|
+
},
|
|
145
|
+
activeImpedances: {
|
|
146
|
+
real: copyFloat64(record.activeImpedances.real, "activeImpedances.real"),
|
|
147
|
+
imag: copyFloat64(record.activeImpedances.imag, "activeImpedances.imag"),
|
|
148
|
+
},
|
|
149
|
+
powersW: copyFloat64(record.powersW, "powersW"),
|
|
150
|
+
factorizationGeneration: record.factorizationGeneration,
|
|
151
|
+
solveGeneration: record.solveGeneration,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export function reviveImpedanceResult(value) {
|
|
155
|
+
const record = value;
|
|
156
|
+
const result = {
|
|
157
|
+
impedance: {
|
|
158
|
+
rows: record.impedance.rows,
|
|
159
|
+
columns: record.impedance.columns,
|
|
160
|
+
order: "row-major",
|
|
161
|
+
real: copyFloat64(record.impedance.real, "impedance.real"),
|
|
162
|
+
imag: copyFloat64(record.impedance.imag, "impedance.imag"),
|
|
163
|
+
},
|
|
164
|
+
admittance: {
|
|
165
|
+
rows: record.admittance.rows,
|
|
166
|
+
columns: record.admittance.columns,
|
|
167
|
+
order: "row-major",
|
|
168
|
+
real: copyFloat64(record.admittance.real, "admittance.real"),
|
|
169
|
+
imag: copyFloat64(record.admittance.imag, "admittance.imag"),
|
|
170
|
+
},
|
|
171
|
+
frequencyMHz: record.frequencyMHz,
|
|
172
|
+
factorizationGeneration: record.factorizationGeneration,
|
|
173
|
+
};
|
|
174
|
+
if (record.conditionEstimate !== undefined) {
|
|
175
|
+
return { ...result, conditionEstimate: record.conditionEstimate };
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
export function reviveFarFieldResult(value) {
|
|
180
|
+
const record = value;
|
|
181
|
+
return {
|
|
182
|
+
radiusM: record.radiusM,
|
|
183
|
+
frequencyMHz: record.frequencyMHz,
|
|
184
|
+
thetaDeg: copyFloat64(record.thetaDeg, "thetaDeg"),
|
|
185
|
+
phiDeg: copyFloat64(record.phiDeg, "phiDeg"),
|
|
186
|
+
eThetaReal: copyFloat64(record.eThetaReal, "eThetaReal"),
|
|
187
|
+
eThetaImag: copyFloat64(record.eThetaImag, "eThetaImag"),
|
|
188
|
+
ePhiReal: copyFloat64(record.ePhiReal, "ePhiReal"),
|
|
189
|
+
ePhiImag: copyFloat64(record.ePhiImag, "ePhiImag"),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
export function reviveEmbeddedFarFieldResult(value) {
|
|
193
|
+
const record = value;
|
|
194
|
+
const field = reviveFarFieldResult(record);
|
|
195
|
+
const normalization = record.normalization.kind === "unit-current"
|
|
196
|
+
? Object.freeze({ kind: "unit-current", valueA: 1 })
|
|
197
|
+
: Object.freeze({ kind: "unit-voltage", valueV: 1 });
|
|
198
|
+
return {
|
|
199
|
+
...field,
|
|
200
|
+
ports: snapshotPorts(record.ports),
|
|
201
|
+
normalization,
|
|
202
|
+
samplesPerPort: record.samplesPerPort,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export function cloneFloat64(source) {
|
|
206
|
+
return Float64Array.from(source);
|
|
207
|
+
}
|
|
208
|
+
export function serializeCreateOptions(options) {
|
|
209
|
+
if (options === undefined) {
|
|
210
|
+
return { transfer: [] };
|
|
211
|
+
}
|
|
212
|
+
const payload = {};
|
|
213
|
+
const transfer = [];
|
|
214
|
+
if (options.wasmUrl !== undefined && options.wasmBinary !== undefined) {
|
|
215
|
+
throw new NecInputError("wasmUrl and wasmBinary cannot both be supplied");
|
|
216
|
+
}
|
|
217
|
+
if (options.wasmUrl !== undefined) {
|
|
218
|
+
payload.wasmUrl = options.wasmUrl instanceof URL
|
|
219
|
+
? options.wasmUrl.href
|
|
220
|
+
: options.wasmUrl;
|
|
221
|
+
}
|
|
222
|
+
if (options.wasmBinary !== undefined) {
|
|
223
|
+
let bytes;
|
|
224
|
+
try {
|
|
225
|
+
if (options.wasmBinary instanceof Uint8Array) {
|
|
226
|
+
bytes = Uint8Array.from(options.wasmBinary);
|
|
227
|
+
}
|
|
228
|
+
else if (options.wasmBinary instanceof ArrayBuffer) {
|
|
229
|
+
bytes = new Uint8Array(options.wasmBinary.slice(0));
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
throw new TypeError("wasmBinary is not an ArrayBuffer or Uint8Array");
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (cause) {
|
|
236
|
+
throw new NecInputError("wasmBinary must be an ArrayBuffer or Uint8Array with readable WASM bytes", { cause });
|
|
237
|
+
}
|
|
238
|
+
payload.wasmBinary = bytes.buffer;
|
|
239
|
+
transfer.push(bytes.buffer);
|
|
240
|
+
}
|
|
241
|
+
if (payload.wasmUrl === undefined && payload.wasmBinary === undefined) {
|
|
242
|
+
return { transfer };
|
|
243
|
+
}
|
|
244
|
+
return { payload, transfer };
|
|
245
|
+
}
|
|
246
|
+
export function toCreateNecModelOptions(options) {
|
|
247
|
+
if (options === undefined) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
if (options.wasmBinary !== undefined) {
|
|
251
|
+
return { wasmBinary: options.wasmBinary };
|
|
252
|
+
}
|
|
253
|
+
if (options.wasmUrl !== undefined) {
|
|
254
|
+
return { wasmUrl: options.wasmUrl };
|
|
255
|
+
}
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CreateNecModelOptions, NecModel, NecWorkerProgressEvent } from "./types.js";
|
|
2
|
+
import { type WorkerRequest, type WorkerResponse } from "./worker-protocol.js";
|
|
3
|
+
export interface WorkerSession {
|
|
4
|
+
model: NecModel | undefined;
|
|
5
|
+
}
|
|
6
|
+
export type ModelFactory = (options?: CreateNecModelOptions) => Promise<NecModel>;
|
|
7
|
+
export interface WorkerRuntimeDependencies {
|
|
8
|
+
readonly createModel: ModelFactory;
|
|
9
|
+
readonly emitProgress: (event: NecWorkerProgressEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function handleWorkerRequest(session: WorkerSession, request: WorkerRequest, deps: WorkerRuntimeDependencies): Promise<{
|
|
12
|
+
response: WorkerResponse;
|
|
13
|
+
transfer: ArrayBuffer[];
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { NecRuntimeError, NecStateError } from "./errors.js";
|
|
2
|
+
import { collectTransferables, serializeError, toCreateNecModelOptions, } from "./worker-protocol.js";
|
|
3
|
+
function invokeModel(model, method, args) {
|
|
4
|
+
switch (method) {
|
|
5
|
+
case "addWire":
|
|
6
|
+
model.addWire(args[0]);
|
|
7
|
+
return undefined;
|
|
8
|
+
case "completeGeometry":
|
|
9
|
+
model.completeGeometry(args[0]);
|
|
10
|
+
return undefined;
|
|
11
|
+
case "definePorts":
|
|
12
|
+
model.definePorts(args[0]);
|
|
13
|
+
return undefined;
|
|
14
|
+
case "addLoad":
|
|
15
|
+
model.addLoad(args[0]);
|
|
16
|
+
return undefined;
|
|
17
|
+
case "clearLoads":
|
|
18
|
+
model.clearLoads();
|
|
19
|
+
return undefined;
|
|
20
|
+
case "setGround":
|
|
21
|
+
model.setGround(args[0]);
|
|
22
|
+
return undefined;
|
|
23
|
+
case "prepare":
|
|
24
|
+
model.prepare(args[0]);
|
|
25
|
+
return undefined;
|
|
26
|
+
case "computeImpedanceMatrix":
|
|
27
|
+
return model.computeImpedanceMatrix();
|
|
28
|
+
case "solveVoltages":
|
|
29
|
+
return model.solveVoltages(args[0]);
|
|
30
|
+
case "solveCurrents":
|
|
31
|
+
return model.solveCurrents(args[0]);
|
|
32
|
+
case "computeFarField":
|
|
33
|
+
return model.computeFarField(args[0]);
|
|
34
|
+
case "computeEmbeddedFarFields":
|
|
35
|
+
return model.computeEmbeddedFarFields(args[0], args[1]);
|
|
36
|
+
case "dispose":
|
|
37
|
+
model.dispose();
|
|
38
|
+
return undefined;
|
|
39
|
+
default: {
|
|
40
|
+
const unexpected = method;
|
|
41
|
+
throw new NecRuntimeError(`Unsupported worker method ${String(unexpected)}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function withProgress(emitProgress, operation, body) {
|
|
46
|
+
emitProgress({ operation, phase: "start" });
|
|
47
|
+
try {
|
|
48
|
+
return await body();
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
emitProgress({ operation, phase: "complete" });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export async function handleWorkerRequest(session, request, deps) {
|
|
55
|
+
if (request.kind === "create") {
|
|
56
|
+
if (session.model !== undefined) {
|
|
57
|
+
return {
|
|
58
|
+
response: {
|
|
59
|
+
id: request.id,
|
|
60
|
+
kind: "error",
|
|
61
|
+
state: session.model.state,
|
|
62
|
+
error: serializeError(new NecRuntimeError("The worker model has already been created")),
|
|
63
|
+
},
|
|
64
|
+
transfer: [],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const model = await withProgress(deps.emitProgress, "create", () => deps.createModel(toCreateNecModelOptions(request.options)));
|
|
69
|
+
session.model = model;
|
|
70
|
+
return {
|
|
71
|
+
response: {
|
|
72
|
+
id: request.id,
|
|
73
|
+
kind: "ok",
|
|
74
|
+
state: model.state,
|
|
75
|
+
transferredBufferCount: 0,
|
|
76
|
+
},
|
|
77
|
+
transfer: [],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return {
|
|
82
|
+
response: {
|
|
83
|
+
id: request.id,
|
|
84
|
+
kind: "error",
|
|
85
|
+
error: serializeError(error),
|
|
86
|
+
},
|
|
87
|
+
transfer: [],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const model = session.model;
|
|
92
|
+
if (model === undefined) {
|
|
93
|
+
return {
|
|
94
|
+
response: {
|
|
95
|
+
id: request.id,
|
|
96
|
+
kind: "error",
|
|
97
|
+
error: serializeError(new NecStateError(request.method, "disposed", "The worker model is not created")),
|
|
98
|
+
},
|
|
99
|
+
transfer: [],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const result = await withProgress(deps.emitProgress, request.method, () => invokeModel(model, request.method, request.args));
|
|
104
|
+
if (request.method === "dispose") {
|
|
105
|
+
session.model = undefined;
|
|
106
|
+
}
|
|
107
|
+
const transfer = collectTransferables(result);
|
|
108
|
+
return {
|
|
109
|
+
response: {
|
|
110
|
+
id: request.id,
|
|
111
|
+
kind: "ok",
|
|
112
|
+
state: request.method === "dispose" ? "disposed" : model.state,
|
|
113
|
+
result,
|
|
114
|
+
transferredBufferCount: transfer.length,
|
|
115
|
+
},
|
|
116
|
+
transfer,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
return {
|
|
121
|
+
response: {
|
|
122
|
+
id: request.id,
|
|
123
|
+
kind: "error",
|
|
124
|
+
state: model.state,
|
|
125
|
+
error: serializeError(error),
|
|
126
|
+
},
|
|
127
|
+
transfer: [],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { NecConditioningError, NecError, NecGeometryError, NecInputError, NecPortError, NecRuntimeError, NecSolverError, NecStateError, } from "./errors.js";
|
|
2
|
+
export { abiVersion, engineVersion, packageVersion } from "./versions.js";
|
|
3
|
+
export type { NecErrorCode, NecErrorOptions } from "./errors.js";
|
|
4
|
+
export { createNecWorkerModel } from "./worker-client.js";
|
|
5
|
+
export type { AngleSweep, CartesianPointM, CompleteGeometryOptions, ComplexMatrix, ComplexVector, ConductivityLoad, CreateNecModelOptions, CreateNecWorkerModelOptions, DistributedParallelRlcLoad, DistributedSeriesRlcLoad, EmbeddedFarFieldResult, EmbeddedFieldNormalization, FarFieldRequest, FarFieldResult, FiniteGround, FreeSpaceGround, GroundConnection, GroundModel, ImpedanceLoad, ImpedanceResult, LoadDefinition, NecModelState, NecWorkerModel, NecWorkerOperation, NecWorkerProgressEvent, NecWorkerProgressListener, ParallelRlcLoad, PerfectGround, PortDefinition, PortSolution, PrepareOptions, SegmentSelection, SeriesRlcLoad, WireDefinition, } from "./types.js";
|
package/dist/worker.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { NecConditioningError, NecError, NecGeometryError, NecInputError, NecPortError, NecRuntimeError, NecSolverError, NecStateError, } from "./errors.js";
|
|
2
|
+
export { abiVersion, engineVersion, packageVersion } from "./versions.js";
|
|
3
|
+
export { createNecWorkerModel } from "./worker-client.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@necpp-engine/wasm",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Stateful NEC2++ electromagnetic solver for Node and the browser",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"antenna",
|
|
9
|
+
"electromagnetics",
|
|
10
|
+
"nec2",
|
|
11
|
+
"simulation",
|
|
12
|
+
"typescript",
|
|
13
|
+
"wasm",
|
|
14
|
+
"webassembly"
|
|
15
|
+
],
|
|
16
|
+
"license": "GPL-2.0-or-later",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/andrekuehne/necpp.git",
|
|
20
|
+
"directory": "packages/necpp-wasm"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/andrekuehne/necpp#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/andrekuehne/necpp/issues"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=24"
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js",
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./worker": {
|
|
42
|
+
"types": "./dist/worker.d.ts",
|
|
43
|
+
"import": "./dist/worker.js",
|
|
44
|
+
"default": "./dist/worker.js"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist",
|
|
49
|
+
"README.md",
|
|
50
|
+
"COPYING"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "node scripts/build-dist.mjs",
|
|
54
|
+
"prepack": "npm run build",
|
|
55
|
+
"build:test": "node test/build.mjs",
|
|
56
|
+
"test": "npm run build:test && node --test test/*.test.mjs && npm run typecheck",
|
|
57
|
+
"test:wasm": "node test/require-wasm.mjs && npm test && npm run test:pack",
|
|
58
|
+
"test:pack": "node test/require-wasm.mjs && node --test --test-timeout=180000 --test-concurrency=1 test/pack/manifest.test.mjs test/pack/consumer.test.mjs",
|
|
59
|
+
"test:browser": "node test/browser-integration.mjs",
|
|
60
|
+
"pack:release": "node scripts/pack-release.mjs",
|
|
61
|
+
"typecheck": "tsc --project tsconfig.json"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^24.13.3",
|
|
65
|
+
"playwright": "1.62.1",
|
|
66
|
+
"typescript": "5.8.3",
|
|
67
|
+
"yaml": "2.9.0"
|
|
68
|
+
}
|
|
69
|
+
}
|