Skip to content

Commit 2291e76

Browse files
authored
Merge pull request #103 from xpadev-net/develop
release: v0.2.71
2 parents 31ab614 + 8a3d4fb commit 2291e76

19 files changed

+735
-697
lines changed

.github/workflows/pr-test-build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: BuildTests
2+
on:
3+
push:
4+
branches: [master, develop]
5+
pull_request:
6+
branches: [master, develop]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: "20"
16+
- name: allow write in work dir
17+
run: sudo chmod -R 777 .
18+
- name: Install Dependencies
19+
run: |
20+
npm -g install pnpm
21+
pnpm install
22+
- name: Building niconicomments
23+
run: pnpm build

.github/workflows/pr-test-linter.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: LinterTests
2+
on:
3+
push:
4+
branches: [master, develop]
5+
pull_request:
6+
branches: [master, develop]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: "20"
16+
- name: allow write in work dir
17+
run: sudo chmod -R 777 .
18+
- name: Install Dependencies
19+
run: |
20+
npm -g install pnpm
21+
pnpm install
22+
- name: Run Linter tests
23+
run: pnpm lint

.github/workflows/playwright.yml renamed to .github/workflows/pr-test-playwright.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ jobs:
1919
run: |
2020
npm -g install pnpm
2121
pnpm install
22-
pnpm build
2322
pnpm playwright install-deps
2423
pnpm playwright install firefox
24+
- name: Building niconicomments
25+
run: |
26+
pnpm build
2527
- name: Run Playwright tests
2628
run: pnpm playwright test
2729
- uses: actions/upload-artifact@v3
File renamed without changes.

