Skip to content

Commit 0141cdf

Browse files
Merge pull request NeuromatchAcademy#83 from NeuromatchAcademy/merge-upstream
Merge upstream - the quote posts one
2 parents 73db488 + 1707e95 commit 0141cdf

910 files changed

Lines changed: 24850 additions & 9927 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/renovate.json5

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
':labels(dependencies)',
77
':prConcurrentLimitNone', // Remove limit for open PRs at any time.
88
':prHourlyLimit2', // Rate limit PR creation to a maximum of two per hour.
9+
':enableVulnerabilityAlertsWithLabel(security)',
910
],
1011
rebaseWhen: 'conflicted',
1112
minimumReleaseAge: '3', // Wait 3 days after the package has been published before upgrading it
@@ -93,6 +94,19 @@
9394
matchUpdateTypes: ['patch', 'minor'],
9495
groupName: 'eslint (non-major)',
9596
},
97+
{
98+
// Group all Storybook-related packages in the same PR
99+
matchManagers: ['npm'],
100+
matchPackageNames: [
101+
'chromatic',
102+
'storybook',
103+
'@storybook/*',
104+
'msw',
105+
'msw-storybook-addon',
106+
],
107+
matchUpdateTypes: ['patch', 'minor'],
108+
groupName: 'storybook (non-major)',
109+
},
96110
{
97111
// Group actions/*-artifact in the same PR
98112
matchManagers: ['github-actions'],
@@ -141,6 +155,12 @@
141155
matchUpdateTypes: ['patch', 'minor'],
142156
groupName: 'opentelemetry-ruby (non-major)',
143157
},
158+
{
159+
// Group Playwright Ruby & JS deps in the same PR, as they need to be in sync
160+
matchManagers: ['bundler', 'npm'],
161+
matchPackageNames: ['playwright-ruby-client', 'playwright'],
162+
groupName: 'Playwright',
163+
},
144164
// Add labels depending on package manager
145165
{ matchManagers: ['npm', 'nvm'], addLabels: ['javascript'] },
146166
{ matchManagers: ['bundler', 'ruby-version'], addLabels: ['ruby'] },

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
language: ['javascript', 'ruby']
29-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
28+
language: ['actions', 'javascript', 'ruby']
29+
# CodeQL supports [ 'actions', 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3030
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3131

3232
steps:

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.18
1+
22.20

.rubocop/metrics.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
---
22
Metrics/AbcSize:
3-
Exclude:
4-
- lib/mastodon/cli/*.rb
3+
Enabled: false
54

65
Metrics/BlockLength:
76
Enabled: false
87

8+
Metrics/BlockNesting:
9+
Enabled: false
10+
911
Metrics/ClassLength:
1012
Enabled: false
1113

14+
Metrics/CollectionLiteralLength:
15+
Enabled: false
16+
1217
Metrics/CyclomaticComplexity:
13-
Exclude:
14-
- lib/mastodon/cli/*.rb
18+
Enabled: false
1519

1620
Metrics/MethodLength:
1721
Enabled: false
@@ -20,4 +24,7 @@ Metrics/ModuleLength:
2024
Enabled: false
2125

2226
Metrics/ParameterLists:
23-
CountKeywordArgs: false
27+
Enabled: false
28+
29+
Metrics/PerceivedComplexity:
30+
Enabled: false

.rubocop_todo.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp`
3-
# using RuboCop version 1.79.2.
3+
# using RuboCop version 1.80.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
10-
Metrics/AbcSize:
11-
Max: 90
12-
13-
# Configuration parameters: CountBlocks, CountModifierForms, Max.
14-
Metrics/BlockNesting:
15-
Exclude:
16-
- 'lib/tasks/mastodon.rake'
17-
18-
# Configuration parameters: AllowedMethods, AllowedPatterns.
19-
Metrics/CyclomaticComplexity:
20-
Max: 25
21-
22-
# Configuration parameters: AllowedMethods, AllowedPatterns.
23-
Metrics/PerceivedComplexity:
24-
Max: 27
25-
269
# This cop supports safe autocorrection (--autocorrect).
2710
# Configuration parameters: AllowedVars, DefaultToNil.
2811
Style/FetchEnvVar:

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.5
1+
3.4.6

.storybook/preview-body.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<html class="no-reduce-motion">
2+
</html>

.storybook/preview.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import { initialize, mswLoader } from 'msw-storybook-addon';
1212
import { action } from 'storybook/actions';
1313

1414
import type { LocaleData } from '@/mastodon/locales';
15-
import { reducerWithInitialState, rootReducer } from '@/mastodon/reducers';
15+
import { reducerWithInitialState } from '@/mastodon/reducers';
1616
import { defaultMiddleware } from '@/mastodon/store/store';
1717
import { mockHandlers, unhandledRequestHandler } from '@/testing/api';
1818

1919
// If you want to run the dark theme during development,
2020
// you can change the below to `/application.scss`
2121
import '../app/javascript/styles/mastodon-light.scss';
22+
import './styles.css';
2223

2324
const localeFiles = import.meta.glob('@/mastodon/locales/*.json', {
2425
query: { as: 'json' },
@@ -49,12 +50,17 @@ const preview: Preview = {
4950
locale: 'en',
5051
},
5152
decorators: [
52-
(Story, { parameters }) => {
53+
(Story, { parameters, globals }) => {
54+
const { locale } = globals as { locale: string };
5355
const { state = {} } = parameters;
54-
let reducer = rootReducer;
55-
if (typeof state === 'object' && state) {
56-
reducer = reducerWithInitialState(state as Record<string, unknown>);
57-
}
56+
const reducer = reducerWithInitialState(
57+
{
58+
meta: {
59+
locale,
60+
},
61+
},
62+
state as Record<string, unknown>,
63+
);
5864
const store = configureStore({
5965
reducer,
6066
middleware(getDefaultMiddleware) {

.storybook/static/mockServiceWorker.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* - Please do NOT modify this file.
88
*/
99

