Skip to content

Commit

Permalink
Remove storybook (github#21037)
Browse files Browse the repository at this point in the history
* Remove storybook

* Update index.js
  • Loading branch information
heiskr authored Aug 23, 2021
1 parent d84b873 commit 86b6b1a
Show file tree
Hide file tree
Showing 12 changed files with 18,245 additions and 35,867 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ coverage/
/data/early-access
.next
.eslintcache
/storybook/

# blc: broken link checker
blc_output.log
Expand Down
9 changes: 0 additions & 9 deletions .storybook/main.js

This file was deleted.

11 changes: 0 additions & 11 deletions .storybook/preview.js

This file was deleted.

1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ COPY content/index.md ./content/index.md
COPY next.config.js ./next.config.js
COPY tsconfig.json ./tsconfig.json
COPY next-env.d.ts ./next-env.d.ts
COPY .storybook ./.storybook

RUN npx tsc --noEmit

Expand Down
30 changes: 0 additions & 30 deletions components/stories/Callout.stories.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions components/stories/Introduction.stories.mdx

This file was deleted.

5 changes: 0 additions & 5 deletions middleware/csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,5 @@ export default function csp(req, res, next) {
csp.directives.scriptSrc.push("'unsafe-inline'")
}

if (req.path.startsWith('/storybook')) {
csp.directives.scriptSrc.push("'unsafe-eval'", "'unsafe-inline'")
csp.directives.frameSrc.push("'self'")
}

return contentSecurityPolicy(csp)(req, res, next)
}
14 changes: 0 additions & 14 deletions middleware/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import express from 'express'
import basicAuth from 'express-basic-auth'
import instrument from '../lib/instrument-middleware.js'
import haltOnDroppedConnection from './halt-on-dropped-connection.js'
import abort from './abort.js'
Expand Down Expand Up @@ -62,7 +61,6 @@ import renderPage from './render-page.js'
const { NODE_ENV } = process.env
const isDevelopment = NODE_ENV === 'development'
const isTest = NODE_ENV === 'test' || process.env.GITHUB_ACTIONS === 'true'
const isProduction = NODE_ENV === 'production' && process.env.HEROKU_PRODUCTION_APP

// Catch unhandled promise rejections and passing them to Express's error handler
// https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016
Expand Down Expand Up @@ -145,18 +143,6 @@ export default function (app) {
instrument(archivedEnterpriseVersionsAssets, './archived-enterprise-versions-assets')
)
)
app.use('/storybook', [
(isProduction &&
basicAuth({ users: { octocat: process.env.STORYBOOK_PASSWORD }, challenge: true })) ||
((req, res, next) => next()),
express.static('storybook', {
index: false,
etag: false,
immutable: true,
lastModified: false,
maxAge: '1 day', // Relatively short in case we update index.html
}),
])
app.use(
'/assets',
express.static('assets', {
Expand Down
Loading

0 comments on commit 86b6b1a

Please sign in to comment.