bundo-appgen 0.0.10 → 0.0.12

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 (87) hide show
  1. package/lib/bin/bin.mjs +550 -191
  2. package/lib/module/{chunk-dvyy3g4j.js → chunk-mxb4tw3v.js} +0 -1
  3. package/lib/module/{chunk-bhc5nymd.js → chunk-z47xn1nx.js} +1 -2
  4. package/lib/module/config/apple/index.js +1 -1
  5. package/lib/module/config/index.js +2 -2
  6. package/lib/module/index.js +2 -2
  7. package/lib/typescript/config/apple/asset-catalogs-namespaced.d.ts +5 -1
  8. package/lib/typescript/config/apple/asset-catalogs-namespaced.d.ts.map +1 -1
  9. package/lib/typescript/config/apple/data.d.ts +22 -3
  10. package/lib/typescript/config/apple/data.d.ts.map +1 -1
  11. package/lib/typescript/config/apple/index.d.mts +3 -2
  12. package/lib/typescript/config/apple/index.d.mts.map +1 -1
  13. package/lib/typescript/config/apple/plist-value.d.ts +6 -0
  14. package/lib/typescript/config/apple/plist-value.d.ts.map +1 -0
  15. package/lib/typescript/config/apple/plist.d.ts +4 -0
  16. package/lib/typescript/config/apple/plist.d.ts.map +1 -0
  17. package/lib/typescript/config/apple/podfile/index.d.ts +5 -0
  18. package/lib/typescript/config/apple/podfile/index.d.ts.map +1 -0
  19. package/lib/typescript/config/apple/podfile/pod-dependency-from-cocoapods.d.ts +12 -0
  20. package/lib/typescript/config/apple/podfile/pod-dependency-from-cocoapods.d.ts.map +1 -0
  21. package/lib/typescript/config/apple/podfile/pod-dependency-from-git.d.ts +16 -0
  22. package/lib/typescript/config/apple/podfile/pod-dependency-from-git.d.ts.map +1 -0
  23. package/lib/typescript/config/apple/podfile/pod-dependency-from-local.d.ts +12 -0
  24. package/lib/typescript/config/apple/podfile/pod-dependency-from-local.d.ts.map +1 -0
  25. package/lib/typescript/config/apple/podfile/pod-dependency.d.ts +5 -0
  26. package/lib/typescript/config/apple/podfile/pod-dependency.d.ts.map +1 -0
  27. package/lib/typescript/plugin/apple/context.d.ts +1 -1
  28. package/lib/typescript/plugin/apple/context.d.ts.map +1 -1
  29. package/lib/typescript/plugin/apple/index.d.ts +0 -3
  30. package/lib/typescript/plugin/apple/index.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/src/_bin/_main/_check-config-validity.mts +10 -2
  33. package/src/_bin/_main/_helpers/config/cache-paths/asset-catalogs-tracker-file.mts +9 -0
  34. package/src/_bin/_main/_helpers/config/cache-paths/dir-cache.mts +19 -0
  35. package/src/_bin/_main/_helpers/config/cache-paths/index.mts +3 -0
  36. package/src/_bin/_main/_helpers/config/cache-paths/string-catalogs-tracker-file.mts +9 -0
  37. package/src/_bin/_main/_helpers/config/get-name.mts +1 -3
  38. package/src/_bin/_main/_helpers/config/get-project-name.mts +10 -5
  39. package/src/_bin/_main/_helpers/config/index.mts +1 -0
  40. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_get-xcassets-path.mts +29 -0
  41. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_init-appiconsets.mts +25 -12
  42. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/_init-imagesets.mts +32 -13
  43. package/src/_bin/_main/_init-template/_init-apple/_create-asset-catalogs/create-asset-catalogs.mts +214 -9
  44. package/src/_bin/_main/_init-template/_init-apple/_create-string-catalogs/create-string-catalog.mts +159 -81
  45. package/src/_bin/_main/_init-template/_init-apple/_mod-files/_app-delegate-swift.mts +3 -6
  46. package/src/_bin/_main/_init-template/_init-apple/_mod-files/_podfile/_pod-dependencies.mts +78 -0
  47. package/src/_bin/_main/_init-template/_init-apple/_mod-files/_podfile/index.mts +1 -0
  48. package/src/_bin/_main/_init-template/_init-apple/_mod-files/{_podfile.mts → _podfile/podfile.mts} +16 -4
  49. package/src/_bin/_main/_init-template/_init-apple/_mod-files/_privacy-manifest.mts +119 -0
  50. package/src/_bin/_main/_init-template/_init-apple/_mod-files/mod-files.mts +8 -2
  51. package/src/_bin/_main/_init-template/_init-apple/init-apple.mts +13 -8
  52. package/src/_bin/_main/_init-template/init-template.mts +2 -0
  53. package/src/_bin/_main/_xcodegen/_create-project-spec/_init-resources.mts +21 -9
  54. package/src/_bin/_main/_xcodegen/_create-project-spec/create-project-spec.mts +51 -32
  55. package/src/_bin/_main/_xcodegen/_mod-known-regions/mod-known-regions.mts +2 -2
  56. package/src/_bin/_main/_xcodegen/xcodegen.mts +1 -1
  57. package/src/_bin/_main/main.mts +1 -1
  58. package/src/_bin/plugin-sandbox-runner/plugin-runner-context-result.ts +0 -27
  59. package/src/config/apple/asset-catalogs-namespaced.ts +1 -1
  60. package/src/config/apple/data.ts +27 -4
  61. package/src/config/apple/index.mts +3 -2
  62. package/src/config/apple/{info-plist-value.ts → plist-value.ts} +5 -4
  63. package/src/config/apple/plist.ts +6 -0
  64. package/src/config/apple/podfile/index.ts +4 -0
  65. package/src/config/apple/podfile/pod-dependency-from-cocoapods.ts +15 -0
  66. package/src/config/apple/podfile/pod-dependency-from-git.ts +23 -0
  67. package/src/config/apple/podfile/pod-dependency-from-local.ts +15 -0
  68. package/src/config/apple/podfile/pod-dependency.ts +16 -0
  69. package/src/plugin/apple/context.ts +1 -35
  70. package/src/plugin/apple/index.ts +0 -3
  71. package/template/macos/Podfile +4 -0
  72. package/template/macos/PrivacyInfo.xcprivacy +5 -0
  73. package/template/macos/pod_dependencies.rb +2 -0
  74. package/lib/typescript/config/apple/info-plist-value.d.ts +0 -8
  75. package/lib/typescript/config/apple/info-plist-value.d.ts.map +0 -1
  76. package/lib/typescript/config/apple/info-plist.d.ts +0 -4
  77. package/lib/typescript/config/apple/info-plist.d.ts.map +0 -1
  78. package/lib/typescript/plugin/apple/pod-spec-source-from-cocoapods.d.ts +0 -5
  79. package/lib/typescript/plugin/apple/pod-spec-source-from-cocoapods.d.ts.map +0 -1
  80. package/lib/typescript/plugin/apple/pod-spec-source-from-git.d.ts +0 -11
  81. package/lib/typescript/plugin/apple/pod-spec-source-from-git.d.ts.map +0 -1
  82. package/lib/typescript/plugin/apple/pod-spec-source-from-local.d.ts +0 -7
  83. package/lib/typescript/plugin/apple/pod-spec-source-from-local.d.ts.map +0 -1
  84. package/src/config/apple/info-plist.ts +0 -6
  85. package/src/plugin/apple/pod-spec-source-from-cocoapods.ts +0 -9
  86. package/src/plugin/apple/pod-spec-source-from-git.ts +0 -13
  87. package/src/plugin/apple/pod-spec-source-from-local.ts +0 -6