README.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const res = await req.json();
3333
const niconiComments = new NiconiComments(canvas, res);
3434
//If video.ontimeupdate is used, the comments will be choppy due to the small number of calls.
3535
setInterval(
36-
() => niconiComments.drawCanvas(Math.floor(video.currentTime * 100)),
36+
() => niconiComments.drawCanvas(video.currentTime * 100),
3737
10
3838
);
3939
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const res = await req.json();
3535
const niconiComments = new NiconiComments(canvas, res);
3636
//video.ontimeupdateを使用すると、呼び出し回数の関係でコメントカクつく
3737
setInterval(
38-
() => niconiComments.drawCanvas(Math.floor(video.currentTime * 100)),
38+
() => niconiComments.drawCanvas(video.currentTime * 100),
3939
10
4040
);
4141
```

docs/localize.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ const localize = {
275275
`<p>addEventListenerで追加されたイベントハンドラを削除します</p>`,
276276
],
277277
m_drawCanvas: [
278-
`<p>Draws a comment on the canvas based on vpos(currentTime*100 of the video)</p>
279-
<p>vpos must be an integer (<span class="yellow">int</span>)</p>`,
280-
`<p>vpos(動画のcurrentTime*100)を元にキャンバスにコメントを描画します</p>
281-
<p>vposは<span class="yellow">整数(int)</span>である必要があります</p>`,
278+
`<p>Draws a comment on the canvas based on vpos(currentTime*100 of the video)</p>`,
279+
`<p>vpos(動画のcurrentTime*100)を元にキャンバスにコメントを描画します</p>`,
282280
],
283281
m_clear: [`<p>Erase Canvas</p>`, `<p>キャンバスを消去します</p>`],
284282
c_flash: [

docs/sample/sample.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,11 @@ const updateTime = (currentTime, paused) => {
334334
const updateCanvas = () => {
335335
if (!nico) return;
336336
if (!videoMicroSec) {
337-
nico.drawCanvas(Math.floor(currentTime * 100));
337+
nico.drawCanvas(currentTime * 100);
338338
} else {
339339
nico.drawCanvas(
340-
Math.floor(
341-
(performance.now() - videoMicroSec.microsec) / 10 +
342-
videoMicroSec.currentTime * 100
343-
)
340+
(performance.now() - videoMicroSec.microsec) / 10 +
341+
videoMicroSec.currentTime * 100
344342
);
345343
}
346344
};

docs/sample/test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
const nico = new NiconiComments(canvasElement, res, {
2121
format: "formatted",
2222
});
23-
nico.drawCanvas(Math.floor(time * 100));
23+
nico.drawCanvas(time * 100);
2424
const elem = document.createElement("div");
2525
elem.id = "loaded";
2626
document.body.appendChild(elem);

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
{
22
"name": "@xpadev-net/niconicomments",
3-
"version": "0.2.70",
3+
"version": "0.2.71",
44
"description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.",
55
"main": "dist/bundle.js",
66
"types": "dist/bundle.d.ts",
77
"scripts": {
88
"build": "npx rimraf dist&&npm run build:ts&&npm run build:dts",
99
"build:ts": "rollup -c rollup.config.mjs",
10-
"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",
10+
"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",
1111
"watch": "rollup -c rollup.config.mjs -w",
1212
"typedoc": "typedoc --entryPointStrategy Expand --out ./docs/type/ ./src/",
1313
"prepublishOnly": "npm run build",
1414
"check-types": "npx tsc --noEmit --jsx react",
1515
"eslint": "eslint src/**/*.ts",
1616
"eslint:fix": "eslint src/**/*.ts --fix",
17-
"format": "prettier --write \"src/**/*.{tsx,ts,js,json,css,scss}\"",
18-
"lint": "npm run eslint&&npm run check-types",
19-
"lint:fix": "npm run format&&npm run eslint:fix&&npm run check-types",
17+
"format": "prettier --check \"src/**/*.{tsx,ts,js,json,css,scss}\"",
18+
"format:fix": "prettier --write \"src/**/*.{tsx,ts,js,json,css,scss}\"",
19+
"lint": "npm run format&&npm run eslint&&npm run check-types",
20+
"lint:fix": "npm run format:fix&&npm run eslint:fix&&npm run check-types",
2021
"prepare": "husky install",
2122
"test": "docker-compose run --rm pw",
2223
"test-server": "http-server"
@@ -44,35 +45,34 @@
4445
"homepage": "https://xpadev-net.github.io/niconicomments/",
4546
"license": "MIT",
4647
"devDependencies": {
47-
"@babel/core": "^7.23.7",
48-
"@babel/preset-env": "^7.23.7",
49-
"@playwright/test": "^1.40.1",
48+
"@babel/core": "^7.23.9",
49+
"@babel/preset-env": "^7.23.9",
50+
"@playwright/test": "^1.41.2",
5051
"@rollup/plugin-babel": "^6.0.4",
5152
"@rollup/plugin-commonjs": "^25.0.7",
5253
"@rollup/plugin-json": "^6.1.0",
5354
"@rollup/plugin-node-resolve": "^15.2.3",
54-
"@rollup/plugin-typescript": "^11.1.5",
55-
"@types/node": "^20.10.6",
56-
"@typescript-eslint/eslint-plugin": "^6.17.0",
57-
"@typescript-eslint/parser": "^6.17.0",
55+
"@rollup/plugin-typescript": "^11.1.6",
56+
"@types/node": "^20.11.19",
57+
"@typescript-eslint/eslint-plugin": "^7.0.1",
58+
"@typescript-eslint/parser": "^7.0.1",
5859
"copyfiles": "^2.4.1",
59-
"dts-bundle-generator": "^9.2.1",
6060
"eslint": "^8.56.0",
6161
"eslint-config-prettier": "^9.1.0",
62-
"eslint-plugin-jsdoc": "^48.0.2",
63-
"eslint-plugin-simple-import-sort": "^10.0.0",
62+
"eslint-plugin-jsdoc": "^48.1.0",
63+
"eslint-plugin-simple-import-sort": "^12.0.0",
6464
"http-server": "^14.1.1",
65-
"husky": "^8.0.3",
66-
"lint-staged": "^15.2.0",
67-
"prettier": "^3.1.1",
65+
"husky": "^9.0.11",
66+
"lint-staged": "^15.2.2",
67+
"prettier": "^3.2.5",
6868
"rimraf": "^5.0.5",
69-
"rollup": "^4.9.2",
69+
"rollup": "^4.12.0",
7070
"rollup-plugin-dts": "^6.1.0",
7171
"rollup-plugin-typescript-paths": "^1.5.0",
7272
"tslib": "^2.6.2",
73-
"typedoc": "^0.25.6",
74-
"typedoc-plugin-missing-exports": "^2.1.0",
73+
"typedoc": "^0.25.8",
74+
"typedoc-plugin-missing-exports": "^2.2.0",
7575
"typescript": "^5.3.3",
76-
"valibot": "^0.25.0"
76+
"valibot": "^0.28.1"
7777
}
7878
}

0 commit comments

Comments
 (0)