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

add pdf-converter app #9279

Conversation

arafubeatbox
Copy link
Contributor

@arafubeatbox arafubeatbox commented Oct 20, 2024

実装内容

仕様書

https://dev.growi.org/66ee8495830566b31e02c953

task

https://redmine.weseek.co.jp/issues/153347

備考

Copy link

changeset-bot bot commented Oct 20, 2024

⚠️ No Changeset found

Latest commit: dadcf07

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@arafubeatbox arafubeatbox changed the base branch from feat/page-bulk-export to feat/135772-pdf-page-bulk-export October 20, 2024 09:30
@arafubeatbox arafubeatbox deleted the feat/135772-153347-pdf-converter-app-tsed branch October 20, 2024 09:37
@arafubeatbox arafubeatbox restored the feat/135772-153347-pdf-converter-app-tsed branch October 20, 2024 09:37
@arafubeatbox arafubeatbox deleted the feat/135772-153347-pdf-converter-app-tsed branch October 20, 2024 09:38
@arafubeatbox arafubeatbox restored the feat/135772-153347-pdf-converter-app-tsed branch October 20, 2024 09:39
@arafubeatbox arafubeatbox reopened this Oct 20, 2024
@arafubeatbox arafubeatbox changed the base branch from feat/135772-pdf-page-bulk-export to feat/page-bulk-export October 20, 2024 09:40
@arafubeatbox arafubeatbox changed the base branch from feat/page-bulk-export to feat/135772-pdf-page-bulk-export October 20, 2024 09:40
@arafubeatbox arafubeatbox marked this pull request as ready for review October 20, 2024 09:41
@arafubeatbox
Copy link
Contributor Author

github がバグって差分が正しく反映されていなかったので、PR の open/close を繰り返していましたm(_ _)m

@@ -0,0 +1,2 @@
/dist
/specs/**/*.json
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specs に openapi spec を出力する設定にしていますが、
https://github.com/tsedio/tsed-cli/tree/master/packages/cli-generate-swagger
に yaml だけ出力するオプションがありませんでした (コードも確認しました

"dev:pdf-converter": "nodemon --watch \"src/**/*.ts\" --ignore \"node_modules/**/*\" --exec ts-node -r \"dotenv-flow/config\" src/index.ts",
"lint": "yarn eslint **/*.{js,ts}",
"gen:client-code": "tsed run generate-swagger --output ./specs && orval",
"build": "yarn gen:client-code && tsc -p tsconfig.build.json"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build 時に gen:client-code でクライアントコードも自動生成しています。

extends: '../../.eslintrc.js',
rules: {
'no-useless-constructor': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
Copy link
Contributor Author

@arafubeatbox arafubeatbox Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts.ed で DI している場所で @typescript-eslint/consistent-type-imports がオンになっていると、DI 対象の import が type のみの import に強要されますが、その結果 DI された対象が何であっても実体のない [Function: anonymous] となってしまいます。
例えば DI された hoge に対して hogeMethod を実行すると TypeError: hoge.hogeMethod is not a function
となってしまいます。

多分 ts.ed の DI では、DI 対象の実装本体を import する必要があるっぽいです。


EXPOSE 3010

ENTRYPOINT ["/usr/bin/tini", "-e", "143", "--"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tini は不要
https://tips.weseek.co.jp/6151b1832b337100519281e7

terminus と連携して解決するのが望ましい
https://tsed.io/tutorials/terminus.html

後続ストーリーで対応をお願いしたい

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ストーリー作成しました。 https://redmine.weseek.co.jp/issues/156179

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この app は type: module にできないだろうか?
Ts.ED が未対応というケースもあるだろうが調査をしてほしい(後続ストーリーでOK)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://redmine.weseek.co.jp/issues/156177 ストーリー作成しました

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このファイルは .gitignore したらだめなの?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apps/pdf-converter/src/client-library の生成元の schema がわかると良いかなと思いましたが、確かにあまり気にすることは無さそうですね。むしろ schema が手動修正 -> commit されるリスクの方が大きそうです。
ignore しますm(_ _)m

"private": true,
"scripts": {
"dev:pdf-converter": "nodemon --watch \"src/**/*.ts\" --ignore \"node_modules/**/*\" --exec ts-node -r \"dotenv-flow/config\" src/index.ts",
"lint": "yarn eslint **/*.{js,ts}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsconfig を細かくチェックはしていないのだけれど、build での tsc は typecheck はせずにスピードを出すのが望ましい。
代わりに lint で typecheck のための tsc を走らせる。
後続ストーリーでよい。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://redmine.weseek.co.jp/issues/156178 ストーリー作成しました。

@yuki-takei yuki-takei merged commit fa9a711 into feat/135772-pdf-page-bulk-export Oct 24, 2024
4 checks passed
@yuki-takei yuki-takei deleted the feat/135772-153347-pdf-converter-app-tsed branch October 24, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants