Skip to content

Commit 7967f29

Browse files
committed
rename example to sample and run the cpp-lib template
1 parent b231d74 commit 7967f29

File tree

113 files changed

+2102
-246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2102
-246
lines changed

packages/default-storage/.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ gradlew
88
gradlew.bat
99
build/
1010
gradle/wrapper/
11-
example/windows/.vs
12-
example/windows/*.sln
13-
example/windows/ARM
14-
example/windows/packages
15-
example/windows/x64
11+
sample/windows/.vs
12+
sample/windows/*.sln
13+
sample/windows/ARM
14+
sample/windows/packages
15+
sample/windows/x64
1616
msbuild.binlog
1717
buck-out/
1818
\.buckd/

packages/default-storage/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ codecov.yml
2121
scripts/
2222

2323
# Example
24-
example/
24+
sample/
2525
app.json
2626

2727
# Android

packages/default-storage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ to learn more.
3535
2. Build app and run tests
3636
```shell
3737
yarn bundle:ios
38-
pod install --project-directory=example/ios
38+
pod install --project-directory=sample/ios
3939
yarn build:e2e:ios
4040
yarn test:e2e:ios
4141
```

packages/default-storage/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"expo": {
3-
"entryPoint": "./example/index"
3+
"entryPoint": "./sample/index"
44
}
55
}

packages/default-storage/example/ios/AsyncStorageExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const config = {};
2+
3+
module.exports = require('@rnx-kit/jest-preset')('windows', config);

packages/default-storage/example/macos/AsyncStorageExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
2+
const fs = require('fs');
3+
const path = require('path');
4+
const escape = require('escape-string-regexp');
5+
const exclusionList = require('metro-config/src/defaults/exclusionList');
6+
const pak = require('../package.json');
7+
8+
const root = path.resolve(__dirname, '..');
9+
const modules = Object.keys({ ...pak.peerDependencies });
10+
11+
const rnwPath = fs.realpathSync(
12+
path.resolve(require.resolve('react-native-windows/package.json'), '..'),
13+
);
14+
15+
//
16+
17+
/**
18+
* Metro configuration
19+
* https://facebook.github.io/metro/docs/configuration
20+
*
21+
* @type {import('metro-config').MetroConfig}
22+
*/
23+
const config = {
24+
watchFolders: [root,
25+
//
26+
],
27+
28+
// We need to make sure that only one version is loaded for peerDependencies
29+
// So we block them at the root, and alias them to the versions in example's node_modules
30+
resolver: {
31+
blacklistRE: exclusionList(
32+
modules.map(
33+
(m) =>
34+
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
35+
).concat([
36+
// This stops "react-native run-windows" from causing the metro server to crash if its already running
37+
new RegExp(
38+
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
39+
),
40+
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
41+
new RegExp(`${rnwPath}/build/.*`),
42+
new RegExp(`${rnwPath}/target/.*`),
43+
/.*\.ProjectImports\.zip/,
44+
])
45+
),
46+
47+
extraNodeModules: modules.reduce((acc, name) => {
48+
acc[name] = path.join(__dirname, 'node_modules', name);
49+
return acc;
50+
},
51+
{
52+
//
53+
}
54+
),
55+
},
56+
57+
transformer: {
58+
getTransformOptions: async () => ({
59+
transform: {
60+
experimentalImportSupport: false,
61+
inlineRequires: true,
62+
},
63+
}),
64+
},
65+
};
66+
67+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
*AppPackages*
2+
*BundleArtifacts*
3+
4+
#OS junk files
5+
[Tt]humbs.db
6+
*.DS_Store
7+
8+
#Visual Studio files
9+
*.[Oo]bj
10+
*.user
11+
*.aps
12+
*.pch
13+
*.vspscc
14+
*.vssscc
15+
*_i.c
16+
*_p.c
17+
*.ncb
18+
*.suo
19+
*.tlb
20+
*.tlh
21+
*.bak
22+
*.[Cc]ache
23+
*.ilk
24+
*.log
25+
*.lib
26+
*.sbr
27+
*.sdf
28+
*.opensdf
29+
*.opendb
30+
*.unsuccessfulbuild
31+
ipch/
32+
[Oo]bj/
33+
[Bb]in
34+
[Dd]ebug*/
35+
[Rr]elease*/
36+
Ankh.NoLoad
37+
.vs/
38+
# Visual C++ cache files
39+
40+
#Files generated by the VS build
41+
**/Generated Files/**
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup Label="Microsoft.ReactNative Experimental Features">
5+
<UseFabric>true</UseFabric>
6+
<UseWinUI3>true</UseWinUI3>
7+
8+
<ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
9+
</PropertyGroup>
10+
11+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<Package
4+
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
5+
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
6+
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
7+
IgnorableNamespaces="uap rescap">
8+
9+
<Identity
10+
Name="ReactNativeAsyncStorageAsyncStorageExample"
11+
Publisher="CN=yajurgrover"
12+
Version="1.0.0.0" />
13+
14+
<Properties>
15+
<DisplayName>ReactNativeAsyncStorageAsyncStorageExample</DisplayName>
16+
<PublisherDisplayName>yajurgrover</PublisherDisplayName>
17+
<Logo>Images\StoreLogo.png</Logo>
18+
</Properties>
19+
20+
<Dependencies>
21+
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
22+
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.17763.0" />
23+
</Dependencies>
24+
25+
<Resources>
26+
<Resource Language="x-generate"/>
27+
</Resources>
28+
29+
<Applications>
30+
<Application Id="App"
31+
Executable="$targetnametoken$.exe"
32+
EntryPoint="$targetentrypoint$">
33+
<uap:VisualElements
34+
DisplayName="ReactNativeAsyncStorageAsyncStorageExample"
35+
Description="ReactNativeAsyncStorageAsyncStorageExample"
36+
BackgroundColor="transparent"
37+
Square150x150Logo="Images\Square150x150Logo.png"
38+
Square44x44Logo="Images\Square44x44Logo.png">
39+
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
40+
<uap:SplashScreen Image="Images\SplashScreen.png" />
41+
</uap:VisualElements>
42+
</Application>
43+
</Applications>
44+
45+
<Capabilities>
46+
<Capability Name="internetClient" />
47+
<rescap:Capability Name="runFullTrust" />
48+
</Capabilities>
49+
</Package>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
4+
<PropertyGroup>
5+
<ProjectGuid>{13b335d1-c33d-40de-a656-e52b780d26f3}</ProjectGuid>
6+
<DefaultLanguage>en-US</DefaultLanguage>
7+
<EntryPointProjectUniqueName>..\ReactNativeAsyncStorageAsyncStorageExample\ReactNativeAsyncStorageAsyncStorageExample.vcxproj</EntryPointProjectUniqueName>
8+
<DebuggerType>NativeOnly</DebuggerType>
9+
<BackgroundTaskDebugEngines>NativeOnly</BackgroundTaskDebugEngines>
10+
</PropertyGroup>
11+
<PropertyGroup Label="ReactNativeWindowsProps">
12+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
13+
</PropertyGroup>
14+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" />
15+
<PropertyGroup>
16+
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
17+
</PropertyGroup>
18+
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
19+
<ItemGroup Label="ProjectConfigurations">
20+
<ProjectConfiguration Include="Debug|x86">
21+
<Configuration>Debug</Configuration>
22+
<Platform>x86</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="Release|x86">
25+
<Configuration>Release</Configuration>
26+
<Platform>x86</Platform>
27+
</ProjectConfiguration>
28+
<ProjectConfiguration Include="Debug|x64">
29+
<Configuration>Debug</Configuration>
30+
<Platform>x64</Platform>
31+
</ProjectConfiguration>
32+
<ProjectConfiguration Include="Release|x64">
33+
<Configuration>Release</Configuration>
34+
<Platform>x64</Platform>
35+
</ProjectConfiguration>
36+
<ProjectConfiguration Include="Debug|ARM64">
37+
<Configuration>Debug</Configuration>
38+
<Platform>ARM64</Platform>
39+
</ProjectConfiguration>
40+
<ProjectConfiguration Include="Release|ARM64">
41+
<Configuration>Release</Configuration>
42+
<Platform>ARM64</Platform>
43+
</ProjectConfiguration>
44+
</ItemGroup>
45+
<ImportGroup Label="ReactNativeWindowsPropertySheets">
46+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.props')" />
47+
</ImportGroup>
48+
<ItemGroup>
49+
<AppxManifest Include="Package.appxmanifest">
50+
<SubType>Designer</SubType>
51+
</AppxManifest>
52+
</ItemGroup>
53+
<ItemGroup>
54+
<Content Include="Images\SplashScreen.scale-200.png" />
55+
<Content Include="Images\LockScreenLogo.scale-200.png" />
56+
<Content Include="Images\Square150x150Logo.scale-200.png" />
57+
<Content Include="Images\Square44x44Logo.scale-200.png" />
58+
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
59+
<Content Include="Images\StoreLogo.png" />
60+
<Content Include="Images\Wide310x150Logo.scale-200.png" />
61+
</ItemGroup>
62+
<ItemGroup>
63+
<ProjectReference Include="..\ReactNativeAsyncStorageAsyncStorageExample\ReactNativeAsyncStorageAsyncStorageExample.vcxproj">
64+
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
65+
</ProjectReference>
66+
</ItemGroup>
67+
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
68+
<ImportGroup Label="ReactNativeWindowsTargets">
69+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.targets')" />
70+
</ImportGroup>
71+
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
72+
<PropertyGroup>
73+
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
74+
</PropertyGroup>
75+
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.props'))" />
76+
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Composition.Package.targets'))" />
77+
</Target>
78+
</Project>

0 commit comments

Comments
 (0)