bundo-appgen 0.0.1-beta.7

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.
Files changed (171) hide show
  1. package/README.md +253 -0
  2. package/bin.mjs +21 -0
  3. package/lib/bin/bin.mjs +1141 -0
  4. package/lib/bin/plugin-sandbox-runner.mjs +105 -0
  5. package/lib/commonjs/index.js +125 -0
  6. package/lib/module/chunk-bhc5nymd.js +12 -0
  7. package/lib/module/chunk-dvyy3g4j.js +25 -0
  8. package/lib/module/chunk-ynqw05p0.js +70 -0
  9. package/lib/module/config/apple/create-osx-appiconset.js +6 -0
  10. package/lib/module/config/apple/index.js +7 -0
  11. package/lib/module/config/index.js +8 -0
  12. package/lib/module/index.js +8 -0
  13. package/lib/typescript/config/apple/asset-catalog-format/app-icon/index.d.ts +3 -0
  14. package/lib/typescript/config/apple/asset-catalog-format/app-icon/index.d.ts.map +1 -0
  15. package/lib/typescript/config/apple/asset-catalog-format/app-icon/set-type.d.ts +42 -0
  16. package/lib/typescript/config/apple/asset-catalog-format/app-icon/set-type.d.ts.map +1 -0
  17. package/lib/typescript/config/apple/asset-catalog-format/app-icon/size.d.ts +21 -0
  18. package/lib/typescript/config/apple/asset-catalog-format/app-icon/size.d.ts.map +1 -0
  19. package/lib/typescript/config/apple/asset-catalog-format/appearances.d.ts +13 -0
  20. package/lib/typescript/config/apple/asset-catalog-format/appearances.d.ts.map +1 -0
  21. package/lib/typescript/config/apple/asset-catalog-format/idiom.d.ts +5 -0
  22. package/lib/typescript/config/apple/asset-catalog-format/idiom.d.ts.map +1 -0
  23. package/lib/typescript/config/apple/asset-catalog-format/image/color-space.d.ts +2 -0
  24. package/lib/typescript/config/apple/asset-catalog-format/image/color-space.d.ts.map +1 -0
  25. package/lib/typescript/config/apple/asset-catalog-format/image/compression-type.d.ts +2 -0
  26. package/lib/typescript/config/apple/asset-catalog-format/image/compression-type.d.ts.map +1 -0
  27. package/lib/typescript/config/apple/asset-catalog-format/image/display-gamut.d.ts +2 -0
  28. package/lib/typescript/config/apple/asset-catalog-format/image/display-gamut.d.ts.map +1 -0
  29. package/lib/typescript/config/apple/asset-catalog-format/image/index.d.ts +6 -0
  30. package/lib/typescript/config/apple/asset-catalog-format/image/index.d.ts.map +1 -0
  31. package/lib/typescript/config/apple/asset-catalog-format/image/language-direction.d.ts +2 -0
  32. package/lib/typescript/config/apple/asset-catalog-format/image/language-direction.d.ts.map +1 -0
  33. package/lib/typescript/config/apple/asset-catalog-format/image/scale.d.ts +9 -0
  34. package/lib/typescript/config/apple/asset-catalog-format/image/scale.d.ts.map +1 -0
  35. package/lib/typescript/config/apple/asset-catalog-format/image/set-type.d.ts +58 -0
  36. package/lib/typescript/config/apple/asset-catalog-format/image/set-type.d.ts.map +1 -0
  37. package/lib/typescript/config/apple/asset-catalog-format/index.d.ts +5 -0
  38. package/lib/typescript/config/apple/asset-catalog-format/index.d.ts.map +1 -0
  39. package/lib/typescript/config/apple/asset-catalogs-namespaced.d.ts +5 -0
  40. package/lib/typescript/config/apple/asset-catalogs-namespaced.d.ts.map +1 -0
  41. package/lib/typescript/config/apple/asset-catalogs.d.ts +73 -0
  42. package/lib/typescript/config/apple/asset-catalogs.d.ts.map +1 -0
  43. package/lib/typescript/config/apple/create-osx-appiconset.d.mts +72 -0
  44. package/lib/typescript/config/apple/create-osx-appiconset.d.mts.map +1 -0
  45. package/lib/typescript/config/apple/data.d.ts +103 -0
  46. package/lib/typescript/config/apple/data.d.ts.map +1 -0
  47. package/lib/typescript/config/apple/index.d.mts +8 -0
  48. package/lib/typescript/config/apple/index.d.mts.map +1 -0
  49. package/lib/typescript/config/apple/info-plist-value.d.ts +8 -0
  50. package/lib/typescript/config/apple/info-plist-value.d.ts.map +1 -0
  51. package/lib/typescript/config/apple/info-plist.d.ts +4 -0
  52. package/lib/typescript/config/apple/info-plist.d.ts.map +1 -0
  53. package/lib/typescript/config/apple/string-catalog.d.ts +2 -0
  54. package/lib/typescript/config/apple/string-catalog.d.ts.map +1 -0
  55. package/lib/typescript/config/data.d.ts +50 -0
  56. package/lib/typescript/config/data.d.ts.map +1 -0
  57. package/lib/typescript/config/index.d.mts +5 -0
  58. package/lib/typescript/config/index.d.mts.map +1 -0
  59. package/lib/typescript/config/plugin-item.d.ts +2 -0
  60. package/lib/typescript/config/plugin-item.d.ts.map +1 -0
  61. package/lib/typescript/config/plugin-registry.d.ts +3 -0
  62. package/lib/typescript/config/plugin-registry.d.ts.map +1 -0
  63. package/lib/typescript/index.d.mts +3 -0
  64. package/lib/typescript/index.d.mts.map +1 -0
  65. package/lib/typescript/plugin/apple/context.d.ts +28 -0
  66. package/lib/typescript/plugin/apple/context.d.ts.map +1 -0
  67. package/lib/typescript/plugin/apple/files.d.ts +7 -0
  68. package/lib/typescript/plugin/apple/files.d.ts.map +1 -0
  69. package/lib/typescript/plugin/apple/index.d.ts +6 -0
  70. package/lib/typescript/plugin/apple/index.d.ts.map +1 -0
  71. package/lib/typescript/plugin/apple/pod-spec-source-from-cocoapods.d.ts +5 -0
  72. package/lib/typescript/plugin/apple/pod-spec-source-from-cocoapods.d.ts.map +1 -0
  73. package/lib/typescript/plugin/apple/pod-spec-source-from-git.d.ts +11 -0
  74. package/lib/typescript/plugin/apple/pod-spec-source-from-git.d.ts.map +1 -0
  75. package/lib/typescript/plugin/apple/pod-spec-source-from-local.d.ts +7 -0
  76. package/lib/typescript/plugin/apple/pod-spec-source-from-local.d.ts.map +1 -0
  77. package/lib/typescript/plugin/context.d.ts +9 -0
  78. package/lib/typescript/plugin/context.d.ts.map +1 -0
  79. package/lib/typescript/plugin/index.d.ts +3 -0
  80. package/lib/typescript/plugin/index.d.ts.map +1 -0
  81. package/package.json +49 -0
  82. package/src/_bin/_global-vars/_global-vars.mts +47 -0
  83. package/src/_bin/_global-vars/index.mts +30 -0
  84. package/src/_bin/_main/_check-config-validity.mts +94 -0
  85. package/src/_bin/_main/_evaluate-plugin-registry.mts +181 -0
  86. package/src/_bin/_main/_exec-plugin-runner/_spawn-plugin-sandbox-runner.mts +149 -0
  87. package/src/_bin/_main/_exec-plugin-runner/exec-plugin-runner.mts +92 -0
  88. package/src/_bin/_main/_exec-plugin-runner/index.mts +1 -0
  89. package/src/_bin/_main/_get-config.mts +64 -0
  90. package/src/_bin/_main/_helpers/config/get-name.mts +24 -0
  91. package/src/_bin/_main/_helpers/config/get-project-name.mts +27 -0
  92. package/src/_bin/_main/_helpers/config/index.mts +2 -0
  93. package/src/_bin/_main/_helpers/index.mts +2 -0
  94. package/src/_bin/_main/_helpers/platform/compatibility-error.mts +7 -0
  95. package/src/_bin/_main/_helpers/platform/data.ts +9 -0
  96. package/src/_bin/_main/_helpers/platform/get-data.mts +48 -0
  97. package/src/_bin/_main/_helpers/platform/index.mts +4 -0
  98. package/src/_bin/_main/_helpers/platform/is-compatible.mts +30 -0
  99. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_init-appiconsets.mts +223 -0
  100. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_init-imagesets.mts +241 -0
  101. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/appearances.mts +24 -0
  102. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/idiom.mts +22 -0
  103. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/compression-type.mts +15 -0
  104. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/display-gamut.mts +12 -0
  105. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/index.mts +3 -0
  106. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/language-direction.mts +12 -0
  107. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/index.mts +3 -0
  108. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/create-asset-catalogs.mts +54 -0
  109. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/index.mts +1 -0
  110. package/src/_bin/_main/_init-template/_init-apple/_create-string-catalogs/create-string-catalog.mts +134 -0
  111. package/src/_bin/_main/_init-template/_init-apple/_create-string-catalogs/index.mts +1 -0
  112. package/src/_bin/_main/_init-template/_init-apple/_mod-files/_app-delegate-swift.mts +62 -0
  113. package/src/_bin/_main/_init-template/_init-apple/_mod-files/_podfile.mts +31 -0
  114. package/src/_bin/_main/_init-template/_init-apple/_mod-files/index.mts +1 -0
  115. package/src/_bin/_main/_init-template/_init-apple/_mod-files/mod-files.mts +17 -0
  116. package/src/_bin/_main/_init-template/_init-apple/index.mts +1 -0
  117. package/src/_bin/_main/_init-template/_init-apple/init-apple.mts +81 -0
  118. package/src/_bin/_main/_init-template/index.mts +1 -0
  119. package/src/_bin/_main/_init-template/init-template.mts +39 -0
  120. package/src/_bin/_main/_mod-plugin/index.mts +1 -0
  121. package/src/_bin/_main/_mod-plugin/mod-plugin.mts +77 -0
  122. package/src/_bin/_main/_xcodegen/_create-project-spec/_init-resources.mts +86 -0
  123. package/src/_bin/_main/_xcodegen/_create-project-spec/create-project-spec.mts +216 -0
  124. package/src/_bin/_main/_xcodegen/_create-project-spec/index.mts +1 -0
  125. package/src/_bin/_main/_xcodegen/_mod-known-regions/index.ts +1 -0
  126. package/src/_bin/_main/_xcodegen/_mod-known-regions/mod-known-regions.mts +52 -0
  127. package/src/_bin/_main/_xcodegen/index.mts +1 -0
  128. package/src/_bin/_main/_xcodegen/xcodegen.mts +46 -0
  129. package/src/_bin/_main/index.mts +1 -0
  130. package/src/_bin/_main/main.mts +160 -0
  131. package/src/_bin/bin.mts +68 -0
  132. package/src/_bin/plugin-sandbox-runner/_exec-plugins.mts +135 -0
  133. package/src/_bin/plugin-sandbox-runner/argv-json.ts +20 -0
  134. package/src/_bin/plugin-sandbox-runner/evaluated-plugin-registry.ts +12 -0
  135. package/src/_bin/plugin-sandbox-runner/index.ts +3 -0
  136. package/src/_bin/plugin-sandbox-runner/plugin-runner-context-result.ts +33 -0
  137. package/src/_bin/plugin-sandbox-runner/plugin-sandbox-runner.mts +68 -0
  138. package/src/config/apple/asset-catalog-format/app-icon/index.ts +2 -0
  139. package/src/config/apple/asset-catalog-format/app-icon/set-type.ts +59 -0
  140. package/src/config/apple/asset-catalog-format/app-icon/size.ts +37 -0
  141. package/src/config/apple/asset-catalog-format/appearances.ts +10 -0
  142. package/src/config/apple/asset-catalog-format/idiom.ts +16 -0
  143. package/src/config/apple/asset-catalog-format/image/color-space.ts +3 -0
  144. package/src/config/apple/asset-catalog-format/image/compression-type.ts +6 -0
  145. package/src/config/apple/asset-catalog-format/image/display-gamut.ts +3 -0
  146. package/src/config/apple/asset-catalog-format/image/index.ts +6 -0
  147. package/src/config/apple/asset-catalog-format/image/language-direction.ts +3 -0
  148. package/src/config/apple/asset-catalog-format/image/scale.ts +11 -0
  149. package/src/config/apple/asset-catalog-format/image/set-type.ts +85 -0
  150. package/src/config/apple/asset-catalog-format/index.ts +4 -0
  151. package/src/config/apple/asset-catalogs-namespaced.ts +13 -0
  152. package/src/config/apple/asset-catalogs.ts +76 -0
  153. package/src/config/apple/create-osx-appiconset.mts +135 -0
  154. package/src/config/apple/data.ts +123 -0
  155. package/src/config/apple/index.mts +7 -0
  156. package/src/config/apple/info-plist-value.ts +16 -0
  157. package/src/config/apple/info-plist.ts +6 -0
  158. package/src/config/apple/string-catalog.ts +0 -0
  159. package/src/config/data.ts +59 -0
  160. package/src/config/index.mts +4 -0
  161. package/src/config/plugin-item.ts +4 -0
  162. package/src/config/plugin-registry.ts +5 -0
  163. package/src/index.mts +2 -0
  164. package/src/plugin/apple/context.ts +68 -0
  165. package/src/plugin/apple/files.ts +14 -0
  166. package/src/plugin/apple/index.ts +5 -0
  167. package/src/plugin/apple/pod-spec-source-from-cocoapods.ts +9 -0
  168. package/src/plugin/apple/pod-spec-source-from-git.ts +13 -0
  169. package/src/plugin/apple/pod-spec-source-from-local.ts +6 -0
  170. package/src/plugin/context.ts +12 -0
  171. package/src/plugin/index.ts +2 -0
