Skip to content

Commit

Permalink
fix: remove hacky workaround and use fixed version 8.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Sep 16, 2024
1 parent 0fc76e0 commit d1f38ea
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 223 deletions.
18 changes: 9 additions & 9 deletions examples/expo-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-community/slider": "4.5.2",
"@storybook/addon-essentials": "^8.3.0",
"@storybook/addon-interactions": "^8.3.0",
"@storybook/addon-links": "^8.3.0",
"@storybook/addon-essentials": "^8.3.1",
"@storybook/addon-interactions": "^8.3.1",
"@storybook/addon-links": "^8.3.1",
"@storybook/addon-ondevice-actions": "^8.3.0-alpha.1",
"@storybook/addon-ondevice-backgrounds": "^8.3.0-alpha.1",
"@storybook/addon-ondevice-controls": "^8.3.0-alpha.1",
"@storybook/addon-ondevice-notes": "^8.3.0-alpha.1",
"@storybook/addon-react-native-server": "0.0.6--canary.6.16aca9d.0",
"@storybook/addon-react-native-web": "^0.0.22",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.3.0",
"@storybook/builder-webpack5": "^8.3.0",
"@storybook/blocks": "^8.3.1",
"@storybook/builder-webpack5": "^8.3.1",
"@storybook/global": "^5.0.0",
"@storybook/react": "^8.3.0",
"@storybook/react": "^8.3.1",
"@storybook/react-native": "^8.3.0-alpha.1",
"@storybook/react-native-theming": "^8.3.0-alpha.1",
"@storybook/react-webpack5": "^8.3.0",
"@storybook/test": "^8.3.0",
"@storybook/react-webpack5": "^8.3.1",
"@storybook/test": "^8.3.1",
"expo": "^51.0.17",
"querystring": "^0.2.1",
"react": "18.2.0",
Expand All @@ -52,7 +52,7 @@
"react-native-safe-area-context": "4.10.1",
"react-native-svg": "15.2.0",
"react-native-web": "~0.19.10",
"storybook": "^8.3.0",
"storybook": "^8.3.1",
"ws": "^8.16.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ondevice-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"prepare": "tsc"
},
"dependencies": {
"@storybook/addon-actions": "^8.3.0",
"@storybook/core": "^8.3.0",
"@storybook/addon-actions": "^8.3.1",
"@storybook/core": "^8.3.1",
"@storybook/global": "^5.0.0",
"fast-deep-equal": "^2.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ondevice-backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dev": "tsc --watch"
},
"dependencies": {
"@storybook/core": "^8.3.0",
"@storybook/core": "^8.3.1",
"@storybook/react-native-theming": "^8.3.0-alpha.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ondevice-controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"copyimages": "cross-env-shell cp -r src/components/color-picker/resources dist/components/color-picker/resources"
},
"dependencies": {
"@storybook/addon-controls": "^8.3.0",
"@storybook/core": "^8.3.0",
"@storybook/addon-controls": "^8.3.1",
"@storybook/core": "^8.3.1",
"@storybook/react-native-theming": "^8.3.0-alpha.1",
"@storybook/react-native-ui": "^8.3.0-alpha.1",
"deep-equal": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/ondevice-notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dev": "tsc --watch"
},
"dependencies": {
"@storybook/core": "^8.3.0",
"@storybook/core": "^8.3.1",
"@storybook/react-native-theming": "^8.3.0-alpha.1",
"react-native-markdown-display": "^7.0.2"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"typescript": "~5.3.3"
},
"dependencies": {
"@storybook/core": "^8.3.0",
"@storybook/react": "^8.3.0",
"@storybook/core": "^8.3.1",
"@storybook/react": "^8.3.1",
"@storybook/react-native-theming": "^8.3.0-alpha.1",
"fuse.js": "^7.0.0",
"memoizerific": "^1.11.3",
Expand Down
18 changes: 1 addition & 17 deletions packages/react-native/metro/withStorybook.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const path = require('path');
const fs = require('fs');

const { generate } = require('../scripts/generate');
const { WebSocketServer } = require('ws');

let alreadyReplaced = false;

module.exports = (config, { configPath, enabled, websockets }) => {
if (!enabled) {
return config;
Expand Down Expand Up @@ -59,20 +57,6 @@ module.exports = (config, { configPath, enabled, websockets }) => {
};
}

// workaround for unsupported regex
if (defaultResolveResult?.filePath?.includes?.('@storybook/core/dist/docs-tools/index')) {
if (!alreadyReplaced) {
const filepath = path.resolve(defaultResolveResult?.filePath);

const input = fs.readFileSync(filepath, 'utf-8');

const output = input.replace(/new RegExp\(([^)]+).*, "u"\)/g, 'new RegExp("")');

fs.writeFileSync(filepath, output);
alreadyReplaced = true;
}
}

return defaultResolveResult;
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"test:ci": "jest"
},
"dependencies": {
"@storybook/core": "^8.3.0",
"@storybook/core": "^8.3.1",
"@storybook/csf": "^0.1.1",
"@storybook/global": "^5.0.0",
"@storybook/react": "^8.3.0",
"@storybook/react": "^8.3.1",
"@storybook/react-native-theming": "^8.3.0-alpha.1",
"@storybook/react-native-ui": "^8.3.0-alpha.1",
"chokidar": "^3.5.1",
Expand Down
Loading

0 comments on commit d1f38ea

Please sign in to comment.