Skip to content

Commit

Permalink
Merge branch 'development' of 'FreeTubeApp/FreeTube' into dev-electro…
Browse files Browse the repository at this point in the history
…n-dwngrade
  • Loading branch information
OothecaPickle committed Oct 27, 2024
2 parents cce5a55 + a34525f commit 53da924
Show file tree
Hide file tree
Showing 41 changed files with 807 additions and 477 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
blank_issues_enabled: false
contact_links:
- name: Discussions
url: https://github.com/FreeTubeApp/FreeTube/discussions/categories/general
url: https://github.com/FreeTubeApp/FreeTube/discussions/categories/general
about: View discussions or start one yourself
- name: Questions
url: https://github.com/FreeTubeApp/FreeTube/discussions/categories/q-a
url: https://github.com/FreeTubeApp/FreeTube/discussions/categories/q-a
about: Ask and answer questions
- name: Matrix Community
url: https://matrix.to/#/+freetube:matrix.org
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body:
- type: textarea
attributes:
label: Alternatives Considered
description: A clear and concise description of any alternative solutions or features you've considered.
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true
- type: dropdown
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
with:
version: ${{ steps.versionNumber.outputs.result }}


- name: Install libarchive-tools
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt -y install libarchive-tools; echo "Version Number ${{ toJson(job) }} ${{ toJson(needs) }}"
Expand Down
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

