@react-native-community/cli-types 5.0.1 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ export interface AndroidProjectConfig {
11
11
  packageName: string;
12
12
  packageFolder: string;
13
13
  appName: string;
14
+ dependencyConfiguration?: string;
14
15
  }
15
16
  export declare type AndroidProjectParams = Partial<AndroidProjectConfig>;
16
17
  export interface AndroidDependencyConfig {
@@ -20,6 +21,7 @@ export interface AndroidDependencyConfig {
20
21
  packageInstance: string;
21
22
  manifestPath: string;
22
23
  packageName: string;
24
+ dependencyConfiguration?: string;
23
25
  buildTypes: string[];
24
26
  }
25
27
  export declare type AndroidDependencyParams = Partial<AndroidDependencyConfig>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../src/android.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,oBAAY,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEjE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,oBAAY,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { IOSProjectConfig, IOSProjectParams, IOSDependencyConfig, IOSDependencyParams, IOSNativeModulesConfig } from './ios';
2
2
  import { AndroidProjectConfig, AndroidProjectParams, AndroidDependencyConfig, AndroidDependencyParams } from './android';
3
- import { Ora } from 'ora';
4
3
  export declare type Prompt = any;
5
4
  export declare type CommandFunction<Args = Object> = (argv: Array<string>, ctx: Config, args: Args) => Promise<void> | void;
6
5
  export declare type OptionValue = string | boolean | number;
@@ -61,83 +60,6 @@ export declare type ProjectConfig = {
61
60
  ios?: IOSProjectConfig;
62
61
  [key: string]: any;
63
62
  };
64
- export declare type NotFound = 'Not Found';
65
- declare type AvailableInformation = {
66
- version: string;
67
- path: string;
68
- };
69
- declare type Information = AvailableInformation | NotFound;
70
- export declare type EnvironmentInfo = {
71
- System: {
72
- OS: string;
73
- CPU: string;
74
- Memory: string;
75
- Shell: AvailableInformation;
76
- };
77
- Binaries: {
78
- Node: AvailableInformation;
79
- Yarn: AvailableInformation;
80
- npm: AvailableInformation;
81
- Watchman: AvailableInformation;
82
- };
83
- SDKs: {
84
- 'iOS SDK': {
85
- Platforms: string[];
86
- };
87
- 'Android SDK': {
88
- 'API Levels': string[] | NotFound;
89
- 'Build Tools': string[] | NotFound;
90
- 'System Images': string[] | NotFound;
91
- 'Android NDK': string | NotFound;
92
- } | NotFound;
93
- };
94
- IDEs: {
95
- 'Android Studio': AvailableInformation | NotFound;
96
- Emacs: AvailableInformation;
97
- Nano: AvailableInformation;
98
- VSCode: AvailableInformation;
99
- Vim: AvailableInformation;
100
- Xcode: AvailableInformation;
101
- };
102
- Languages: {
103
- Java: Information;
104
- };
105
- };
106
- export declare type HealthCheckCategory = {
107
- label: string;
108
- healthchecks: HealthCheckInterface[];
109
- };
110
- export declare type Healthchecks = {
111
- common: HealthCheckCategory;
112
- android: HealthCheckCategory;
113
- ios?: HealthCheckCategory;
114
- };
115
- export declare type RunAutomaticFix = (args: {
116
- loader: Ora;
117
- logManualInstallation: ({ healthcheck, url, command, message, }: {
118
- healthcheck?: string;
119
- url?: string;
120
- command?: string;
121
- message?: string;
122
- }) => void;
123
- environmentInfo: EnvironmentInfo;
124
- }) => Promise<void> | void;
125
- export declare type HealthCheckInterface = {
126
- label: string;
127
- visible?: boolean | void;
128
- isRequired?: boolean;
129
- description?: string;
130
- getDiagnostics: (environmentInfo: EnvironmentInfo) => Promise<{
131
- version?: string;
132
- versions?: [string];
133
- versionRange?: string;
134
- needsToBeFixed: boolean | string;
135
- }>;
136
- win32AutomaticFix?: RunAutomaticFix;
137
- darwinAutomaticFix?: RunAutomaticFix;
138
- linuxAutomaticFix?: RunAutomaticFix;
139
- runAutomaticFix: RunAutomaticFix;
140
- };
141
63
  /**
142
64
  * @property root - Root where the configuration has been resolved from
143
65
  * @property reactNativePath - Path to React Native source
@@ -162,7 +84,7 @@ export interface Config extends IOSNativeModulesConfig {
162
84
  [name: string]: PlatformConfig<any, any, any, any>;
163
85
  };
164
86
  commands: Command[];
165
- healthChecks: HealthCheckCategory[];
87
+ healthChecks: [];
166
88
  }
167
89
  /**
168
90
  * Shares some structure with Config, except that root is calculated and can't
@@ -180,7 +102,7 @@ export declare type UserDependencyConfig = {
180
102
  dependency: Omit<Dependency, 'name' | 'root'>;
181
103
  commands: Command[];
182
104
  platforms: Config['platforms'];
183
- healthChecks: HealthCheckCategory[];
105
+ healthChecks: [];
184
106
  };
185
107
  export { IOSProjectConfig, IOSProjectParams, IOSDependencyConfig, IOSDependencyParams, IOSNativeModulesConfig, };
186
108
  export { AndroidProjectConfig, AndroidProjectParams, AndroidDependencyConfig, AndroidDependencyParams, };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.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,mBAAmB,EACnB,mBAAmB,CACpB,CAAC;QACF,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;KACpD,CAAC;IACF,QAAQ,EAAE,OAAO,EAAE,CAAC;IAEpB,YAAY,EAAE,EAAE,CAAC;CAClB;AAED;;;GAGG;AAEH,oBAAY,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IAC9C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,OAAO,EAAE;QACP,OAAO,CAAC,EAAE,oBAAoB,CAAC;QAC/B,GAAG,CAAC,EAAE,gBAAgB,CAAC;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAEjC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAE9C,QAAQ,EAAE,OAAO,EAAE,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAE/B,YAAY,EAAE,EAAE,CAAC;CAClB,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,CAAC;AAEF,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GACxB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAOA","sourcesContent":["import {\n IOSProjectConfig,\n IOSProjectParams,\n IOSDependencyConfig,\n IOSDependencyParams,\n IOSNativeModulesConfig,\n} from './ios';\nimport {\n AndroidProjectConfig,\n AndroidProjectParams,\n AndroidDependencyConfig,\n AndroidDependencyParams,\n} from './android';\n\nexport type Prompt = any;\n\nexport type CommandFunction<Args = Object> = (\n argv: Array<string>,\n ctx: Config,\n args: Args,\n) => Promise<void> | void;\n\nexport type OptionValue = string | boolean | number;\n\nexport type CommandOption<T = (ctx: Config) => OptionValue> = {\n name: string;\n description?: string;\n parse?: (val: string) => any;\n default?: OptionValue | T;\n};\n\nexport type DetachedCommandFunction<Args = Object> = (\n argv: string[],\n args: Args,\n) => Promise<void> | void;\n\nexport type Command<IsDetached extends boolean = false> = {\n name: string;\n description?: string;\n detached?: IsDetached;\n examples?: Array<{\n desc: string;\n cmd: string;\n }>;\n pkg?: {\n name: string;\n version: string;\n };\n func: IsDetached extends true\n ? DetachedCommandFunction<Object>\n : CommandFunction<Object>;\n options?: Array<\n CommandOption<\n IsDetached extends true ? () => OptionValue : (ctx: Config) => OptionValue\n >\n >;\n};\n\nexport type DetachedCommand = Command<true>;\n\ninterface PlatformConfig<\n ProjectConfig,\n ProjectParams,\n DependencyConfig,\n DependencyParams\n> {\n npmPackageName?: string;\n projectConfig: (\n projectRoot: string,\n projectParams: ProjectParams | void,\n ) => ProjectConfig | void;\n dependencyConfig: (\n dependency: string,\n params: DependencyParams,\n ) => DependencyConfig | void;\n linkConfig: () => {\n isInstalled: (\n projectConfig: ProjectConfig,\n packageName: string,\n dependencyConfig: DependencyConfig,\n ) => boolean;\n register: (\n name: string,\n dependencyConfig: DependencyConfig,\n params: Object,\n projectConfig: ProjectConfig,\n ) => void;\n unregister: (\n name: string,\n dependencyConfig: DependencyConfig,\n projectConfig: ProjectConfig,\n otherDependencies: Array<DependencyConfig>,\n ) => void;\n copyAssets: (assets: string[], projectConfig: ProjectConfig) => void;\n unlinkAssets: (assets: string[], projectConfig: ProjectConfig) => void;\n };\n}\n\nexport interface Dependency {\n name: string;\n root: string;\n platforms: {\n android?: AndroidDependencyConfig | null;\n ios?: IOSDependencyConfig | null;\n [key: string]: any;\n };\n assets: string[];\n hooks: {\n prelink?: string;\n postlink?: string;\n preunlink?: string;\n postunlink?: string;\n };\n params: Prompt[];\n}\n\nexport type ProjectConfig = {\n android?: AndroidProjectConfig;\n ios?: IOSProjectConfig;\n [key: string]: any;\n};\n\n/**\n * @property root - Root where the configuration has been resolved from\n * @property reactNativePath - Path to React Native source\n * @property project - Object that contains configuration for a project (null, when platform not available)\n * @property assets - An array of assets as defined by the user\n * @property dependencies - Map of the dependencies that are present in the project\n * @property platforms - Map of available platforms (build-ins and dynamically loaded)\n * @property commands - An array of commands that are present in 3rd party packages\n * @property healthChecks - An array of health check categories to add to doctor command\n */\nexport interface Config extends IOSNativeModulesConfig {\n root: string;\n reactNativePath: string;\n project: ProjectConfig;\n assets: string[];\n dependencies: {[key: string]: Dependency};\n platforms: {\n android: PlatformConfig<\n AndroidProjectConfig,\n AndroidProjectParams,\n AndroidDependencyConfig,\n AndroidDependencyParams\n >;\n ios: PlatformConfig<\n IOSProjectConfig,\n IOSProjectParams,\n IOSDependencyConfig,\n IOSDependencyParams\n >;\n [name: string]: PlatformConfig<any, any, any, any>;\n };\n commands: Command[];\n // @todo this should be removed: https://github.com/react-native-community/cli/issues/1261\n healthChecks: [];\n}\n\n/**\n * Shares some structure with Config, except that root is calculated and can't\n * be defined\n */\n\nexport type UserConfig = Omit<Config, 'root'> & {\n reactNativePath: string | void;\n // Additional project settings\n project: {\n android?: AndroidProjectParams;\n ios?: IOSProjectParams;\n [key: string]: any;\n };\n};\n\nexport type UserDependencyConfig = {\n // Additional dependency settings\n dependency: Omit<Dependency, 'name' | 'root'>;\n // An array of commands that ship with the dependency\n commands: Command[];\n // An array of extra platforms to load\n platforms: Config['platforms'];\n // Additional health checks\n healthChecks: [];\n};\n\nexport {\n IOSProjectConfig,\n IOSProjectParams,\n IOSDependencyConfig,\n IOSDependencyParams,\n IOSNativeModulesConfig,\n};\n\nexport {\n AndroidProjectConfig,\n AndroidProjectParams,\n AndroidDependencyConfig,\n AndroidDependencyParams,\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AM,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,gBAAgB,GAAG,eAAe,GAAG,KAAK,CAAC;CACjE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE;QACP,GAAG,CAAC,EAAE;YACJ,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,YAAY,EAAE;QACZ,CAAC,IAAI,EAAE,MAAM,GAAG;YACd,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE;gBACT,GAAG,CAAC,EAAE,IAAI,GAAG;oBACX;;;;;;uBAMG;oBACH,WAAW,EAAE,MAAM,CAAC;oBACpB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;iBACtC,CAAC;gBACF,OAAO,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC;aACrB,CAAC;SACH,CAAC;KACH,CAAC;CACH"}
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@react-native-community/cli-types",
3
- "version": "5.0.1",
3
+ "version": "7.0.1",
4
4
  "main": "build",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "dependencies": {
9
- "ora": "^3.4.0"
10
- },
11
8
  "files": [
12
9
  "build",
13
10
  "!*.map"
@@ -19,6 +16,5 @@
19
16
  "type": "git",
20
17
  "url": "https://github.com/react-native-community/cli.git",
21
18
  "directory": "packages/cli-types"
22
- },
23
- "gitHead": "84e9f0ba54a391db43ee30f1da2824845f6c289e"
19
+ }
24
20
  }
