-
Notifications
You must be signed in to change notification settings - Fork 0
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 530292d
Showing
9 changed files
with
243 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,26 @@ | ||
name: Releases | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "build ts" | ||
run: | | ||
npm i pnpm -g | ||
pnpm i | ||
pnpm run build | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "./es5/*.js" |
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,86 @@ | ||
# Logs | ||
dist | ||
es5 | ||
.parcel-cache | ||
fish.exe.stackdump | ||
|
||
target | ||
|
||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
bundle | ||
pnpm-lock.yaml | ||
|
||
# Runtime data | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
# OS X temporary files | ||
.DS_Store | ||
|
||
# IntelliJ IDEA project files; if you want to commit IntelliJ settings, this recipe may be helpful: | ||
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
.idea/ | ||
*.iml | ||
|
||
# Rush temporary files | ||
common/deploy/ | ||
common/temp/ | ||
common/autoinstallers/*/.npmrc | ||
**/.rush/temp/ | ||
|
||
# Heft temporary files | ||
.heft | ||
|
||
/apps/*/dist | ||
|
||
/html |
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,19 @@ | ||
const fnVar = (t) => | ||
t.variableDeclaration("var", [ | ||
t.variableDeclarator( | ||
t.identifier("__"), | ||
t.functionExpression(null, [], t.blockStatement([])), | ||
), | ||
]); | ||
module.exports = function ({ types: t }) { | ||
return { | ||
visitor: { | ||
FunctionDeclaration(path) { | ||
path.node.body?.body?.unshift?.(fnVar(t)); | ||
}, | ||
ArrowFunctionExpression(path) { | ||
// path.node.body?.body?.unshift?.(fnVar(t)) | ||
}, | ||
}, | ||
}; | ||
}; |
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,45 @@ | ||
{ | ||
"name": "@mpv-easy/mpsm-scripts", | ||
"private": true, | ||
"version": "0.1.0", | ||
"files": [ | ||
"bin", | ||
"dist", | ||
"es5", | ||
"bundle", | ||
"readme.md", | ||
"package.json" | ||
], | ||
"description": "@mpv-easy/mpsm-scripts", | ||
"main": "./dist/index.js", | ||
"bin": "./bin/cli", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"bundle": "esbuild ./src/*.ts --bundle --outdir=./bundle --platform=node", | ||
"build": "pnpm run bundle && pnpm run es5", | ||
"es5": "babel --presets @babel/preset-env ./bundle -d es5 --plugins ./babel/hack.js", | ||
"lint": "biome check --apply-unsafe ./", | ||
"format": "biome format --write ./" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@mpv-easy/tool": "^0.1.5", | ||
"esbuild": "^0.21.3", | ||
"typescript": "^5.3.3", | ||
"@babel/cli": "^7.23.9", | ||
"@babel/core": "^7.23.9", | ||
"@babel/preset-env": "^7.23.9", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@biomejs/biome": "^1.5.3", | ||
"@types/node": "^20.11.17" | ||
}, | ||
"browserslist": [ | ||
"iOS >= 9", | ||
"Android >= 4.4", | ||
"last 2 versions", | ||
"> 0.2%", | ||
"not dead" | ||
] | ||
} |
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 @@ | ||
## @mpv-easy/mpsm-scripts | ||
|
||
```bash | ||
mpsm install speed | ||
``` |
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 @@ | ||
{ | ||
"speed": "https://github.com/mpv-easy/mpsm-scripts/releases/download/v0.1.0/speed.js" | ||
} |
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,27 @@ | ||
import { PropertyNumber, addKeyBinding } from "@mpv-easy/tool"; | ||
|
||
const speed = new PropertyNumber("speed"); | ||
addKeyBinding( | ||
"MOUSE_BTN0", | ||
"MPV_EASY_SPEED", | ||
({ event }) => { | ||
switch (event) { | ||
case "down": { | ||
speed.value = 2; | ||
break; | ||
} | ||
case "up": { | ||
speed.value = 1; | ||
break; | ||
} | ||
case "press": { | ||
break; | ||
} | ||
} | ||
}, | ||
{ | ||
complex: true, | ||
repeatable: true, | ||
forced: false, | ||
}, | ||
); |
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,7 @@ | ||
{ | ||
"extends": "../tsconfig.build.json", | ||
"compilerOptions": { | ||
"outDir": "./dist/" | ||
}, | ||
"include": ["src"] | ||
} |
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,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"lib": ["ESNext", "ES2022", "es2021", "DOM"], | ||
"allowJs": true, | ||
"esModuleInterop": false, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "ESNext", | ||
"skipDefaultLibCheck": true, | ||
"skipLibCheck": true, | ||
"noEmit": false, | ||
"noEmitOnError": false, | ||
"moduleResolution": "Node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"declaration": true, | ||
"declarationMap": false, | ||
"sourceMap": false | ||
}, | ||
"include": ["src"] | ||
} |