-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(example/basic): add windows support
- Loading branch information
1 parent
0f9d241
commit cee47a8
Showing
37 changed files
with
1,959 additions
and
51 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
examples/basic/ios/videoplayer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,59 @@ | ||
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const escape = require('escape-string-regexp'); | ||
const {getDefaultConfig} = require('@react-native/metro-config'); | ||
const exclusionList = require('metro-config/src/defaults/exclusionList'); | ||
const pak = require('../../package.json'); | ||
|
||
const rnwPath = fs.realpathSync( | ||
path.resolve(require.resolve('react-native-windows/package.json'), '..'), | ||
); | ||
|
||
const pak = require('../../package.json'); | ||
const root = path.resolve(__dirname, '../..'); | ||
const modules = Object.keys({...pak.peerDependencies}); | ||
|
||
const defaultConfig = getDefaultConfig(__dirname); | ||
|
||
/** | ||
* Metro configuration | ||
* https://facebook.github.io/metro/docs/configuration | ||
* | ||
* @type {import('metro-config').MetroConfig} | ||
*/ | ||
const config = { | ||
...defaultConfig, | ||
|
||
const config = { | ||
projectRoot: __dirname, | ||
watchFolders: [root], | ||
|
||
// We need to make sure that only one version is loaded for peerDependencies | ||
// So we block them at the root, and alias them to the versions in example's node_modules | ||
resolver: { | ||
...defaultConfig.resolver, | ||
|
||
blacklistRE: exclusionList( | ||
modules.map( | ||
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`), | ||
blockList: exclusionList([ | ||
// 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, '/')}.*`, | ||
), | ||
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild | ||
new RegExp(`${rnwPath}/build/.*`), | ||
new RegExp(`${rnwPath}/target/.*`), | ||
/.*\.ProjectImports\.zip/, | ||
]), | ||
// We need to make sure that only one version is loaded for peerDependencies | ||
// So we block them at the root, and alias them to the versions in example's node_modules | ||
blacklistRE: modules.map( | ||
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`), | ||
), | ||
|
||
extraNodeModules: modules.reduce((acc, name) => { | ||
acc[name] = path.join(__dirname, 'node_modules', name); | ||
return acc; | ||
}, {}), | ||
}, | ||
transformer: { | ||
getTransformOptions: async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: true, | ||
}, | ||
}), | ||
// This fixes the 'missing-asset-registry-path` error (see https://github.com/microsoft/react-native-windows/issues/11437) | ||
assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry', | ||
}, | ||
}; | ||
|
||
module.exports = config; | ||
module.exports = mergeConfig(getDefaultConfig(__dirname), config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
*AppPackages* | ||
*BundleArtifacts* | ||
|
||
#OS junk files | ||
[Tt]humbs.db | ||
*.DS_Store | ||
|
||
#Visual Studio files | ||
*.[Oo]bj | ||
*.user | ||
*.aps | ||
*.pch | ||
*.vspscc | ||
*.vssscc | ||
*_i.c | ||
*_p.c | ||
*.ncb | ||
*.suo | ||
*.tlb | ||
*.tlh | ||
*.bak | ||
*.[Cc]ache | ||
*.ilk | ||
*.log | ||
*.lib | ||
*.sbr | ||
*.sdf | ||
*.opensdf | ||
*.opendb | ||
*.unsuccessfulbuild | ||
ipch/ | ||
[Oo]bj/ | ||
[Bb]in | ||
[Dd]ebug*/ | ||
[Rr]elease*/ | ||
Ankh.NoLoad | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
*.aps | ||
*.ncb | ||
*.opendb | ||
*.opensdf | ||
*.sdf | ||
*.cachefile | ||
*.VC.db | ||
*.VC.VC.opendb | ||
|
||
#MonoDevelop | ||
*.pidb | ||
*.userprefs | ||
|
||
#Tooling | ||
_ReSharper*/ | ||
*.resharper | ||
[Tt]est[Rr]esult* | ||
*.sass-cache | ||
|
||
#Project files | ||
[Bb]uild/ | ||
|
||
#Subversion files | ||
.svn | ||
|
||
# Office Temp Files | ||
~$* | ||
|
||
# vim Temp Files | ||
*~ | ||
|
||
#NuGet | ||
packages/ | ||
*.nupkg | ||
|
||
#ncrunch | ||
*ncrunch* | ||
*crunch*.local.xml | ||
|
||
# visual studio database projects | ||
*.dbmdl | ||
|
||
#Test files | ||
*.testsettings | ||
|
||
#Other files | ||
*.DotSettings | ||
.vs/ | ||
*project.lock.json | ||
|
||
#Files generated by the VS build | ||
**/Generated Files/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<!-- | ||
This file contains some important settings that will apply globally for | ||
your app and *all* native modules your app consumes. These values were | ||
set when you created the app project, and in some cases cannot be | ||
simply changed here without recreating a new project. | ||
--> | ||
|
||
<PropertyGroup Label="Microsoft.ReactNative Experimental Features"> | ||
<!-- | ||
Enables default usage of Hermes. | ||
See https://microsoft.github.io/react-native-windows/docs/hermes | ||
--> | ||
<UseHermes>true</UseHermes> | ||
|
||
<!-- | ||
Changes compilation to assume use of WinUI 3 instead of System XAML. | ||
Requires creation of new project. | ||
See https://microsoft.github.io/react-native-windows/docs/winui3 | ||
--> | ||
<UseWinUI3>false</UseWinUI3> | ||
|
||
<!-- | ||
Changes compilation to assume use of Microsoft.ReactNative NuGet packages | ||
instead of building the framework from source. | ||
Requires creation of new project. | ||
See https://microsoft.github.io/react-native-windows/docs/nuget | ||
--> | ||
<UseExperimentalNuget>false</UseExperimentalNuget> | ||
|
||
<ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet> | ||
|
||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<config> | ||
<add key="repositoryPath" value="packages" /> | ||
</config> | ||
<packageSources> | ||
<clear /> | ||
<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
</packageSources> | ||
<disabledPackageSources> | ||
<clear /> | ||
</disabledPackageSources> | ||
</configuration> |
Oops, something went wrong.