This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9100136
Showing
12 changed files
with
1,697 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 18, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"root": true, | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/consistent-type-definitions": ["error", "type"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: cd | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
HUSKY: 0 | ||
TAG_NAME: ${{ github.event.release.tag_name }} | ||
|
||
jobs: | ||
publish: | ||
if: ${{ !github.event.release.draft }} | ||
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}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
dist/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
PATH="/usr/local/bin:$PATH" | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm exec lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# @mochiapp/runner | ||
> A test runner used for Mochi modules. | ||
## Installation | ||
Using pnpm: | ||
```bash | ||
pnpm add -D @mochiapp/runner | ||
``` | ||
|
||
Using npm: | ||
```bash | ||
npm install --save-dev @mochiapp/runner | ||
``` | ||
|
||
Using yarn: | ||
```bash | ||
yarn add -D @mochiapp/runner | ||
``` | ||
|
||
## Example | ||
In a test file: | ||
```js | ||
import Source from '../src/source'; | ||
import runner from '@mochiapp/runner'; | ||
|
||
const source = runner(Source); | ||
|
||
test('fetch filters', () => { | ||
return source.searchFilters() | ||
.then(r => { | ||
assert.equal(r.length, 1); | ||
}); | ||
}); | ||
|
||
// Rest of the tests... | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "@mochiapp/runner", | ||
"version": "0.0.1", | ||
"description": "A test runner used for Mochi modules.", | ||
"keywords": [ | ||
"mochi", | ||
"runner" | ||
], | ||
"author": "errorerrorerror", | ||
"repository": "https://github.com/Mochi-Team/runner", | ||
"license": "MIT", | ||
"private": false, | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"./dist" | ||
], | ||
"dependencies": { | ||
"@types/got": "^9.6.12", | ||
"axios": "^1.6.2" | ||
}, | ||
"devDependencies": { | ||
"@mochiapp/js": "^0.0.1", | ||
"@types/node": "^20.9.1", | ||
"@typescript-eslint/eslint-plugin": "^6.11.0", | ||
"@typescript-eslint/parser": "^6.11.0", | ||
"eslint": "^8.54.0", | ||
"husky": "^8.0.0", | ||
"lint-staged": "^15.1.0", | ||
"prettier": "^3.1.0", | ||
"typescript": "^5.2.2" | ||
}, | ||
"peerDependencies": { | ||
"@mochiapp/js": "^0.0.1" | ||
}, | ||
"lint-staged": { | ||
"*.ts": [ | ||
"pnpm lint:fix", | ||
"pnpm format" | ||
] | ||
}, | ||
"scripts": { | ||
"prepare": "husky install", | ||
"lint": "eslint", | ||
"lint:fix": "eslint --fix", | ||
"format": "prettier -w src", | ||
"format:check": "prettier --check src", | ||
"build": "rm -rf dist/ && tsc" | ||
} | ||
} |
Oops, something went wrong.