package/src/android.ts ADDED
@@ -0,0 +1,30 @@
1
+ export interface AndroidProjectConfig {
2
+ sourceDir: string;
3
+ isFlat: boolean;
4
+ folder: string;
5
+ stringsPath: string;
6
+ manifestPath: string;
7
+ buildGradlePath: string;
8
+ settingsGradlePath: string;
9
+ assetsPath: string;
10
+ mainFilePath: string;
11
+ packageName: string;
12
+ packageFolder: string;
13
+ appName: string;
14
+ dependencyConfiguration?: string;
15
+ }
16
+
17
+ export type AndroidProjectParams = Partial<AndroidProjectConfig>;
18
+
19
+ export interface AndroidDependencyConfig {
20
+ sourceDir: string;
21
+ folder: string;
22
+ packageImportPath: string;
23
+ packageInstance: string;
24
+ manifestPath: string;
25
+ packageName: string;
26
+ dependencyConfiguration?: string;
27
+ buildTypes: string[];
28
+ }
29
+
30
+ export type AndroidDependencyParams = Partial<AndroidDependencyConfig>;
package/src/index.ts ADDED
@@ -0,0 +1,198 @@
1
+ import {
2
+ IOSProjectConfig,
3
+ IOSProjectParams,
4
+ IOSDependencyConfig,
5
+ IOSDependencyParams,
6
+ IOSNativeModulesConfig,
7
+ } from './ios';
8
+ import {
9
+ AndroidProjectConfig,
10
+ AndroidProjectParams,
11
+ AndroidDependencyConfig,
12
+ AndroidDependencyParams,
13
+ } from './android';
14
+
15
+ export type Prompt = any;
16
+
17
+ export type CommandFunction<Args = Object> = (
18
+ argv: Array<string>,
19
+ ctx: Config,
20
+ args: Args,
21
+ ) => Promise<void> | void;
22
+
23
+ export type OptionValue = string | boolean | number;
24
+
25
+ export type CommandOption<T = (ctx: Config) => OptionValue> = {
26
+ name: string;
27
+ description?: string;
28
+ parse?: (val: string) => any;
29
+ default?: OptionValue | T;
30
+ };
31
+
32
+ export type DetachedCommandFunction<Args = Object> = (
33
+ argv: string[],
34
+ args: Args,
35
+ ) => Promise<void> | void;
36
+
37
+ export type Command<IsDetached extends boolean = false> = {
38
+ name: string;
39
+ description?: string;
40
+ detached?: IsDetached;
41
+ examples?: Array<{
42
+ desc: string;
43
+ cmd: string;
44
+ }>;
45
+ pkg?: {
46
+ name: string;
47
+ version: string;
48
+ };
49
+ func: IsDetached extends true
50
+ ? DetachedCommandFunction<Object>
51
+ : CommandFunction<Object>;
52
+ options?: Array<
53
+ CommandOption<
54
+ IsDetached extends true ? () => OptionValue : (ctx: Config) => OptionValue
55
+ >
56
+ >;
57
+ };
58
+
59
+ export type DetachedCommand = Command<true>;
60
+
61
+ interface PlatformConfig<
62
+ ProjectConfig,
63
+ ProjectParams,
64
+ DependencyConfig,
65
+ DependencyParams
66
+ > {
67
+ npmPackageName?: string;
68
+ projectConfig: (
69
+ projectRoot: string,
70
+ projectParams: ProjectParams | void,
71
+ ) => ProjectConfig | void;
72
+ dependencyConfig: (
73
+ dependency: string,
74
+ params: DependencyParams,
75
+ ) => DependencyConfig | void;
76
+ linkConfig: () => {
77
+ isInstalled: (
78
+ projectConfig: ProjectConfig,
79
+ packageName: string,
80
+ dependencyConfig: DependencyConfig,
81
+ ) => boolean;
82
+ register: (
83
+ name: string,
84
+ dependencyConfig: DependencyConfig,
85
+ params: Object,
86
+ projectConfig: ProjectConfig,
87
+ ) => void;
88
+ unregister: (
89
+ name: string,
90
+ dependencyConfig: DependencyConfig,
91
+ projectConfig: ProjectConfig,
92
+ otherDependencies: Array<DependencyConfig>,
93
+ ) => void;
94
+ copyAssets: (assets: string[], projectConfig: ProjectConfig) => void;
95
+ unlinkAssets: (assets: string[], projectConfig: ProjectConfig) => void;
96
+ };
97
+ }
98
+
99
+ export interface Dependency {
100
+ name: string;
101
+ root: string;
102
+ platforms: {
103
+ android?: AndroidDependencyConfig | null;
104
+ ios?: IOSDependencyConfig | null;
105
+ [key: string]: any;
106
+ };
107
+ assets: string[];
108
+ hooks: {
109
+ prelink?: string;
110
+ postlink?: string;
111
+ preunlink?: string;
112
+ postunlink?: string;
113
+ };
114
+ params: Prompt[];
115
+ }
116
+
117
+ export type ProjectConfig = {
118
+ android?: AndroidProjectConfig;
119
+ ios?: IOSProjectConfig;
120
+ [key: string]: any;
121
+ };
122
+
123
+ /**
124
+ * @property root - Root where the configuration has been resolved from
125
+ * @property reactNativePath - Path to React Native source
126
+ * @property project - Object that contains configuration for a project (null, when platform not available)
127
+ * @property assets - An array of assets as defined by the user
128
+ * @property dependencies - Map of the dependencies that are present in the project
129
+ * @property platforms - Map of available platforms (build-ins and dynamically loaded)
130
+ * @property commands - An array of commands that are present in 3rd party packages
131
+ * @property healthChecks - An array of health check categories to add to doctor command
132
+ */
133
+ export interface Config extends IOSNativeModulesConfig {
134
+ root: string;
135
+ reactNativePath: string;
136
+ project: ProjectConfig;
137
+ assets: string[];
138
+ dependencies: {[key: string]: Dependency};
139
+ platforms: {
140
+ android: PlatformConfig<
141
+ AndroidProjectConfig,
142
+ AndroidProjectParams,
143
+ AndroidDependencyConfig,
144
+ AndroidDependencyParams
145
+ >;
146
+ ios: PlatformConfig<
147
+ IOSProjectConfig,
148
+ IOSProjectParams,
149
+ IOSDependencyConfig,
150
+ IOSDependencyParams
151
+ >;
152
+ [name: string]: PlatformConfig<any, any, any, any>;
153
+ };
154
+ commands: Command[];
155
+ // @todo this should be removed: https://github.com/react-native-community/cli/issues/1261
156
+ healthChecks: [];
157
+ }
158
+
159
+ /**
160
+ * Shares some structure with Config, except that root is calculated and can't
161
+ * be defined
162
+ */
163
+
164
+ export type UserConfig = Omit<Config, 'root'> & {
165
+ reactNativePath: string | void;
166
+ // Additional project settings
167
+ project: {
168
+ android?: AndroidProjectParams;
169
+ ios?: IOSProjectParams;
170
+ [key: string]: any;
171
+ };
172
+ };
173
+
174
+ export type UserDependencyConfig = {
175
+ // Additional dependency settings
176
+ dependency: Omit<Dependency, 'name' | 'root'>;
177
+ // An array of commands that ship with the dependency
178
+ commands: Command[];
179
+ // An array of extra platforms to load
180
+ platforms: Config['platforms'];
181
+ // Additional health checks
182
+ healthChecks: [];
183
+ };
184
+
185
+ export {
186
+ IOSProjectConfig,
187
+ IOSProjectParams,
188
+ IOSDependencyConfig,
189
+ IOSDependencyParams,
190
+ IOSNativeModulesConfig,
191
+ };
192
+
193
+ export {
194
+ AndroidProjectConfig,
195
+ AndroidProjectParams,
196
+ AndroidDependencyConfig,
197
+ AndroidDependencyParams,
198
+ };
package/src/ios.ts ADDED
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Settings that user can define in the project configuration for iOS.
3
+ * Same for dependency - we share the type.
4
+ *
5
+ * See UserDependencyConfigT and UserConfigT for details
6
+ */
7
+ export interface IOSProjectParams {
8
+ project?: string;
9
+ /**
10
+ * @deprecated A podspec should always be at the root of a package and
11
+ * have the name of the package. This property will be
12
+ * removed in a future major version.
13
+ *
14
+ * @todo Log a warning when this is used.
15
+ */
16
+ podspecPath?: string;
17
+ sharedLibraries?: string[];
18
+ libraryFolder?: string;
19
+ plist: Array<any>;
20
+ scriptPhases?: Array<any>;
21
+ }
22
+
23
+ export interface IOSDependencyParams extends IOSProjectParams {
24
+ configurations?: string[];
25
+ }
26
+
27
+ // The following types are used in untyped-parts of the codebase, so I am leaving them
28
+ // until we actually need them.
29
+ export interface IOSProjectConfig {
30
+ sourceDir: string;
31
+ folder: string;
32
+ pbxprojPath: string;
33
+ podfile: string;
34
+ podspecPath: string;
35
+ projectPath: string;
36
+ projectName: string;
37
+ libraryFolder: string;
38
+ sharedLibraries: Array<any>;
39
+ plist: Array<any>;
40
+ }
41
+
42
+ export interface IOSDependencyConfig extends IOSProjectConfig {
43
+ configurations: string[];
44
+ }
45
+
46
+ /**
47
+ * @see https://www.rubydoc.info/gems/cocoapods-core/Pod/Podfile/DSL#script_phase-instance_method
48
+ *
49
+ * The only difference is that `script` may be omitted in favour of a
50
+ * `path`, relative to the root of the package, whose content will be
51
+ * used.
52
+ */
53
+ export type IOSScriptPhase = ({script: string} | {path: string}) & {
54
+ name: string;
55
+ shell_path?: string;
56
+ input_files?: string[];
57
+ output_files?: string[];
58
+ input_file_lists?: string[];
59
+ output_file_lists?: string[];
60
+ show_env_vars_in_log?: boolean;
61
+ dependency_file?: string;
62
+ execution_position?: 'before_compile' | 'after_compile' | 'any';
63
+ };
64
+
65
+ /**
66
+ * This describes the data that is expected by `native_modules.rb`. It is only
67
+ * meant to ensure the `Config` interface follows exactly what is needed, so
68
+ * only make changes to this interface (or `IOSScriptPhase`) if the data
69
+ * requirements of `native_modules.rb` change.
70
+ */
71
+ export interface IOSNativeModulesConfig {
72
+ reactNativePath: string;
73
+ project: {
74
+ ios?: {
75
+ sourceDir: string;
76
+ };
77
+ };
78
+ dependencies: {
79
+ [name: string]: {
80
+ root: string;
81
+ platforms: {
82
+ ios?: null | {
83
+ /**
84
+ * @deprecated A podspec should always be at the root of a package and
85
+ * have the name of the package. This property will be
86
+ * removed in a future major version.
87
+ *
88
+ * @todo Log a warning when this is used.
89
+ */
90
+ podspecPath: string;
91
+ scriptPhases?: Array<IOSScriptPhase>;
92
+ };
93
+ android?: null | {};
94
+ };
95
+ };
96
+ };
97
+ }
@@ -0,0 +1,66 @@
1
+ // https://github.com/antelle/node-stream-zip/issues/36#issuecomment-596249657
2
+ declare module 'node-stream-zip' {
3
+ import {Stream} from 'stream';
4
+
5
+ interface StreamZipOptions {
6
+ /**
7
+ * File to read
8
+ */
9
+ file: string;
10
+ /**
11
+ * You will be able to work with entries inside zip archive, otherwise the only way to access them is entry event
12
+ *
13
+ * default: true
14
+ */
15
+ storeEntries?: boolean;
16
+ /**
17
+ * By default, entry name is checked for malicious characters, like ../ or c:\123, pass this flag to disable validation errors
18
+ *
19
+ * default: false
20
+ */
21
+ skipEntryNameValidation?: boolean;
22
+ /**
23
+ * Undocumented adjustment of chunk size
24
+ *
25
+ * default: automatic
26
+ */
27
+ chunkSize?: number;
28
+ }
29
+
30
+ class ZipEntry {
31
+ name: string;
32
+ isDirectory: boolean;
33
+ isFile: boolean;
34
+ comment: string;
35
+ size: number;
36
+ }
37
+
38
+ class StreamZip {
39
+ constructor(config: StreamZipOptions);
40
+
41
+ on(event: 'ready', handler: () => void): void;
42
+
43
+ entry(entry: string): ZipEntry;
44
+ entries(): ZipEntry[];
45
+
46
+ entriesCount: number;
47
+
48
+ stream(
49
+ entry: string,
50
+ callback: (err: any | null, stream?: Stream) => void,
51
+ ): void;
52
+ entryDataSync(entry: string): Buffer;
53
+ openEntry(
54
+ entry: string,
55
+ callback: (err: any | null, entry?: ZipEntry) => void,
56
+ sync: boolean,
57
+ ): void;
58
+ extract(
59
+ entry: string | null,
60
+ outPath: string,
61
+ callback: (err?: any) => void,
62
+ ): void;
63
+ close(callback?: (err?: any) => void): void;
64
+ }
65
+ export = StreamZip;
66
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "build"
6
+ }
7
+ }