Procházet zdrojové kódy

Convert endpoints to TypeScript (#22664)

GitOrigin-RevId: 159f0f38333ad2944c3f25c5076432e5f5dc7ba3
Alf Eaton před 1 rokem
rodič
revize
f79aac8d01

+ 1 - 1
services/web/.storybook/preview.tsx

@@ -1,7 +1,7 @@
 import type { Preview } from '@storybook/react'
 
 // Storybook does not (currently) support async loading of "stories". Therefore
-// the strategy in frontend/js/i18n.js does not work (because we cannot wait on
+// the strategy in frontend/js/i18n.ts does not work (because we cannot wait on
 // the promise to resolve).
 // Therefore we have to use the synchronous method for configuring
 // react-i18next. Because this, we can only hard-code a single language.

+ 1 - 1
services/web/cypress/support/component.ts

@@ -1,6 +1,6 @@
 import 'cypress-plugin-tab'
 import { resetMeta } from './ct/window' // needs to be before i18n
-import '../../frontend/js/i18n'
+import '@/i18n'
 import './shared/commands'
 import './shared/exceptions'
 import './ct/commands'

+ 0 - 0
services/web/frontend/js/dev-toolbar.js → services/web/frontend/js/dev-toolbar.ts


+ 0 - 0
services/web/frontend/js/i18n.js → services/web/frontend/js/i18n.ts


+ 0 - 0
services/web/frontend/js/ide-detached.js → services/web/frontend/js/ide-detached.ts


+ 0 - 0
services/web/frontend/js/marketing.js → services/web/frontend/js/marketing.ts


+ 1 - 1
services/web/frontend/js/pages/project-list.tsx

@@ -1,7 +1,7 @@
 import './../utils/meta'
 import './../utils/webpack-public-path'
 import './../infrastructure/error-reporter'
-import './../i18n'
+import '@/i18n'
 import '../features/event-tracking'
 import '../features/cookie-banner'
 import '../features/link-helpers/slow-link'

+ 1 - 1
services/web/frontend/js/pages/sharing-updates.tsx

@@ -1,7 +1,7 @@
 import './../utils/meta'
 import './../utils/webpack-public-path'
 import './../infrastructure/error-reporter'
-import './../i18n'
+import '@/i18n'
 import ReactDOM from 'react-dom'
 import SharingUpdatesRoot from '../features/token-access/components/sharing-updates-root'
 

+ 1 - 1
services/web/frontend/js/pages/token-access.tsx

@@ -1,7 +1,7 @@
 import './../utils/meta'
 import './../utils/webpack-public-path'
 import './../infrastructure/error-reporter'
-import './../i18n'
+import '@/i18n'
 import ReactDOM from 'react-dom'
 import TokenAccessRoot from '../features/token-access/components/token-access-root'
 

+ 1 - 1
services/web/frontend/js/pages/user/settings.jsx

@@ -2,7 +2,7 @@ import '../../marketing'
 import './../../utils/meta'
 import './../../utils/webpack-public-path'
 import './../../infrastructure/error-reporter'
-import './../../i18n'
+import '@/i18n'
 import '../../features/settings/components/root'
 import ReactDOM from 'react-dom'
 import SettingsPageRoot from '../../features/settings/components/root.tsx'

+ 1 - 1
services/web/frontend/js/pages/user/subscription/base.js

@@ -1,7 +1,7 @@
 import './../../../utils/meta'
 import './../../../utils/webpack-public-path'
 import './../../../infrastructure/error-reporter'
-import './../../../i18n'
+import '@/i18n'
 import '../../../features/event-tracking'
 import '../../../features/cookie-banner'
 import '../../../features/link-helpers/slow-link'

+ 1 - 1
services/web/frontend/js/shared/hooks/use-wait-for-i18n.ts

@@ -1,5 +1,5 @@
 import { useEffect, useState } from 'react'
-import i18n from '../../../js/i18n'
+import i18n from '@/i18n'
 import { useTranslation } from 'react-i18next'
 
 function useWaitForI18n() {

+ 1 - 1
services/web/modules/launchpad/frontend/js/pages/launchpad.js

@@ -1,5 +1,5 @@
 /* global io */
-import '../../../../../frontend/js/marketing'
+import '@/marketing'
 import {
   inflightHelper,
   toggleDisplay,

+ 1 - 1
services/web/modules/user-activate/frontend/js/pages/user-activate-page.jsx

@@ -1,4 +1,4 @@
-import '../../../../../frontend/js/marketing'
+import '@/marketing'
 
 import ReactDOM from 'react-dom'
 import UserActivateRegister from '../components/user-activate-register'

+ 3 - 3
services/web/webpack.config.js

@@ -19,9 +19,9 @@ const entryPoints = {
   tracing: './frontend/js/tracing.js',
   'bootstrap-3': './frontend/js/bootstrap-3.ts',
   'bootstrap-5': './frontend/js/bootstrap-5.ts',
-  devToolbar: './frontend/js/dev-toolbar.js',
-  'ide-detached': './frontend/js/ide-detached.js',
-  marketing: './frontend/js/marketing.js',
+  devToolbar: './frontend/js/dev-toolbar.ts',
+  'ide-detached': './frontend/js/ide-detached.ts',
+  marketing: './frontend/js/marketing.ts',
   'main-style': './frontend/stylesheets/main-style.less',
   'main-ieee-style': './frontend/stylesheets/main-ieee-style.less',
   'main-light-style': './frontend/stylesheets/main-light-style.less',