Thank you for your interest in contributing! FEAScript is in early development, with continuous additions of new features and improvements. To ensure a smooth and collaborative development process, please review and follow the guidelines below.
-
Respect the existing coding style: Observe the code near your intended changes and aim to preserve that style in your modifications.
-
Recommended tools:
We recommend using Visual Studio Code with the Prettier plugin for automatic code formatting. Additionally, use a 110-character line width to maintain consistent formatting. -
Naming conventions:
Use camelCase formatting for variable names throughout the code. -
Testing changes locally:
Before submitting a pull request, test your modifications by running the FEAScript library from a local directory. For example, you can load the library in your HTML file as follows:import { FEAScriptModel, plotSolution, printVersion } from "[USER_DIRECTORY]/FEAScript-core/src/index.js";
FEAScript can be run on a local server. To start a local server, you can use Python HTTP Server:
python -m http.server
where the server will be available at
http://127.0.0.1:8000/. Static file server npm packages like serve and Vite can also be used.
To contribute a new feature or fix:
- Do not commit directly to
mainordev. - Instead, start your work in a feature branch based on the
devbranch.
If you are not a member of the repository (e.g., an external contributor), you must first fork the repository. Make your changes in your fork, then submit a Pull Request from your fork's feature branch into thedev branch.
All files in the FEAScript-core codebase should follow this structure:
- Banner: All files start with the FEAScript ASCII art banner
- Imports:
- External imports (from npm packages) first, alphabetically ordered
- Internal imports next, grouped by module/folder
- Classes/Functions: Implementation with proper JSDoc comments
Example:
// ______ ______ _____ _ _ //
// | ____| ____| /\ / ____| (_) | | //
// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
// | | | | //
// |_| | |_ //
// Website: https://feascript.com/ \__| //
// External imports
import { mathLibrary } from "math-package";
// Internal imports
import { relatedFunction } from "../utilities/helperScript.js";
/**
* Class to handle specific functionality
*/
export class MyClass {
/**
* Constructor to initialize the class
* @param {object} options - Configuration options
*/
constructor(options) {
// Implementation
}
/**
* Function to perform a specific action
* @param {number} input - Input value
* @returns {number} Processed result
*/
doSomething(input) {
// Implementation
return input * DEFAULT_VALUE;
}
}