@@ -21,5 +21,4 @@ var exports_apple = {};
21
21
  __export(exports_apple, {
22
22
  createOSXappiconset: () => createOSXappiconset2
23
23
  });
24
-
25
24
  export { __export, exports_apple };
@@ -1,12 +1,11 @@
1
1
  import {
2
2
  __export,
3
3
  exports_apple
4
- } from "./chunk-dvyy3g4j.js";
4
+ } from "./chunk-mxb4tw3v.js";
5
5
 
6
6
  // src/config/index.mts
7
7
  var exports_config = {};
8
8
  __export(exports_config, {
9
9
  Apple: () => exports_apple
10
10
  });
11
-
12
11
  export { exports_config };
@@ -1,4 +1,4 @@
1
- import"../../chunk-dvyy3g4j.js";
1
+ import"../../chunk-mxb4tw3v.js";
2
2
  import {
3
3
  createOSXappiconset2
4
4
  } from "../../chunk-ynqw05p0.js";
@@ -1,7 +1,7 @@
1
- import"../chunk-bhc5nymd.js";
1
+ import"../chunk-z47xn1nx.js";
2
2
  import {
3
3
  exports_apple
4
- } from "../chunk-dvyy3g4j.js";
4
+ } from "../chunk-mxb4tw3v.js";
5
5
  import"../chunk-ynqw05p0.js";
