Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "none",
"comment": "Fix Invalid Regular Expression (#3795)",
"packageName": "@office-iss/react-native-win32",
"email": "t-pesant@microsoft.com",
"commit": "5d51eb6cc6b9610b35ff76c8ce1d4270661b22cd",
"dependentChangeType": "patch",
"date": "2020-02-15T01:31:37.614Z"
}
9 changes: 9 additions & 0 deletions change/react-native-windows-2020-02-15-01-31-40-patch-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "none",
"comment": "Fix Invalid Regular Expression (#3795)",
"packageName": "react-native-windows",
"email": "t-pesant@microsoft.com",
"commit": "5d51eb6cc6b9610b35ff76c8ce1d4270661b22cd",
"dependentChangeType": "patch",
"date": "2020-02-15T01:31:40.076Z"
}
18 changes: 8 additions & 10 deletions packages/E2ETest/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,39 @@ module.exports = {
blacklistRE: blacklist([
new RegExp(
`${'.*E2ETest/msbuild.*'
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
.replace(/[/\\\\]/g, '/')}.*`
), // Avoid error EBUSY: resource busy or locked, open 'D:\a\1\s\packages\E2ETest\msbuild.ProjectImports.zip' in pipeline
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
new RegExp(
`${path
.resolve(rnwPath, 'RNTesterCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(rnwPath, 'RNTesterCopy').replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'IntegrationTestsCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'node_modules/react-native')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
.replace(/[/\\\\]/g, '/')}.*`
),
new RegExp(
`${path
.resolve(rnwePath, 'node_modules/react-native')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
.replace(/[/\\\\]/g, '/')}.*`
),
new RegExp(
`${path
.resolve(
require.resolve('@react-native-community/cli/package.json'),
'../node_modules/react-native'
)
.replace(/[/\\\\]/g, '[/\\\\]')}.*`
.replace(/[/\\\\]/g, '/')}.*`
),

// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '[/\\\\]')}.*`
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '/')}.*`
),
]),
},
Expand Down
20 changes: 8 additions & 12 deletions packages/microsoft-reactnative-sampleapps/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,39 @@ module.exports = {
new RegExp(
`${'.*microsoft-reactnative-sampleapps/msbuild.*'.replace(
/[/\\\\]/g,
'[/\\\\]',
'/',
)}.*`,
), // Avoid error EBUSY: resource busy or locked, open 'D:\a\1\s\packages\E2ETest\msbuild.ProjectImports.zip' in pipeline
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
new RegExp(
`${path
.resolve(rnwPath, 'RNTesterCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(rnwPath, 'RNTesterCopy').replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'IntegrationTestsCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'node_modules/react-native')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwePath, 'node_modules/react-native')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(
require.resolve('@react-native-community/cli/package.json'),
'../node_modules/react-native',
)
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path
.resolve(__dirname, 'windows')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '/')}.*`,
),
]),
},
Expand Down
18 changes: 7 additions & 11 deletions packages/playground/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,37 @@ module.exports = {
// Since there are multiple copies of react-native, we need to ensure that metro only sees one of them
// This should go away after RN 0.61 when haste is removed
blacklistRE: blacklist([
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
new RegExp(
`${path
.resolve(rnwPath, 'node_modules/react-native')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'RNTesterCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(rnwPath, 'RNTesterCopy').replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'IntegrationTestsCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwePath, 'node_modules/react-native')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(
require.resolve('@react-native-community/cli/package.json'),
'../node_modules/react-native',
)
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),

// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path
.resolve(__dirname, 'windows')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '/')}.*`,
),
]),
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-win32/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ module.exports = {
// Since there are multiple copies of react-native, we need to ensure that metro only sees one of them
// This should go away after RN 0.61 when haste is removed
blacklistRE: blacklist([
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
new RegExp(
`${path
.resolve(
require.resolve('@react-native-community/cli/package.json'),
'../node_modules/react-native',
)
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
]),
},
Expand Down
6 changes: 2 additions & 4 deletions vnext/local-cli/generator-windows/templates/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ module.exports = {
// This should go in RN 0.61 when haste is removed
blacklistRE: blacklist([
new RegExp(
`${(path.resolve(rnPath) + path.sep).replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${(path.resolve(rnPath) + path.sep).replace(/[/\\\\]/g, '/')}.*`,
),

// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path
.resolve(__dirname, 'windows')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(__dirname, 'windows').replace(/[/\\\\]/g, '/')}.*`,
),
]),
},
Expand Down
10 changes: 4 additions & 6 deletions vnext/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,22 @@ module.exports = {
// Since there are multiple copies of react-native, we need to ensure that metro only sees one of them
// This should go away after RN 0.61 when haste is removed
blacklistRE: blacklist([
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '[/\\\\]')}.*`),
new RegExp(`${path.resolve(rnPath).replace(/[/\\\\]/g, '/')}.*`),
new RegExp(
`${path
.resolve(rnwPath, 'RNTesterCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
`${path.resolve(rnwPath, 'RNTesterCopy').replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(rnwPath, 'IntegrationTestsCopy')
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
new RegExp(
`${path
.resolve(
require.resolve('@react-native-community/cli/package.json'),
'../node_modules/react-native',
)
.replace(/[/\\\\]/g, '[/\\\\]')}.*`,
.replace(/[/\\\\]/g, '/')}.*`,
),
]),
hasteImplModulePath: path.resolve(__dirname, 'jest/hasteImpl.js'),
Expand Down