Coinfer JS
The documentation is here.Directory Structure
📂assets
: Some resource files required by the project, such as pictures referenced in the document, etc.📂build-scripts
: Some script codes required for building, such as clearing folders, copying static files, etc.📂build-template
: Some static files required for building, such as package dependencies (package.json
), README.md used to describe the built package, etc.📂document-generator
: This folder is used to store the code for generating the project API documentation. It usesDocusaurus
andApi Document
, and usestypescript
’s document comments and declaration files to generate HTML pages.📂output
: The built code will be output to this directory. Its subdirectoriescoinferjs
,coinferjs-node
andcoinferjs-react
correspond to the three packages built by this project.📂src
: Source code folder.📂react-tools
: This folder provides some tools that are convenient for using the React framework, such as theWebSocket
library that encapsulates permission verification and initialization, context tools, and some Hooks.📄local_utils.js
: Store code that is only used in the localNode
environment, such as reading and writing local files, etc.📄proxy_server.js
: Used to provide proxy server functionality.📄coinfer.ts
: The main file of the code library encapsulates most of the business functions, such as: operating the model list, operating theExperiment
list, adding and deleting tokens, providingWebSocket
to obtainExperiment
information, etc.
📂tests
: The folder mainly stores the code used for testing.
How to build
- Run one of these commands:
yarn rollup
, this command will monitor the project file for changes and compile it automatically.
-
Wait a while until the code is built. The bundled files will be located in the
output
directory. -
In the
output
directory, you can see these directories:coinferjs
: It just contains a coinfer.js, it provides entities CRUD.coinferjs-node
: Provide a node-based program that can be called from the command line, such as “node index.js —help”, of course, this command depends on “Nodejs”.coinferjs-react
: Provider some hooks and context of React.demo
: This directory is for real-time development.
-
Build the docs. After successfully running
yarn rollup
, you can generate the documentation by runningyarn build:docs
. The final output directory is located atdocument-generator/website
, and the generation process follows the sequence*.ts -> *.d.ts -> *.api.json -> *.md -> *.html.
.
- You can copy the dist files to your project. Of course, you can also publish these output files as npm packages.
Unit Test
yarn test
Export binary
Runningyarn build
, the binary file after building is in the output
directory
Reference
- We generate documentation using
API extractor
,API documenter
, andDocusaurus
.API extractor
andAPI documenter
, this tools is part of microsoft/rushstack-websites.Docusaurus