Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorErrorError committed Nov 15, 2023
0 parents commit 95b6d1e
Show file tree
Hide file tree
Showing 32 changed files with 2,330 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 18,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"eslint-plugin-tsdoc"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"root": true,
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"tsdoc/syntax": "warn"
}
}
48 changes: 48 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: cd

on:
release:
types: [published]

env:
HUSKY: 0
TAG_NAME: ${{ github.event.release.tag_name }}

jobs:
run-checks:
if: ${{ !github.event.release.draft }}
name: Run Checks
uses: ./.github/workflows/ci.yml

publish:
if: ${{ !github.event.release.draft }}
needs:
- run-checks
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org/

- run: corepack enable
- run: corepack prepare pnpm@latest --activate

- name: Install
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- run: pnpm publish --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_MOCHI_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_MOCHI_TOKEN}}
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: lint

on:
push:
branches:
- '*'
pull_request:
types: [review_requested]

env:
HUSKY: 0

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: corepack enable
- run: corepack prepare pnpm@latest --activate
- run: pnpm install --frozen-lockfile
- run: pnpm lint -f github-annotations
continue-on-error: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
node_modules/

.vscode/

.DS_Store
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec lint-staged
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"endOfLine": "lf"
}
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @mochiapp/js
> Javascript/Typescript bindings for [Mochi](https://github.com/Mochi-Team/mochi).
## Installation
Using pnpm:
```bash
pnpm add @mochiapp/js
```

Using npm:
```bash
npm install @mochiapp/js
```

Using yarn:
```bash
yarn add @mochiapp/js
```

## Development / Contribution
You must use [pnpm](https://pnpm.io/) when you're modifying this package.

## License
[MIT](LICENSE)
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@mochiapp/js",
"version": "0.0.1",
"description": "A typescript library used to build modules for Mochi.",
"repository": "https://github.com/Mochi-Team/mochi-js",
"author": "errorerrorerror",
"license": "MIT",
"private": false,
"main": "dist/index.js",
"types": "dist/index.d.js",
"files": [
"./dist"
],
"scripts": {
"prepare": "husky install",
"lint": "eslint",
"lint:fix": "eslint --fix",
"format": "prettier -w src",
"format:check": "prettier --check src",
"build": "rm -rf dist && tsc"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-tsdoc": "^0.2.17",
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"typedoc": "^0.25.3",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.2.2"
},
"lint-staged": {
"*.ts": ["pnpm lint:fix", "pnpm format"]
}
}
Loading

0 comments on commit 95b6d1e

Please sign in to comment.