Skip to content

Commit c556727

Browse files
nikoschamsridhar-maniSridharNCICopilot
authored
sync with dev branch (#26)
* Made the initial build for npm (#25) * Made the initial build for npm * fix: update package.json with correct license, description and module type - Change license from AGPLv3 to MIT to match actual project license - Replace HTML image tag with proper text description - Update type to "module" to align with ES module syntax * Prepare package for npm publishing and bump version to 0.1.1 * Update package.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update rollup.config.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update rollup.config.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update test script to use jest and add jest as a devDependency * fix: remove (still) unused wasm plugin from rollup configuration * fix: remove unused rollup-plugin-wasm from devDependencies * fix: revert test script to no tests configured and remove jest from devDependencies * Add plotly.js as a peer and dev dependency; update Rollup config for external globals * fix: remove unused rollup-plugin-typescript2 from configuration * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: update import paths in README for consistency with distribution bundle * fix: correct parameter syntax in addBoundaryCondition example --------- Co-authored-by: Sridhar.Mani <sridhar.mani@novacastindia.com> Co-authored-by: Nikos Chamakos <nikoscham@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update author and contributors information in package.json * Add publishConfig to package.json for public access --------- Co-authored-by: sridhar <2019309038@student.annauniv.edu> Co-authored-by: Sridhar.Mani <sridhar.mani@novacastindia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 2a18a9e commit c556727

15 files changed

+4743
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
node_modules
3+
node_modules/

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
examples/
2+
test/
3+
.gitignore
4+
package-lock.json

README.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,67 @@
66

77
> 🚧 **FEAScript is currently under heavy development.** Functionality and interfaces may change rapidly as new features and enhancements are introduced. 🚧
88
9-
## Getting Started
9+
## Installation
1010

11-
FEAScript is entirely implemented in pure JavaScript and requires only a simple HTML page to operate. All simulations are executed locally in your browser, without the need for any cloud services.
11+
FEAScript is entirely implemented in pure JavaScript and requires only a simple HTML page to operate. All simulations are executed locally in your browser, without the need for any cloud services. You can use FEAScript in your projects through one of the following methods:
12+
13+
### Option 1: NPM Installation
14+
15+
```bash
16+
# Install FEAScript and its peer dependencies
17+
npm install feascript mathjs plotly.js
18+
```
19+
20+
Then import it in your JavaScript/TypeScript file:
21+
22+
```javascript
23+
// ES Modules
24+
import { FEAScriptModel, plotSolution } from "feascript";
25+
26+
// CommonJS
27+
const { FEAScriptModel, plotSolution } = require("feascript");
28+
```
29+
30+
**Important:** FEAScript is built as an ES module. If you're starting a new project, make sure to configure it to use ES modules by running:
31+
32+
```bash
33+
# Create package.json with type=module for ES modules support
34+
echo '{"type":"module"}' > package.json
35+
```
36+
37+
If you already have a package.json file, manually add `"type": "module"` to enable ES modules in your project.
38+
39+
### Option 2: Direct Import from CDN
40+
41+
Add this line to your HTML or JavaScript module:
42+
43+
```javascript
44+
import { FEAScriptModel, plotSolution } from "https://core.feascript.com/dist/feascript.umd.js";
45+
```
46+
47+
### Option 3: Download and Use Locally
48+
49+
1. Download the latest release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases)
50+
2. Include it in your project:
51+
52+
```html
53+
<script type="module">
54+
import { FEAScriptModel, plotSolution } from "./path/to/dist/feascript.esm.js";
55+
// Your code here
56+
</script>
57+
```
1258

1359
### Example Usage
1460

1561
```javascript
1662
// Import FEAScript library
17-
import { FEAScriptModel, plotSolution } from "https://core.feascript.com/src/index.js";
63+
import { FEAScriptModel, plotSolution } from "https://core.feascript.com/dist/feascript.umd.js";
1864

1965
// Create and configure model
2066
const model = new FEAScriptModel();
2167
model.setSolverConfig("solverType"); // e.g., "solidHeatTransfer" for a stationary solid heat transfer case
22-
model.setMeshConfig({ // Define mesh configuration (assuming a rectangular domain for 2D)
68+
model.setMeshConfig({
69+
// Define mesh configuration (assuming a rectangular domain for 2D)
2370
meshDimension: "1D" | "2D", // Mesh dimension
2471
elementOrder: "linear" | "quadratic", // Element order
2572
numElementsX: number, // Number of elements in x-direction

dist/feascript.cjs.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/feascript.cjs.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/feascript.esm.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/feascript.esm.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/feascript.umd.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/feascript.umd.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

feascript-0.1.1.tgz

138 KB
Binary file not shown.

0 commit comments

Comments
 (0)