6
6
  export {
7
7
  exports_apple as Apple
@@ -1,8 +1,8 @@
1
1
  import"./chunk-ynqw05p0.js";
2
- import"./chunk-dvyy3g4j.js";
2
+ import"./chunk-mxb4tw3v.js";
3
3
  import {
4
4
  exports_config
5
- } from "./chunk-bhc5nymd.js";
5
+ } from "./chunk-z47xn1nx.js";
6
6
  export {
7
7
  exports_config as Config
8
8
  };
@@ -1,5 +1,9 @@
1
1
  import type { AssetCatalogs } from "./asset-catalogs";
2
2
  export type AssetCatalogsNamespaced = AssetCatalogs & {
3
- [Namespace in string]?: Omit<AssetCatalogs | AssetCatalogsNamespaced, "appiconsets">;
3
+ /**
4
+ * Stated by Xcode
5
+ * "The app icon set must be a top level object in the asset."
6
+ */
7
+ [Namespace: Exclude<string, keyof AssetCatalogs>]: Omit<AssetCatalogs, "appiconsets"> | AssetCatalogsNamespaced;
4
8
  };
5
9
  //# sourceMappingURL=asset-catalogs-namespaced.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-catalogs-namespaced.d.ts","sourceRoot":"","sources":["../../../../src/config/apple/asset-catalogs-namespaced.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,uBAAuB,GAChC,aAAa,GACb;KAKA,SAAS,IAAI,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,uBAAuB,EAAE,aAAa,CAAC;CACpF,CAAA"}
