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.
- package/README.md +253 -0
- package/bin.mjs +21 -0
- package/lib/bin/bin.mjs +1141 -0
- package/lib/bin/plugin-sandbox-runner.mjs +105 -0
- package/lib/commonjs/index.js +125 -0
- package/lib/module/chunk-bhc5nymd.js +12 -0
- package/lib/module/chunk-dvyy3g4j.js +25 -0
- package/lib/module/chunk-ynqw05p0.js +70 -0
- package/lib/module/config/apple/create-osx-appiconset.js +6 -0
- package/lib/module/config/apple/index.js +7 -0
- package/lib/module/config/index.js +8 -0
- package/lib/module/index.js +8 -0
- package/lib/typescript/config/apple/asset-catalog-format/app-icon/index.d.ts +3 -0
- package/lib/typescript/config/apple/asset-catalog-format/app-icon/index.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/app-icon/set-type.d.ts +42 -0
- package/lib/typescript/config/apple/asset-catalog-format/app-icon/set-type.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/app-icon/size.d.ts +21 -0
- package/lib/typescript/config/apple/asset-catalog-format/app-icon/size.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/appearances.d.ts +13 -0
- package/lib/typescript/config/apple/asset-catalog-format/appearances.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/idiom.d.ts +5 -0
- package/lib/typescript/config/apple/asset-catalog-format/idiom.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/color-space.d.ts +2 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/color-space.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/compression-type.d.ts +2 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/compression-type.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/display-gamut.d.ts +2 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/display-gamut.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/index.d.ts +6 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/index.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/language-direction.d.ts +2 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/language-direction.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/scale.d.ts +9 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/scale.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/set-type.d.ts +58 -0
- package/lib/typescript/config/apple/asset-catalog-format/image/set-type.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalog-format/index.d.ts +5 -0
- package/lib/typescript/config/apple/asset-catalog-format/index.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalogs-namespaced.d.ts +5 -0
- package/lib/typescript/config/apple/asset-catalogs-namespaced.d.ts.map +1 -0
- package/lib/typescript/config/apple/asset-catalogs.d.ts +73 -0
- package/lib/typescript/config/apple/asset-catalogs.d.ts.map +1 -0
- package/lib/typescript/config/apple/create-osx-appiconset.d.mts +72 -0
- package/lib/typescript/config/apple/create-osx-appiconset.d.mts.map +1 -0
- package/lib/typescript/config/apple/data.d.ts +103 -0
- package/lib/typescript/config/apple/data.d.ts.map +1 -0
- package/lib/typescript/config/apple/index.d.mts +8 -0
- package/lib/typescript/config/apple/index.d.mts.map +1 -0
- package/lib/typescript/config/apple/info-plist-value.d.ts +8 -0
- package/lib/typescript/config/apple/info-plist-value.d.ts.map +1 -0
- package/lib/typescript/config/apple/info-plist.d.ts +4 -0
- package/lib/typescript/config/apple/info-plist.d.ts.map +1 -0
- package/lib/typescript/config/apple/string-catalog.d.ts +2 -0
- package/lib/typescript/config/apple/string-catalog.d.ts.map +1 -0
- package/lib/typescript/config/data.d.ts +50 -0
- package/lib/typescript/config/data.d.ts.map +1 -0
- package/lib/typescript/config/index.d.mts +5 -0
- package/lib/typescript/config/index.d.mts.map +1 -0
- package/lib/typescript/config/plugin-item.d.ts +2 -0
- package/lib/typescript/config/plugin-item.d.ts.map +1 -0
- package/lib/typescript/config/plugin-registry.d.ts +3 -0
- package/lib/typescript/config/plugin-registry.d.ts.map +1 -0
- package/lib/typescript/index.d.mts +3 -0
- package/lib/typescript/index.d.mts.map +1 -0
- package/lib/typescript/plugin/apple/context.d.ts +28 -0
- package/lib/typescript/plugin/apple/context.d.ts.map +1 -0
- package/lib/typescript/plugin/apple/files.d.ts +7 -0
- package/lib/typescript/plugin/apple/files.d.ts.map +1 -0
- package/lib/typescript/plugin/apple/index.d.ts +6 -0
- package/lib/typescript/plugin/apple/index.d.ts.map +1 -0
- package/lib/typescript/plugin/apple/pod-spec-source-from-cocoapods.d.ts +5 -0
- package/lib/typescript/plugin/apple/pod-spec-source-from-cocoapods.d.ts.map +1 -0
- package/lib/typescript/plugin/apple/pod-spec-source-from-git.d.ts +11 -0
- package/lib/typescript/plugin/apple/pod-spec-source-from-git.d.ts.map +1 -0
- package/lib/typescript/plugin/apple/pod-spec-source-from-local.d.ts +7 -0
- package/lib/typescript/plugin/apple/pod-spec-source-from-local.d.ts.map +1 -0
- package/lib/typescript/plugin/context.d.ts +9 -0
- package/lib/typescript/plugin/context.d.ts.map +1 -0
- package/lib/typescript/plugin/index.d.ts +3 -0
- package/lib/typescript/plugin/index.d.ts.map +1 -0
- package/package.json +49 -0
- package/src/_bin/_global-vars/_global-vars.mts +47 -0
- package/src/_bin/_global-vars/index.mts +30 -0
- package/src/_bin/_main/_check-config-validity.mts +94 -0
- package/src/_bin/_main/_evaluate-plugin-registry.mts +181 -0
- package/src/_bin/_main/_exec-plugin-runner/_spawn-plugin-sandbox-runner.mts +149 -0
- package/src/_bin/_main/_exec-plugin-runner/exec-plugin-runner.mts +92 -0
- package/src/_bin/_main/_exec-plugin-runner/index.mts +1 -0
- package/src/_bin/_main/_get-config.mts +64 -0
- package/src/_bin/_main/_helpers/config/get-name.mts +24 -0
- package/src/_bin/_main/_helpers/config/get-project-name.mts +27 -0
- package/src/_bin/_main/_helpers/config/index.mts +2 -0
- package/src/_bin/_main/_helpers/index.mts +2 -0
- package/src/_bin/_main/_helpers/platform/compatibility-error.mts +7 -0
- package/src/_bin/_main/_helpers/platform/data.ts +9 -0
- package/src/_bin/_main/_helpers/platform/get-data.mts +48 -0
- package/src/_bin/_main/_helpers/platform/index.mts +4 -0
- package/src/_bin/_main/_helpers/platform/is-compatible.mts +30 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_init-appiconsets.mts +223 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_init-imagesets.mts +241 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/appearances.mts +24 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/idiom.mts +22 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/compression-type.mts +15 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/display-gamut.mts +12 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/index.mts +3 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/image/language-direction.mts +12 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_metadata-check/index.mts +3 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/create-asset-catalogs.mts +54 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/index.mts +1 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-string-catalogs/create-string-catalog.mts +134 -0
- package/src/_bin/_main/_init-template/_init-apple/_create-string-catalogs/index.mts +1 -0
- package/src/_bin/_main/_init-template/_init-apple/_mod-files/_app-delegate-swift.mts +62 -0
- package/src/_bin/_main/_init-template/_init-apple/_mod-files/_podfile.mts +31 -0
- package/src/_bin/_main/_init-template/_init-apple/_mod-files/index.mts +1 -0
- package/src/_bin/_main/_init-template/_init-apple/_mod-files/mod-files.mts +17 -0
- package/src/_bin/_main/_init-template/_init-apple/index.mts +1 -0
- package/src/_bin/_main/_init-template/_init-apple/init-apple.mts +81 -0
- package/src/_bin/_main/_init-template/index.mts +1 -0
- package/src/_bin/_main/_init-template/init-template.mts +39 -0
- package/src/_bin/_main/_mod-plugin/index.mts +1 -0
- package/src/_bin/_main/_mod-plugin/mod-plugin.mts +77 -0
- package/src/_bin/_main/_xcodegen/_create-project-spec/_init-resources.mts +86 -0
- package/src/_bin/_main/_xcodegen/_create-project-spec/create-project-spec.mts +216 -0
- package/src/_bin/_main/_xcodegen/_create-project-spec/index.mts +1 -0
- package/src/_bin/_main/_xcodegen/_mod-known-regions/index.ts +1 -0
- package/src/_bin/_main/_xcodegen/_mod-known-regions/mod-known-regions.mts +52 -0
- package/src/_bin/_main/_xcodegen/index.mts +1 -0
- package/src/_bin/_main/_xcodegen/xcodegen.mts +46 -0
- package/src/_bin/_main/index.mts +1 -0
- package/src/_bin/_main/main.mts +160 -0
- package/src/_bin/bin.mts +68 -0
- package/src/_bin/plugin-sandbox-runner/_exec-plugins.mts +135 -0
- package/src/_bin/plugin-sandbox-runner/argv-json.ts +20 -0
- package/src/_bin/plugin-sandbox-runner/evaluated-plugin-registry.ts +12 -0
- package/src/_bin/plugin-sandbox-runner/index.ts +3 -0
- package/src/_bin/plugin-sandbox-runner/plugin-runner-context-result.ts +33 -0
- package/src/_bin/plugin-sandbox-runner/plugin-sandbox-runner.mts +68 -0
- package/src/config/apple/asset-catalog-format/app-icon/index.ts +2 -0
- package/src/config/apple/asset-catalog-format/app-icon/set-type.ts +59 -0
- package/src/config/apple/asset-catalog-format/app-icon/size.ts +37 -0
- package/src/config/apple/asset-catalog-format/appearances.ts +10 -0
- package/src/config/apple/asset-catalog-format/idiom.ts +16 -0
- package/src/config/apple/asset-catalog-format/image/color-space.ts +3 -0
- package/src/config/apple/asset-catalog-format/image/compression-type.ts +6 -0
- package/src/config/apple/asset-catalog-format/image/display-gamut.ts +3 -0
- package/src/config/apple/asset-catalog-format/image/index.ts +6 -0
- package/src/config/apple/asset-catalog-format/image/language-direction.ts +3 -0
- package/src/config/apple/asset-catalog-format/image/scale.ts +11 -0
- package/src/config/apple/asset-catalog-format/image/set-type.ts +85 -0
- package/src/config/apple/asset-catalog-format/index.ts +4 -0
- package/src/config/apple/asset-catalogs-namespaced.ts +13 -0
- package/src/config/apple/asset-catalogs.ts +76 -0
- package/src/config/apple/create-osx-appiconset.mts +135 -0
- package/src/config/apple/data.ts +123 -0
- package/src/config/apple/index.mts +7 -0
- package/src/config/apple/info-plist-value.ts +16 -0
- package/src/config/apple/info-plist.ts +6 -0
- package/src/config/apple/string-catalog.ts +0 -0
- package/src/config/data.ts +59 -0
- package/src/config/index.mts +4 -0
- package/src/config/plugin-item.ts +4 -0
- package/src/config/plugin-registry.ts +5 -0
- package/src/index.mts +2 -0
- package/src/plugin/apple/context.ts +68 -0
- package/src/plugin/apple/files.ts +14 -0
- package/src/plugin/apple/index.ts +5 -0
- package/src/plugin/apple/pod-spec-source-from-cocoapods.ts +9 -0
- package/src/plugin/apple/pod-spec-source-from-git.ts +13 -0
- package/src/plugin/apple/pod-spec-source-from-local.ts +6 -0
- package/src/plugin/context.ts +12 -0
- 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"
|
|
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_ : <project>/macos
|
|
18
|
+
* - _rw_ : <project>/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
|
+
* - <project>/macos/HelloWorld/AppDelegate.swift
|
|
48
|
+
* - <project>/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
|
+
}
|
package/src/index.mts
ADDED
|
@@ -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,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
|
+
}
|