Skip to content

update dependencies#1

Open
kontrollanten wants to merge 2 commits intoJohnXLivingston:mainfrom
kontrollanten:update-deps
Open

update dependencies#1
kontrollanten wants to merge 2 commits intoJohnXLivingston:mainfrom
kontrollanten:update-deps

Conversation

@kontrollanten
Copy link

@kontrollanten kontrollanten commented Dec 22, 2024

  • Update dependencies

Copy link
Owner

@JohnXLivingston JohnXLivingston left a comment

Choose a reason for hiding this comment

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

Thanks for your PR.
Updating ESLint and typescript is more than welcome.

But i have some concerns about some changes you made.

Copy link
Owner

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

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",
Copy link
Owner

Choose a reason for hiding this comment

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

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?

Copy link
Author

Choose a reason for hiding this comment

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

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",
Copy link
Owner

Choose a reason for hiding this comment

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

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).

Copy link
Author

Choose a reason for hiding this comment

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

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",
Copy link
Owner

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

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",
Copy link
Owner

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

I've reverted this.

import type { RegisterServerOptions } from '@peertube/peertube-types'

async function register ({ peertubeHelpers }: RegisterServerOptions): Promise<void> {
await Promise.resolve()
Copy link
Owner

Choose a reason for hiding this comment

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

Why?

Copy link
Author

Choose a reason for hiding this comment

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


async function unregister (): Promise<void> {}
async function unregister (): Promise<void> {
await Promise.resolve()
Copy link
Owner

Choose a reason for hiding this comment

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

Why?

Copy link
Author

Choose a reason for hiding this comment

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

tsconfig.json Outdated
@@ -1,7 +1,7 @@
{
"extends": "@tsconfig/node16/tsconfig.json",
"extends": "@tsconfig/node18/tsconfig.json",
Copy link
Owner

Choose a reason for hiding this comment

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

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
Copy link
Owner

Choose a reason for hiding this comment

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

see previous comment.

Copy link
Author

Choose a reason for hiding this comment

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

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
Comment on lines +17 to +27
"outDir": "./dist/",
"paths": {},
"allowJs": true
},
"include": [
"./**/*"
"./server/**/*",
"**/*.mjs"
],
"exclude": []
"exclude": [
"./client"
]
Copy link
Owner

Choose a reason for hiding this comment

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

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).

Copy link
Author

Choose a reason for hiding this comment

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

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.

@JohnXLivingston
Copy link
Owner

JohnXLivingston commented Jan 6, 2025

Thanks for your modification @kontrollanten .
I have a very busy week. I'll take a look next week.

@kontrollanten
Copy link
Author

Thanks for your modification @kontrollanten . I have a very busy week. I'll take a look next week.

Sounds great! No hurry and feel free to change anything. Thanks for this repo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants