Skip to content

Commit 86b6b1a

Browse files
authored
Remove storybook (github#21037)
* Remove storybook * Update index.js
1 parent d84b873 commit 86b6b1a

File tree

12 files changed

+18245
-35867
lines changed

12 files changed

+18245
-35867
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ coverage/
1010
/data/early-access
1111
.next
1212
.eslintcache
13-
/storybook/
1413

1514
# blc: broken link checker
1615
blc_output.log

.storybook/main.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

.storybook/preview.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ COPY content/index.md ./content/index.md
4848
COPY next.config.js ./next.config.js
4949
COPY tsconfig.json ./tsconfig.json
5050
COPY next-env.d.ts ./next-env.d.ts
51-
COPY .storybook ./.storybook
5251

5352
RUN npx tsc --noEmit
5453

components/stories/Callout.stories.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.

components/stories/Introduction.stories.mdx

Lines changed: 0 additions & 12 deletions
This file was deleted.

middleware/csp.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,5 @@ export default function csp(req, res, next) {
7070
csp.directives.scriptSrc.push("'unsafe-inline'")
7171
}
7272

73-
if (req.path.startsWith('/storybook')) {
74-
csp.directives.scriptSrc.push("'unsafe-eval'", "'unsafe-inline'")
75-
csp.directives.frameSrc.push("'self'")
76-
}
77-
7873
return contentSecurityPolicy(csp)(req, res, next)
7974
}

middleware/index.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import express from 'express'
2-
import basicAuth from 'express-basic-auth'
32
import instrument from '../lib/instrument-middleware.js'
43
import haltOnDroppedConnection from './halt-on-dropped-connection.js'
54
import abort from './abort.js'
@@ -62,7 +61,6 @@ import renderPage from './render-page.js'
6261
const { NODE_ENV } = process.env
6362
const isDevelopment = NODE_ENV === 'development'
6463
const isTest = NODE_ENV === 'test' || process.env.GITHUB_ACTIONS === 'true'
65-
const isProduction = NODE_ENV === 'production' && process.env.HEROKU_PRODUCTION_APP
6664

6765
// Catch unhandled promise rejections and passing them to Express's error handler
6866
// https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016
@@ -145,18 +143,6 @@ export default function (app) {
145143
instrument(archivedEnterpriseVersionsAssets, './archived-enterprise-versions-assets')
146144
)
147145
)
148-
app.use('/storybook', [
149-
(isProduction &&
150-
basicAuth({ users: { octocat: process.env.STORYBOOK_PASSWORD }, challenge: true })) ||
151-
((req, res, next) => next()),
152-
express.static('storybook', {
153-
index: false,
154-
etag: false,
155-
immutable: true,
156-
lastModified: false,
157-
maxAge: '1 day', // Relatively short in case we update index.html
158-
}),
159-
])
160146
app.use(
161147
'/assets',
162148
express.static('assets', {

0 commit comments

Comments
 (0)