Skip to content

Commit 3b518a8

Browse files
committed
Fix Invalid Regular Expression (microsoft#3795)
Signed-off-by: Pedro Tôrres <t-pesant@microsoft.com>
1 parent c9a5084 commit 3b518a8

8 files changed

Lines changed: 49 additions & 31 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "none",
3+
"comment": "Fix Invalid Regular Expression (#3795)",
4+
"packageName": "@office-iss/react-native-win32",
5+
"email": "t-pesant@microsoft.com",
6+
"commit": "5d51eb6cc6b9610b35ff76c8ce1d4270661b22cd",
7+
"dependentChangeType": "patch",
8+
"date": "2020-02-15T01:31:37.614Z"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "none",
3+
"comment": "Fix Invalid Regular Expression (#3795)",
4+
"packageName": "react-native-windows",
5+
"email": "t-pesant@microsoft.com",
6+
"commit": "5d51eb6cc6b9610b35ff76c8ce1d4270661b22cd",
7+
"dependentChangeType": "patch",
8+
"date": "2020-02-15T01:31:40.076Z"
9+
}

packages/E2ETest/metro.config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,41 @@ module.exports = {
3939
blacklistRE: blacklist([
4040
new RegExp(
4141
`${'.*E2ETest/msbuild.*'
42-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
42+
.replace(/[/\\\\]/g, '/')}.*`
4343
), // Avoid error EBUSY: resource busy or locked, open 'D:\a\1\s\packages\E2ETest\msbuild.ProjectImports.zip' in pipeline
44-
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
44+
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
4545
new RegExp(
4646
`${path
4747
.resolve(rnwPath, 'RNTesterCopy')
48-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
48+
.replace(/[/\\\\]/g, '/')}.*`,
4949
),
5050
new RegExp(
5151
`${path
5252
.resolve(rnwPath, 'IntegrationTestsCopy')
53-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
53+
.replace(/[/\\\\]/g, '/')}.*`,
5454
),
5555
new RegExp(
5656
`${path
5757
.resolve(rnwPath, 'node_modules/react-native')
58-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
58+
.replace(/[/\\\\]/g, '/')}.*`
5959
),
6060
new RegExp(
6161
`${path
6262
.resolve(rnwePath, 'node_modules/react-native')
63-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
63+
.replace(/[/\\\\]/g, '/')}.*`
6464
),
6565
new RegExp(
6666
`${path
6767
.resolve(
6868
require.resolve('@react-native-community/cli/package.json'),
6969
'../node_modules/react-native'
7070
)
71-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
71+
.replace(/[/\\\\]/g, '/')}.*`
7272
),
7373

7474
// This stops "react-native run-windows" from causing the metro server to crash if its already running
7575
new RegExp(
76-
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '[/\\\\]')}.*`
76+
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '/')}.*`
7777
),
7878
]),
7979
},

packages/microsoft-reactnative-sampleapps/metro.config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,43 @@ module.exports = {
4040
new RegExp(
4141
`${'.*microsoft-reactnative-sampleapps/msbuild.*'.replace(
4242
/[/\\\\]/g,
43-
'[/\\\\]',
43+
'/',
4444
)}.*`,
4545
), // Avoid error EBUSY: resource busy or locked, open 'D:\a\1\s\packages\E2ETest\msbuild.ProjectImports.zip' in pipeline
46-
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
46+
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
4747
new RegExp(
4848
`${path
4949
.resolve(rnwPath, 'RNTesterCopy')
50-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
50+
.replace(/[/\\\\]/g, '/')}.*`,
5151
),
5252
new RegExp(
5353
`${path
5454
.resolve(rnwPath, 'IntegrationTestsCopy')
55-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
55+
.replace(/[/\\\\]/g, '/')}.*`,
5656
),
5757
new RegExp(
5858
`${path
5959
.resolve(rnwPath, 'node_modules/react-native')
60-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
60+
.replace(/[/\\\\]/g, '/')}.*`,
6161
),
6262
new RegExp(
6363
`${path
6464
.resolve(rnwePath, 'node_modules/react-native')
65-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
65+
.replace(/[/\\\\]/g, '/')}.*`,
6666
),
6767
new RegExp(
6868
`${path
6969
.resolve(
7070
require.resolve('@react-native-community/cli/package.json'),
7171
'../node_modules/react-native',
7272
)
73-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
73+
.replace(/[/\\\\]/g, '/')}.*`,
7474
),
7575
// This stops "react-native run-windows" from causing the metro server to crash if its already running
7676
new RegExp(
7777
`${path
7878
.resolve(__dirname, 'windows')
79-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
79+
.replace(/[/\\\\]/g, '/')}.*`,
8080
),
8181
]),
8282
},

