feat: add build script
This commit adds pnpm scripts for compiling and running the typocomath package, and a convenience script `pnpm go` that does both in succession. It also configure pnpm to use a shell emulator so that it should work on Windows as well. Finally, it changes the directory for object files from obj to build. Resolves #9.
This commit is contained in:
parent
f06943ba1a
commit
c9e53b7152
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,7 +2,7 @@
|
|||||||
*~
|
*~
|
||||||
# Typescript
|
# Typescript
|
||||||
# emitted code
|
# emitted code
|
||||||
obj
|
build
|
||||||
|
|
||||||
# ---> Node
|
# ---> Node
|
||||||
# Logs
|
# Logs
|
||||||
|
11
README.md
11
README.md
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
A final (?) prototype for a refactor of mathjs, culminating the picomath, pocomath, typomath series. Provides an extensible core with "fuzzy" types for its operations, that can at any time generate exact .d.ts file for its current state.
|
A final (?) prototype for a refactor of mathjs, culminating the picomath, pocomath, typomath series. Provides an extensible core with "fuzzy" types for its operations, that can at any time generate exact .d.ts file for its current state.
|
||||||
|
|
||||||
To build and run the prototype, run:
|
|
||||||
|
|
||||||
```
|
Convenience scripts:
|
||||||
npx tsc
|
|
||||||
echo '{"type": "module"}' > obj/package.json
|
* `pnpm build` -- compile the package
|
||||||
node obj
|
* `pnpm exec` -- run the compiled code produced by `pnpm build`
|
||||||
```
|
* `pnpm go` -- both of the above in sequence.
|
||||||
|
1
etc/package.json
Normal file
1
etc/package.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"type": "module"}
|
@ -5,7 +5,11 @@
|
|||||||
main: 'index.ts',
|
main: 'index.ts',
|
||||||
scripts: {
|
scripts: {
|
||||||
test: 'echo "Error: no test specified" && exit 1',
|
test: 'echo "Error: no test specified" && exit 1',
|
||||||
|
build: 'tsc && cp etc/package.json build',
|
||||||
|
exec: 'node build',
|
||||||
|
go: 'pnpm --sequential "/build|exec/"',
|
||||||
},
|
},
|
||||||
|
packageManager: 'pnpm',
|
||||||
keywords: [
|
keywords: [
|
||||||
'math',
|
'math',
|
||||||
'algebra',
|
'algebra',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./obj",
|
"outDir": "./build",
|
||||||
"moduleResolution": "nodenext"
|
"moduleResolution": "nodenext"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user