ActivityPub-federated video streaming platform using P2P directly in your web browser
Migrate peertube-cli to tsdown
Chocobozzz4bb710400d0c
diff --git a/apps/peertube-cli/CHANGELOG.md b/apps/peertube-cli/CHANGELOG.mdindex 83af889745..02781d30ee 100644--- a/apps/peertube-cli/CHANGELOG.md+++ b/apps/peertube-cli/CHANGELOG.md@@ -1,5 +1,10 @@# Changelog+## v1.1.0++ * Remove `previewfile` option (deprecated in PeerTube 8.1)+ * Migrate to `tsdown` to build the runner. The peertube-cli filename is now `peertube.mjs`+## v1.0.3- * Fix `util.isArray` deprecation warning+ * Fix `util.isArray` deprecation warningdiff --git a/apps/peertube-cli/README.md b/apps/peertube-cli/README.mdindex 95bc64cf00..b0b1888765 100644--- a/apps/peertube-cli/README.md+++ b/apps/peertube-cli/README.md@@ -31,7 +31,7 @@ npm run build:peertube-cli```bashcd peertube-root-node apps/peertube-cli/dist/peertube-cli.js --help+node apps/peertube-cli/dist/peertube.js --help```## Publish on NPMdiff --git a/apps/peertube-cli/package.json b/apps/peertube-cli/package.jsonindex e1e99d1cc8..6cfa1619aa 100644--- a/apps/peertube-cli/package.json+++ b/apps/peertube-cli/package.json@@ -2,14 +2,20 @@"name": "@peertube/peertube-cli","version": "1.0.3","type": "module",- "main": "dist/peertube.js",- "bin": "dist/peertube.js",- "scripts": {},+ "bin": "dist/peertube.mjs","license": "AGPL-3.0",+ "scripts": {+ "build": "tsdown",+ "dev": "tsdown --watch"+ },"private": false,"devDependencies": {"application-config": "^3.0.0","cli-table3": "^0.6.5",- "netrc-parser": "^3.1.6"+ "netrc-parser": "^3.1.6",+ "tsdown": "0.21.0-beta.2"+ },+ "exports": {+ ".": "./dist/peertube-runner.mjs"}}diff --git a/apps/peertube-cli/scripts/build.js b/apps/peertube-cli/scripts/build.jsdeleted file mode 100644index a9139acfae..0000000000--- a/apps/peertube-cli/scripts/build.js+++ /dev/null@@ -1,27 +0,0 @@-import * as esbuild from 'esbuild'-import { readFileSync } from 'fs'--const packageJSON = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)))--export const esbuildOptions = {- entryPoints: [ './src/peertube.ts' ],- bundle: true,- platform: 'node',- format: 'esm',- target: 'node16',- external: [- './lib-cov/fluent-ffmpeg',- 'pg-hstore'- ],- outfile: './dist/peertube.js',- banner: {- js: `const require = (await import("node:module")).createRequire(import.meta.url);` +- `const __filename = (await import("node:url")).fileURLToPath(import.meta.url);` +- `const __dirname = (await import("node:path")).dirname(__filename);`- },- define: {- 'process.env.PACKAGE_VERSION': `'${packageJSON.version}'`- }-}--await esbuild.build(esbuildOptions)diff --git a/apps/peertube-cli/scripts/watch.js b/apps/peertube-cli/scripts/watch.jsdeleted file mode 100644index 94e57199ce..0000000000--- a/apps/peertube-cli/scripts/watch.js+++ /dev/null@@ -1,7 +0,0 @@-import * as esbuild from 'esbuild'-import { esbuildOptions } from './build.js'--const context = await esbuild.context(esbuildOptions)--// Enable watch mode-await context.watch()diff --git a/apps/peertube-cli/src/peertube-auth.ts b/apps/peertube-cli/src/peertube-auth.tsindex 22f65b422f..25ae2c1ee6 100644--- a/apps/peertube-cli/src/peertube-auth.ts+++ b/apps/peertube-cli/src/peertube-auth.ts@@ -1,6 +1,6 @@-import CliTable3 from 'cli-table3'-import prompt from 'prompt'import { Command } from '@commander-js/extra-typings'+import CliTable3 from 'cli-table3'+import prompts from 'prompts'import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './shared/index.js'export function defineAuthProgram () {@@ -15,46 +15,60 @@ export function defineAuthProgram () {.option('-U, --username <username>', 'Username').option('-p, --password <token>', 'Password').option('--default', 'add the entry as the new default')- .action(options => {- prompt.override = options- prompt.start()- prompt.get({- properties: {- url: {- description: 'instance url',- conform: value => isURLaPeerTubeInstance(value),- message: 'It should be an URL (https://peertube.example.com)',- required: true- },- username: {- conform: value => typeof value === 'string' && value.length !== 0,- message: 'Name must be only letters, spaces, or dashes',- required: true- },- password: {- hidden: true,- replace: '*',- required: true- }+ .action(async options => {+ const overrides = {+ url: options.url,+ username: options.username,+ password: options.password+ }++ const result = await prompts([+ {+ type: overrides.url ? null : 'text',+ name: 'url',+ message: 'instance url',+ validate: value => isURLaPeerTubeInstance(value) ? true : 'It should be an URL (https://peertube.example.com)'+ },+ {+ type: overrides.username ? null : 'text',+ name: 'username',+ message: 'username',+ validate: value => typeof value === 'string' && value.length !== 0 ? true : 'Name must be only letters, spaces, or dashes'+ },+ {+ type: overrides.password ? null : 'password',+ name: 'password',+ message: 'password',+ validate: value => typeof value === 'string' && value.length !== 0 ? true : 'Password is required'}- }, async (_, result) => {- // Check credentials- try {- // Strip out everything after the domain:port.- // See https://github.com/Chocobozzz/PeerTube/issues/3520- result.url = stripExtraneousFromPeerTubeUrl(result.url)-- const server = buildServer(result.url)- await assignToken(server, result.username, result.password)- } catch (err) {- console.error(err.message)- process.exit(-1)+ ], {+ onCancel: () => {+ process.exit(1)}+ })- await setInstance(result.url, result.username, result.password, options.default)+ const resolved = {+ url: overrides.url ?? result.url,+ username: overrides.username ?? result.username,+ password: overrides.password ?? result.password+ }- process.exit(0)- })+ // Check credentials+ try {+ // Strip out everything after the domain:port.+ // See https://github.com/Chocobozzz/PeerTube/issues/3520+ resolved.url = stripExtraneousFromPeerTubeUrl(resolved.url)++ const server = buildServer(resolved.url)+ await assignToken(server, resolved.username, resolved.password)+ } catch (err) {+ console.error(err.message)+ process.exit(-1)+ }++ await setInstance(resolved.url, resolved.username, resolved.password, options.default)++ process.exit(0)})programdiff --git a/apps/peertube-cli/tsconfig.json b/apps/peertube-cli/tsconfig.jsonindex 636bdb95a3..c32374d4a1 100644--- a/apps/peertube-cli/tsconfig.json+++ b/apps/peertube-cli/tsconfig.json@@ -6,6 +6,7 @@"rootDir": "src","tsBuildInfoFile": "./dist/.tsbuildinfo"},+ "include": [ "src/**/*.ts" ],"references": [{ "path": "../../packages/core-utils" },{ "path": "../../packages/models" },diff --git a/apps/peertube-cli/tsdown.config.ts b/apps/peertube-cli/tsdown.config.tsnew file mode 100644index 0000000000..65712b7aee--- /dev/null+++ b/apps/peertube-cli/tsdown.config.ts@@ -0,0 +1,18 @@+import { defineConfig } from 'tsdown'+import { readFileSync } from 'fs'++const packageJSON = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8'))++export default defineConfig({+ entry: [ './src/peertube.ts' ],+ shims: true,++ external: [+ './lib-cov/fluent-ffmpeg',+ 'pg-hstore'+ ],++ define: {+ 'process.env.PACKAGE_VERSION': `'${packageJSON.version}'`+ }+})diff --git a/eslint.config.mjs b/eslint.config.mjsindex 1f282cf06f..7616d68046 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -14,7 +14,8 @@ export default defineConfig(['*.js','client','dist',- 'server/.i18next.config.ts'+ 'server/.i18next.config.ts',+ 'apps/**/tsdown.config.ts']),{diff --git a/package.json b/package.jsonindex d86567e5fb..e3b5d4b13b 100644--- a/package.json+++ b/package.json@@ -181,7 +181,7 @@"password-generator": "^3.0.0","pg": "^8.18.0","piscina": "^5.1.4",- "prompt": "^1.3.0",+ "prompts": "^2.4.2","proxy-addr": "^2.0.7","pug": "^3.0.3","reflect-metadata": "^0.2.2",@@ -233,6 +233,7 @@"@types/multer": "^2.0.0","@types/node": "22.14.1","@types/nodemailer": "^7.0.11",+ "@types/prompts": "^2.4.9","@types/pug": "^2.0.10","@types/validator": "^13.15.10","@types/webtorrent": "^0.110.1",@@ -244,7 +245,6 @@"chai-xml": "^0.4.1","concurrently": "^9.2.1","depcheck": "^1.4.7",- "esbuild": "^0.27.3","eslint": "^9.39.3","eslint-config-love": "^133.0.0","fast-xml-parser": "^5.3.7",diff --git a/packages/tests/src/cli/peertube.ts b/packages/tests/src/cli/peertube.tsindex aaa7c314fc..1ab6326ff9 100644--- a/packages/tests/src/cli/peertube.ts+++ b/packages/tests/src/cli/peertube.ts@@ -19,7 +19,7 @@ describe('Test CLI wrapper', function () {let cliCommand: CLICommand- const cmd = 'node ./apps/peertube-cli/dist/peertube.js'+ const cmd = 'node ./apps/peertube-cli/dist/peertube.mjs'before(async function () {this.timeout(30000)@@ -46,7 +46,6 @@ describe('Test CLI wrapper', function () {})describe('Authentication and instance selection', function () {-it('Should get an access token', async function () {const { stdout } = await cliCommand.execWithEnv(`${cmd} token --url ${server.url} --username user_1 --password super_password`)const token = stdout.trim()@@ -95,7 +94,6 @@ describe('Test CLI wrapper', function () {})describe('Video upload', function () {-it('Should upload a video', async function () {this.timeout(60000)@@ -117,7 +115,6 @@ describe('Test CLI wrapper', function () {})describe('Admin auth', function () {-it('Should remove the auth user', async function () {await cliCommand.execWithEnv(`${cmd} auth del ${server.url}`)@@ -131,7 +128,6 @@ describe('Test CLI wrapper', function () {})describe('Manage plugins', function () {-it('Should install a plugin', async function () {this.timeout(60000)diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex d8e615491a..492a08c58a 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -299,9 +299,9 @@ importers:piscina:specifier: ^5.1.4version: 5.1.4- prompt:- specifier: ^1.3.0- version: 1.3.0+ prompts:+ specifier: ^2.4.2+ version: 2.4.2proxy-addr:specifier: ^2.0.7version: 2.0.7@@ -450,6 +450,9 @@ importers:'@types/nodemailer':specifier: ^7.0.11version: 7.0.11+ '@types/prompts':+ specifier: ^2.4.9+ version: 2.4.9'@types/pug':specifier: ^2.0.10version: 2.0.10@@ -483,9 +486,6 @@ importers:depcheck:specifier: ^1.4.7version: 1.4.7- esbuild:- specifier: ^0.27.3- version: 0.27.3eslint:specifier: ^9.39.3version: 9.39.3([email protected])@@ -553,6 +553,9 @@ importers:netrc-parser:specifier: ^3.1.6version: 3.1.6+ tsdown:+ specifier: 0.21.0-beta.2+ version: 0.21.0-beta.2([email protected])apps/peertube-runner:devDependencies:@@ -567,7 +570,7 @@ importers:version: 4.0.0follow-redirects:specifier: ^1.15.11- version: 1.15.11+ version: 1.15.11([email protected])net-ipc:specifier: ^2.2.2version: 2.2.2@@ -4202,6 +4205,9 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-NoaMtzhxOrubeL/7UZuNTrejB4MPAJ0RpxZqXQf2qXuVlTPuG6Y8p4u9dKRaue4yjmC7ZhzVO2/Yyyn25znrPQ==}+ '@types/[email protected]':+ resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==}+'@types/[email protected]':resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==}@@ -4753,12 +4759,6 @@ packages:resolution: {integrity: sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==}- resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==}-- resolution: {integrity: sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==}-resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==}@@ -5342,10 +5342,6 @@ packages:resolution: {integrity: sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==}- resolution: {integrity: sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==}- engines: {node: '>=0.1.90'}-resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}engines: {node: '>= 0.8'}@@ -5577,10 +5573,6 @@ packages:resolution: {integrity: sha512-NOx7YDFWEsM/fTRAJjRpPp8t+MKRVvniAg9wQlUKx20MFrPs73WLJhFf5iteqrxNYnsy924K3Iroh3yNHeYd2g==}- resolution: {integrity: sha512-TVF6svNzeQCOpjCqsy0/CSy8VgObG3wXusJ73xW2GbG5rGx7lC8zxDSURicsXI2UsGdi2L0QNRCi745/wUDvsA==}- engines: {node: '>=0.4.0'}-resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==}engines: {node: '>=0.12'}@@ -6301,10 +6293,6 @@ packages:engines: {node: '>= 10.17.0'}hasBin: true- resolution: {integrity: sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==}- engines: {node: '> 0.1.90'}-resolution: {integrity: sha512-ybA6PDXIXOXivLJK/z9e+Otk7ve13I4ckBvGO5I2RRmBU1gMHLVDJYEuJYhGwez7YNlYji2M2DvVU+a9mSFDlw==}@@ -7346,9 +7334,6 @@ packages:resolution: {integrity: sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ==}engines: {node: '>=10'}- resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}-resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==}engines: {node: '>=8'}@@ -7538,6 +7523,10 @@ packages:resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}engines: {node: '>=0.10.0'}+ resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}+ engines: {node: '>=6'}+resolution: {integrity: sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==}@@ -8091,9 +8080,6 @@ packages:resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==}hasBin: true- resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==}-resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==}engines: {node: ^18.17.0 || >=20.5.0}@@ -8865,9 +8851,9 @@ packages:resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==}- resolution: {integrity: sha512-ZkaRWtaLBZl7KKAKndKYUL8WqNT+cQHKRZnT4RYYms48jQkFw3rrBL+/N5K/KtdEveHkxs982MX2BkDKub2ZMg==}- engines: {node: '>= 6.0.0'}+ resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==}+ engines: {node: '>= 6'}resolution: {integrity: sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==}@@ -9080,10 +9066,6 @@ packages:resolution: {integrity: sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==}engines: {node: '>=16'}- resolution: {integrity: sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==}- engines: {node: '>=0.8'}-resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==}@@ -9237,10 +9219,6 @@ packages:resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}engines: {iojs: '>=1.0.0', node: '>=0.10.0'}- resolution: {integrity: sha512-xcBILK2pA9oh4SiinPEZfhP8HfrB/ha+a2fTMyl7Om2WjlDVrOQy99N2MXXlUHqGJz4qEu2duXxHJjDWuK/0xg==}- engines: {node: '>= 0.4.0'}-resolution: {integrity: sha512-rRg/6Lb+IGfJqO05HZkN50UtY7K/JhxJag1kP23+zyMfrvoB0B7RWv06MbOzoc79RgCdNTiUaNsTT1AJZ7Z+cg==}@@ -9681,6 +9659,9 @@ packages:resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}+ resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}+resolution: {integrity: sha512-J/SU27FJ+I52TcDLKZzPRRVQUMj0Pp1i/HLb2lrkU+hrMLM+qdeRjdacrNxnSW48Waa3UcEOGOdX1+0Lob7TgA==}engines: {node: '>=20.19.5', npm: '>=10.8.2'}@@ -10819,10 +10800,6 @@ packages:resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==}engines: {node: '>= 12.0.0'}- resolution: {integrity: sha512-vLB4BqzCKDnnZH9PHGoS2ycawueX4HLqENXQitvFHczhgW2vFpSOn31LZtVr1KU8YTw7DS4tM+cqyovxo8taVg==}- engines: {node: '>= 0.10.0'}-resolution: {integrity: sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA==}engines: {node: '>= 12.0.0'}@@ -12115,7 +12092,8 @@ snapshots:hashery: 1.5.0keyv: 5.6.0- '@colors/[email protected]': {}+ '@colors/[email protected]':+ optional: true'@colors/[email protected]': {}@@ -14351,7 +14329,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.14.1+ '@types/node': 20.19.33'@types/[email protected]':dependencies:@@ -14502,7 +14480,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.14.1+ '@types/node': 20.19.33'@types/[email protected]':dependencies:@@ -14516,10 +14494,15 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.14.1+ '@types/node': 20.19.33pg-protocol: 1.11.0pg-types: 2.2.0+ '@types/[email protected]':+ dependencies:+ '@types/node': 20.19.33+ kleur: 3.0.3+'@types/[email protected]': {}'@types/[email protected]':@@ -14544,7 +14527,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 24.10.13+ '@types/node': 20.19.33'@types/[email protected]':dependencies:@@ -15339,12 +15322,6 @@ snapshots:- dependencies:- lodash: 4.17.23-- [email protected]: {}-@@ -16089,8 +16066,6 @@ snapshots:- [email protected]: {}-dependencies:delayed-stream: 1.0.0@@ -16370,8 +16345,6 @@ snapshots:- [email protected]: {}-dependencies:es5-ext: 0.10.64@@ -16773,7 +16746,7 @@ snapshots:dependencies:'@types/cors': 2.8.19- '@types/node': 22.14.1+ '@types/node': 20.19.33accepts: 1.3.8base64id: 2.0.0cookie: 0.7.2@@ -17415,8 +17388,6 @@ snapshots:transitivePeerDependencies:- supports-color- [email protected]: {}-@@ -17597,8 +17568,6 @@ snapshots:- [email protected]: {}-optionalDependencies:debug: 4.4.3([email protected])@@ -18558,8 +18527,6 @@ snapshots:- [email protected]: {}-@@ -18810,6 +18777,8 @@ snapshots:+ [email protected]: {}+@@ -19438,8 +19407,6 @@ snapshots:- [email protected]: {}-@@ -20331,13 +20298,10 @@ snapshots:dependencies:asap: 2.0.6dependencies:- '@colors/colors': 1.5.0- async: 3.2.3- read: 1.0.7- revalidator: 0.1.8- winston: 2.4.7+ kleur: 3.0.3+ sisteransi: 1.0.5dependencies:@@ -20622,10 +20586,6 @@ snapshots:parse-json: 7.1.1type-fest: 4.41.0- dependencies:- mute-stream: 0.0.8-dependencies:core-util-is: 1.0.3@@ -20799,8 +20759,6 @@ snapshots:- [email protected]: {}-@@ -21345,6 +21303,8 @@ snapshots:once: 1.4.0simple-concat: 1.0.1+ [email protected]: {}+dependencies:'@types/node': 24.10.13@@ -22693,15 +22653,6 @@ snapshots:readable-stream: 3.6.2triple-beam: 1.4.1- dependencies:- async: 2.6.4- colors: 1.0.3- cycle: 1.0.3- eyes: 0.1.8- isstream: 0.1.2- stack-trace: 0.0.10-dependencies:'@colors/colors': 1.6.0@@ -22725,7 +22676,7 @@ snapshots:dependencies:- '@types/node': 22.14.1+ '@types/node': 20.19.33diff --git a/scripts/build/peertube-cli.sh b/scripts/build/peertube-cli.shindex 51886a0db1..b4aaa3cd6c 100644--- a/scripts/build/peertube-cli.sh+++ b/scripts/build/peertube-cli.sh@@ -9,4 +9,4 @@ rm -rf ./distrm -rf ./distmkdir ./dist-node ./scripts/build.js+npm run builddiff --git a/scripts/dev/peertube-cli.sh b/scripts/dev/peertube-cli.shindex 172bf038ed..a7c4213c06 100755--- a/scripts/dev/peertube-cli.sh+++ b/scripts/dev/peertube-cli.sh@@ -8,4 +8,4 @@ cd ./apps/peertube-cli../../node_modules/.bin/concurrently -k \"../../node_modules/.bin/tsc -w --noEmit" \- "node ./scripts/watch.js"+ "npm run dev"diff --git a/server/scripts/shared/common.ts b/server/scripts/shared/common.tsindex 4bb28c002a..3c777797be 100644--- a/server/scripts/shared/common.ts+++ b/server/scripts/shared/common.ts@@ -1,28 +1,17 @@-import prompt from 'prompt'+import prompts from 'prompts'export async function askConfirmation (message: string) {- return new Promise((res, rej) => {- prompt.start()-- const schema = {- properties: {- confirm: {- type: 'string',- description: message + ' (y/n)',- default: 'n',- validator: /y[es]*|n[o]?/,- warning: 'Must respond yes or no',- required: true- }- }+ const result = await prompts({+ type: 'confirm',+ name: 'confirm',+ message+ }, {+ onCancel: () => {+ process.exit(1)}-- prompt.get(schema, function (err, result) {- if (err) return rej(err)-- return res(result.confirm?.match(/y/) !== null)- })})++ return result.confirm === true}export function displayPeerTubeMustBeStoppedWarning () {