Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
81379b6
Update README.md and CLAUDE.md with correct guidances
Victorcorcos Aug 29, 2025
0b8597d
Add basic configs of vitest, node, packages, index and lint
Victorcorcos Aug 29, 2025
f71df14
Update files to actually return the value with correct type instead o…
Victorcorcos Aug 29, 2025
274fdf5
Update README.md and CLAUDE.md
Victorcorcos Aug 29, 2025
443cd77
Remove outdated test files leftover from the previous ugly html based…
Victorcorcos Aug 30, 2025
38723c4
Ignore node_modules/ and other files/folders
Victorcorcos Aug 30, 2025
75c5108
Rename npm package and class to a better name: Parsec
Victorcorcos Aug 30, 2025
5c52fbf
Setup and Apply lint, formatting and autofixes for both of them
Victorcorcos Aug 30, 2025
97ef598
Update CLAUDE and README
Victorcorcos Aug 30, 2025
9440d17
Update CLAUDE.md
Victorcorcos Aug 30, 2025
44d70ea
Fix emsdk build
Victorcorcos Aug 31, 2025
df28660
Remove emsdk/ folder. It should be run locally.
Victorcorcos Sep 1, 2025
1a4b3da
Untrack test-results.json from git
Victorcorcos Sep 1, 2025
cd57f42
Remove /emsdk from eslint and prettier
Victorcorcos Sep 1, 2025
4cf2dc0
Update CLAUDE, README and build.sh to deal with Emscripten installation
Victorcorcos Sep 1, 2025
4b5f0f5
Prepare repository for package publishment
Victorcorcos Sep 1, 2025
5f0b0f0
Remove unecessary backwards compatibility with old gigantic class name
Victorcorcos Sep 1, 2025
0d30be8
Remove code related to spikes (c++ -> .wasm -> javascript of sum() an…
Victorcorcos Sep 1, 2025
e14b162
Add wasm/ to gitignore
Victorcorcos Sep 1, 2025
f791a81
Merge remote-tracking branch 'upstream/main' into phase3_automated_tests
Victorcorcos Sep 1, 2025
90ebf90
Update build-equations-parser.sh
Victorcorcos Sep 1, 2025
7cc9993
Modernize build system and fix performance issues
Victorcorcos Sep 1, 2025
254f070
Fix html page
Victorcorcos Sep 1, 2025
08e41b2
Improve README usability by moving Quick Start section to beginning
Victorcorcos Sep 1, 2025
08aa4e4
Simplify documentation by removing development phase references
Victorcorcos Sep 1, 2025
b2ec60d
Merge upstream/main into phase3_automated_tests
Victorcorcos Sep 2, 2025
977af94
Compact README
Victorcorcos Sep 2, 2025
a5112bf
Remove invalid comments
Victorcorcos Sep 2, 2025
2487524
Configure github actions to run the tests
Victorcorcos Sep 2, 2025
7a639eb
Run github actions in all branches
Victorcorcos Sep 2, 2025
af4ba1f
Merge remote-tracking branch 'upstream/main' into phase3_automated_tests
Victorcorcos Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/**
* ESLint Configuration for Parsec Equations Library
*
* Provides comprehensive linting rules for JavaScript/ES6+ code
* with Prettier integration for formatting and specific considerations
* for WebAssembly integration and cross-platform library development.
*/

module.exports = {
// Environment configuration
env: {
browser: true,
node: true,
es2022: true,
worker: true,
},

// Parser configuration for modern JavaScript
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
allowImportExportEverywhere: true,
},

// Base configurations
extends: ['eslint:recommended', 'prettier'],

// Plugin configuration
plugins: ['prettier'],

// Global variables
globals: {
// Vitest globals
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeAll: 'readonly',
beforeEach: 'readonly',
afterAll: 'readonly',
afterEach: 'readonly',
vi: 'readonly',

// WebAssembly globals
WebAssembly: 'readonly',

// AMD module globals
define: 'readonly',

// Test environment globals
__TEST_ENV__: 'readonly',
__VERSION__: 'readonly',
},

// Custom rules
rules: {
// Prettier integration
'prettier/prettier': 'error',

// Variables
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'no-var': 'error',
'prefer-const': 'error',

// Functions
'no-unused-expressions': 'error',
'prefer-arrow-callback': 'error',

// Best practices
eqeqeq: ['error', 'always'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-new-func': 'error',
'no-console': 'off', // Allow console for WebAssembly debugging
'no-debugger': 'error',
'no-alert': 'error',

// ES6+ features
'prefer-template': 'error',
'prefer-destructuring': [
'error',
{
array: false,
object: true,
},
],

// Error handling
'no-throw-literal': 'error',
'prefer-promise-reject-errors': 'error',

// Code complexity
complexity: ['warn', 15],
'max-depth': ['warn', 4],

// Async/await
'require-await': 'error',
'no-return-await': 'error',

// Classes
'class-methods-use-this': 'off', // Allow methods that don't use 'this'
'no-useless-constructor': 'error',

// Imports/exports
'no-duplicate-imports': 'error',

// WebAssembly specific
'no-new-wrappers': 'error',
'no-prototype-builtins': 'error',
},

// Override rules for specific file patterns
overrides: [
// Test files
{
files: ['tests/**/*.js', '**/*.test.js', '**/*.spec.js'],
rules: {
'no-magic-numbers': 'off', // Allow magic numbers in tests
'prefer-arrow-callback': 'off', // Allow function expressions in tests
},
},

// Configuration files
{
files: ['*.config.js', '.eslintrc.js', 'vitest.config.js'],
rules: {
'no-console': 'off',
},
},

// WebAssembly wrapper files
{
files: ['js/**/*.js'],
rules: {
'no-console': 'off', // Allow console for WASM debugging
complexity: ['warn', 20], // Allow higher complexity for WASM integration
},
},

// Entry point files
{
files: ['index.js', 'index.mjs'],
rules: {
complexity: ['warn', 20], // Allow higher complexity for compatibility layers
},
},
],

// Ignore patterns
ignorePatterns: [
'node_modules/',
'coverage/',
'dist/',
'equations-parser/', // Git submodule - don't lint
'wasm/*.js', // Generated Emscripten files
'*.wasm',
'html/',
'docs/',
'*.min.js',
'emsdk/', // Emscripten SDK - don't lint
],
}
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI - Tests

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [18.x, 20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --run

# Optional: upload coverage if your `npm test` generates it
# - name: Upload coverage report
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: coverage-${{ matrix.os }}-node${{ matrix.node }}
# path: coverage
40 changes: 40 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Dependencies
node_modules/

# Submodules
equations-parser/

# Emscripten SDK
emsdk/

# Build outputs
dist/
coverage/

# Generated WebAssembly files
wasm/*.js
*.wasm

# HTML test files (legacy)
html/
tests/*.html

# Documentation
docs/

# Minified files
*.min.js

# Logs
*.log
npm-debug.log*

# Test results
test-results*.json

# GitHub files
.github/

# OS files
.DS_Store
Thumbs.db
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100,
"bracketSpacing": true,
"arrowParens": "avoid"
}
Loading
Loading