Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v0.2.71 #103

Merged
merged 13 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pr-test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: BuildTests
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: allow write in work dir
run: sudo chmod -R 777 .
- name: Install Dependencies
run: |
npm -g install pnpm
pnpm install
- name: Building niconicomments
run: pnpm build
23 changes: 23 additions & 0 deletions .github/workflows/pr-test-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: LinterTests
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: allow write in work dir
run: sudo chmod -R 777 .
- name: Install Dependencies
run: |
npm -g install pnpm
pnpm install
- name: Run Linter tests
run: pnpm lint
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ jobs:
run: |
npm -g install pnpm
pnpm install
pnpm build
pnpm playwright install-deps
pnpm playwright install firefox
- name: Building niconicomments
run: |
pnpm build
- name: Run Playwright tests
run: pnpm playwright test
- uses: actions/upload-artifact@v3
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const res = await req.json();
const niconiComments = new NiconiComments(canvas, res);
//If video.ontimeupdate is used, the comments will be choppy due to the small number of calls.
setInterval(
() => niconiComments.drawCanvas(Math.floor(video.currentTime * 100)),
() => niconiComments.drawCanvas(video.currentTime * 100),
10
);
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const res = await req.json();
const niconiComments = new NiconiComments(canvas, res);
//video.ontimeupdateを使用すると、呼び出し回数の関係でコメントカクつく
setInterval(
() => niconiComments.drawCanvas(Math.floor(video.currentTime * 100)),
() => niconiComments.drawCanvas(video.currentTime * 100),
10
);
```
Expand Down
6 changes: 2 additions & 4 deletions docs/localize.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,8 @@ const localize = {
`<p>addEventListenerで追加されたイベントハンドラを削除します</p>`,
],
m_drawCanvas: [
`<p>Draws a comment on the canvas based on vpos(currentTime*100 of the video)</p>
<p>vpos must be an integer (<span class="yellow">int</span>)</p>`,
`<p>vpos(動画のcurrentTime*100)を元にキャンバスにコメントを描画します</p>
<p>vposは<span class="yellow">整数(int)</span>である必要があります</p>`,
`<p>Draws a comment on the canvas based on vpos(currentTime*100 of the video)</p>`,
`<p>vpos(動画のcurrentTime*100)を元にキャンバスにコメントを描画します</p>`,
],
m_clear: [`<p>Erase Canvas</p>`, `<p>キャンバスを消去します</p>`],
c_flash: [
Expand Down
8 changes: 3 additions & 5 deletions docs/sample/sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,11 @@ const updateTime = (currentTime, paused) => {
const updateCanvas = () => {
if (!nico) return;
if (!videoMicroSec) {
nico.drawCanvas(Math.floor(currentTime * 100));
nico.drawCanvas(currentTime * 100);
} else {
nico.drawCanvas(
Math.floor(
(performance.now() - videoMicroSec.microsec) / 10 +
videoMicroSec.currentTime * 100
)
(performance.now() - videoMicroSec.microsec) / 10 +
videoMicroSec.currentTime * 100
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion docs/sample/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const nico = new NiconiComments(canvasElement, res, {
format: "formatted",
});
nico.drawCanvas(Math.floor(time * 100));
nico.drawCanvas(time * 100);
const elem = document.createElement("div");
elem.id = "loaded";
document.body.appendChild(elem);
Expand Down
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"name": "@xpadev-net/niconicomments",
"version": "0.2.70",
"version": "0.2.71",
"description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.",
"main": "dist/bundle.js",
"types": "dist/bundle.d.ts",
"scripts": {
"build": "npx rimraf dist&&npm run build:ts&&npm run build:dts",
"build:ts": "rollup -c rollup.config.mjs",
"build:dts": "npx copyfiles -u 2 src/@types/*.d.ts dist/dts/@types/&&node ./util/resolve-path-alias.js&&rollup -c rollup.config.dts.mjs&& npx dts-bundle-generator --external-inlines=valibot -o dist/bundle.d.ts dist/bundle_.d.ts",
"build:dts": "npx copyfiles -u 2 src/@types/*.d.ts dist/dts/@types/&&node ./util/resolve-path-alias.js&&rollup -c rollup.config.dts.mjs",
"watch": "rollup -c rollup.config.mjs -w",
"typedoc": "typedoc --entryPointStrategy Expand --out ./docs/type/ ./src/",
"prepublishOnly": "npm run build",
"check-types": "npx tsc --noEmit --jsx react",
"eslint": "eslint src/**/*.ts",
"eslint:fix": "eslint src/**/*.ts --fix",
"format": "prettier --write \"src/**/*.{tsx,ts,js,json,css,scss}\"",
"lint": "npm run eslint&&npm run check-types",
"lint:fix": "npm run format&&npm run eslint:fix&&npm run check-types",
"format": "prettier --check \"src/**/*.{tsx,ts,js,json,css,scss}\"",
"format:fix": "prettier --write \"src/**/*.{tsx,ts,js,json,css,scss}\"",
"lint": "npm run format&&npm run eslint&&npm run check-types",
"lint:fix": "npm run format:fix&&npm run eslint:fix&&npm run check-types",
"prepare": "husky install",
"test": "docker-compose run --rm pw",
"test-server": "http-server"
Expand Down Expand Up @@ -44,35 +45,34 @@
"homepage": "https://xpadev-net.github.io/niconicomments/",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.7",
"@playwright/test": "^1.40.1",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@playwright/test": "^1.41.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.5",
"@types/node": "^20.10.6",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"copyfiles": "^2.4.1",
"dts-bundle-generator": "^9.2.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^48.0.2",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-jsdoc": "^48.1.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"rollup": "^4.9.2",
"rollup": "^4.12.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-typescript-paths": "^1.5.0",
"tslib": "^2.6.2",
"typedoc": "^0.25.6",
"typedoc-plugin-missing-exports": "^2.1.0",
"typedoc": "^0.25.8",
"typedoc-plugin-missing-exports": "^2.2.0",
"typescript": "^5.3.3",
"valibot": "^0.25.0"
"valibot": "^0.28.1"
}
}
Loading
Loading