-
Notifications
You must be signed in to change notification settings - Fork 4.2k
KTL-2944 Add webteam youtube-playlist #5017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
be990f3
cc9600f
fa576d8
1f926a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
save-exact = true | ||
@webteam:registry=https://packages.jetbrains.team/npm/p/wt/npm/ | ||
//packages.jetbrains.team/npm/p/wt/npm/:_authToken=${WEBTEAM_UI_NPM_TOKEN} | ||
//packages.jetbrains.team/npm/p/wt/npm/:always-auth=true | ||
legacy-peer-deps=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import YoutubePlayer from '@jetbrains/kotlin-web-site-ui/out/components/youtube-player'; | ||
|
||
interface YoutubePlaylistProps { | ||
playlistId: string; | ||
playlistTitle: string; | ||
} | ||
|
||
const YoutubePlaylist: FC<YoutubePlaylistProps> = ({ playlistId, playlistTitle }) => { | ||
return ( | ||
<YoutubePlayer | ||
mode={1} | ||
id={playlistId} | ||
/> | ||
); | ||
}; | ||
|
||
export default YoutubePlaylist; | ||
Comment on lines
+1
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fallback component. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
const path = require('path'); | ||
const packageJSON = require('./package.json'); | ||
|
||
const withPlugins = require('next-compose-plugins'); | ||
|
@@ -13,6 +14,20 @@ let transpiledPackages = [ | |
'@rescui/menu' | ||
]; | ||
|
||
if (process.env.USE_FALLBACK_FOR_INTERNAL_PACKAGES !== '1') { | ||
transpiledPackages.push( | ||
'@webteam/youtube-playlist', | ||
'@webteam/ui-contexts', | ||
'@webteam/colors', | ||
'@webteam/toggle', | ||
'@webteam/youtube-player', | ||
'@webteam/use-fetch', | ||
'@webteam/use-async-data', | ||
'@webteam/bem-cn-fast', | ||
'@webteam/list' | ||
) | ||
} | ||
Comment on lines
+18
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a workaround, it is expected to be here, we do the same with the RescUI components above. |
||
|
||
const withTranspile = nextTranspileModules(transpiledPackages); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably keep it for now, but I found out that |
||
|
||
const nextConfig = { | ||
|
@@ -44,6 +59,17 @@ const nextConfig = { | |
type: 'asset/source' | ||
}); | ||
|
||
const useFallbackForInternalPackages = process.env.USE_FALLBACK_FOR_INTERNAL_PACKAGES === '1'; | ||
|
||
config.resolve.alias = config.resolve.alias || {}; | ||
|
||
if (useFallbackForInternalPackages) { | ||
config.resolve.alias['@webteam'] = path.resolve( | ||
__dirname, | ||
'components/webteam-fallback' | ||
); | ||
} | ||
Comment on lines
+66
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the place, where all the magic happens. |
||
|
||
return config; | ||
}, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why, but types resolve doesn't work with it.