Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohk committed Jan 28, 2024
0 parents commit 5a81c3a
Show file tree
Hide file tree
Showing 20 changed files with 660 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"check-coverage": true,
"lines": 95,
"reporter": ["json-summary"]
}
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
coverage
**/*.d.ts
tests
43 changes: 43 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier'
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./typescript.eslintrc.json'],
extraFileExtensions: ['.cjs']
},
plugins: ['@typescript-eslint', 'prettier'],
env: {
es6: true,
browser: true
},
ignorePatterns: ['node_modules'],
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
'prefer-const': ['error'],
semi: ['error', 'always'],
'max-len': [
'warn',
{
code: 80
}
],
'prettier/prettier': 2,
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'no-self-assign': 'off'
}
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.ipynb linguist-detectable=false
*.yml linguist-language=typescript
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
#: Run the test every week
# schedule:
# - cron: "0 12 * * 1"

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [16]
os: [ubuntu-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Test
run: npm run test:run
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
coverage
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

pnpm-lock.yaml

test-generation
*.npz
gh-pages
examples/models/benchmark

notebooks
30 changes: 30 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist-ssr
coverage
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.github

pnpm-lock.yaml
examples
test-generation
gh-pages
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
**/node_modules
**/lib
**/package.json
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "none",
"svelteSortOrder": "options-scripts-styles-markup",
"arrowParens": "avoid"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023, Jay Wang and Polo Chau

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Matmul
67 changes: 67 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "mememo",
"version": "0.0.1",
"description": "On-device vector database",
"main": "./dist/index.umd.js",
"module": "./dist/index.es.js",
"type": "module",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.umd.js",
"import": "./dist/index.es.js",
"types": "./dist/index.d.ts"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/xiaohk/mememo"
},
"keywords": [
"machine-learning",
"machine",
"learning",
"ai",
"matrix",
"matrix multiplication",
"linear algebra",
"math"
],
"author": "Jay Wang",
"license": "MIT",
"bugs": {
"url": "https://github.com/xiaohk/mememo/issues"
},
"homepage": "https://github.com/xiaohk/mememo#readme",
"scripts": {
"test": "vitest",
"test:ui": "vitest --ui",
"test:run": "vitest run",
"coverage": "vitest run --coverage && c8 report && pnpm run coverage:badge",
"coverage:badge": "pnpx make-coverage-badge --output-path ./imgs/coverage-badge.svg",
"build": "pnpm run clean && vite build",
"build:doc": "pnpm typedoc ./src/index.ts --excludeExternals --externalPattern 'node_modules' --name 'WebSHAP' --out './gh-pages/doc/' '$SRC_DIR'",
"clean": "rimraf ./dist",
"publish": "pnpm publish --access=public"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/d3-random": "^3.0.3",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@vitest/browser": "^1.2.1",
"@vitest/coverage-v8": "^1.2.1",
"c8": "^9.1.0",
"d3-random": "^3.0.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vitest": "^1.2.1",
"webdriverio": "^8.29.1"
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { add } from './mememo';
Loading

0 comments on commit 5a81c3a

Please sign in to comment.