1
+ {"version":3,"file":"asset-catalogs-namespaced.d.ts","sourceRoot":"","sources":["../../../../src/config/apple/asset-catalogs-namespaced.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,uBAAuB,GAChC,aAAa,GACb;IACD;;;OAGG;IACH,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,uBAAuB,CAAA;CAC/G,CAAA"}
@@ -1,7 +1,17 @@
1
1
  import type { AssetCatalogs } from "./asset-catalogs";
2
2
  import type { AssetCatalogsNamespaced } from "./asset-catalogs-namespaced";
3
- import type { InfoPlist } from "./info-plist";
3
+ import type { Plist } from "./plist";
4
+ import type * as Podfile from "./podfile";
4
5
  export interface Data {
6
+ /**
7
+ * @deprecated
8
+ * React Native will move away from CocoaPods, and use Swift Package Manager.
9
+ * Consider this deprecation as a warning, because Swift Package Manager in React Native is still experimental.
10
+ * You can still use this until Swift Package Manager is supported in React Native completely.
11
+ */
12
+ Podfile?: {
13
+ dependencies?: Podfile.PodDependency[];
14
+ };
5
15
  /**
6
16
  * Use one name of `appiconsets` in Asset Catalogs as the app icon.
7
17
  * appgen script will throw an error if the name given is not found in the catalog.
@@ -20,12 +30,17 @@ export interface Data {
20
30
  */
21
31
  buildVersion: string;
22
32
  bundleIdentifier: string;
33
+ /**
34
+ * Key-value pairs that grant an executable permission to use a service or technology.
35
+ * @see https://developer.apple.com/documentation/bundleresources/entitlements
36
+ */
37
+ entitlements?: Plist;
23
38
  /**
24
39
  * Customize the information property list values for your app.
25
40
  *
26
41
  * For human readable information property list, you can localize the information property through string catalog. See {@link stringCatalogs|`stringCatalogs`}
27
42
  */
28
- infoPlist?: InfoPlist;
43
+ infoPlist?: Plist;
29
44
  /**
30
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).
31
46
  *
@@ -44,13 +59,17 @@ export interface Data {
44
59
  * This name will be used also for project name in Xcode with removed spaces and special characters.
45
60
  */
46
61
  name?: string;
62
+ /**
63
+ * Describe the data your app or third-party SDK collects and the required reasons APIs it uses.
64
+ */
65
+ privacyManifest?: Plist;
47
66
  /**
48
67
  * Add files to the native bundle resources directory, e.g. "/Applications/Hello World.app/Contents/Resources".
49
68
  * 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.
50
69
  *
51
70
  * 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".
52
71
  *
53
- * For another real example, you can copy your font files in the bundle resources, and use in your React Native macOS app.
72
+ * For another real example, you can copy your font files to the bundle resources, and use it in your React Native macOS app.
54
73
  *
55
74
  * ```ts
56
75
  * import type { Config } from "bundo.rn/appgen"
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/config/apple/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EACX,uBAAuB,EACvB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,KAAK,EACX,SAAS,EACT,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,IAAI;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,aAAa,GAAG,uBAAuB,CAAC;IAExD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,cAAc,CAAC,EAAE;SACf,WAAW,IAAI,MAAM,GAAG;aACvB,GAAG,IAAI,MAAM,GAAG;iBACf,MAAM,IAAI,MAAM,GAAG,MAAM;aAC1B;SACD;KACD,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CAEhB"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/config/apple/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EACX,uBAAuB,EACvB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,KAAK,EACX,KAAK,EACL,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAA;AAEzC,MAAM,WAAW,IAAI;IAEpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE;QACT,YAAY,CAAC,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC;KACvC,CAAC;IAEF;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,aAAa,GAAG,uBAAuB,CAAC;IAExD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC;IAExB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,cAAc,CAAC,EAAE;SACf,WAAW,IAAI,MAAM,GAAG;aACvB,GAAG,IAAI,MAAM,GAAG;iBACf,MAAM,IAAI,MAAM,GAAG,MAAM;aAC1B;SACD;KACD,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CAEhB"}
@@ -3,6 +3,7 @@ export type * from "./asset-catalogs.ts";
3
3
  export type * from "./asset-catalogs-namespaced.ts";
4
4
  export * from "./create-osx-appiconset.mts";
5
5
  export type * from "./data.ts";
6
- export type * from "./info-plist.ts";
7
- export type * from "./info-plist-value.ts";
6
+ export type * from "./plist.ts";
7
+ export type * from "./plist-value.ts";
8
+ export type * as Podfile from "./podfile/index.ts";
8
9
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/config/apple/index.mts"],"names":[],"mappings":"AAAA,YAAY,KAAK,kBAAkB,MAAM,iCAAiC,CAAA;AAC1E,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,gCAAgC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/config/apple/index.mts"],"names":[],"mappings":"AAAA,YAAY,KAAK,kBAAkB,MAAM,iCAAiC,CAAA;AAC1E,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,gCAAgC,CAAA;AACnD,cAAc,6BAA6B,CAAA;AAC3C,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,kBAAkB,CAAA;AACrC,YAAY,KAAK,OAAO,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,6 @@
1
+ export type PlistValue = boolean | string | string[] | DictionaryValue | DictionaryValue[];
2
+ type DictionaryValue = {
3
+ [Key in string]: boolean | string | string[] | DictionaryValue;
4
+ };
5
+ export {};
6
+ //# sourceMappingURL=plist-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plist-value.d.ts","sourceRoot":"","sources":["../../../../src/config/apple/plist-value.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,MAAM,GACN,MAAM,EAAE,GACR,eAAe,GACf,eAAe,EAAE,CAAA;AAEpB,KAAK,eAAe,GAAG;KACrB,GAAG,IAAI,MAAM,GACX,OAAO,GACP,MAAM,GACN,MAAM,EAAE,GACR,eAAe;CAIlB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { PlistValue } from "./plist-value";
2
+ export interface Plist extends Record<string, PlistValue> {
3
+ }
4
+ //# sourceMappingURL=plist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plist.d.ts","sourceRoot":"","sources":["../../../../src/config/apple/plist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,MAAM,eAAe,CAAA;AAEtB,MAAM,WAAW,KAAM,SAAQ,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;CACxD"}
@@ -0,0 +1,5 @@
1
+ export type * from "./pod-dependency";
2
+ export type * from "./pod-dependency-from-cocoapods";
3
+ export type * from "./pod-dependency-from-git";
4
+ export type * from "./pod-dependency-from-local";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/apple/podfile/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,iCAAiC,CAAA;AACpD,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,6BAA6B,CAAA"}
@@ -0,0 +1,12 @@
1
+ export interface PodDependencyFromCocoapods {
2
+ type: "cocoapods";
3
+ /**
4
+ * The pod name or a name for specific subspec e.g. "QueryKit/Attribute".
5
+ */
6
+ name: string;
7
+ /**
8
+ * Use latest or specific version of a Pod. See {@link https://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions|Specifying Pod Versions}
9
+ */
10
+ version?: string;
11
+ }
12
+ //# sourceMappingURL=pod-dependency-from-cocoapods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pod-dependency-from-cocoapods.d.ts","sourceRoot":"","sources":["../../../../../src/config/apple/podfile/pod-dependency-from-cocoapods.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IAE1C,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAEjB"}
@@ -0,0 +1,16 @@
1
+ export interface PodDependencyFromGit {
2
+ type: "git";
3
+ /**
4
+ * The pod name or a name for specific subspec e.g. "QueryKit/Attribute".
5
+ */
6
+ name: string;
7
+ /**
8
+ * @example "https://github.com/facebook/react-native.git"
9
+ */
10
+ url: string;
11
+ revision?: {
12
+ type: "branch" | "tag" | "commit";
13
+ ref: string;
14
+ };
15
+ }
16
+ //# sourceMappingURL=pod-dependency-from-git.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pod-dependency-from-git.d.ts","sourceRoot":"","sources":["../../../../../src/config/apple/podfile/pod-dependency-from-git.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IAEpC,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,QAAQ,CAAC,EAAE;QACV,IAAI,EACD,QAAQ,GACR,KAAK,GACL,QAAQ,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACZ,CAAC;CAEF"}
@@ -0,0 +1,12 @@
1
+ export interface PodDependencyFromLocal {
2
+ type: "local";
3
+ /**
4
+ * The pod name or a name for specific subspec e.g. "QueryKit/Attribute".
5
+ */
6
+ name: string;
7
+ /**
8
+ * Using the files from a local folder to the machine.
9
+ */
10
+ path: string;
11
+ }
12
+ //# sourceMappingURL=pod-dependency-from-local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pod-dependency-from-local.d.ts","sourceRoot":"","sources":["../../../../../src/config/apple/podfile/pod-dependency-from-local.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IAEtC,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAEb"}
@@ -0,0 +1,5 @@
1
+ import type { PodDependencyFromCocoapods } from "./pod-dependency-from-cocoapods";
2
+ import type { PodDependencyFromGit } from "./pod-dependency-from-git";
3
+ import type { PodDependencyFromLocal } from "./pod-dependency-from-local";
4
+ export type PodDependency = PodDependencyFromCocoapods | PodDependencyFromGit | PodDependencyFromLocal;
5
+ //# sourceMappingURL=pod-dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pod-dependency.d.ts","sourceRoot":"","sources":["../../../../../src/config/apple/podfile/pod-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,0BAA0B,EAC1B,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EACX,oBAAoB,EACpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EACX,sBAAsB,EACtB,MAAM,6BAA6B,CAAA;AAEpC,MAAM,MAAM,aAAa,GACtB,0BAA0B,GAC1B,oBAAoB,GACpB,sBAAsB,CAAA"}
@@ -23,6 +23,6 @@ export interface Context {
23
23
  *
24
24
  * The Info Plist result from plugin cannot overwrite an Info Plist item of client app with the same key.
25
25
  */
26
- readonly infoPlist: Config.Apple.InfoPlist;
26
+ readonly infoPlist: Config.Apple.Plist;
27
27
  }
28
28
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/plugin/apple/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EACX,KAAK,EACL,MAAM,SAAS,CAAA;AAchB,MAAM,WAAW,OAAO;IAwBvB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;CAE3C"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/plugin/apple/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EACX,KAAK,EACL,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,OAAO;IAEvB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;CAEvC"}
@@ -1,6 +1,3 @@
1
1
  export type * from "./context";
