Skip to content

Commit 5041967

Browse files
committed
chore: update npm library from 'mathflow' to '@mathflowjs/mathflow'
the former package was accidentally unpublished and i got little or no help from npm to restore the package or at least use the name again.
1 parent 3db9f09 commit 5041967

File tree

8 files changed

+44
-44
lines changed

8 files changed

+44
-44
lines changed

docs/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This provides a simple interface for solving, rendering, and managing variables/
1111
Use `createContext` to manage isolated or persistent variable scopes:
1212

1313
```ts
14-
import { createContext } from "mathflow";
14+
import { createContext } from "@mathflowjs/mathflow";
1515

1616
const ctx = createContext({
1717
// ...

docs/api/procedural.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ MathFlow's processing pipeline consists of four main stages:
2929
Converts a string input into a sequence of tokens.
3030

3131
```ts
32-
import { createContext, tokenize, TOKEN } from "mathflow";
32+
import { createContext, tokenize, TOKEN } from "@mathflowjs/mathflow";
3333

3434
const ctx = createContext();
3535

@@ -75,7 +75,7 @@ type Token = {
7575
Converts a sequence of tokens into an Abstract Syntax Tree (AST).
7676

7777
```ts
78-
import { parse, NODE } from "mathflow";
78+
import { parse, NODE } from "@mathflowjs/mathflow";
7979

8080
const ast = parse(tokens);
8181
// {
@@ -115,7 +115,7 @@ enum NODE {
115115
Creates a new solution stack for tracking evaluation steps.
116116

117117
```ts
118-
import { createSolutionStack } from "mathflow";
118+
import { createSolutionStack } from "@mathflowjs/mathflow";
119119

120120
const solution = createSolutionStack();
121121

@@ -131,7 +131,7 @@ console.log(solution.steps); // [ ... ]
131131
Evaluates an AST node in the given context.
132132

133133
```ts
134-
import { evaluate } from "mathflow";
134+
import { evaluate } from "@mathflowjs/mathflow";
135135

136136
const value = evaluate(ctx, ast.body[0], solution);
137137

@@ -151,7 +151,7 @@ import {
151151
createSolutionStack,
152152
TOKEN,
153153
NODE,
154-
} from "mathflow";
154+
} from "@mathflowjs/mathflow";
155155

156156
// 1. Create context with variables
157157
const ctx = createContext({
@@ -184,7 +184,7 @@ console.log("Steps:", solution.steps);
184184
### Custom Token Processing
185185

186186
```ts
187-
import { Token, TOKEN } from "mathflow";
187+
import { Token, TOKEN } from "@mathflowjs/mathflow";
188188

189189
function analyzeTokens(tokens: Token[]) {
190190
return tokens.reduce(
@@ -206,7 +206,7 @@ function analyzeTokens(tokens: Token[]) {
206206
### AST Transformation
207207

208208
```ts
209-
import { Node, NODE } from "mathflow";
209+
import { Node, NODE } from "@mathflowjs/mathflow";
210210

211211
// ...
212212

@@ -248,7 +248,7 @@ function simplifyAST(node: Node): Node {
248248
### Custom Evaluation Strategy
249249

250250
```ts
251-
import { Context, Node } from "mathflow";
251+
import { Context, Node } from "@mathflowjs/mathflow";
252252

253253
function evaluateWithTimeout(
254254
ctx: Context,

docs/api/rendering.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can render mathematical expressions as HTML with customizable styling and th
1111
You can render MathFlow code as HTML using the context API (recommended):
1212

1313
```ts
14-
import { createContext } from "mathflow";
14+
import { createContext } from "@mathflowjs/mathflow";
1515

1616
const ctx = createContext();
1717
const html = ctx.renderAsHTML("sin(x) + 2^3", {
@@ -25,7 +25,7 @@ const html = ctx.renderAsHTML("sin(x) + 2^3", {
2525
For advanced usage, tokenize an expression and render manually:
2626

2727
```ts
28-
import { createContext, tokenize, renderTokensAsHTML } from "mathflow";
28+
import { createContext, tokenize, renderTokensAsHTML } from "@mathflowjs/mathflow";
2929

3030
const ctx = createContext();
3131
const tokens = tokenize(ctx, "sin(x) + 2^3");
@@ -61,7 +61,7 @@ You can convert mathematical expressions to LaTeX format, suitable for use with
6161
You can render MathFlow code as LaTeX using the context API (recommended):
6262

6363
```ts
64-
import { createContext } from "mathflow";
64+
import { createContext } from "@mathflowjs/mathflow";
6565

6666
const ctx = createContext();
6767

@@ -74,7 +74,7 @@ const latex = ctx.renderAsLaTeX("sqrt(4) + pi", { mode: "inline" });
7474
For advanced usage, tokenize an expression and render manually:
7575

7676
```ts
77-
import { createContext, tokenize, renderTokensAsLaTeX } from "mathflow";
77+
import { createContext, tokenize, renderTokensAsLaTeX } from "@mathflowjs/mathflow";
7878

7979
const ctx = createContext();
8080

docs/examples/index.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section provides practical examples of using MathFlow in different scenario
77
### Simple Calculations
88

99
```ts:line-numbers
10-
import { createContext } from 'mathflow';
10+
import { createContext } from '@mathflowjs/mathflow';
1111
1212
const ctx = createContext();
1313
@@ -23,7 +23,7 @@ console.log(ctx.solve('sqrt(16)')); // 4
2323
### Working with Variables
2424

2525
```ts:line-numbers
26-
import { createContext } from 'mathflow';
26+
import { createContext } from '@mathflowjs/mathflow';
2727
2828
const ctx = createContext({
2929
variables: {
@@ -46,7 +46,7 @@ console.log(ctx.solve('x + y + z')); // 18
4646
### Solving Equations in Steps
4747

4848
```ts:line-numbers
49-
import { createContext } from 'mathflow';
49+
import { createContext } from '@mathflowjs/mathflow';
5050
5151
const steps = ctx.solveBatch(`
5252
x = 5
@@ -65,7 +65,7 @@ steps.forEach(step => {
6565
### Working with Functions
6666

6767
```ts:line-numbers
68-
import { createContext } from 'mathflow';
68+
import { createContext } from '@mathflowjs/mathflow';
6969
7070
const ctx = createContext({
7171
functions: {
@@ -83,7 +83,7 @@ console.log(ctx.solve('circleArea(5)')); // 78.54...
8383
### Trigonometry
8484

8585
```ts:line-numbers
86-
import { createContext } from 'mathflow';
86+
import { createContext } from '@mathflowjs/mathflow';
8787
8888
const ctx = createContext({
8989
preferences: {
@@ -103,7 +103,7 @@ console.log(ctx.solve('sin(x)^2 + cos(x)^2')); // 1
103103
### LaTeX Output
104104

105105
```ts:line-numbers
106-
import { createContext } from 'mathflow';
106+
import { createContext } from '@mathflowjs/mathflow';
107107
108108
const ctx = createContext();
109109
@@ -121,7 +121,7 @@ console.log(latex);
121121
### HTML Rendering
122122

123123
```ts:line-numbers
124-
import { createContext } from 'mathflow';
124+
import { createContext } from '@mathflowjs/mathflow';
125125
126126
const ctx = createContext();
127127
@@ -140,7 +140,7 @@ document.getElementById('math').innerHTML = html;
140140
### Financial Calculations
141141

142142
```ts:line-numbers
143-
import { createContext } from 'mathflow';
143+
import { createContext } from '@mathflowjs/mathflow';
144144
145145
const ctx = createContext({
146146
functions: {
@@ -164,7 +164,7 @@ console.log(ctx.solve('PMT(200000, 0.035, 360)')); // 898.09
164164
### Physics Equations
165165

166166
```ts:line-numbers
167-
import { createContext } from 'mathflow';
167+
import { createContext } from '@mathflowjs/mathflow';
168168
169169
const ctx = createContext({
170170
constants: {
@@ -189,7 +189,7 @@ console.log(ctx.solve('period(2)')); // 2.84s (2m length)
189189
### Geometry
190190

191191
```ts:line-numbers
192-
import { createContext } from 'mathflow';
192+
import { createContext } from '@mathflowjs/mathflow';
193193
194194
const ctx = createContext({
195195
functions: {
@@ -217,7 +217,7 @@ console.log(ctx.solve('polygonArea(6, 2)')); // 10.39
217217
### Graceful Error Handling
218218

219219
```ts:line-numbers
220-
import { createContext } from 'mathflow';
220+
import { createContext } from '@mathflowjs/mathflow';
221221
222222
function safeSolve(expr: string) {
223223
try {
@@ -244,7 +244,7 @@ console.log(safeSolve('undefined_var')); // { success: false, error: "RuntimeErr
244244
### Input Validation
245245

246246
```ts:line-numbers
247-
import { createContext } from 'mathflow';
247+
import { createContext } from '@mathflowjs/mathflow';
248248
249249
function validateExpression(expr: string) {
250250
const ctx = createContext();

docs/guide/builtin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ MathFlow comes with a rich set of built-in constants and functions for mathemati
5050
## Examples
5151

5252
```js:line-numbers
53-
import { createContext } from 'mathflow';
53+
import { createContext } from '@mathflowjs/mathflow';
5454
5555
const ctx = createContext();
5656

docs/guide/getting-started.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ Install MathFlow using your preferred package manager:
1919
:::code-group
2020

2121
```sh [npm]
22-
$ npm install mathflow
22+
$ npm install @mathflowjs/mathflow
2323
```
2424

2525
```sh [pnpm]
26-
$ pnpm add mathflow
26+
$ pnpm add @mathflowjs/mathflow
2727
```
2828

2929
```sh [yarn]
30-
$ yarn add mathflow
30+
$ yarn add @mathflowjs/mathflow
3131
```
3232

3333
```sh [bun]
34-
$ bun add mathflow
34+
$ bun add @mathflowjs/mathflow
3535
```
3636

3737
:::
@@ -41,7 +41,7 @@ $ bun add mathflow
4141
Here's a simple example to get you started:
4242

4343
```ts:line-numbers
44-
import { createContext } from 'mathflow';
44+
import { createContext } from '@mathflowjs/mathflow';
4545
4646
// Create a new context
4747
const ctx = createContext();
@@ -58,7 +58,7 @@ This section uses the [Context API](../api/index.md) which provides a simple int
5858
### 1. Simple Calculations
5959

6060
```ts:line-numbers
61-
import { createContext } from 'mathflow';
61+
import { createContext } from '@mathflowjs/mathflow';
6262
6363
const ctx = createContext();
6464
@@ -71,7 +71,7 @@ console.log(ctx.solve('2^3 + sqrt(16)').value); // 12
7171
### 2. Working with Variables
7272

7373
```ts:line-numbers
74-
import { createContext } from 'mathflow';
74+
import { createContext } from '@mathflowjs/mathflow';
7575
7676
const ctx = createContext();
7777
@@ -87,7 +87,7 @@ console.log(ctx.solve('x^2 + y^2').value); // 34
8787
### 3. Custom Functions
8888

8989
```ts:line-numbers
90-
import { createContext } from 'mathflow';
90+
import { createContext } from '@mathflowjs/mathflow';
9191
9292
const ctx = createContext({
9393
functions: {
@@ -113,7 +113,7 @@ import {
113113
parse,
114114
evaluate,
115115
createSolutionStack
116-
} from 'mathflow';
116+
} from '@mathflowjs/mathflow';
117117
118118
const ctx = createContext();
119119
const solution = createSolutionStack();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"vitepress": "^1.6.4"
2121
},
2222
"dependencies": {
23-
"mathflow": "^0.3.0"
23+
"@mathflowjs/mathflow": "^1.0.0"
2424
}
2525
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)