packages/playground/metro.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,41 @@ module.exports = {
3939
// Since there are multiple copies of react-native, we need to ensure that metro only sees one of them
4040
// This should go away after RN 0.61 when haste is removed
4141
blacklistRE: blacklist([
42-
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
42+
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
4343
new RegExp(
4444
`${path
4545
.resolve(rnwPath, 'node_modules/react-native')
46-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
46+
.replace(/[/\\\\]/g, '/')}.*`,
4747
),
4848
new RegExp(
4949
`${path
5050
.resolve(rnwPath, 'RNTesterCopy')
51-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
51+
.replace(/[/\\\\]/g, '/')}.*`,
5252
),
5353
new RegExp(
5454
`${path
5555
.resolve(rnwPath, 'IntegrationTestsCopy')
56-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
56+
.replace(/[/\\\\]/g, '/')}.*`,
5757
),
5858
new RegExp(
5959
`${path
6060
.resolve(rnwePath, 'node_modules/react-native')
61-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
61+
.replace(/[/\\\\]/g, '/')}.*`,
6262
),
6363
new RegExp(
6464
`${path
6565
.resolve(
6666
require.resolve('@react-native-community/cli/package.json'),
6767
'../node_modules/react-native',
6868
)
69-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
69+
.replace(/[/\\\\]/g, '/')}.*`,
7070
),
7171

7272
// This stops "react-native run-windows" from causing the metro server to crash if its already running
7373
new RegExp(
7474
`${path
7575
.resolve(__dirname, 'windows')
76-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
76+
.replace(/[/\\\\]/g, '/')}.*`,
7777
),
7878
]),
7979
},

packages/react-native-win32/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ module.exports = {
3838
// Since there are multiple copies of react-native, we need to ensure that metro only sees one of them
3939
// This should go away after RN 0.61 when haste is removed
4040
blacklistRE: blacklist([
41-
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
41+
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
4242
new RegExp(
4343
`${path
4444
.resolve(
4545
require.resolve('@react-native-community/cli/package.json'),
4646
'../node_modules/react-native',
4747
)
48-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
48+
.replace(/[/\\\\]/g, '/')}.*`,
4949
),
5050
]),
5151
},

vnext/local-cli/generator-windows/templates/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ module.exports = {
2828
// This should go in RN 0.61 when haste is removed
2929
blacklistRE: blacklist([
3030
new RegExp(
31-
`${(path.resolve(rnPath) + path.sep).replace(/[/\\\\]/g, '[/\\\\]')}.*`,
31+
`${(path.resolve(rnPath) + path.sep).replace(/[/\\\\]/g, '/')}.*`,
3232
),
3333

3434
// This stops "react-native run-windows" from causing the metro server to crash if its already running
3535
new RegExp(
3636
`${path
3737
.resolve(__dirname, 'windows')
38-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
38+
.replace(/[/\\\\]/g, '/')}.*`,
3939
),
4040
]),
4141
},

vnext/metro.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ module.exports = {
3030
// Since there are multiple copies of react-native, we need to ensure that metro only sees one of them
3131
// This should go away after RN 0.61 when haste is removed
3232
blacklistRE: blacklist([
33-
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
33+
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
3434
new RegExp(
3535
`${path
3636
.resolve(rnwPath, 'RNTesterCopy')
37-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
37+
.replace(/[/\\\\]/g, '/')}.*`,
3838
),
3939
new RegExp(
4040
`${path
4141
.resolve(rnwPath, 'IntegrationTestsCopy')
42-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
42+
.replace(/[/\\\\]/g, '/')}.*`,
4343
),
4444
new RegExp(
4545
`${path
4646
.resolve(
4747
require.resolve('@react-native-community/cli/package.json'),
4848
'../node_modules/react-native',
4949
)
50-
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
50+
.replace(/[/\\\\]/g, '/')}.*`,
5151
),
5252
]),
5353
hasteImplModulePath: path.resolve(__dirname, 'jest/hasteImpl.js'),

0 commit comments

Comments
 (0)