2
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";
6
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/apple/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,SAAS,CAAA;AAC5B,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/apple/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bundo-appgen",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Native app generator for React Native macOS",
5
5
  "license": "MIT",
6
6
  "author": "RakaDoank <rakaaudira@gmail.com> (https://github.com/RakaDoank)",
@@ -22,13 +22,21 @@ export function checkConfigValidity(
22
22
 
23
23
  const isCrossPlatform = GlobalVars.argv.get().forceCrossPlatform
24
24
 
25
+ // These check here are not correct if we support other platforms, e.g. windows
26
+ // bundo-appgen is only supporting "macos" currently.
25
27
  if(isCrossPlatform) {
26
28
  checkMacosConfig(config)
27
- // TODO windows
29
+ // we only support "macos" currently.
30
+ // if we support other Apple platforms e.g. "ios",
31
+ // we need another if-else check here
28
32
  } else if(process.platform == "darwin") {
33
+ // we only support "macos" currently.
34
+ // if we support other Apple platforms e.g. "ios",
35
+ // we need another if-else check here
29
36
  checkMacosConfig(config)
30
- } else if(process.platform == "win32") {
37
+ } else /* if(process.platform == "win32") */ {
31
38
  // TODO windows
39
+ throw new Error(`Cannot support appgen for macOS in ${process.platform} platform.`)
32
40
  }
33
41
 
34
42
  // check plugin
@@ -0,0 +1,9 @@
1
+ import * as node_path from "node:path"
2
+
3
+ import {
4
+ dirCache,
5
+ } from "./dir-cache.mts"
6
+
7
+ export function assetCatalogsTrackerFile() {
8
+ return node_path.join(dirCache(), "asset-catalogs.json")
9
+ }
@@ -0,0 +1,19 @@
1
+ import * as node_fs from "node:fs"
2
+ import * as node_path from "node:path"
3
+
4
+ import {
5
+ GlobalVars,
6
+ } from "../../../../_global-vars/index.mts"
7
+
8
+ export function dirCache() {
9
+ const path = node_path.join(
10
+ node_path.dirname(GlobalVars.configFilePath.get()),
11
+ ".bundo.rn",
12
+ )
13
+
14
+ if(!node_fs.existsSync(path)) {
15
+ node_fs.mkdirSync(path)
16
+ }
17
+
18
+ return path
19
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./asset-catalogs-tracker-file.mts"
2
+ export * from "./dir-cache.mts"
3
+ export * from "./string-catalogs-tracker-file.mts"
@@ -0,0 +1,9 @@
1
+ import * as node_path from "node:path"
2
+
3
+ import {
4
+ dirCache,
5
+ } from "./dir-cache.mts"
6
+
7
+ export function stringCatalogsTrackerFile() {
8
+ return node_path.join(dirCache(), "string-catalogs.json")
9
+ }
@@ -8,9 +8,7 @@ import type {
8
8
  export function getName(
9
9
  config: Config.Data,
10
10
  platform:
11
- | "macos"
12
- | "windows"
13
- | "ios",
11
+ | "macos",
14
12
  ): string | undefined {
15
13
 
16
14
  if(platform == "macos") {
@@ -2,7 +2,7 @@ import {
2
2
  getName,
3
3
  } from "./get-name.mts"
4
4
 
5
- let cache: string
5
+ let cacheMacos: string
6
6
 
7
7
  /**
8
8
  * Get the project name for Xcode or Visual Studio. This function is not guaranteed to return valid string due to missing value in the config object.
@@ -11,9 +11,10 @@ export function getProjectName(
11
11
  ...params: Parameters<typeof getName>
12
12
  ): string | undefined {
13
13
 
14
- if(cache) {
15
- return cache
14
+ if(params[1] == "macos" && cacheMacos) {
15
+ return cacheMacos
16
16
  }
17
+ // TODO other platforms
17
18
 
18
19
  const name = getName(...params)
19
20
 
@@ -21,7 +22,11 @@ export function getProjectName(
21
22
  return undefined
22
23
  }
23
24
 
24
- cache = name.replace(/[^a-zA-Z0-9]/g, "")
25
- return cache
25
+ if(params[1] == "macos") {
26
+ cacheMacos = name.replace(/[^a-zA-Z0-9]/g, "")
27
+ return cacheMacos
28
+ }
29
+
30
+ return undefined
26
31
 
27
32
  }
@@ -1,2 +1,3 @@
1
+ export * as CachePaths from "./cache-paths/index.mts"
1
2
  export * from "./get-name.mts"
2
3
  export * from "./get-project-name.mts"
@@ -0,0 +1,29 @@
1
+ import * as node_path from "node:path"
2
+
3
+ import {
4
+ GlobalVars,
5
+ } from "../../../../_global-vars/index.mts"
6
+
7
+ import {
8
+ ConfigHelpers,
9
+ } from "../../../_helpers/index.mts"
10
+
11
+ export function getXcassetsPath(
12
+ platform: "macos",
13
+ ) {
14
+
15
+ const
16
+ projectDirectory =
17
+ node_path.dirname(GlobalVars.configFilePath.get()),
18
+
19
+ projectName =
20
+ ConfigHelpers.getProjectName(GlobalVars.appConfig.get(), platform)!
21
+
22
+ return node_path.join(
23
+ projectDirectory,
24
+ platform,
25
+ projectName,
26
+ "Assets.xcassets",
27
+ )
28
+
29
+ }
@@ -9,32 +9,39 @@ import {
9
9
  GlobalVars,
10
10
  } from "../../../../_global-vars/index.mts"
11
11
 
12
+ import {
13
+ getXcassetsPath,
14
+ } from "./_get-xcassets-path.mts"
15
+
12
16
  import * as MetadataCheck from "./_metadata-check/index.mts"
13
17
 
14
18
  /**
15
- * Similar as the _init-imagesets.mts
19
+ * This function is similar as the _init-imagesets.mts. The main difference is "appiconsets" does not has a namespace.
20
+ *
21
+ * @returns
22
+ * Returns an array of string that represents as the catalog name that has been created,
23
+ * e.g. `["MyImage", "AnotherImage"]`.
16
24
  */
17
25
  export function initAppiconsets(
18
26
  appiconsets: Config.Apple.AssetCatalogs["appiconsets"],
19
27
  metadata: {
20
28
  bundleIdentifier: string,
21
- projectName: string,
22
- platform: "ios" | "macos",
29
+ platform: "macos",
23
30
  },
24
- ) {
31
+ ): string[] | undefined {
25
32
 
26
33
  if(!appiconsets?.length) {
27
34
  return
28
35
  }
29
36
 
30
- const projectDirectory = node_path.dirname(GlobalVars.configFilePath.get())
37
+ const
38
+ createdCatalogs: string[] =
39
+ [],
40
+
41
+ projectDirectory =
42
+ node_path.dirname(GlobalVars.configFilePath.get())
31
43
 
32
- const targetDirectory = node_path.join(
33
- projectDirectory,
34
- "macos",
35
- metadata.projectName,
36
- "Assets.xcassets",
37
- )
44
+ const xcassetsPath = getXcassetsPath(metadata.platform)
38
45
 
39
46
  let appiconset_index = -1
40
47
  for(const appiconset of appiconsets) {
@@ -46,7 +53,7 @@ export function initAppiconsets(
46
53
 
47
54
  // +++++ create <name>.appiconset directory inside of the target directory
48
55
  const _appiconset_directory = node_path.join(
49
- targetDirectory,
56
+ xcassetsPath,
50
57
  `${appiconset.name}.appiconset`,
51
58
  )
52
59
  if(!node_fs.existsSync(_appiconset_directory)) {
@@ -180,8 +187,14 @@ export function initAppiconsets(
180
187
  ),
181
188
  "utf8",
182
189
  )
190
+
191
+ createdCatalogs.push(appiconset.name)
183
192
  }
184
193
 
194
+ // BUG : false positive
195
+ // eslint-disable-next-line consistent-return
196
+ return createdCatalogs
197
+
185
198
  }
186
199
 
187
200
  /**
@@ -9,37 +9,46 @@ import {
9
9
  GlobalVars,
10
10
  } from "../../../../_global-vars/index.mts"
11
11
 
12
+ import {
13
+ getXcassetsPath,
14
+ } from "./_get-xcassets-path.mts"
15
+
12
16
  import * as MetadataCheck from "./_metadata-check/index.mts"
13
17
 
18
+ /**
19
+ * @returns
20
+ * Returns an array of string that represents as the catalog name that has been created
21
+ * including its namespace, e.g. `["Foo/Bar", "MyImage", "AnotherImage"]`.
22
+ */
14
23
  export function initImagesets(
15
24
  imagesets: Config.Apple.AssetCatalogs["imagesets"],
16
25
  metadata: {
17
26
  bundleIdentifier: string,
18
27
  namespace?: string,
19
- projectName: string,
28
+ platform: "macos",
20
29
  },
21
- ) {
30
+ ): string[] | undefined {
22
31
 
23
32
  if(!imagesets?.length) {
24
33
  return
25
34
  }
26
35
 
27
- const projectDirectory = node_path.dirname(GlobalVars.configFilePath.get())
36
+ const
37
+ createdCatalogs: string[] =
38
+ [],
28
39
 
29
- let targetDirectory = node_path.join(
30
- projectDirectory,
31
- "macos",
32
- metadata.projectName,
33
- "Assets.xcassets",
34
- )
40
+ projectDirectory =
41
+ node_path.dirname(GlobalVars.configFilePath.get())
42
+
43
+ let xcassetsPath = getXcassetsPath(metadata.platform)
35
44
 
36
45
  if(metadata.namespace) {
37
46
  // append a namespace directory after Assets.xcassets
38
- targetDirectory = node_path.join(targetDirectory, metadata.namespace)
47
+ xcassetsPath = node_path.join(xcassetsPath, metadata.namespace)
39
48
 
40
49
  // Create a namespace directory inside of "Assets.xcassets"
41
50
  node_fs.mkdirSync(
42
- targetDirectory,
51
+ xcassetsPath,
43
52
  {
44
53
  recursive: true,
45
54
  },
@@ -47,7 +56,7 @@ export function initImagesets(
47
56
 
48
57
  // create Contents.json in the namespace directory
49
58
  node_fs.writeFileSync(
50
- node_path.join(targetDirectory, "Contents.json"),
59
+ node_path.join(xcassetsPath, "Contents.json"),
51
60
  JSON.stringify({
52
61
  info: {
53
62
  version: 1,
@@ -71,7 +80,7 @@ export function initImagesets(
71
80
 
72
81
  // +++++ create <name>.imageset directory inside of the target directory
73
82
  const _imageset_directory = node_path.join(
74
- targetDirectory,
83
+ xcassetsPath,
75
84
  `${imageset.name}.imageset`,
76
85
  )
77
86
  if(!node_fs.existsSync(_imageset_directory)) {
@@ -215,8 +224,18 @@ export function initImagesets(
215
224
  ),
216
225
  "utf8",
217
226
  )
227
+
228
+ if(metadata.namespace) {
229
+ createdCatalogs.push(`${metadata.namespace}/${imageset.name}`)
230
+ } else {
231
+ createdCatalogs.push(imageset.name)
232
+ }
218
233
  }
219
234
 
235
+ // BUG : false positive
236
+ // eslint-disable-next-line consistent-return
237
+ return createdCatalogs
238
+
220
239
  }
221
240
 
222
241
  /**