-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathrecover-from-missing-package-scripts.test.js.snap
More file actions
997 lines (894 loc) · 29.8 KB
/
recover-from-missing-package-scripts.test.js.snap
File metadata and controls
997 lines (894 loc) · 29.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`create alice-bobbi module with example, with \`exampleFileLinkage: true\` then recover from missing scripts in example package.json 1`] = `
Array [
"* execa.commandSync command: react-native --version options: {\\"stdio\\":\\"inherit\\"}
",
"* execa.commandSync command: yarn --version options: {\\"stdio\\":\\"inherit\\"}
",
"* ensureDir dir: react-native-alice-bobbi
",
"* ensureDir dir: react-native-alice-bobbi/
",
"* ensureDir dir: react-native-alice-bobbi/
",
"* ensureDir dir: react-native-alice-bobbi/
",
"* ensureDir dir: react-native-alice-bobbi/
",
"* ensureDir dir: react-native-alice-bobbi/android/
",
"* ensureDir dir: react-native-alice-bobbi/android/src/main/
",
"* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/
",
"* ensureDir dir: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/
",
"* ensureDir dir: react-native-alice-bobbi/android/
",
"* ensureDir dir: react-native-alice-bobbi/
",
"* ensureDir dir: react-native-alice-bobbi/ios/
",
"* ensureDir dir: react-native-alice-bobbi/ios/
",
"* ensureDir dir: react-native-alice-bobbi/ios/AliceBobbi.xcworkspace/
",
"* ensureDir dir: react-native-alice-bobbi/ios/AliceBobbi.xcodeproj/
",
"* outputFile name: react-native-alice-bobbi/README.md
content:
--------
# react-native-alice-bobbi
## Getting started
\`$ npm install react-native-alice-bobbi --save\`
### Mostly automatic installation
\`$ react-native link react-native-alice-bobbi\`
## Usage
\`\`\`javascript
import AliceBobbi from 'react-native-alice-bobbi';
// TODO: What to do with the module?
AliceBobbi;
\`\`\`
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/package.json
content:
--------
{
\\"name\\": \\"react-native-alice-bobbi\\",
\\"title\\": \\"React Native Alice Bobbi\\",
\\"version\\": \\"1.0.0\\",
\\"description\\": \\"TODO\\",
\\"main\\": \\"index.js\\",
\\"files\\": [
\\"README.md\\",
\\"android\\",
\\"index.js\\",
\\"ios\\",
\\"react-native-alice-bobbi.podspec\\"
],
\\"scripts\\": {
\\"test\\": \\"echo \\\\\\"Error: no test specified\\\\\\" && exit 1\\"
},
\\"repository\\": {
\\"type\\": \\"git\\",
\\"url\\": \\"git+https://github.com/github_account/react-native-alice-bobbi.git\\",
\\"baseUrl\\": \\"https://github.com/github_account/react-native-alice-bobbi\\"
},
\\"keywords\\": [
\\"react-native\\"
],
\\"author\\": {
\\"name\\": \\"Your Name\\",
\\"email\\": \\"yourname@email.com\\"
},
\\"license\\": \\"MIT\\",
\\"licenseFilename\\": \\"LICENSE\\",
\\"readmeFilename\\": \\"README.md\\",
\\"androidPackageIdentifier\\": \\"com.reactlibrary\\",
\\"peerDependencies\\": {
\\"react\\": \\"^16.8.1\\",
\\"react-native\\": \\">=0.60.0-rc.0 <1.0.x\\"
},
\\"devDependencies\\": {
\\"react\\": \\"^16.9.0\\",
\\"react-native\\": \\"^0.61.5\\"
}
}
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/index.js
content:
--------
import { NativeModules } from 'react-native';
const { AliceBobbi } = NativeModules;
export default AliceBobbi;
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/.gitignore
content:
--------
# OSX
#
.DS_Store
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# BUCK
buck-out/
\\\\.buckd/
*.keystore
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/android/build.gradle
content:
--------
// android/build.gradle
// based on:
//
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
// original location:
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
//
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
// original location:
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
def DEFAULT_COMPILE_SDK_VERSION = 28
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
def DEFAULT_MIN_SDK_VERSION = 16
def DEFAULT_TARGET_SDK_VERSION = 28
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
versionCode 1
versionName \\"1.0\\"
}
lintOptions {
abortOnError false
}
}
repositories {
// ref: https://www.baeldung.com/maven-local-repository
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url \\"$rootDir/../node_modules/react-native/android\\"
}
maven {
// Android JSC is installed from npm
url \\"$rootDir/../node_modules/jsc-android/dist\\"
}
google()
jcenter()
}
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
}
def configureReactNativePom(def pom) {
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
pom.project {
name packageJson.title
artifactId packageJson.name
version = packageJson.version
group = packageJson.androidPackageIdentifier
description packageJson.description
url packageJson.repository.baseUrl
licenses {
license {
name packageJson.license
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
distribution 'repo'
}
}
developers {
developer {
id packageJson.author.username
name packageJson.author.name
}
}
}
}
afterEvaluate { project ->
// some Gradle build hooks ref:
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath)
classpath += files(project.getConfigurations().getByName('compile').asList())
include '**/*.java'
}
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc'
from androidJavadoc.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
include '**/*.java'
}
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
def javaCompileTask = variant.javaCompileProvider.get()
task \\"jar\${name}\\"(type: Jar, dependsOn: javaCompileTask) {
from javaCompileTask.destinationDir
}
}
artifacts {
archives androidSourcesJar
archives androidJavadocJar
}
task installArchives(type: Upload) {
configuration = configurations.archives
repositories.mavenDeployer {
// Deploy to react-native-event-bridge/maven, ready to publish to npm
repository url: \\"file://\${projectDir}/../android/maven\\"
configureReactNativePom pom
}
}
}
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/android/src/main/AndroidManifest.xml
content:
--------
<manifest xmlns:android=\\"http://schemas.android.com/apk/res/android\\"
package=\\"com.reactlibrary\\">
</manifest>
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/AliceBobbiModule.java
content:
--------
package com.reactlibrary;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Callback;
public class AliceBobbiModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
public AliceBobbiModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return \\"AliceBobbi\\";
}
@ReactMethod
public void sampleMethod(String stringArgument, int numberArgument, Callback callback) {
// TODO: Implement some actually useful functionality
callback.invoke(\\"Received numberArgument: \\" + numberArgument + \\" stringArgument: \\" + stringArgument);
}
}
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/android/src/main/java/com/reactlibrary/AliceBobbiPackage.java
content:
--------
package com.reactlibrary;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.bridge.JavaScriptModule;
public class AliceBobbiPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new AliceBobbiModule(reactContext));
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/android/README.md
content:
--------
README
======
If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
2. Be sure to have a \`local.properties\` file in this folder that points to the Android SDK and NDK
\`\`\`
ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
sdk.dir=/Users/{username}/Library/Android/sdk
\`\`\`
3. Delete the \`maven\` folder
4. Run \`./gradlew installArchives\`
5. Verify that latest set of generated files is in the maven folder with the correct version number
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/react-native-alice-bobbi.podspec
content:
--------
require \\"json\\"
package = JSON.parse(File.read(File.join(__dir__, \\"package.json\\")))
Pod::Spec.new do |s|
s.name = \\"react-native-alice-bobbi\\"
s.version = package[\\"version\\"]
s.summary = package[\\"description\\"]
s.description = <<-DESC
react-native-alice-bobbi
DESC
s.homepage = \\"https://github.com/github_account/react-native-alice-bobbi\\"
# brief license entry:
s.license = \\"MIT\\"
# optional - use expanded license entry instead:
# s.license = { :type => \\"MIT\\", :file => \\"LICENSE\\" }
s.authors = { \\"Your Name\\" => \\"yourname@email.com\\" }
s.platforms = { :ios => \\"9.0\\" }
s.source = { :git => \\"https://github.com/github_account/react-native-alice-bobbi.git\\", :tag => \\"#{s.version}\\" }
s.source_files = \\"ios/**/*.{h,c,m,swift}\\"
s.requires_arc = true
s.dependency \\"React\\"
# ...
# s.dependency \\"...\\"
end
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.h
content:
--------
#import <React/RCTBridgeModule.h>
@interface AliceBobbi : NSObject <RCTBridgeModule>
@end
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.m
content:
--------
#import \\"AliceBobbi.h\\"
@implementation AliceBobbi
RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback)
{
// TODO: Implement some actually useful functionality
callback(@[[NSString stringWithFormat: @\\"numberArgument: %@ stringArgument: %@\\", numberArgument, stringArgument]]);
}
@end
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.xcworkspace/contents.xcworkspacedata
content:
--------
<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>
<Workspace
version = \\"1.0\\">
<FileRef
location = \\"group:AliceBobbi.xcodeproj\\">
</FileRef>
</Workspace>
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/ios/AliceBobbi.xcodeproj/project.pbxproj
content:
--------
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXCopyFilesBuildPhase section */
58B511D91A9E6C8500147676 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = \\"include/$(PRODUCT_NAME)\\";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libAliceBobbi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAliceBobbi.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
58B511D81A9E6C8500147676 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup;
children = (
134814201AA4EA6300B7C361 /* libAliceBobbi.a */,
);
name = Products;
sourceTree = \\"<group>\\";
};
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
134814211AA4EA7D00B7C361 /* Products */,
);
sourceTree = \\"<group>\\";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
58B511DA1A9E6C8500147676 /* AliceBobbi */ = {
isa = PBXNativeTarget;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \\"AliceBobbi\\" */;
buildPhases = (
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
58B511D91A9E6C8500147676 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = AliceBobbi;
productName = RCTDataManager;
productReference = 134814201AA4EA6300B7C361 /* libAliceBobbi.a */;
productType = \\"com.apple.product-type.library.static\\";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
58B511D31A9E6C8500147676 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
58B511DA1A9E6C8500147676 = {
CreatedOnToolsVersion = 6.1.1;
};
};
};
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \\"AliceBobbi\\" */;
compatibilityVersion = \\"Xcode 3.2\\";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 58B511D21A9E6C8500147676;
productRefGroup = 58B511D21A9E6C8500147676;
projectDirPath = \\"\\";
projectRoot = \\"\\";
targets = (
58B511DA1A9E6C8500147676 /* AliceBobbi */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
58B511D71A9E6C8500147676 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
58B511ED1A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = \\"gnu++0x\\";
CLANG_CXX_LIBRARY = \\"libc++\\";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
\\"DEBUG=1\\",
\\"$(inherited)\\",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = \\"/usr/lib/swift $(inherited)\\";
LIBRARY_SEARCH_PATHS = (
\\"\\\\\\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\\\\\\"\\",
\\"\\\\\\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\\\\\\"\\",
\\"\\\\\\"$(inherited)\\\\\\"\\",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
58B511EE1A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = \\"gnu++0x\\";
CLANG_CXX_LIBRARY = \\"libc++\\";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = \\"/usr/lib/swift $(inherited)\\";
LIBRARY_SEARCH_PATHS = (
\\"\\\\\\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\\\\\\"\\",
\\"\\\\\\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\\\\\\"\\",
\\"\\\\\\"$(inherited)\\\\\\"\\",
);
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
58B511F01A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
\\"$(inherited)\\",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
\\"$(SRCROOT)/../../../React/**\\",
\\"$(SRCROOT)/../../react-native/React/**\\",
);
LIBRARY_SEARCH_PATHS = \\"$(inherited)\\";
OTHER_LDFLAGS = \\"-ObjC\\";
PRODUCT_NAME = AliceBobbi;
SKIP_INSTALL = YES;
};
name = Debug;
};
58B511F11A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
\\"$(inherited)\\",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
\\"$(SRCROOT)/../../../React/**\\",
\\"$(SRCROOT)/../../react-native/React/**\\",
);
LIBRARY_SEARCH_PATHS = \\"$(inherited)\\";
OTHER_LDFLAGS = \\"-ObjC\\";
PRODUCT_NAME = AliceBobbi;
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \\"AliceBobbi\\" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511ED1A9E6C8500147676 /* Debug */,
58B511EE1A9E6C8500147676 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \\"AliceBobbi\\" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511F01A9E6C8500147676 /* Debug */,
58B511F11A9E6C8500147676 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
}
<<<<<<<< ======== >>>>>>>>
",
"* execa.commandSync command: react-native init example --version react-native@latest options: {\\"cwd\\":\\"./react-native-alice-bobbi\\",\\"stdio\\":\\"inherit\\"}
",
"* ensureDir dir: react-native-alice-bobbi/scripts/
",
"* ensureDir dir: react-native-alice-bobbi/example/
",
"* outputFile name: react-native-alice-bobbi/scripts/examples_postinstall.js
content:
--------
#!/usr/bin/env node
/*
* Using libraries within examples and linking them within packages.json like:
* \\"react-native-library-name\\": \\"file:../\\"
* will cause problems with the metro bundler if the example will run via
* \`react-native run-[ios|android]\`. This will result in an error as the metro
* bundler will find multiple versions for the same module while resolving it.
* The reason for that is that if the library is installed it also copies in the
* example folder itself as well as the node_modules folder of the library
* although their are defined in .npmignore and should be ignored in theory.
*
* This postinstall script removes the node_modules folder as well as all
* entries from the libraries .npmignore file within the examples node_modules
* folder after the library was installed. This should resolve the metro
* bundler issue mentioned above.
*
* It is expected this scripts lives in the libraries root folder within a
* scripts folder. As first parameter the relative path to the libraries
* folder within the example's node_modules folder may be provided.
* This script will determine the path from this project's package.json file
* if no such relative path is provided.
* An example's package.json entry could look like:
* \\"postinstall\\": \\"node ../scripts/examples_postinstall.js node_modules/react-native-library-name/\\"
*/
'use strict';
const fs = require('fs');
const path = require('path');
/// Delete all files and directories for the given path
const removeFileDirectoryRecursively = fileDirPath => {
// Remove file
if (!fs.lstatSync(fileDirPath).isDirectory()) {
fs.unlinkSync(fileDirPath);
return;
}
// Go down the directory an remove each file / directory recursively
fs.readdirSync(fileDirPath).forEach(entry => {
const entryPath = path.join(fileDirPath, entry);
removeFileDirectoryRecursively(entryPath);
});
fs.rmdirSync(fileDirPath);
};
/// Remove example/node_modules/react-native-library-name/node_modules directory
const removeLibraryNodeModulesPath = (libraryNodeModulesPath) => {
const nodeModulesPath = path.resolve(libraryNodeModulesPath, 'node_modules')
if (!fs.existsSync(nodeModulesPath)) {
console.log(\`No node_modules path found at \${nodeModulesPath}. Skipping delete.\`)
return;
}
console.log(\`Deleting: \${nodeModulesPath}\`)
try {
removeFileDirectoryRecursively(nodeModulesPath);
console.log(\`Successfully deleted: \${nodeModulesPath}\`)
} catch (err) {
console.log(\`Error deleting \${nodeModulesPath}: \${err.message}\`);
}
};
/// Remove all entries from the .npmignore within example/node_modules/react-native-library-name/
const removeLibraryNpmIgnorePaths = (npmIgnorePath, libraryNodeModulesPath) => {
if (!fs.existsSync(npmIgnorePath)) {
console.log(\`No .npmignore path found at \${npmIgnorePath}. Skipping deleting content.\`);
return;
}
fs.readFileSync(npmIgnorePath, 'utf8').split(/\\\\r?\\\\n/).forEach(entry => {
if (entry.length === 0) {
return
}
const npmIgnoreLibraryNodeModulesEntryPath = path.resolve(libraryNodeModulesPath, entry);
if (!fs.existsSync(npmIgnoreLibraryNodeModulesEntryPath)) {
return;
}
console.log(\`Deleting: \${npmIgnoreLibraryNodeModulesEntryPath}\`)
try {
removeFileDirectoryRecursively(npmIgnoreLibraryNodeModulesEntryPath);
console.log(\`Successfully deleted: \${npmIgnoreLibraryNodeModulesEntryPath}\`)
} catch (err) {
console.log(\`Error deleting \${npmIgnoreLibraryNodeModulesEntryPath}: \${err.message}\`);
}
});
};
// Main start sweeping process
(() => {
// Read out dir of example project
const exampleDir = process.cwd();
console.log(\`Starting postinstall cleanup for \${exampleDir}\`);
// Resolve the React Native library's path within the example's node_modules directory
const libraryNodeModulesPath = process.argv.length > 2
? path.resolve(exampleDir, process.argv[2])
: path.resolve(exampleDir, 'node_modules', require('../package.json').name);
console.log(\`Removing unwanted artifacts for \${libraryNodeModulesPath}\`);
removeLibraryNodeModulesPath(libraryNodeModulesPath);
const npmIgnorePath = path.resolve(__dirname, '../.npmignore');
removeLibraryNpmIgnorePaths(npmIgnorePath, libraryNodeModulesPath);
})();
<<<<<<<< ======== >>>>>>>>
",
"* outputFile name: react-native-alice-bobbi/example/App.js
content:
--------
/**
* Sample React Native App
*
* adapted from App.js generated by the following command:
*
* react-native init example
*
* https://github.com/facebook/react-native
*/
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import AliceBobbi from 'react-native-alice-bobbi';
export default class App extends Component<{}> {
state = {
status: 'starting',
message: '--'
};
componentDidMount() {
AliceBobbi.sampleMethod('Testing', 123, (message) => {
this.setState({
status: 'native callback received',
message
});
});
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>☆AliceBobbi example☆</Text>
<Text style={styles.instructions}>STATUS: {this.state.status}</Text>
<Text style={styles.welcome}>☆NATIVE CALLBACK MESSAGE☆</Text>
<Text style={styles.instructions}>{this.state.message}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
<<<<<<<< ======== >>>>>>>>
",
Object {
"call": "fs.readFileSync",
"jsonFilePath": "./react-native-alice-bobbi/example/package.json",
},
Object {
"call": "fs.writeFileSync",
"filePath": "./react-native-alice-bobbi/example/package.json",
"json": "{
\\"name\\": \\"example\\",
\\"version\\": \\"0.0.1\\",
\\"scripts\\": {
\\"postinstall\\": \\"node ../scripts/examples_postinstall.js\\"
}
}
",
"options": Object {
"fs": Object {
"ensureDir": [Function],
"outputFile": [Function],
"readFileSync": [Function],
"writeFileSync": [Function],
},
"spaces": 2,
},
},
"* execa.commandSync command: yarn add file:../ options: {\\"cwd\\":\\"./react-native-alice-bobbi/example\\",\\"stdio\\":\\"inherit\\"}
",
"* execa.commandSync command: pod --version options: {\\"cwd\\":\\"./react-native-alice-bobbi/example/ios\\",\\"stdio\\":\\"inherit\\"}
",
"* execa.commandSync command: pod install options: {\\"cwd\\":\\"./react-native-alice-bobbi/example/ios\\",\\"stdio\\":\\"inherit\\"}
",
]
`;