dependencies: Upgrade JavaScript dependencies.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-05-09 13:29:53 -07:00 committed by Tim Abbott
parent 512f16690a
commit 42abc1b635
18 changed files with 932 additions and 654 deletions

View File

@ -98,7 +98,12 @@
"unicorn/no-process-exit": "off", "unicorn/no-process-exit": "off",
"unicorn/no-useless-undefined": "off", "unicorn/no-useless-undefined": "off",
"unicorn/number-literal-case": "off", "unicorn/number-literal-case": "off",
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-array-flat": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-spread": "off", "unicorn/prefer-spread": "off",
"unicorn/prefer-switch": "off",
"unicorn/prefer-ternary": "off", "unicorn/prefer-ternary": "off",
"unicorn/prevent-abbreviations": "off", "unicorn/prevent-abbreviations": "off",
"valid-typeof": ["error", {"requireStringLiterals": true}], "valid-typeof": ["error", {"requireStringLiterals": true}],

View File

@ -55,8 +55,7 @@ run_test("clean_function_name", () => {
"Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.forEach", "Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.forEach",
), ),
{ {
scope: scope: "Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.",
"Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.",
name: "forEach", name: "forEach",
}, },
); );

View File

@ -136,7 +136,8 @@ test("videos", (override) => {
page_params.jitsi_server_url = "https://meet.jit.si"; page_params.jitsi_server_url = "https://meet.jit.si";
handler(ev); handler(ev);
// video link ids consist of 15 random digits // video link ids consist of 15 random digits
const video_link_regex = /\[translated: Click to join video call]\(https:\/\/meet.jit.si\/\d{15}\)/; const video_link_regex =
/\[translated: Click to join video call]\(https:\/\/meet.jit.si\/\d{15}\)/;
assert(called); assert(called);
assert.match(syntax_to_insert, video_link_regex); assert.match(syntax_to_insert, video_link_regex);
})(); })();
@ -214,13 +215,13 @@ test("videos", (override) => {
channel.get = (options) => { channel.get = (options) => {
assert(options.url === "/json/calls/bigbluebutton/create"); assert(options.url === "/json/calls/bigbluebutton/create");
options.success({ options.success({
url: url: "/calls/bigbluebutton/join?meeting_id=%22zulip-1%22&password=%22AAAAAAAAAA%22&checksum=%2232702220bff2a22a44aee72e96cfdb4c4091752e%22",
"/calls/bigbluebutton/join?meeting_id=%22zulip-1%22&password=%22AAAAAAAAAA%22&checksum=%2232702220bff2a22a44aee72e96cfdb4c4091752e%22",
}); });
}; };
handler(ev); handler(ev);
const video_link_regex = /\[translated: Click to join video call]\(\/calls\/bigbluebutton\/join\?meeting_id=%22zulip-1%22&password=%22AAAAAAAAAA%22&checksum=%2232702220bff2a22a44aee72e96cfdb4c4091752e%22\)/; const video_link_regex =
/\[translated: Click to join video call]\(\/calls\/bigbluebutton\/join\?meeting_id=%22zulip-1%22&password=%22AAAAAAAAAA%22&checksum=%2232702220bff2a22a44aee72e96cfdb4c4091752e%22\)/;
assert(called); assert(called);
assert.match(syntax_to_insert, video_link_regex); assert.match(syntax_to_insert, video_link_regex);
})(); })();

View File

