Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed May 15, 2024
1 parent 4bf3df4 commit ac3429e
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 22 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/commander/src/utils/appendRevisionToVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* External dependencies
*/
import { execSync } from 'child_process';
import { execSync } from 'node:child_process';

/**
* Appends the current revision to the version number for nightly builds.
Expand Down
2 changes: 1 addition & 1 deletion packages/commander/src/utils/copyFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* External dependencies
*/
import { execFileSync } from 'child_process';
import { execFileSync } from 'node:child_process';

/**
* Copies all files minuses ignored ones from source to target directory.
Expand Down
2 changes: 1 addition & 1 deletion packages/commander/src/utils/generateZipFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* External dependencies
*/
import { dirname, basename, join } from 'node:path';
import { execFileSync } from 'child_process';
import { execFileSync } from 'node:child_process';
import { existsSync, unlinkSync } from 'node:fs';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
import appendRevisionToVersion from '../appendRevisionToVersion';

jest.mock('child_process', () => {
jest.mock('node:child_process', () => {
return {
execSync: () => '1234567',
};
Expand Down
4 changes: 2 additions & 2 deletions packages/commander/src/utils/test/bundlePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import generateZipFile from '../generateZipFile';
import getCurrentVersionNumber from '../getCurrentVersionNumber';
import deleteExistingZipFiles from '../deleteExistingZipFiles';

jest.mock('fs');
jest.mock('child_process');
jest.mock('node:fs');
jest.mock('node:child_process');

jest.mock('../generateZipFile');
jest.mock('../getCurrentVersionNumber');
Expand Down
4 changes: 2 additions & 2 deletions packages/commander/src/utils/test/copyFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
/**
* External dependencies
*/
import { execFileSync } from 'child_process';
import { execFileSync } from 'node:child_process';

/**
* Internal dependencies
*/
import copyFiles from '../copyFiles';

jest.mock('child_process');
jest.mock('node:child_process');

describe('copyFiles', () => {
it('should sync source files to target', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/commander/src/utils/test/createBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { __setMockFiles } from 'node:fs';
import createBuild from '../createBuild';
import copyFiles from '../copyFiles';

jest.mock('fs');
jest.mock('node:fs');

jest.mock('../getIgnoredFiles', () => jest.fn(() => ['bar.txt', 'baz/']));
jest.mock('../copyFiles');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { __setMockFiles, readdirSync } from 'node:fs';
*/
import deleteExistingZipFiles from '../deleteExistingZipFiles';

jest.mock('fs');
jest.mock('node:fs');

describe('deleteExistingZipFiles', () => {
const MOCK_FILE_INFO = {
Expand Down
4 changes: 2 additions & 2 deletions packages/commander/src/utils/test/generateZipFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
/**
* External dependencies
*/
import { execFileSync } from 'child_process';
import { execFileSync } from 'node:child_process';

/**
* Internal dependencies
*/
import generateZipFile from '../generateZipFile';

jest.mock('child_process');
jest.mock('node:child_process');

describe('generateZipFile', () => {
it('should ZIP the web-stories directory', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { __setMockFiles } from 'node:fs';
*/
import getCurrentVersionNumber from '../getCurrentVersionNumber';

jest.mock('fs');
jest.mock('node:fs');

const PLUGIN_FILE_CONTENT = `
<?php
Expand Down
2 changes: 1 addition & 1 deletion packages/commander/src/utils/test/getIgnoredFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { __setMockFiles } from 'node:fs';
*/
import getIgnoredFiles from '../getIgnoredFiles';

jest.mock('fs');
jest.mock('node:fs');

describe('getIgnoredFiles', () => {
const MOCK_FILE_INFO = {
Expand Down
2 changes: 1 addition & 1 deletion packages/commander/src/utils/test/updateCdnUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { __setMockFiles, readFileSync } from 'node:fs';
*/
import updateCdnUrl from '../updateCdnUrl';

jest.mock('fs');
jest.mock('node:fs');

const PLUGIN_FILE_CONTENT = `
<?php
Expand Down
2 changes: 1 addition & 1 deletion packages/commander/src/utils/test/updateVersionNumbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { __setMockFiles, readFileSync } from 'node:fs';
*/
import updateVersionNumbers from '../updateVersionNumbers';

jest.mock('fs');
jest.mock('node:fs');
jest.mock('../appendRevisionToVersion', () =>
jest.fn(() => '1.0.0-alpha+1234567')
);
Expand Down
9 changes: 5 additions & 4 deletions packages/karma-puppeteer-client/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/

((global) => {
(function (global) {
'use strict';

function noCleanup() {}

Expand All @@ -26,7 +27,7 @@
* @return {*} Function result.
*/
function puppeteerFunction(methodName) {
return () => {
return function () {
var args = Array.prototype.slice.call(arguments, 0);
var name = '__karma_puppeteer_' + methodName;
if (!window[name]) {
Expand All @@ -48,15 +49,15 @@
*/
function withSelector(methodName) {
var func = puppeteerFunction(methodName);
return () => {
return function () {
var args = Array.prototype.slice.call(arguments, 0);
var node = args[0] && args[0].nodeType ? args[0] : null;
var cleanup = noCleanup;
if (node) {
var uniqueId = Math.random();
node.setAttribute('karma_puppeteer_id', uniqueId);
args[0] = '[karma_puppeteer_id="' + uniqueId + '"]';
cleanup = () => {
cleanup = function () {
node.removeAttribute('karma_puppeteer_id');
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ const BulkVideoOptimization = () => {
};

const VideoOptimization = () => {
// `isTranscodingEnabled` already checks for `hasUploadMediaAction`.
const { isTranscodingEnabled } = useFFmpeg();

return isTranscodingEnabled ? <BulkVideoOptimization /> : null;
Expand Down
5 changes: 3 additions & 2 deletions packages/tinymce-button/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ if (!_.hasOwnProperty('pluck')) {
_.pluck = _.map;
}

tinymce.PluginManager.add('web_stories', (editor) => {
// eslint-disable-next-line prefer-arrow-callback -- Must not be an arrow function.
tinymce.PluginManager.add('web_stories', function (editor) {
editor.addButton('web_stories', {
text: __('Web Stories', 'web-stories'),
classes: 'web-stories',
image:
'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjA4IiBoZWlnaHQ9IjIwOCIgdmlld0JveD0iMCAwIDIwOCAyMDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjEwMCIgY3k9IjEwMCIgcj0iMTAwIiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNMTM1LjIgNjIuNDAwNUMxNDAuOTQ0IDYyLjQwMDUgMTQ1LjYgNjcuMDU2NyAxNDUuNiA3Mi44MDA1VjEzNS4yQzE0NS42IDE0MC45NDQgMTQwLjk0NCAxNDUuNiAxMzUuMiAxNDUuNlY2Mi40MDA1WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTU3LjIgNjIuNDAwNUM1Ny4yIDU2LjY1NjcgNjEuODU2MiA1Mi4wMDA1IDY3LjYgNTIuMDAwNUgxMTQuNEMxMjAuMTQ0IDUyLjAwMDUgMTI0LjggNTYuNjU2NyAxMjQuOCA2Mi40MDA1VjE0NS42QzEyNC44IDE1MS4zNDQgMTIwLjE0NCAxNTYgMTE0LjQgMTU2SDY3LjZDNjEuODU2MiAxNTYgNTcuMiAxNTEuMzQ0IDU3LjIgMTQ1LjZWNjIuNDAwNVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xNTYgNzIuODAwNUMxNjAuMzA4IDcyLjgwMDUgMTYzLjggNzYuMjkyNyAxNjMuOCA4MC42MDA1VjEyNy40QzE2My44IDEzMS43MDggMTYwLjMwOCAxMzUuMiAxNTYgMTM1LjJWNzIuODAwNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPg==',
onClick: () => {
onClick: function () {
dispatch(store).setEditor(editor);
dispatch(store).toggleModal(true);
},
Expand Down

0 comments on commit ac3429e

Please sign in to comment.