mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Stop using tsconfig register
Prefer to replace paths at compile time
This commit is contained in:
@@ -2,19 +2,19 @@ import { Command } from 'commander'
|
||||
import { Netrc } from 'netrc-parser'
|
||||
import { join } from 'path'
|
||||
import { createLogger, format, transports } from 'winston'
|
||||
import { PeerTubeServer } from '@shared/server-commands'
|
||||
import { loadLanguages } from '@server/initializers/constants'
|
||||
import { root } from '@shared/core-utils'
|
||||
import { UserRole } from '@shared/models'
|
||||
import { PeerTubeServer } from '@shared/server-commands'
|
||||
import { VideoPrivacy } from '../../shared/models/videos'
|
||||
import { getAppNumber, isTestInstance } from '../helpers/core-utils'
|
||||
import { root } from '@shared/core-utils'
|
||||
import { loadLanguages } from '@server/initializers/constants'
|
||||
|
||||
let configName = 'PeerTube/CLI'
|
||||
if (isTestInstance()) configName += `-${getAppNumber()}`
|
||||
|
||||
const config = require('application-config')(configName)
|
||||
|
||||
const version = require('../../../package.json').version
|
||||
const version = require(join(root(), 'package.json')).version
|
||||
|
||||
async function getAdminTokenOrDie (server: PeerTubeServer, username: string, password: string) {
|
||||
const token = await server.login.getAccessToken(username, password)
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
// eslint-disable @typescript-eslint/no-unnecessary-type-assertion
|
||||
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import { OptionValues, program } from 'commander'
|
||||
import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './cli'
|
||||
import { isUserUsernameValid } from '../helpers/custom-validators/users'
|
||||
import CliTable3 from 'cli-table3'
|
||||
import { OptionValues, program } from 'commander'
|
||||
import { isUserUsernameValid } from '../helpers/custom-validators/users'
|
||||
import { assignToken, buildServer, getNetrc, getSettings, writeSettings } from './cli'
|
||||
|
||||
import prompt = require('prompt')
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import { program } from 'commander'
|
||||
import { assignToken, buildServer } from './cli'
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import { program } from 'commander'
|
||||
import { accessSync, constants } from 'fs'
|
||||
import { remove } from 'fs-extra'
|
||||
import { join } from 'path'
|
||||
import { sha256 } from '@shared/extra-utils'
|
||||
import { YoutubeDLCLI, YoutubeDLInfo, YoutubeDLInfoBuilder } from '@server/helpers/youtube-dl'
|
||||
import { wait } from '@shared/core-utils'
|
||||
import { sha256 } from '@shared/extra-utils'
|
||||
import { doRequestAndSaveToFile } from '../helpers/requests'
|
||||
import {
|
||||
assignToken,
|
||||
@@ -16,7 +14,7 @@ import {
|
||||
getLogger,
|
||||
getServerCredentials
|
||||
} from './cli'
|
||||
import { YoutubeDLCLI, YoutubeDLInfo, YoutubeDLInfoBuilder } from '@server/helpers/youtube-dl'
|
||||
|
||||
import prompt = require('prompt')
|
||||
|
||||
const processOptions = {
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
// eslint-disable @typescript-eslint/no-unnecessary-type-assertion
|
||||
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import { program, Command, OptionValues } from 'commander'
|
||||
import { assignToken, buildServer, getServerCredentials } from './cli'
|
||||
import { PluginType } from '../../shared/models'
|
||||
import { isAbsolute } from 'path'
|
||||
import CliTable3 from 'cli-table3'
|
||||
import { Command, OptionValues, program } from 'commander'
|
||||
import { isAbsolute } from 'path'
|
||||
import { PluginType } from '../../shared/models'
|
||||
import { assignToken, buildServer, getServerCredentials } from './cli'
|
||||
|
||||
program
|
||||
.name('plugins')
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import CliTable3 from 'cli-table3'
|
||||
import { Command, program } from 'commander'
|
||||
import { uniq } from 'lodash'
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import { program } from 'commander'
|
||||
import { access, constants } from 'fs-extra'
|
||||
import { isAbsolute } from 'path'
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { registerTSPaths } from '../helpers/register-ts-paths'
|
||||
registerTSPaths()
|
||||
|
||||
import { CommandOptions, program } from 'commander'
|
||||
import { getSettings, version } from './cli'
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/server/tools"
|
||||
"baseUrl": "./",
|
||||
"outDir": "../../dist/server/tools",
|
||||
"paths": { // FIXME: https://github.com/benyap/resolve-tspaths/issues/10
|
||||
"@server/*": [ "../../server/*" ],
|
||||
"@shared/*": [ "../../shared/*" ]
|
||||
}
|
||||
},
|
||||
"include": [ ".", "../typings" ],
|
||||
"references": [
|
||||
{ "path": "../" },
|
||||
{ "path": "../" }
|
||||
],
|
||||
"files": [],
|
||||
"exclude": [ ] // Overwrite exclude property
|
||||
|
||||
Reference in New Issue
Block a user