@ -49,8 +49,7 @@ run_test("$tr", () => {
assert.equal( assert.equal(
$t_html( $t_html(
{ {
id: id: "<p>The stream <b>{stream_name}</b> does not exist.</p><p>Manage your subscriptions <z-link>on your Streams page</z-link>.</p>",
"<p>The stream <b>{stream_name}</b> does not exist.</p><p>Manage your subscriptions <z-link>on your Streams page</z-link>.</p>",
defaultMessage: defaultMessage:
"<p>The stream <b>{stream_name}</b> does not exist.</p><p>Manage your subscriptions <z-link>on your Streams page</z-link>.</p>", "<p>The stream <b>{stream_name}</b> does not exist.</p><p>Manage your subscriptions <z-link>on your Streams page</z-link>.</p>",
}, },

View File

@ -302,8 +302,7 @@ test("marked", () => {
'<div class="codehilite"><pre><span></span><code>fenced code\n</code></pre></div>\n<p>and then after</p>', '<div class="codehilite"><pre><span></span><code>fenced code\n</code></pre></div>\n<p>and then after</p>',
}, },
{ {
input: input: "\n```\n fenced code trailing whitespace \n```\n\nand then after\n",
"\n```\n fenced code trailing whitespace \n```\n\nand then after\n",
expected: expected:
'<div class="codehilite"><pre><span></span><code> fenced code trailing whitespace\n</code></pre></div>\n<p>and then after</p>', '<div class="codehilite"><pre><span></span><code> fenced code trailing whitespace\n</code></pre></div>\n<p>and then after</p>',
}, },
@ -401,8 +400,7 @@ test("marked", () => {
'<p>Silent mention: <span class="user-mention silent" data-user-id="101">Cordelia, Lear&#39;s daughter</span></p>', '<p>Silent mention: <span class="user-mention silent" data-user-id="101">Cordelia, Lear&#39;s daughter</span></p>',
}, },
{ {
input: input: "> Mention in quote: @**Cordelia, Lear's daughter**\n\nMention outside quote: @**Cordelia, Lear's daughter**",
"> Mention in quote: @**Cordelia, Lear's daughter**\n\nMention outside quote: @**Cordelia, Lear's daughter**",
expected: expected:
'<blockquote>\n<p>Mention in quote: <span class="user-mention silent" data-user-id="101">Cordelia, Lear&#39;s daughter</span></p>\n</blockquote>\n<p>Mention outside quote: <span class="user-mention" data-user-id="101">@Cordelia, Lear&#39;s daughter</span></p>', '<blockquote>\n<p>Mention in quote: <span class="user-mention silent" data-user-id="101">Cordelia, Lear&#39;s daughter</span></p>\n</blockquote>\n<p>Mention outside quote: <span class="user-mention" data-user-id="101">@Cordelia, Lear&#39;s daughter</span></p>',
}, },

View File

@ -216,8 +216,7 @@ test("basics", () => {
local_id: "unicode_emoji,1f680", local_id: "unicode_emoji,1f680",
count: 3, count: 3,
user_ids: [5, 6, 7], user_ids: [5, 6, 7],
label: label: "translated: You (click to remove), Bob van Roberts and Cali reacted with :rocket:",
"translated: You (click to remove), Bob van Roberts and Cali reacted with :rocket:",
emoji_alt_code: false, emoji_alt_code: false,
class: "message_reaction reacted", class: "message_reaction reacted",
}, },

View File

@ -293,13 +293,8 @@ function test_submit_settings_form(override, submit_form) {
} }
function test_change_save_button_state() { function test_change_save_button_state() {
const { const {save_button_controls, save_button_text, save_button, discard_button, props} =
save_button_controls, createSaveButtons("msg-editing");
save_button_text,
save_button,
discard_button,
props,
} = createSaveButtons("msg-editing");
save_button.attr("id", "org-submit-msg-editing"); save_button.attr("id", "org-submit-msg-editing");
{ {

View File

@ -547,7 +547,8 @@ test("notifications", () => {
antarctica.push_notifications = null; antarctica.push_notifications = null;
antarctica.wildcard_mentions_notify = null; antarctica.wildcard_mentions_notify = null;
const unmatched_streams = stream_settings_data.get_unmatched_streams_for_notification_settings(); const unmatched_streams =
stream_settings_data.get_unmatched_streams_for_notification_settings();
const expected_streams = [ const expected_streams = [
{ {
desktop_notifications: true, desktop_notifications: true,

View File

@ -414,33 +414,27 @@ class CommonUtils {
async get_rendered_messages(page: Page, table = "zhome"): Promise<[string, string[]][]> { async get_rendered_messages(page: Page, table = "zhome"): Promise<[string, string[]][]> {
const recipient_rows = await page.$$(`#${CSS.escape(table)} .recipient_row`); const recipient_rows = await page.$$(`#${CSS.escape(table)} .recipient_row`);
return Promise.all( return Promise.all(
recipient_rows.map( recipient_rows.map(async (element): Promise<[string, string[]]> => {
async (element): Promise<[string, string[]]> => { const stream_label = await element.$(".stream_label");
const stream_label = await element.$(".stream_label"); const stream_name = (await this.get_element_text(stream_label!)).trim();
const stream_name = (await this.get_element_text(stream_label!)).trim(); const topic_label = await element.$(".stream_topic a");
const topic_label = await element.$(".stream_topic a"); const topic_name =
const topic_name = topic_label === null ? "" : (await this.get_element_text(topic_label)).trim();
topic_label === null let key = stream_name;
? "" if (topic_name !== "") {
: (await this.get_element_text(topic_label)).trim(); // If topic_name is '' then this is PMs, so only
let key = stream_name; // append > topic_name if we are not in PMs or Group PMs.
if (topic_name !== "") { key = `${stream_name} > ${topic_name}`;
// If topic_name is '' then this is PMs, so only }
// append > topic_name if we are not in PMs or Group PMs.
key = `${stream_name} > ${topic_name}`;
}
const messages = await Promise.all( const messages = await Promise.all(
( (
await element.$$(".message_row .message_content") await element.$$(".message_row .message_content")
).map(async (message_row) => ).map(async (message_row) => (await this.get_element_text(message_row)).trim()),
(await this.get_element_text(message_row)).trim(), );
),
);
return [key, messages]; return [key, messages];
}, }),
),
); );
} }
@ -552,7 +546,7 @@ class CommonUtils {
console_ready = (async () => { console_ready = (async () => {
const frames = await Promise.all( const frames = await Promise.all(
ErrorStackParser.parse(error1).map(async (frame1) => { ErrorStackParser.parse(error1).map(async (frame1) => {
let frame = (frame1 as unknown) as StackFrame; let frame = frame1 as unknown as StackFrame;
try { try {
frame = await this.gps.getMappedLocation(frame); frame = await this.gps.getMappedLocation(frame);
} catch { } catch {

View File

@ -8,7 +8,8 @@ import common from "../puppeteer_lib/common";
const OUTGOING_WEBHOOK_BOT_TYPE = "3"; const OUTGOING_WEBHOOK_BOT_TYPE = "3";
const GENERIC_BOT_TYPE = "1"; const GENERIC_BOT_TYPE = "1";
const zuliprc_regex = /^data:application\/octet-stream;charset=utf-8,\[api]\nemail=.+\nkey=.+\nsite=.+\n$/; const zuliprc_regex =
/^data:application\/octet-stream;charset=utf-8,\[api]\nemail=.+\nkey=.+\nsite=.+\n$/;
async function get_decoded_url_in_selector(page: Page, selector: string): Promise<string> { async function get_decoded_url_in_selector(page: Page, selector: string): Promise<string> {
return await page.evaluate( return await page.evaluate(
@ -115,7 +116,8 @@ async function test_webhook_bot_creation(page: Page): Promise<void> {
const download_zuliprc_selector = `.download_bot_zuliprc[data-email="${CSS.escape( const download_zuliprc_selector = `.download_bot_zuliprc[data-email="${CSS.escape(
bot_email, bot_email,
)}"]`; )}"]`;
const outgoing_webhook_zuliprc_regex = /^data:application\/octet-stream;charset=utf-8,\[api]\nemail=.+\nkey=.+\nsite=.+\ntoken=.+\n$/; const outgoing_webhook_zuliprc_regex =
/^data:application\/octet-stream;charset=utf-8,\[api]\nemail=.+\nkey=.+\nsite=.+\ntoken=.+\n$/;
await page.waitForSelector(download_zuliprc_selector, {visible: true}); await page.waitForSelector(download_zuliprc_selector, {visible: true});
await page.click(download_zuliprc_selector); await page.click(download_zuliprc_selector);
@ -157,7 +159,8 @@ async function test_botserverrc(page: Page): Promise<void> {
page, page,
"#download_botserverrc", "#download_botserverrc",
); );
const botserverrc_regex = /^data:application\/octet-stream;charset=utf-8,\[]\nemail=.+\nkey=.+\nsite=.+\ntoken=.+\n$/; const botserverrc_regex =
/^data:application\/octet-stream;charset=utf-8,\[]\nemail=.+\nkey=.+\nsite=.+\ntoken=.+\n$/;
assert(botserverrc_regex.test(botserverrc_decoded_url), "Incorrect botserverrc format."); assert(botserverrc_regex.test(botserverrc_decoded_url), "Incorrect botserverrc format.");
} }

View File

@ -13,7 +13,7 @@
"@babel/register": "^7.6.2", "@babel/register": "^7.6.2",
"@formatjs/intl": "^1.9.7", "@formatjs/intl": "^1.9.7",
"@giphy/js-components": "^4.3.1", "@giphy/js-components": "^4.3.1",
"@giphy/js-fetch-api": "^2.4.0", "@giphy/js-fetch-api": "^3.0.0",
"@uppy/core": "^1.7.1", "@uppy/core": "^1.7.1",
"@uppy/progress-bar": "^1.3.4", "@uppy/progress-bar": "^1.3.4",
"@uppy/xhr-upload": "^1.4.2", "@uppy/xhr-upload": "^1.4.2",
@ -36,7 +36,7 @@
"emoji-datasource-google-blob": "npm:emoji-datasource-google@^3.0.0", "emoji-datasource-google-blob": "npm:emoji-datasource-google@^3.0.0",
"emoji-datasource-twitter": "^6.0.0", "emoji-datasource-twitter": "^6.0.0",
"error-stack-parser": "^2.0.2", "error-stack-parser": "^2.0.2",
"eslint-plugin-unicorn": "^29.0.0", "eslint-plugin-unicorn": "^32.0.0",
"expose-loader": "^1.0.0", "expose-loader": "^1.0.0",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"flatpickr": "^4.5.7", "flatpickr": "^4.5.7",
@ -66,7 +66,7 @@
"simplebar": "^5.2.1", "simplebar": "^5.2.1",
"sortablejs": "^1.9.0", "sortablejs": "^1.9.0",
"sorttable": "^1.0.2", "sorttable": "^1.0.2",
"source-code-pro": "https://codeload.github.com/adobe-fonts/source-code-pro/tar.gz/72d3d0eb3567e68669a2b97904a1274ac3b376fa", "source-code-pro": "^2.38.0",
"source-sans": "^3.28.0", "source-sans": "^3.28.0",
"spectrum-colorpicker": "^1.8.1", "spectrum-colorpicker": "^1.8.1",
"stacktrace-gps": "^3.0.4", "stacktrace-gps": "^3.0.4",
@ -114,7 +114,7 @@
"source-map": "https://codeload.github.com/benthemonkey/source-map/tar.gz/d95423f77edef6cbb9e21d2d6014c7de85ae220a", "source-map": "https://codeload.github.com/benthemonkey/source-map/tar.gz/d95423f77edef6cbb9e21d2d6014c7de85ae220a",
"stylelint": "^13.0.0", "stylelint": "^13.0.0",
"stylelint-config-prettier": "^8.0.2", "stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^21.0.0", "stylelint-config-standard": "^22.0.0",
"svgo": "^2.0.3", "svgo": "^2.0.3",
"swagger-parser": "^10.0.0", "swagger-parser": "^10.0.0",
"ts-node": "^9.1.1", "ts-node": "^9.1.1",

View File

@ -89,7 +89,7 @@ export async function display_stacktrace(error: string, stack: string): Promise<
ErrorStackParser.parse(ex).map(async (stack_frame: ErrorStackParser.StackFrame) => { ErrorStackParser.parse(ex).map(async (stack_frame: ErrorStackParser.StackFrame) => {
// Work around mistake in ErrorStackParser.StackFrame definition // Work around mistake in ErrorStackParser.StackFrame definition
// https://github.com/stacktracejs/error-stack-parser/pull/54 // https://github.com/stacktracejs/error-stack-parser/pull/54
let location = (stack_frame as unknown) as StackFrame; let location = stack_frame as unknown as StackFrame;
try { try {
location = await stack_trace_gps.getMappedLocation(location); location = await stack_trace_gps.getMappedLocation(location);
} catch { } catch {

View File

@ -204,9 +204,8 @@ export const update_elements = (content) => {
const $pre = $codehilite.find("pre"); const $pre = $codehilite.find("pre");
const fenced_code_lang = $codehilite.data("code-language"); const fenced_code_lang = $codehilite.data("code-language");
if (fenced_code_lang !== undefined) { if (fenced_code_lang !== undefined) {
const playground_info = realm_playground.get_playground_info_for_languages( const playground_info =
fenced_code_lang, realm_playground.get_playground_info_for_languages(fenced_code_lang);
);
if (playground_info !== undefined) { if (playground_info !== undefined) {
// If a playground is configured for this language, // If a playground is configured for this language,
// offer to view the code in that playground. When // offer to view the code in that playground. When

View File

@ -105,8 +105,8 @@ export function build_page() {
general_settings: settings_config.all_notifications().general_settings, general_settings: settings_config.all_notifications().general_settings,
notification_settings: settings_config.all_notifications().settings, notification_settings: settings_config.all_notifications().settings,
desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values, desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values,
show_push_notifications_tooltip: settings_config.all_notifications() show_push_notifications_tooltip:
.show_push_notifications_tooltip, settings_config.all_notifications().show_push_notifications_tooltip,
display_settings: settings_config.get_all_display_settings(), display_settings: settings_config.get_all_display_settings(),
user_can_change_name: settings_data.user_can_change_name(), user_can_change_name: settings_data.user_can_change_name(),
user_can_change_avatar: settings_data.user_can_change_avatar(), user_can_change_avatar: settings_data.user_can_change_avatar(),

View File

@ -20,7 +20,8 @@ function rerender_ui() {
return; return;
} }
const unmatched_streams = stream_settings_data.get_unmatched_streams_for_notification_settings(); const unmatched_streams =
stream_settings_data.get_unmatched_streams_for_notification_settings();
unmatched_streams_table.find(".stream-row").remove(); unmatched_streams_table.find(".stream-row").remove();

View File

@ -783,9 +783,10 @@ export function build_page() {
data.allow_message_editing = Boolean(data.message_content_edit_limit_seconds); data.allow_message_editing = Boolean(data.message_content_edit_limit_seconds);
} else { } else {
data.allow_message_editing = true; data.allow_message_editing = true;
data.message_content_edit_limit_seconds = settings_config.msg_edit_limit_dropdown_values.get( data.message_content_edit_limit_seconds =
edit_limit_setting_value, settings_config.msg_edit_limit_dropdown_values.get(
).seconds; edit_limit_setting_value,
).seconds;
} }
const delete_limit_setting_value = $("#id_realm_msg_delete_limit_setting").val(); const delete_limit_setting_value = $("#id_realm_msg_delete_limit_setting").val();
if (delete_limit_setting_value === "never") { if (delete_limit_setting_value === "never") {
@ -798,9 +799,10 @@ export function build_page() {
data.allow_message_deleting = Boolean(data.message_content_delete_limit_seconds); data.allow_message_deleting = Boolean(data.message_content_delete_limit_seconds);
} else { } else {
data.allow_message_deleting = true; data.allow_message_deleting = true;
data.message_content_delete_limit_seconds = settings_config.msg_delete_limit_dropdown_values.get( data.message_content_delete_limit_seconds =
delete_limit_setting_value, settings_config.msg_delete_limit_dropdown_values.get(
).seconds; delete_limit_setting_value,
).seconds;
} }
} else if (subsection === "notifications") { } else if (subsection === "notifications") {
data.notifications_stream_id = Number.parseInt(notifications_stream_widget.value(), 10); data.notifications_stream_id = Number.parseInt(notifications_stream_widget.value(), 10);

View File

@ -45,4 +45,4 @@ API_FEATURE_LEVEL = 64
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = "144.0" PROVISION_VERSION = "145.0"

1452
yarn.lock

File diff suppressed because it is too large Load Diff