Conversation
52c7c19 to
66e49b8
Compare
JohnXLivingston
left a comment
There was a problem hiding this comment.
Thanks for your PR.
Updating ESLint and typescript is more than welcome.
But i have some concerns about some changes you made.
There was a problem hiding this comment.
Why do you change the stylelintrc filetype ? Is there a good reason?
Using a JS file allows comment (if needed). That could help if the configuration become more complexe one day.
There was a problem hiding this comment.
I agree. I tried to solve an issue with eslint that I couldn't solve in a better way. I switch back since this file isn't linted anymore.
| "build:server": "npx tsc --build server/tsconfig.json", | ||
| "build:client": "node ./scripts/build.js", | ||
| "build:server": "npx tsc --build tsconfig.json", | ||
| "build:client": "node ./scripts/build.mjs", |
There was a problem hiding this comment.
Why have you changed the file type to a mjs?
This is a script, not a module. Is there a good reason that i missed?
There was a problem hiding this comment.
It's to enable the use of ES import in the file.
package.json
Outdated
| "build:styles": "npx sass --no-source-map assets:dist/assets", | ||
| "build": "npm-run-all -s clean check:client:tsc -p build:server build:client build:styles", | ||
| "lint:script": "npx eslint --ext .ts --ext .js .", | ||
| "lint:script": "eslint", |
There was a problem hiding this comment.
Why do you removed the npx call?
Using npx ensure that it is using the eslint version in the node_modules directory, and not any globally installed eslint (which could cause some issue if the version is not matching).
There was a problem hiding this comment.
I wasn't aware of that, I'll change back
package.json
Outdated
| "esbuild": "^0.14.36", | ||
| "eslint": "^8.21.0", | ||
| "eslint-config-standard-with-typescript": "^22.0.0", | ||
| "@peertube/peertube-types": "^7.0.0", |
There was a problem hiding this comment.
There was a good reason to let "@peertube/peertube-types": "^4.2.2",: in the engine section, I mention that this plugin is compatible with "peertube": ">=4.2.0".
So we must use the Peertube 4.2.x types, to be sure to not use features that are not avaible.
This is explained in the README.
There was a problem hiding this comment.
Okay, personally I prefer to always target the latest version since I can't really see any reason an instance keep using an old version. But I'll switch back to PT 4.2 support.
package.json
Outdated
| "eslint": "^8.21.0", | ||
| "eslint-config-standard-with-typescript": "^22.0.0", | ||
| "@peertube/peertube-types": "^7.0.0", | ||
| "@tsconfig/node18": "^18.2.4", |
There was a problem hiding this comment.
The tsconfig/nodexx dependency should match the node version supported by the supported Peertube version.
This template is meant for Peertube >= 4.2.0, so it should be Node16.
| import type { RegisterServerOptions } from '@peertube/peertube-types' | ||
|
|
||
| async function register ({ peertubeHelpers }: RegisterServerOptions): Promise<void> { | ||
| await Promise.resolve() |
|
|
||
| async function unregister (): Promise<void> {} | ||
| async function unregister (): Promise<void> { | ||
| await Promise.resolve() |
tsconfig.json
Outdated
| @@ -1,7 +1,7 @@ | |||
| { | |||
| "extends": "@tsconfig/node16/tsconfig.json", | |||
| "extends": "@tsconfig/node18/tsconfig.json", | |||
There was a problem hiding this comment.
See previous comment. Should be related to the supported Peertube version.
| "extends": "@tsconfig/node18/tsconfig.json", | ||
| "compilerOptions": { | ||
| "moduleResolution": "node", // Tell tsc to look in node_modules for modules | ||
| "moduleResolution": "node16", // Tell tsc to look in node_modules for modules |
There was a problem hiding this comment.
This is necessary due to the following error
server/tsconfig.json:4:23 - error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node16'.
tsconfig.json
Outdated
| "outDir": "./dist/", | ||
| "paths": {}, | ||
| "allowJs": true | ||
| }, | ||
| "include": [ | ||
| "./**/*" | ||
| "./server/**/*", | ||
| "**/*.mjs" | ||
| ], | ||
| "exclude": [] | ||
| "exclude": [ | ||
| "./client" | ||
| ] |
There was a problem hiding this comment.
Why to you moved the server tsconfig file?
Server and Client configuration were separate. Moving the server tsconfig in the root directory adds confusion (IMHO).
There was a problem hiding this comment.
It was because I was trying to include the js/mjs files in the eslint as well, but that's better ways to handle that. I've moved back the file.
c86511f to
9710dbc
Compare
|
Thanks for your modification @kontrollanten . |
Sounds great! No hurry and feel free to change anything. Thanks for this repo! |
Uh oh!
There was an error while loading. Please reload this page.