@@ -0,0 +1,123 @@
1
+ import type {
2
+ AssetCatalogs,
3
+ } from "./asset-catalogs"
4
+
5
+ import type {
6
+ AssetCatalogsNamespaced,
7
+ } from "./asset-catalogs-namespaced"
8
+
9
+ import type {
10
+ InfoPlist,
11
+ } from "./info-plist"
12
+
13
+ export interface Data {
14
+
15
+ /**
16
+ * Use one name of `appiconsets` in Asset Catalogs as the app icon.
17
+ * appgen script will throw an error if the name given is not found in the catalog.
18
+ */
19
+ appicon?: string,
20
+
21
+ /**
22
+ * Put compatible files as Asset Catalogs in Apple app.
23
+ *
24
+ * Unknown properties will be considered as namespace.
25
+ *
26
+ * @see https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/AssetTypes.html
27
+ */
28
+ assetCatalogs?: AssetCatalogs | AssetCatalogsNamespaced,
29
+
30
+ /**
31
+ * Build number for your Apple standalone app. Corresponds to `CFBundleVersion` and must match Apple's [specified format](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion).
32
+ */
33
+ buildVersion: string,
34
+
35
+ bundleIdentifier: string,
36
+
37
+ /**
38
+ * Customize the information property list values for your app.
39
+ *
40
+ * For human readable information property list, you can localize the information property through string catalog. See {@link stringCatalogs|`stringCatalogs`}
41
+ */
42
+ infoPlist?: InfoPlist,
43
+
44
+ /**
45
+ * Provide array of [language identifier](https://developer.apple.com/documentation/xcode/choosing-localization-regions-and-scripts), made up of a [2-letter language code](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) of your desired language, with an optional region code (for example, en-US or en-GB).
46
+ *
47
+ * The first locale in the array will take it as the default language for your app. If there is no locales provided, "en" locale will be used.
48
+ */
49
+ locales?: string[],
50
+
51
+ /**
52
+ * Apple app minimum deployment.
53
+ * @default "15.6"
54
+ */
55
+ minimumDeployment?: string,
56
+
57
+ /**
58
+ * The name of your app as it appears on your home screen as a standalone app.
59
+ * It will overrides `name` property in the common config.
60
+ *
61
+ * This name will be used also for project name in Xcode with removed spaces and special characters.
62
+ */
63
+ name?: string,
64
+
65
+ /**
66
+ * Add files to the native bundle resources directory, e.g. "/Applications/Hello World.app/Contents/Resources".
67
+ * This property expects an array of string, which the string represent as the path, and it can be pointing to a specific file or a directory.
68
+ *
69
+ * For example, "../node_modules/foo-bar-module/xyz/abc" will copy the "abc" including its files if it is directory. Your app will has "abc" under bundle resources directory, e.g. "/Applications/Hello World.app/Contents/Resources/abc".
70
+ *
71
+ * For another real example, you can copy your font files in the bundle resources, and use in your React Native macOS app.
72
+ *
73
+ * ```ts
74
+ * import type { Config } from "bundo.rn/appgen"
75
+ *
76
+ * export default {
77
+ *
78
+ * resources: ["./path/to/your/font-files"],
79
+ *
80
+ * infoPlist: {
81
+ * ATSApplicationFontsPath: "font-files/"
82
+ * },
83
+ *
84
+ * } satisfies Config.Data
85
+ * ```
86
+ */
87
+ resources?: string[],
88
+
89
+ /**
90
+ * Create string catalog in your app for localizable string. This is useful if you want to localize your information property list of your app.
91
+ *
92
+ * For example, to localize your app display name, you can provide a `InfoPlist` string catalog, with `CFBundleDisplayName` object and its key-value for each locale
93
+ * ```ts
94
+ * import type { Config } from "bundo.rn/appgen"
95
+ *
96
+ * export default {
97
+ * locales: ["en", "de"],
98
+ *
99
+ * stringCatalogs: {
100
+ * InfoPlist: {
101
+ * CFBundleDisplayName: {
102
+ * en: "Hello World",
103
+ * de: "Hallo Welt"
104
+ * },
105
+ * },
106
+ * },
107
+ * } satisfies Config.Data
108
+ * ```
109
+ */
110
+ stringCatalogs?: {
111
+ [CatalogName in string]: {
112
+ [Key in string]: {
113
+ [Locale in string]: string
114
+ }
115
+ }
116
+ },
117
+
118
+ /**
119
+ * This corresponds to `CFBundleShortVersionString`, The required format can be found [here](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring)
120
+ */
121
+ version: string,
122
+
123
+ }
@@ -0,0 +1,7 @@
1
+ export type * as AssetCatalogFormat from "./asset-catalog-format/index.ts"
2
+ export type * from "./asset-catalogs.ts"
3
+ export type * from "./asset-catalogs-namespaced.ts"
4
+ export * from "./create-osx-appiconset.mts"
5
+ export type * from "./data.ts"
6
+ export type * from "./info-plist.ts"
7
+ export type * from "./info-plist-value.ts"
@@ -0,0 +1,16 @@
1
+ export type InfoPlistValue =
2
+ | boolean
3
+ | string
4
+ | string[]
5
+ | DictionaryValue
6
+
7
+ type DictionaryValue = {
8
+ [Key in string]:
9
+ | boolean
10
+ | string
11
+ | string[]
12
+ | DictionaryValue
13
+ | {
14
+ [Key2 in string]: DictionaryValue
15
+ }[]
16
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ InfoPlistValue,
3
+ } from "./info-plist-value"
4
+
5
+ export interface InfoPlist extends Record<string, InfoPlistValue> {
6
+ }
File without changes
@@ -0,0 +1,59 @@
1
+ import type * as Apple from "./apple/index.mts"
2
+
3
+ import type {
4
+ PluginRegistry,
5
+ } from "./plugin-registry"
6
+
7
+ export interface Data {
8
+
9
+ /**
10
+ * Please, only register a plugin in this field if you are really trust the plugin will not doing anything suspicious.
11
+ *
12
+ * Plugin in this registry is **letting a plugin to run its function in less restrictive way**, and run after all the restrictive plugins has finished.
13
+ *
14
+ * In this field, we let plugins run their functions in with these listed permissions
15
+ *
16
+ * - File System : Read and/or write access to these directories:
17
+ * - _rw_ : &lt;project&gt;/macos
18
+ * - _rw_ : &lt;project&gt;/windows
19
+ * - _r_ : node_modules directory lookup relatively from your project and global modules
20
+ * - _r_ : Its own plugin directory
21
+ * - Networking : HTTP request such as `fetch`.
22
+ *
23
+ * A plugin can modify some provided template files such as `AppDelegate.swift` without asking your permission.
24
+ * It is strongly recommended to check or audit your generated native project.
25
+ *
26
+ * Read {@link https://nodejs.org/api/permissions.html|Node.js Permission Model} for more informations.
27
+ */
28
+ lessRestrictivePlugins?: PluginRegistry,
29
+
30
+ /**
31
+ * The name of your app as it appears on user screen as a standalone app. This value can be overriden in the platform specific config property if some cases the app name is different each platform.
32
+ *
33
+ * This name will be used also for project name in Xcode and Visual Studio with removed spaces and special characters.
34
+ */
35
+ name?: string,
36
+
37
+ macos?: Apple.Data,
38
+
39
+ /**
40
+ * Register a plugin for letting the plugin to customize your generated native project, such as adding assets, modifying native code, and other advanced configurations.
41
+ *
42
+ * Plugins in this registry will only allow plugins to run their function in restrictive way. A plugin cannot perform a non restricted action such as File System, Networking, Child Process, and other actions in Node.js. See {@link https://nodejs.org/api/permissions.html|Node.js Permission Model}.
43
+ *
44
+ * In this field, we let plugins run their functions in with these listed permissions
45
+ *
46
+ * - File System - Read only access to these directories and/or files
47
+ * - &lt;project&gt;/macos/HelloWorld/AppDelegate.swift
48
+ * - &lt;project&gt;/macos/Podfile
49
+ * - node_modules directory lookup relatively from your project and global modules
50
+ * - Its own plugin directory
51
+ *
52
+ * A plugin still can modify some provided template files such as `AppDelegate.swift` without asking your permission.
53
+ * It is recommended to check or audit your generated native project.
54
+ */
55
+ plugins?: PluginRegistry,
56
+
57
+ windows?: unknown, // TODO
58
+
59
+ }
@@ -0,0 +1,4 @@
1
+ export * as Apple from "./apple/index.mts"
2
+ export type * from "./data.ts"
3
+ export type * from "./plugin-item.ts"
4
+ export type * from "./plugin-registry.ts"
@@ -0,0 +1,4 @@
1
+ export type PluginItem =
2
+ | string
3
+ | [string]
4
+ | [string, Record<string, unknown>]
@@ -0,0 +1,5 @@
1
+ import type {
2
+ PluginItem,
3
+ } from "./plugin-item"
4
+
5
+ export type PluginRegistry = PluginItem[]
package/src/index.mts ADDED
@@ -0,0 +1,2 @@
1
+ export * as Config from "./config/index.mts"
2
+ export type * as Plugin from "./plugin/index.ts"
@@ -0,0 +1,68 @@
1
+ import type * as Config from "../../config/index.mts"
2
+
3
+ import type {
4
+ Files,
5
+ } from "./files"
6
+
7
+ // import type {
8
+ // PodSpecSourceFromCocoapods,
9
+ // } from "./pod-spec-source-from-cocoapods"
10
+
11
+ // import type {
12
+ // PodSpecSourceFromGit,
13
+ // } from "./pod-spec-source-from-git"
14
+
15
+ // import type {
16
+ // PodSpecSourceFromLocal,
17
+ // } from "./pod-spec-source-from-local"
18
+
19
+ export interface Context {
20
+
21
+ // /**
22
+ // * @deprecated
23
+ // * It will be replaced by Swift Package Manager in the future.
24
+ // * We need to wait until React Native and React Native macOS support Swift Package Manager completely.
25
+ // *
26
+ // * @see https://guides.cocoapods.org/using/the-podfile.html
27
+ // */
28
+ // readonly Podfile: {
29
+ // /**
30
+ // * Add a Pod for client application.
31
+ // *
32
+ // * The Pod array is initially an empty array, but incrementally added and overwritten by other plugins.
33
+ // */
34
+ // readonly pod: {
35
+ // name: string,
36
+ // source:
37
+ // | PodSpecSourceFromCocoapods
38
+ // | PodSpecSourceFromGit
39
+ // | PodSpecSourceFromLocal
40
+ // }[],
41
+ // },
42
+
43
+ /**
44
+ * Read and modify the templated files in raw source text.
45
+ *
46
+ * The initial source text will be the client app files.
47
+ * If the `appgen` run for the first time or clean run, the source text will be the `bundo-appgen` templates files.
48
+ *
49
+ * The source text is incrementally modified by client, other plugins, and yours.
50
+ * Be careful about modifying the source text file.
51
+ *
52
+ * See the directory `bundo-appgen/templates` in the node_modules
53
+ * or in our GitHub repository for your references.
54
+ */
55
+ readonly files: Files,
56
+
57
+ /**
58
+ * Write a Info Plist for client app.
59
+ *
60
+ * The Info Plist object is initially an empty object,
61
+ * which means you cannot read what is the current Info Plist configuration from client configuration,
62
+ * but incrementally added and overwritten by other plugins.
63
+ *
64
+ * The Info Plist result from plugin cannot overwrite an Info Plist item of client app with the same key.
65
+ */
66
+ readonly infoPlist: Config.Apple.InfoPlist,
67
+
68
+ }
@@ -0,0 +1,14 @@
1
+ export interface Files {
2
+ readonly Project: {
3
+ ["AppDelegate.swift"]: string,
4
+ // add: (
5
+ // filename: string,
6
+ // source: string,
7
+ // ) => void,
8
+ },
9
+ Podfile: string,
10
+ // add: (
11
+ // filename: string,
12
+ // source: string,
13
+ // ) => void,
14
+ }
@@ -0,0 +1,5 @@
1
+ export type * from "./context"
2
+ export type * from "./files"
3
+ export type * from "./pod-spec-source-from-cocoapods"
4
+ export type * from "./pod-spec-source-from-git"
5
+ export type * from "./pod-spec-source-from-local"
@@ -0,0 +1,9 @@
1
+ export interface PodSpecSourceFromCocoapods {
2
+ operator?:
3
+ | ">"
4
+ | ">="
5
+ | "<"
6
+ | "<="
7
+ | "~>",
8
+ value: string,
9
+ }
@@ -0,0 +1,13 @@
1
+ export interface PodSpecSourceFromGit {
2
+ gitUrl: string,
3
+ revision?:
4
+ | {
5
+ branch: string,
6
+ }
7
+ | {
8
+ tag: string,
9
+ }
10
+ | {
11
+ commit: string,
12
+ },
13
+ }
@@ -0,0 +1,6 @@
1
+ export interface PodSpecSourceFromLocal {
2
+ /**
3
+ * Using the files from a local folder to the machine.
4
+ */
5
+ path: string,
6
+ }
@@ -0,0 +1,12 @@
1
+ import type * as Apple from "./apple"
2
+
3
+ export interface Context<PluginParam extends object = object> {
4
+
5
+ /**
6
+ * An object that user passed to your plugin through plugin registry.
7
+ */
8
+ readonly parameter: PluginParam | undefined,
9
+
10
+ readonly macos: Apple.Context,
11
+
12
+ }
@@ -0,0 +1,2 @@
1
+ export type * from "./context"
2
+ export type * as Apple from "./apple"