@ferscloud/fers-calculation-web 0.2.61 → 0.2.63
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/README.md +16 -3
- package/fers-models.d.ts +60 -6
- package/fers_calculations_bg.js +2 -2
- package/fers_calculations_bg.wasm +0 -0
- package/package.json +16 -1
package/README.md
CHANGED
|
@@ -20,17 +20,26 @@ npm install @ferscloud/fers-calculation
|
|
|
20
20
|
**Vite**
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npm i -D vite-plugin-wasm
|
|
23
|
+
npm i -D vite-plugin-wasm
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
27
|
// vite.config.ts
|
|
28
28
|
import wasm from "vite-plugin-wasm";
|
|
29
|
-
import topLevelAwait from "vite-plugin-top-level-await";
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
// The package initialises with a top-level await, so the build target has to
|
|
31
|
+
// be one that supports it. `esnext` needs no second plugin.
|
|
32
|
+
export default {
|
|
33
|
+
plugins: [wasm()],
|
|
34
|
+
build: { target: "esnext" },
|
|
35
|
+
};
|
|
32
36
|
```
|
|
33
37
|
|
|
38
|
+
`esnext` keeps the top-level await in the output, which needs Chrome, Edge or
|
|
39
|
+
Firefox 89+, or Safari 15+. If you still have `vite-plugin-top-level-await` in
|
|
40
|
+
your config from an earlier version of this README, drop it — recent
|
|
41
|
+
`@swc/core` releases make it fail at `vite build`.
|
|
42
|
+
|
|
34
43
|
**Next.js / webpack**
|
|
35
44
|
|
|
36
45
|
```js
|
|
@@ -202,6 +211,10 @@ const credit = fersAttributionHtml(res);
|
|
|
202
211
|
exported. All of them accept the envelope, the parsed model or the results
|
|
203
212
|
bundle, and all return nothing for a Pro result or an error envelope.
|
|
204
213
|
|
|
214
|
+
On 0.2.61 this subpath resolved only under a bundler; plain Node ESM needed
|
|
215
|
+
`/badge.js`. From 0.2.62 the package ships an `exports` map and both forms work
|
|
216
|
+
everywhere.
|
|
217
|
+
|
|
205
218
|
Using the free tier in an application? Please display the credit. It is the
|
|
206
219
|
only thing the free tier asks of you.
|
|
207
220
|
|
package/fers-models.d.ts
CHANGED
|
@@ -125,11 +125,7 @@ export interface components {
|
|
|
125
125
|
include_warping: boolean;
|
|
126
126
|
/** Format: int32 */
|
|
127
127
|
max_iterations?: number | null;
|
|
128
|
-
|
|
129
|
-
* @description Controls the nonlinear solver formulation (P_DELTA or COROTATIONAL).
|
|
130
|
-
* Only affects second-order (nonlinear) analysis.
|
|
131
|
-
*/
|
|
132
|
-
nonlinear_method?: components["schemas"]["NonlinearMethod"];
|
|
128
|
+
nonlinear_method?: null | components["schemas"]["NonlinearMethod"];
|
|
133
129
|
order: components["schemas"]["AnalysisOrder"];
|
|
134
130
|
/**
|
|
135
131
|
* @description Controls the geometric stiffness matrix formulation for P-Delta analysis.
|
|
@@ -200,7 +196,20 @@ export interface components {
|
|
|
200
196
|
*/
|
|
201
197
|
self_weight_load_case_id?: number | null;
|
|
202
198
|
solve_loadcases: boolean;
|
|
203
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* Format: double
|
|
201
|
+
* @description Convergence tolerance for the second-order Newton residual.
|
|
202
|
+
*
|
|
203
|
+
* **Floored at 1e-6.** A smaller value is accepted and then raised to that
|
|
204
|
+
* floor, because below it the residual is dominated by rounding in the
|
|
205
|
+
* assembly rather than by the equilibrium error, so iterating further buys
|
|
206
|
+
* precision that is not there. Asking for 1e-10 therefore gets you 1e-6, and
|
|
207
|
+
* that is deliberate — the number is named `SECOND_ORDER_RESIDUAL_FLOOR` in
|
|
208
|
+
* `models::fers::fers`.
|
|
209
|
+
*
|
|
210
|
+
* Ignored entirely by a first-order (`Linear`) analysis, which factorises
|
|
211
|
+
* once and does not iterate.
|
|
212
|
+
*/
|
|
204
213
|
tolerance: number;
|
|
205
214
|
};
|
|
206
215
|
/**
|
|
@@ -211,6 +220,50 @@ export interface components {
|
|
|
211
220
|
* @enum {string}
|
|
212
221
|
*/
|
|
213
222
|
AnalysisOrder: "LINEAR" | "NONLINEAR";
|
|
223
|
+
/**
|
|
224
|
+
* @description Free-tier provenance stamp, attached to every result the free solver
|
|
225
|
+
* produces and absent from Premium results.
|
|
226
|
+
*
|
|
227
|
+
* Why it lives in the engine rather than in a JS wrapper: the tier is decided
|
|
228
|
+
* inside the WASM module, by Ed25519-verifying a solve token against a public
|
|
229
|
+
* key compiled into the binary (`wasm_bindings::verify_solve_token`). Anything
|
|
230
|
+
* downstream of that boundary — a bundler config, a React component, a JSON
|
|
231
|
+
* post-processing step — can be edited by whoever ships the page. Minting the
|
|
232
|
+
* attribution here means the branded path is the default one, and removing it
|
|
233
|
+
* means either holding the server's private key or patching and rebuilding a
|
|
234
|
+
* WebAssembly binary.
|
|
235
|
+
*
|
|
236
|
+
* It is not, and cannot be, an absolute guarantee: anything shipped to a
|
|
237
|
+
* browser can ultimately be modified. It raises the cost of stripping
|
|
238
|
+
* attribution from "delete a div" to "rebuild the engine", and the licence
|
|
239
|
+
* carries the rest.
|
|
240
|
+
*
|
|
241
|
+
* `html` and `text` are pre-rendered so a consumer can display the credit
|
|
242
|
+
* without knowing anything about our brand. `fersAttributionHtml()` in
|
|
243
|
+
* `@ferscloud/fers-calculation-web/badge` simply returns `attribution.html`,
|
|
244
|
+
* and returns "" when the field is absent — so upgrading to Pro white-labels
|
|
245
|
+
* with no code change.
|
|
246
|
+
*/
|
|
247
|
+
Attribution: {
|
|
248
|
+
/**
|
|
249
|
+
* @description Engine version that produced the results. Mirrors
|
|
250
|
+
* [`ResultsBundle::engine_version`].
|
|
251
|
+
*/
|
|
252
|
+
engine_version: string;
|
|
253
|
+
/** @description Always "FERS". */
|
|
254
|
+
generated_by: string;
|
|
255
|
+
/** @description Ready-to-inject HTML anchor, for web UIs. */
|
|
256
|
+
html: string;
|
|
257
|
+
/** @description Plain-text credit, for console output, PDFs and text reports. */
|
|
258
|
+
text: string;
|
|
259
|
+
/**
|
|
260
|
+
* @description The tier this solve ran under. Only ever "free" — Premium results carry
|
|
261
|
+
* no `attribution` object at all.
|
|
262
|
+
*/
|
|
263
|
+
tier: string;
|
|
264
|
+
/** @description Canonical product URL. */
|
|
265
|
+
url: string;
|
|
266
|
+
};
|
|
214
267
|
/**
|
|
215
268
|
* @description A global coordinate axis.
|
|
216
269
|
* @enum {string}
|
|
@@ -2355,6 +2408,7 @@ export interface components {
|
|
|
2355
2408
|
};
|
|
2356
2409
|
/** @description All analysis results: per load case, per load combination, unity-check results and the optional HTML report. */
|
|
2357
2410
|
ResultsBundle: {
|
|
2411
|
+
attribution?: null | components["schemas"]["Attribution"];
|
|
2358
2412
|
buckling?: null | components["schemas"]["BucklingResults"];
|
|
2359
2413
|
/**
|
|
2360
2414
|
* @description Per-reference buckling runs, present only when `analysis.buckling`
|
package/fers_calculations_bg.js
CHANGED
|
@@ -118,7 +118,7 @@ export function version() {
|
|
|
118
118
|
export function wasm_init() {
|
|
119
119
|
wasm.wasm_init();
|
|
120
120
|
}
|
|
121
|
-
export function
|
|
121
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
122
122
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
123
123
|
}
|
|
124
124
|
export function __wbg_error_757e9472f8410341(arg0, arg1) {
|
|
@@ -136,7 +136,7 @@ export function __wbg_new_227d7c05414eb861() {
|
|
|
136
136
|
const ret = new Error();
|
|
137
137
|
return ret;
|
|
138
138
|
}
|
|
139
|
-
export function
|
|
139
|
+
export function __wbg_now_d1fb6650485d7f3e() {
|
|
140
140
|
const ret = Date.now();
|
|
141
141
|
return ret;
|
|
142
142
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ferscloud/fers-calculation-web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.63",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -55,5 +55,20 @@
|
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
|
+
},
|
|
59
|
+
"exports": {
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./fers_calculations.d.ts",
|
|
62
|
+
"default": "./fers_calculations.js"
|
|
63
|
+
},
|
|
64
|
+
"./badge": {
|
|
65
|
+
"types": "./badge.d.ts",
|
|
66
|
+
"default": "./badge.js"
|
|
67
|
+
},
|
|
68
|
+
"./fers-models": {
|
|
69
|
+
"types": "./fers-models.d.ts"
|
|
70
|
+
},
|
|
71
|
+
"./package.json": "./package.json",
|
|
72
|
+
"./*": "./*"
|
|
58
73
|
}
|
|
59
74
|
}
|