10-
const PACKAGE_VERSION = '2.10.2'
11-
const INTEGRITY_CHECKSUM = 'f5825c521429caf22a4dd13b66e243af'
10+
const PACKAGE_VERSION = '2.11.3'
11+
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
1212
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
1313
const activeClientIds = new Set()
1414

@@ -71,11 +71,6 @@ addEventListener('message', async function (event) {
7171
break
7272
}
7373

74-
case 'MOCK_DEACTIVATE': {
75-
activeClientIds.delete(clientId)
76-
break
77-
}
78-
7974
case 'CLIENT_CLOSED': {
8075
activeClientIds.delete(clientId)
8176

@@ -94,6 +89,8 @@ addEventListener('message', async function (event) {
9489
})
9590

9691
addEventListener('fetch', function (event) {
92+
const requestInterceptedAt = Date.now()
93+
9794
// Bypass navigation requests.
9895
if (event.request.mode === 'navigate') {
9996
return
@@ -110,23 +107,29 @@ addEventListener('fetch', function (event) {
110107

111108
// Bypass all requests when there are no active clients.
112109
// Prevents the self-unregistered worked from handling requests
113-
// after it's been deleted (still remains active until the next reload).
110+
// after it's been terminated (still remains active until the next reload).
114111
if (activeClientIds.size === 0) {
115112
return
116113
}
117114

118115
const requestId = crypto.randomUUID()
119-
event.respondWith(handleRequest(event, requestId))
116+
event.respondWith(handleRequest(event, requestId, requestInterceptedAt))
120117
})
121118

122119
/**
123120
* @param {FetchEvent} event
124121
* @param {string} requestId
122+
* @param {number} requestInterceptedAt
125123
*/
126-
async function handleRequest(event, requestId) {
124+
async function handleRequest(event, requestId, requestInterceptedAt) {
127125
const client = await resolveMainClient(event)
128126
const requestCloneForEvents = event.request.clone()
129-
const response = await getResponse(event, client, requestId)
127+
const response = await getResponse(
128+
event,
129+
client,
130+
requestId,
131+
requestInterceptedAt,
132+
)
130133

131134
// Send back the response clone for the "response:*" life-cycle events.
132135
// Ensure MSW is active and ready to handle the message, otherwise
@@ -204,7 +207,7 @@ async function resolveMainClient(event) {
204207
* @param {string} requestId
205208
* @returns {Promise<Response>}
206209
*/
207-
async function getResponse(event, client, requestId) {
210+
async function getResponse(event, client, requestId, requestInterceptedAt) {
208211
// Clone the request because it might've been already used
209212
// (i.e. its body has been read and sent to the client).
210213
const requestClone = event.request.clone()
@@ -255,6 +258,7 @@ async function getResponse(event, client, requestId) {
255258
type: 'REQUEST',
256259
payload: {
257260
id: requestId,
261+
interceptedAt: requestInterceptedAt,
258262
...serializedRequest,
259263
},
260264
},

.storybook/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
a {
2+
color: inherit;
3+
text-decoration: none;
4+
}
5+
6+
a:hover {
7+
text-decoration: underline;
8+
}

0 commit comments

Comments
 (0)