Skip to content

Commit

Permalink
[chore] format files
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkwinter committed Jun 29, 2023
1 parent 36f16b9 commit a493832
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import child_process from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import { execSync } from 'node:child_process';

import { rollup } from 'rollup';
import { getBabelOutputPlugin } from '@rollup/plugin-babel';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import { rollup } from 'rollup';
import html from 'rollup-plugin-html';

import archiver from 'archiver';

import pkg from '../package.json' assert { type: 'json' };
Expand All @@ -30,7 +31,7 @@ console.time('Cleaning /dist');
cleanOutput();
console.timeEnd('Cleaning /dist');

console.log('Building...')
console.log('Building...');

console.time(' Userscript');
await buildUserscript();
Expand Down Expand Up @@ -92,18 +93,18 @@ async function buildUserscript() {
commonjs(),
userscript('userscript.config.js'),
replace({
__BUILD_TARGET__: `'USERSCRIPT'`,
__BUILD_VERSION__: pkg.version,
preventAssignment: true,
__BUILD_TARGET__: `'USERSCRIPT'`,
__BUILD_VERSION__: pkg.version,
preventAssignment: true,
}),
getBabelOutputPlugin({
presets: [ ['@babel/preset-env', { modules: false }] ],
presets: [['@babel/preset-env', { modules: false }]],
retainLines: true,
}),
],
});

execSync(`dprint fmt ${USERSCRIPT_OUT_DIR}/${USERSCRIPT_OUT_NAME} --excludes **/node-modules`);
child_process.execSync(`dprint fmt ${USERSCRIPT_OUT_DIR}/${USERSCRIPT_OUT_NAME} --excludes **/node-modules`);
}

async function buildWebExtension() {
Expand Down Expand Up @@ -175,7 +176,7 @@ async function buildWebExtension() {
html(),
nodeResolve(),
commonjs(),
replace({ __BUILD_TARGET__: `'WEB_EXTENSION'`, preventAssignment: true }),
replace({ __BUILD_TARGET__: `'WEB_EXTENSION'`, preventAssignment: true }),
],
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/strategies/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function getUnlockStrategies(videoId, lastPlayerUnlockReason) {
const clientVersion = getYtcfgValue('INNERTUBE_CLIENT_VERSION') || '2.20220203.04.00';
const hl = getYtcfgValue('HL');
const userInterfaceTheme = getYtcfgValue('INNERTUBE_CONTEXT').client.userInterfaceTheme
?? (document.documentElement.hasAttribute("dark") ? 'USER_INTERFACE_THEME_DARK' : 'USER_INTERFACE_THEME_LIGHT');
?? (document.documentElement.hasAttribute('dark') ? 'USER_INTERFACE_THEME_DARK' : 'USER_INTERFACE_THEME_LIGHT');

return [
/**
Expand Down

0 comments on commit a493832

Please sign in to comment.