3 changes: 1 addition & 2 deletions _scripts/ProcessLocalesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ProcessLocalesPlugin {

/** @param {import('webpack').Compiler} compiler */
apply(compiler) {
const { CachedSource, RawSource } = compiler.webpack.sources;
const { CachedSource, RawSource } = compiler.webpack.sources
const { Compilation, DefinePlugin } = compiler.webpack

new DefinePlugin({
Expand All @@ -59,7 +59,6 @@ class ProcessLocalesPlugin {
name: PLUGIN_NAME,
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
}, async (_assets) => {

// While running in the webpack dev server, this hook gets called for every incremental build.
// For incremental builds we can return the already processed versions, which saves time
// and makes webpack treat them as cached
Expand Down
2 changes: 1 addition & 1 deletion _scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (platform === 'darwin') {
arch = Arch.arm64
}

targets = Platform.MAC.createTarget(['DMG','zip', '7z'], arch)
targets = Platform.MAC.createTarget(['DMG', 'zip', '7z'], arch)
} else if (platform === 'win32') {
let arch = Arch.x64

Expand Down
2 changes: 1 addition & 1 deletion _scripts/dev-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function restartElectron() {
*/
function setupNotifyLocaleUpdate(compiler, devServer) {
const notifyLocaleChange = (updatedLocales) => {
devServer.sendMessage(devServer.webSocketServer.clients, "freetube-locale-update", updatedLocales)
devServer.sendMessage(devServer.webSocketServer.clients, 'freetube-locale-update', updatedLocales)
}

compiler.options.plugins
Expand Down
24 changes: 12 additions & 12 deletions _scripts/ebuilder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const config = {
},
protocols: [
{
name: "FreeTube",
name: 'FreeTube',
schemes: [
"freetube"
'freetube'
]
}
],
Expand Down Expand Up @@ -52,19 +52,19 @@ const config = {
// https://github.com/jordansissel/fpm/issues/1503
// https://github.com/jgraph/drawio-desktop/issues/259
rpm: {
fpm: [`--rpm-rpmbuild-define=_build_id_links none`]
fpm: ['--rpm-rpmbuild-define=_build_id_links none']
},
deb: {
depends: [
"libgtk-3-0",
"libnotify4",
"libnss3",
"libxss1",
"libxtst6",
"xdg-utils",
"libatspi2.0-0",
"libuuid1",
"libsecret-1-0"
'libgtk-3-0',
'libnotify4',
'libnss3',
'libxss1',
'libxtst6',
'xdg-utils',
'libatspi2.0-0',
'libuuid1',
'libsecret-1-0'
]
},
mac: {
Expand Down
3 changes: 1 addition & 2 deletions _scripts/getRegions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ for (const language of youTubeLanguages) {
youTube: language,
freeTube: language
})
// eslint-disable-next-line @stylistic/brace-style
}
// special cases
else if (language === 'de') {
Expand Down Expand Up @@ -120,8 +121,6 @@ for (const { youTube, freeTube } of languagesToScrape) {
processGeolocations(freeTube, youTube, response)
}



async function scrapeLanguage(youTubeLanguageCode) {
const session = await Innertube.create({
retrieve_player: false,
Expand Down
5 changes: 2 additions & 3 deletions _scripts/injectAllowedPaths.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { closeSync, ftruncateSync, openSync, readFileSync, readdirSync, writeSyn
import { dirname, join, relative, resolve } from 'path'
import { fileURLToPath } from 'url'

const __dirname = dirname(fileURLToPath(import.meta.url));
const __dirname = dirname(fileURLToPath(import.meta.url))

const distDirectory = resolve(__dirname, '..', 'dist')
const webDirectory = join(distDirectory, 'web')
Expand All @@ -25,14 +25,13 @@ const paths = readdirSync(distDirectory, {
dirent.name !== 'main.js' &&
dirent.name !== 'main.js.LICENSE.txt' &&
// filter out any web build files, in case the dist directory contains a web build
!dirent.path.startsWith(webDirectory);
!dirent.path.startsWith(webDirectory)
})
.map(dirent => {
const joined = join(dirent.path, dirent.name)
return '/' + relative(distDirectory, joined).replaceAll('\\', '/')
})


let fileHandle
try {
fileHandle = openSync(join(distDirectory, 'main.js'), 'r+')
Expand Down
1 change: 0 additions & 1 deletion _scripts/mime-db-shrinking-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = function (source) {
if (mimeType.startsWith('image/') && original[mimeType].extensions &&
(!mimeType.startsWith('image/x-') || mimeType === 'image/x-icon' || mimeType === 'image/x-ms-bmp') &&
(!mimeType.startsWith('image/vnd.') || mimeType === 'image/vnd.microsoft.icon')) {

// Only the extensions field is needed, see: https://github.com/kevva/ext-list/blob/v2.2.2/index.js
reduced[mimeType] = {
extensions: original[mimeType].extensions
Expand Down
1 change: 0 additions & 1 deletion _scripts/patchShaka.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ async function replaceAndDownloadMaterialIconsFont() {

let newFontCSS = text.match(/(@font-face\s*{[^}]+})/)[1].replaceAll('\n', '')


const urlMatch = newFontCSS.match(/https:\/\/fonts\.gstatic\.com\/s\/materialiconsround\/(?<version>[^/]+)\/[^.]+\.(?<extension>\w+)/)

const url = urlMatch[0]
Expand Down
16 changes: 8 additions & 8 deletions _scripts/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ const config = {
if (!isDevMode) {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/static'),
globOptions: {
dot: true,
ignore: ['**/.*', '**/locales/**', '**/pwabuilder-sw.js', '**/manifest.json', '**/dashFiles/**', '**/storyboards/**'],
},
patterns: [
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/static'),
globOptions: {
dot: true,
ignore: ['**/.*', '**/locales/**', '**/pwabuilder-sw.js', '**/manifest.json', '**/dashFiles/**', '**/storyboards/**'],
},
},
]
})
)
Expand Down
24 changes: 13 additions & 11 deletions _scripts/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,20 @@ const config = {
},
// Don't need to copy them in dev mode,
// as we configure WebpackDevServer to serve them
...(isDevMode ? [] : [
{
from: path.join(__dirname, '../node_modules/shaka-player/ui/locales', `{${SHAKA_LOCALES_TO_BE_BUNDLED.join(',')}}.json`).replaceAll('\\', '/'),
to: path.join(__dirname, '../dist/static/shaka-player-locales'),
context: path.join(__dirname, '../node_modules/shaka-player/ui/locales'),
transform: {
transformer: (input) => {
return JSON.stringify(JSON.parse(input.toString('utf-8')))
...(isDevMode
? []
: [
{
from: path.join(__dirname, '../node_modules/shaka-player/ui/locales', `{${SHAKA_LOCALES_TO_BE_BUNDLED.join(',')}}.json`).replaceAll('\\', '/'),
to: path.join(__dirname, '../dist/static/shaka-player-locales'),
context: path.join(__dirname, '../node_modules/shaka-player/ui/locales'),
transform: {
transformer: (input) => {
return JSON.stringify(JSON.parse(input.toString('utf-8')))
}
}
}
}
}
])
])
]
})
],
Expand Down
23 changes: 11 additions & 12 deletions _scripts/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,18 @@ config.plugins.push(
'process.env.SHAKA_LOCALES_PREBUNDLED': JSON.stringify(SHAKA_LOCALES_PREBUNDLED)
}),
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../static/pwabuilder-sw.js'),
to: path.join(__dirname, '../dist/web/pwabuilder-sw.js'),
patterns: [
{
from: path.join(__dirname, '../static/pwabuilder-sw.js'),
to: path.join(__dirname, '../dist/web/pwabuilder-sw.js'),
},
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
globOptions: {
dot: true,
ignore: ['**/.*', '**/locales/**', '**/pwabuilder-sw.js', '**/dashFiles/**', '**/storyboards/**'],
},
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/web/static'),
globOptions: {
dot: true,
ignore: ['**/.*', '**/locales/**', '**/pwabuilder-sw.js', '**/dashFiles/**', '**/storyboards/**'],
},
},
{
from: path.join(__dirname, '../node_modules/shaka-player/ui/locales', `{${SHAKA_LOCALES_TO_BE_BUNDLED.join(',')}}.json`).replaceAll('\\', '/'),
Expand All @@ -206,5 +206,4 @@ config.plugins.push(
})
)


module.exports = config
39 changes: 19 additions & 20 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
import eslintPluginVue from 'eslint-plugin-vue'
import vuejsAccessibility from 'eslint-plugin-vuejs-accessibility'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import eslintConfigPrettier from 'eslint-config-prettier'
import intlifyVueI18N from '@intlify/eslint-plugin-vue-i18n'
import globals from 'globals'
import vueEslintParser from 'vue-eslint-parser'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import { fixupConfigRules } from '@eslint/compat'
import jsoncEslintParser from 'jsonc-eslint-parser'
import eslintPluginJsonc from 'eslint-plugin-jsonc'
import eslintPluginYml from 'eslint-plugin-yml'
import yamlEslintParser from 'yaml-eslint-parser'
import neostandard from 'neostandard'

import activeLocales from './static/locales/activeLocales.json' with { type: 'json' }

const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
})

export default [
{
ignores: [
'build/',
'dist/',
'eslint.config.mjs'
'eslint.config.mjs',
// The JSON files inside this directory are auto-generated, so they don't follow the code style rules
'static/geolocations/'
]
},
...fixupConfigRules(
compat.config({
extends: ['standard']
})
),
...neostandard({
noJsx: true,
ts: false,
}),
js.configs.recommended,
eslintConfigPrettier,
...eslintPluginVue.configs['flat/vue2-recommended'],
...vuejsAccessibility.configs["flat/recommended"],
...intlifyVueI18N.configs['flat/recommended'],
Expand Down Expand Up @@ -68,8 +61,8 @@ export default [
},

rules: {
'space-before-function-paren': 'off',
'comma-dangle': ['error', 'only-multiline'],
'@stylistic/space-before-function-paren': 'off',
'@stylistic/comma-dangle': ['error', 'only-multiline'],
'vue/no-v-html': 'off',

'no-console': ['error', {
Expand Down Expand Up @@ -137,8 +130,9 @@ export default [
},

rules: {
'no-tabs': 'off',
'comma-spacing': 'off',
'@stylistic/no-tabs': 'off',
'@stylistic/comma-spacing': 'off',
'@stylistic/eol-last': 'off',
'no-irregular-whitespace': 'off',
},

Expand All @@ -164,6 +158,7 @@ export default [

rules: {
'yml/no-irregular-whitespace': 'off',
'@stylistic/spaced-comment': 'off',
},

settings: {
Expand Down Expand Up @@ -206,6 +201,8 @@ export default [
},

rules: {
'@stylistic/space-before-function-paren': 'off',
'@stylistic/comma-dangle': ['error', 'only-multiline'],
'no-console': 'off',
'n/no-path-concat': 'off',
'unicorn/better-regex': 'error',
Expand All @@ -227,6 +224,8 @@ export default [

rules: {
'no-console': 'off',
'@stylistic/space-before-function-paren': 'off',
'@stylistic/comma-dangle': ['error', 'only-multiline'],
'n/no-path-concat': 'off',
'unicorn/better-regex': 'error',
}
Expand Down
Loading

0 comments on commit 53da924

Please sign in to comment.