aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-custom-markup
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-31 14:34:36 +0200
committerChocobozzz <me@florianbigard.com>2023-08-11 15:02:33 +0200
commit3a4992633ee62d5edfbb484d9c6bcb3cf158489d (patch)
treee4510b39bdac9c318fdb4b47018d08f15368b8f0 /client/src/app/shared/shared-custom-markup
parent04d1da5621d25d59bd5fa1543b725c497bf5d9a8 (diff)
downloadPeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.tar.gz
PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.tar.zst
PeerTube-3a4992633ee62d5edfbb484d9c6bcb3cf158489d.zip
Migrate server to ESM
Sorry for the very big commit that may lead to git log issues and merge conflicts, but it's a major step forward: * Server can be faster at startup because imports() are async and we can easily lazy import big modules * Angular doesn't seem to support ES import (with .js extension), so we had to correctly organize peertube into a monorepo: * Use yarn workspace feature * Use typescript reference projects for dependencies * Shared projects have been moved into "packages", each one is now a node module (with a dedicated package.json/tsconfig.json) * server/tools have been moved into apps/ and is now a dedicated app bundled and published on NPM so users don't have to build peertube cli tools manually * server/tests have been moved into packages/ so we don't compile them every time we want to run the server * Use isolatedModule option: * Had to move from const enum to const (https://www.typescriptlang.org/docs/handbook/enums.html#objects-vs-enums) * Had to explictely specify "type" imports when used in decorators * Prefer tsx (that uses esbuild under the hood) instead of ts-node to load typescript files (tests with mocha or scripts): * To reduce test complexity as esbuild doesn't support decorator metadata, we only test server files that do not import server models * We still build tests files into js files for a faster CI * Remove unmaintained peertube CLI import script * Removed some barrels to speed up execution (less imports)
Diffstat (limited to 'client/src/app/shared/shared-custom-markup')
-rw-r--r--client/src/app/shared/shared-custom-markup/custom-markup.service.ts2
-rw-r--r--client/src/app/shared/shared-custom-markup/dynamic-element.service.ts2
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts2
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts2
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts2
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts4
6 files changed, 7 insertions, 7 deletions
diff --git a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
index b49f64834..4ab78a250 100644
--- a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
+++ b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
@@ -10,7 +10,7 @@ import {
10 PlaylistMiniatureMarkupData, 10 PlaylistMiniatureMarkupData,
11 VideoMiniatureMarkupData, 11 VideoMiniatureMarkupData,
12 VideosListMarkupData 12 VideosListMarkupData
13} from '@shared/models' 13} from '@peertube/peertube-models'
14import { DynamicElementService } from './dynamic-element.service' 14import { DynamicElementService } from './dynamic-element.service'
15import { 15import {
16 ButtonMarkupComponent, 16 ButtonMarkupComponent,
diff --git a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts
index a12907055..dc4f683ac 100644
--- a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts
+++ b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts
@@ -10,7 +10,7 @@ import {
10 SimpleChanges, 10 SimpleChanges,
11 Type 11 Type
12} from '@angular/core' 12} from '@angular/core'
13import { objectKeysTyped } from '@shared/core-utils' 13import { objectKeysTyped } from '@peertube/peertube-core-utils'
14 14
15@Injectable() 15@Injectable()
16export class DynamicElementService { 16export class DynamicElementService {
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
index 4f00eabd3..b731ccc64 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
@@ -3,7 +3,7 @@ import { finalize, map, switchMap, tap } from 'rxjs/operators'
3import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 3import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
4import { MarkdownService, Notifier, UserService } from '@app/core' 4import { MarkdownService, Notifier, UserService } from '@app/core'
5import { FindInBulkService } from '@app/shared/shared-search' 5import { FindInBulkService } from '@app/shared/shared-search'
6import { VideoSortField } from '@shared/models' 6import { VideoSortField } from '@peertube/peertube-models'
7import { Video, VideoChannel, VideoService } from '../../shared-main' 7import { Video, VideoChannel, VideoService } from '../../shared-main'
8import { CustomMarkupComponent } from './shared' 8import { CustomMarkupComponent } from './shared'
9 9
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
index 0baf2428b..bca7444ec 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
@@ -1,7 +1,7 @@
1import { environment } from 'src/environments/environment' 1import { environment } from 'src/environments/environment'
2import { Component, ElementRef, Input, OnInit } from '@angular/core' 2import { Component, ElementRef, Input, OnInit } from '@angular/core'
3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' 3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
4import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils' 4import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@peertube/peertube-core-utils'
5import { CustomMarkupComponent } from './shared' 5import { CustomMarkupComponent } from './shared'
6 6
7@Component({ 7@Component({
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
index bd93929c9..d692abbe3 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
@@ -2,7 +2,7 @@ import { finalize } from 'rxjs/operators'
2import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 2import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { FindInBulkService } from '@app/shared/shared-search' 4import { FindInBulkService } from '@app/shared/shared-search'
5import { objectKeysTyped } from '@shared/core-utils' 5import { objectKeysTyped } from '@peertube/peertube-core-utils'
6import { Video } from '../../shared-main' 6import { Video } from '../../shared-main'
7import { MiniatureDisplayOptions } from '../../shared-video-miniature' 7import { MiniatureDisplayOptions } from '../../shared-video-miniature'
8import { CustomMarkupComponent } from './shared' 8import { CustomMarkupComponent } from './shared'
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
index 81363be87..cbd5c7bf5 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
@@ -1,8 +1,8 @@
1import { finalize } from 'rxjs/operators' 1import { finalize } from 'rxjs/operators'
2import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 2import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { objectKeysTyped } from '@shared/core-utils' 4import { objectKeysTyped } from '@peertube/peertube-core-utils'
5import { VideoSortField } from '@shared/models' 5import { VideoSortField } from '@peertube/peertube-models'
6import { Video, VideoService } from '../../shared-main' 6import { Video, VideoService } from '../../shared-main'
7import { MiniatureDisplayOptions } from '../../shared-video-miniature' 7import { MiniatureDisplayOptions } from '../../shared-video-miniature'
8import { CustomMarkupComponent } from './shared' 8import { CustomMarkupComponent } from './shared'