Skip to content

Commit

Permalink
Merge pull request wevote#3828 from SailingSteve/steveWebAppFeb14-1117am
Browse files Browse the repository at this point in the history
Added building and access via webapp to the Storybook design inventory
  • Loading branch information
DaleMcGrew authored Feb 14, 2024
2 parents bdb1a32 + 36b4c7d commit 13284df
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 40 deletions.
36 changes: 0 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"wdio:setup": "node tests/browserstack_automation/buildMobileCapabilities.js",
"wdio": "wdio ./tests/browserstack_automation/config/wdio.config.js",
"wdio:upgrade": "ncu -u *wdio* webdriver*",
"build": "node node/buildDateFile.js && MINIMIZED=1 webpack --mode production",
"build": "node node/buildDateFile.js && npm run build-storybook && MINIMIZED=1 webpack --mode production",
"buildCordova": "node node/buildDateFile.js && node node/buildSrcCordova && CORDOVA=1 && webpack --mode development && node node/logCompileDate.js",
"buildCordovaAndLinks": "node node/buildDateFile.js && node node/buildSrcCordova && CORDOVA=1 && webpack --mode development && node node/buildSymLinksRemote.js && bash ./node/unSymLinkIOS.sh && node node/logCompileDate.js",
"lint": "eslint --format stylish --ext .jsx --ext .js src/js",
"lintCordova": "eslint --format stylish --ext .jsx --ext .js srcCordova/js",
"prod": "node node/buildDateFile.js && MINIMIZED=1 webpack --mode production",
"prod": "npm run build",
"run-prod-local": "node server-prod-local.js",
"start": "node node/buildDateFile.js && PROTOCOL=HTTP webpack serve --mode development",
"start": "node node/buildDateFile.js && npm run build-storybook && PROTOCOL=HTTP webpack serve --mode development",
"start-win": "node node/buildDateFile.js && webpack serve --mode development",
"start-https": "node node/buildDateFile.js && PROTOCOL=HTTPS webpack serve --mode development",
"start-https-real-certs": "node node/buildDateFile.js && USE_REAL_CERTS=1 && PROTOCOL=HTTPS webpack serve --mode development",
Expand Down Expand Up @@ -55,7 +55,6 @@
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-interactions": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/addon-onboarding": "^1.0.10",
"@storybook/blocks": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-webpack5": "^7.6.7",
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { isCordova, isWebApp } from './js/common/utils/isCordovaOrWebApp';
import { renderLog } from './js/common/utils/logging';
import Header from './js/components/Navigation/Header';
import HeaderBarSuspense from './js/components/Navigation/HeaderBarSuspense';
import StorybookRedirect from './js/components/Widgets/StorybookRedirect';
import webAppConfig from './js/config';
import VoterStore from './js/stores/VoterStore';
import initializeFacebookSDK from './js/utils/initializeFacebookSDK';
Expand Down Expand Up @@ -550,6 +551,7 @@ class App extends Component {
<Route path="/sign_in_email/:email_secret_key" component={SignInEmailProcess} />
<Route path="/setupaccount/:set_up_page" exact component={SetUpAccountRoot} />
<Route path="/setupaccount" exact><SetUpAccountRoot /></Route>
<Route path="/storybook"><StorybookRedirect /></Route>
<Route path="/squads" exact><Squads /></Route>
<Route exact path="/start-a-campaign"><CampaignStartIntro /></Route>
<Route path="/terms" component={TermsOfService} />
Expand Down
12 changes: 12 additions & 0 deletions src/js/components/Widgets/StorybookRedirect.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { renderLog } from '../../common/utils/logging';


// React functional component example
export default function StorybookRedirect () {
renderLog('StorybookRedirect functional component');

return (
<a href="/storybook?path=/docs/design-system--docs">Redirect to Html page</a>
);
}
2 changes: 2 additions & 0 deletions storybook-static/README.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Feb 13, 2024
This empty file is needed to allow `npm run prod` to complete if Storybook static compile failed or was not run
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ module.exports = (env, argv) => ({
to: 'img/',
globOptions: { ignore: ['**/DO-NOT-BUNDLE/**']},
},
{ from: 'storybook-static', to: './storybook' },
],
}),
new MomentLocalesPlugin(),
Expand Down

0 comments on commit 13284df

Please sign in to comment.