Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ terraform.tfstate.backup

# next.js
.next
**/next-env.d.ts

# playwright
**/test-results/
Expand Down
1 change: 0 additions & 1 deletion apis/api-users/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"jsx": "react-jsx",
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions apis/api-users/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"noEmit": true,
"strict": true,
"incremental": true,
"module": "esnext",
"moduleResolution": "bundler",
"tsBuildInfoFile": "../../.cache/api-users/tsc/.tsbuildinfo"
},
"files": [],
Expand Down
1 change: 0 additions & 1 deletion apis/api-users/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"jsx": "react-jsx",
"types": [
"jest",
Expand Down
7 changes: 7 additions & 0 deletions apps/arclight/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ export default [
...nextConfig,
{
ignores: ['apps/arclight/next.config.js']
},
{
files: ['apps/arclight/**/*.{js,jsx,ts,tsx}'],
rules: {
// Allow literal strings in this project (e.g. small validation UI messages).
'i18next/no-literal-string': 'off'
}
}
]
6 changes: 0 additions & 6 deletions apps/arclight/next-env.d.ts

This file was deleted.

9 changes: 3 additions & 6 deletions apps/arclight/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ const { composePlugins, withNx } = require('@nx/next')
**/
const nextConfig = {
nx: {},
typedRoutes: true,
productionBrowserSourceMaps: true,
typescript: {
// handled by github actions
ignoreBuildErrors: process.env.CI === 'true'
},
eslint: {
// handled by github actions
ignoreDuringBuilds: process.env.CI === 'true'
},
reactCompiler: true,
outputFileTracingExcludes: {
'*': [
'node_modules/@swc/core-linux-x64-gnu',
Expand All @@ -24,8 +22,7 @@ const nextConfig = {
]
},
experimental: {
fallbackNodePolyfills: false,
reactCompiler: true
fallbackNodePolyfills: false
}
}

Expand Down
3 changes: 2 additions & 1 deletion apps/arclight/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"executor": "@nx/next:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/arclight"
"outputPath": "dist/apps/arclight",
"webpack": true
},
"configurations": {
"production": {}
Expand Down
17 changes: 17 additions & 0 deletions apps/arclight/src/app/[keyword]/getShortLinkQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { graphql } from '@core/shared/gql'

export const GET_SHORT_LINK_QUERY = graphql(`
query GetShortLinkQuery($hostname: String!, $pathname: String!) {
shortLink: shortLinkByPath(hostname: $hostname, pathname: $pathname) {
__typename
... on QueryShortLinkByPathSuccess {
data {
to
redirectType
brightcoveId
bitrate
}
}
}
}
`)
18 changes: 2 additions & 16 deletions apps/arclight/src/app/[keyword]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,13 @@ import { OpenAPIHono, createRoute, z } from '@hono/zod-openapi'
import { HTTPException } from 'hono/http-exception'
import { handle } from 'hono/vercel'

import { ResultOf, graphql } from '@core/shared/gql'
import { ResultOf } from '@core/shared/gql'

import { getApolloClient } from '../../lib/apolloClient'
import { getBrightcoveUrl } from '../../lib/brightcove'
import { getClientIp, setCorsHeaders } from '../../lib/redirectUtils'

export const GET_SHORT_LINK_QUERY = graphql(`
query GetShortLinkQuery($hostname: String!, $pathname: String!) {
shortLink: shortLinkByPath(hostname: $hostname, pathname: $pathname) {
__typename
... on QueryShortLinkByPathSuccess {
data {
to
redirectType
brightcoveId
bitrate
}
}
}
}
`)
import { GET_SHORT_LINK_QUERY } from './getShortLinkQuery'

const app = new OpenAPIHono().basePath('/')

Expand Down
49 changes: 20 additions & 29 deletions apps/arclight/src/app/videoPlayerUrl/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { notFound } from 'next/navigation'

import { graphql } from '@core/shared/gql'

import { getApolloClient } from '../../lib/apolloClient'
Expand Down Expand Up @@ -47,6 +49,18 @@ const GET_VIDEO_TITLE = graphql(`
}
`)

type VideoPlayerUrlSearchParams = {
refId?: string
start?: string
end?: string
subon?: string
sublangids?: string
}

type VideoPlayerUrlPageProps = {
searchParams: Promise<VideoPlayerUrlSearchParams>
}

function handleSubtitles(
subonRaw: string | null,
sublangidsRaw: string | null
Expand Down Expand Up @@ -87,21 +101,10 @@ function handleSubtitles(
return { activeSubLangId, acceptedSubLangIds }
}

export default async function Page(props: {
searchParams: Promise<{
refId?: string
start?: string
end?: string
subon?: string
sublangids?: string
}>
}) {
export default async function Page(props: VideoPlayerUrlPageProps) {
const searchParams = await props.searchParams
if (!searchParams.refId) {
return {
message: 'Missing refId parameter',
status: 404
}
notFound()
}

// Parse start and end times, ensuring they are valid numbers
Expand All @@ -112,24 +115,15 @@ export default async function Page(props: {

// Validate time parameters
if (startTime != null && (isNaN(startTime) || startTime < 0)) {
return {
message: 'Invalid start time parameter',
status: 400
}
return <p>Invalid start time parameter</p>
}

if (endTime != null && (isNaN(endTime) || endTime < 0)) {
return {
message: 'Invalid end time parameter',
status: 400
}
return <p>Invalid end time parameter</p>
}

if (startTime != null && endTime != null && endTime <= startTime) {
return {
message: 'End time must be greater than start time',
status: 400
}
return <p>End time must be greater than start time</p>
}

const { data } = await getApolloClient().query({
Expand Down Expand Up @@ -165,10 +159,7 @@ export default async function Page(props: {
}))

if (!hlsUrl) {
return {
message: 'No video URL found for ID: ' + searchParams.refId,
status: 404
}
notFound()
}

return (
Expand Down
2 changes: 2 additions & 0 deletions apps/arclight/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"module": "esnext",
"moduleResolution": "bundler",
"tsBuildInfoFile": "../../.cache/arclight/tsc/.tsbuildinfo",
"types": ["jest", "node"],
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/fixtures/authenticated.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test as base } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

import { LoginPage } from '../pages/login-page'

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/card-level-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* eslint-disable playwright/no-wait-for-timeout */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from '@playwright/test'
import dayjs from 'dayjs'
import type { Page } from 'playwright-core'

import testData from '../utils/testData.json'

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/home-page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

export class HomePage {
readonly page: Page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

import { generateRandomNumber } from '../framework/helpers'
import testData from '../utils/testData.json'
Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/journey-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs'
import path from 'path'

import { expect } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

import { generateRandomNumber } from '../framework/helpers'
import testData from '../utils/testData.json'
Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/landing-page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test'
import { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

import { isVisible } from '../framework/actions'
import { getBaseUrl } from '../framework/helpers'
Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/left-nav.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

const sixtySecondsTimeout = 60000

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/login-page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

import { getEmail, getPassword } from '../framework/helpers'

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/profile-page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

const thirtySecondsTimeout = 30000

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

import testData from '../utils/testData.json'

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/register-Page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from '@playwright/test'
import dayjs from 'dayjs'
import type { Page } from 'playwright-core'

import { getOTP, getPassword } from '../framework/helpers'
import testData from '../utils/testData.json'
Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/teams-page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from '@playwright/test'
import dayjs from 'dayjs'
import type { Page } from 'playwright-core'

import testData from '../utils/testData.json'

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/template-page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable playwright/no-force-option */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@playwright/test'
import type { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

const sixtySecondsTimeout = 60000

Expand Down
2 changes: 1 addition & 1 deletion apps/journeys-admin-e2e/src/pages/top-nav.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test'
import { Page } from 'playwright-core'
import type { Page } from '@playwright/test'

export class TopNav {
readonly page: Page
Expand Down
6 changes: 1 addition & 5 deletions apps/journeys-admin/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ declare module '*.svg' {
export const ReactComponent: any
export default content
}
export type DateTime = string

declare global {
type DateTime = string
}
type DateTime = string
6 changes: 0 additions & 6 deletions apps/journeys-admin/next-env.d.ts

This file was deleted.

8 changes: 1 addition & 7 deletions apps/journeys-admin/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,11 @@ const nextConfig = {
]
},
productionBrowserSourceMaps: true,
reactCompiler: true,
typescript: {
// handled by github actions
ignoreBuildErrors: process.env.CI === 'true'
},
eslint: {
// handled by github actions
ignoreDuringBuilds: process.env.CI === 'true'
},
transpilePackages: [
'shared-ui',
'shared-ui-dynamic',
Expand All @@ -105,9 +102,6 @@ const nextConfig = {
'node_modules/@swc/core-linux-x64-musl',
'node_modules/esbuild-linux-64/bin'
]
},
experimental: {
reactCompiler: true
}
}
const plugins = [withNx]
Expand Down
Loading
Loading