Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX storybook msw service worker load #1906

Merged
merged 5 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: ['./public'],
staticDirs: ['public'],
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],
core: {
builder: 'webpack5',
Expand Down
303 changes: 0 additions & 303 deletions .storybook/msw/mockServiceWorker.js

This file was deleted.

10 changes: 9 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,13 @@ if (typeof global.process === 'undefined') {
// Start the mocking when each story is loaded.
// Repetitive calls to the `.start()` method do not register a new worker,
// but check whether there's an existing once, reusing it, if so.
worker.start();

const pathname = document.location.pathname.slice(0, document.location.pathname.lastIndexOf('/'));
worker.start({
serviceWorker: {
// Points to the custom location of the Service Worker file.
url: `${pathname}/mockServiceWorker.js`,
scope: '/',
},
});
}
20 changes: 8 additions & 12 deletions .storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": [
"node"
],
"allowSyntheticDefaultImports": true
},
"exclude": ["../node_modules/**/*", "../dist/**/*", "../packages/**/*.spec.ts", "../stories/**/*.spec.ts"],
"include": ["../packages/**/*", "../stories/**/*", "./msw/**/*"],
"files": [
"./typings.d.ts"
]
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["node"],
"allowSyntheticDefaultImports": true
},
"exclude": ["../packages/**/*.spec.ts", "../stories/**/*.spec.ts"],
"include": ["../packages/**/*", "../stories/**/*", "./msw/**/*"],
"files": ["./typings.d.ts"]
}
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ node(label: CI.getSelectedNode(script:this)) {
if (isPR || isRc || isMaster) {
loggableStage('Deploy') {
echo "deploying ${branchName}"
bat "npm run compodoc"
bat "npm run build-storybook"
bat "npm run build-compodoc"
powershell "Remove-Item \\\\RBX1-SH1-TECH\\lucca-front\\${branchName}\\storybook -Recurse"
Expand Down
Loading