@devlander/expo-app-config 0.0.76 → 0.0.82

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/cjs/index.js +1 -2
  2. package/dist/cjs/typings/__tests__/apply-relative-paths-to-config.test.d.ts +1 -0
  3. package/dist/cjs/typings/__tests__/create-bundle.test.d.ts +0 -1
  4. package/dist/cjs/typings/__tests__/format-assets-path.test.d.ts +1 -0
  5. package/dist/cjs/typings/__tests__/get-colors-for-environment.test.d.ts +0 -1
  6. package/dist/cjs/typings/__tests__/get-images-for-config.test.d.ts +0 -1
  7. package/dist/cjs/typings/__tests__/get-versions.test.d.ts +0 -1
  8. package/dist/cjs/typings/__tests__/tools.test.d.ts +1 -0
  9. package/dist/cjs/typings/apply-relative-paths-to-config.d.ts +9 -0
  10. package/dist/cjs/typings/create-bundle.d.ts +7 -3
  11. package/dist/cjs/typings/create-names-for-package.d.ts +0 -1
  12. package/dist/cjs/typings/format-assets-path.d.ts +2 -0
  13. package/dist/cjs/typings/get-app-images.d.ts +8 -0
  14. package/dist/cjs/typings/get-colors-for-environment.d.ts +0 -1
  15. package/dist/cjs/typings/get-images-for-config.d.ts +0 -1
  16. package/dist/cjs/typings/get-versions.d.ts +2 -3
  17. package/dist/cjs/typings/index.d.ts +0 -6
  18. package/dist/cjs/typings/setup-config.types.d.ts +4 -11
  19. package/dist/cjs/typings/tools.d.ts +17 -0
  20. package/dist/esm/index.js +1 -2
  21. package/dist/esm/typings/__tests__/apply-relative-paths-to-config.test.d.ts +1 -0
  22. package/dist/esm/typings/__tests__/create-bundle.test.d.ts +0 -1
  23. package/dist/esm/typings/__tests__/format-assets-path.test.d.ts +1 -0
  24. package/dist/esm/typings/__tests__/get-colors-for-environment.test.d.ts +0 -1
  25. package/dist/esm/typings/__tests__/get-images-for-config.test.d.ts +0 -1
  26. package/dist/esm/typings/__tests__/get-versions.test.d.ts +0 -1
  27. package/dist/esm/typings/__tests__/tools.test.d.ts +1 -0
  28. package/dist/esm/typings/apply-relative-paths-to-config.d.ts +9 -0
  29. package/dist/esm/typings/create-bundle.d.ts +7 -3
  30. package/dist/esm/typings/create-names-for-package.d.ts +0 -1
  31. package/dist/esm/typings/format-assets-path.d.ts +2 -0
  32. package/dist/esm/typings/get-app-images.d.ts +8 -0
  33. package/dist/esm/typings/get-colors-for-environment.d.ts +0 -1
  34. package/dist/esm/typings/get-images-for-config.d.ts +0 -1
  35. package/dist/esm/typings/get-versions.d.ts +2 -3
  36. package/dist/esm/typings/index.d.ts +0 -6
  37. package/dist/esm/typings/setup-config.types.d.ts +4 -11
  38. package/dist/esm/typings/tools.d.ts +17 -0
  39. package/dist/umd/index.js +1 -0
  40. package/dist/umd/typings/__tests__/apply-relative-paths-to-config.test.d.ts +1 -0
  41. package/dist/umd/typings/__tests__/create-bundle.test.d.ts +1 -0
  42. package/dist/umd/typings/__tests__/format-assets-path.test.d.ts +1 -0
  43. package/dist/umd/typings/__tests__/get-colors-for-environment.test.d.ts +1 -0
  44. package/dist/umd/typings/__tests__/get-images-for-config.test.d.ts +1 -0
  45. package/dist/umd/typings/__tests__/get-versions.test.d.ts +1 -0
  46. package/dist/umd/typings/__tests__/tools.test.d.ts +1 -0
  47. package/dist/umd/typings/apply-relative-paths-to-config.d.ts +9 -0
  48. package/dist/umd/typings/create-bundle.d.ts +7 -0
  49. package/dist/umd/typings/create-names-for-package.d.ts +8 -0
  50. package/dist/umd/typings/format-assets-path.d.ts +2 -0
  51. package/dist/umd/typings/get-app-images.d.ts +8 -0
  52. package/dist/umd/typings/get-colors-for-environment.d.ts +2 -0
  53. package/dist/umd/typings/get-images-for-config.d.ts +15 -0
  54. package/dist/umd/typings/get-versions.d.ts +2 -0
  55. package/dist/umd/typings/index.d.ts +4 -0
  56. package/dist/umd/typings/setup-config.types.d.ts +145 -0
  57. package/dist/umd/typings/tools.d.ts +17 -0
  58. package/package.json +14 -8
  59. package/typings/__tests__/apply-relative-paths-to-config.test.d.ts +1 -0
  60. package/typings/__tests__/create-bundle.test.d.ts +0 -1
  61. package/typings/__tests__/format-assets-path.test.d.ts +1 -0
  62. package/typings/__tests__/get-colors-for-environment.test.d.ts +0 -1
  63. package/typings/__tests__/get-images-for-config.test.d.ts +0 -1
  64. package/typings/__tests__/get-versions.test.d.ts +0 -1
  65. package/typings/__tests__/tools.test.d.ts +1 -0
  66. package/typings/apply-relative-paths-to-config.d.ts +9 -0
  67. package/typings/create-bundle.d.ts +7 -3
  68. package/typings/create-names-for-package.d.ts +0 -1
  69. package/typings/format-assets-path.d.ts +2 -0
  70. package/typings/get-app-images.d.ts +8 -0
  71. package/typings/get-colors-for-environment.d.ts +0 -1
  72. package/typings/get-images-for-config.d.ts +0 -1
  73. package/typings/get-versions.d.ts +2 -3
  74. package/typings/index.d.ts +0 -6
  75. package/typings/setup-config.types.d.ts +4 -11
  76. package/typings/tools.d.ts +17 -0
  77. package/dist/cjs/index.js.map +0 -1
  78. package/dist/cjs/typings/__tests__/create-bundle.test.d.ts.map +0 -1
  79. package/dist/cjs/typings/__tests__/get-colors-for-environment.test.d.ts.map +0 -1
  80. package/dist/cjs/typings/__tests__/get-images-for-config.test.d.ts.map +0 -1
  81. package/dist/cjs/typings/__tests__/get-versions.test.d.ts.map +0 -1
  82. package/dist/cjs/typings/create-bundle.d.ts.map +0 -1
  83. package/dist/cjs/typings/create-names-for-package.d.ts.map +0 -1
  84. package/dist/cjs/typings/get-colors-for-environment.d.ts.map +0 -1
  85. package/dist/cjs/typings/get-images-for-config.d.ts.map +0 -1
  86. package/dist/cjs/typings/get-versions.d.ts.map +0 -1
  87. package/dist/cjs/typings/index.d.ts.map +0 -1
  88. package/dist/cjs/typings/normalize-paths.d.ts +0 -6
  89. package/dist/cjs/typings/normalize-paths.d.ts.map +0 -1
  90. package/dist/cjs/typings/setup-config.types.d.ts.map +0 -1
  91. package/dist/esm/index.js.map +0 -1
  92. package/dist/esm/typings/__tests__/create-bundle.test.d.ts.map +0 -1
  93. package/dist/esm/typings/__tests__/get-colors-for-environment.test.d.ts.map +0 -1
  94. package/dist/esm/typings/__tests__/get-images-for-config.test.d.ts.map +0 -1
  95. package/dist/esm/typings/__tests__/get-versions.test.d.ts.map +0 -1
  96. package/dist/esm/typings/create-bundle.d.ts.map +0 -1
  97. package/dist/esm/typings/create-names-for-package.d.ts.map +0 -1
  98. package/dist/esm/typings/get-colors-for-environment.d.ts.map +0 -1
  99. package/dist/esm/typings/get-images-for-config.d.ts.map +0 -1
  100. package/dist/esm/typings/get-versions.d.ts.map +0 -1
  101. package/dist/esm/typings/index.d.ts.map +0 -1
  102. package/dist/esm/typings/normalize-paths.d.ts +0 -6
  103. package/dist/esm/typings/normalize-paths.d.ts.map +0 -1
  104. package/dist/esm/typings/setup-config.types.d.ts.map +0 -1
  105. package/typings/__tests__/create-bundle.test.d.ts.map +0 -1
  106. package/typings/__tests__/get-colors-for-environment.test.d.ts.map +0 -1
  107. package/typings/__tests__/get-images-for-config.test.d.ts.map +0 -1
  108. package/typings/__tests__/get-versions.test.d.ts.map +0 -1
  109. package/typings/create-bundle.d.ts.map +0 -1
  110. package/typings/create-names-for-package.d.ts.map +0 -1
  111. package/typings/get-colors-for-environment.d.ts.map +0 -1
  112. package/typings/get-images-for-config.d.ts.map +0 -1
  113. package/typings/get-versions.d.ts.map +0 -1
  114. package/typings/index.d.ts.map +0 -1
  115. package/typings/normalize-paths.d.ts +0 -6
  116. package/typings/normalize-paths.d.ts.map +0 -1
  117. package/typings/setup-config.types.d.ts.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("path"),e=require("fs"),r=function(){return r=Object.assign||function(o){for(var e,r=1,a=arguments.length;r<a;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o},r.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var a,n=function(a,n){if(!n)throw new Error("Path for colors is not defined");var i=o.resolve("".concat(n,"/").concat(a,".colors.json")),s=o.resolve("".concat(n,"/shared.colors.json"));try{var t=e.readFileSync(i,"utf8"),c=e.readFileSync(s,"utf8");return r(r({},JSON.parse(c)),JSON.parse(t))}catch(o){throw new Error("Error reading color files: ".concat(o))}},i={splashFileName:"app-splash",iconFileName:"app-icon",adaptiveFileName:"app-adaptive-icon",faviconFileName:"favicon"},s=function(o,e,r){try{e||(e="../assets/images"),r||(r=i);var a=require("path"),n=o.toLowerCase();return{splashImage:a.resolve("".concat(e,"/").concat(n,"-").concat(r.splashFileName,".png")).replace(/\n/g,"").trim(),iconImage:a.resolve("".concat(e,"/").concat(n,"-").concat(r.iconFileName,".png")).replace(/\n/g,"").trim(),adaptiveIconImage:a.resolve("".concat(e,"/").concat(n,"-").concat(r.adaptiveFileName,".png")).replace(/\s/g,""),faviconImage:a.resolve("".concat(e,"/").concat(n,"-favicon.png")).replace(/\n/g,"").trim()}}catch(e){throw new Error("Error getting images for environment: ".concat(o))}};exports.EnvEumFromPackage=void 0,(a=exports.EnvEumFromPackage||(exports.EnvEumFromPackage={})).production="production",a.staging="staging",a.development="development",a.local="local";var t=function(o,e){var r={name:"",slug:"",identifier:"",shortName:"",scheme:""},a="",n="";return o===exports.EnvEumFromPackage.development?(a=" Dev",n="Development"):o===exports.EnvEumFromPackage.staging?(a=" Staging",n="Staging"):o===exports.EnvEumFromPackage.local?(a=" Local",n="Local"):(a="",n="Production"),r.name="".concat(e).concat(a),r.slug="".concat(e.toLowerCase()).replace(" ",""),r.slug=r.slug.replace(/\s/g,""),r.identifier="com.".concat(r.slug,".").concat(o.toLowerCase()),r.shortName="".concat(e).concat(a).replace("The","").substring(0,12),r.scheme=n,r},c=function(r,a){try{if(!a)throw new Error("Path for versions is not defined");var n=o.resolve(a),i=e.readFileSync(n,"utf8"),s=JSON.parse(i),t=s[r];return t||(t=s.production),{android:{versionCode:t.android.versionCode},ios:{buildNumber:t.ios.buildNumber},app:{version:t.app.version}}}catch(o){throw new Error("Error getting versions for environment: ".concat(r," - ").concat(o.message))}};function l(o){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},l(o)}var d=function(o,e){var a,i,d,p,g=e.envVariables.environment,u=s(g,e.imagesPath),m=n(g,e.colorsPath),v=t(g,o.name),h=v.name,b=v.slug,f=v.shortName,C=v.scheme,k=v.identifier,w=c(g,e.versionsPath),y=w.ios,I=w.android,E={name:h,slug:b,scheme:C,version:w.app.version,icon:u.iconImage,splash:{image:u.splashImage,backgroundColor:m.splash.backgroundColor.light,resizeMode:"contain"},android:{package:k,versionCode:I.versionCode,backgroundColor:m.splash.backgroundColor.light,splash:{image:u.splashImage,backgroundColor:m.splash.backgroundColor.light,resizeMode:"contain"},adaptiveIcon:{foregroundImage:u.adaptiveIconImage},icon:u.iconImage},web:{backgroundColor:m.splash.backgroundColor.light,splash:{image:u.splashImage,backgroundColor:m.splash.backgroundColor.light,resizeMode:"contain"},shortName:f,favicon:u.faviconImage,themeColor:m.themeColor},ios:{backgroundColor:m.splash.backgroundColor.light,buildNumber:y.buildNumber,bundleIdentifier:k,splash:{backgroundColor:m.splash.backgroundColor.light,image:u.splashImage,resizeMode:"contain"},icon:u.iconImage}},N=r(r(r({},E),o),{name:E.name,slug:E.slug,version:E.version});return N.icon&&(N.icon=E.icon),N.splash&&(N.splash=E.splash),N.android&&(N.android.splash=E.android.splash,N.android.adaptiveIcon=E.android.adaptiveIcon,N.android.icon=E.android.icon,N.android.package=E.android.package,N.android.versionCode=E.android.versionCode,N.android.backgroundColor=E.android.backgroundColor),N.ios&&(N.ios.splash=E.ios.splash,N.ios.icon=E.ios.icon,N.ios.bundleIdentifier=E.ios.bundleIdentifier,N.ios.backgroundColor=E.ios.backgroundColor,N.ios.buildNumber=E.ios.buildNumber),o.extra&&(N.extra=o.extra),N.web&&(N.web.backgroundColor=E.web.backgroundColor,N.web.splash=E.web.splash,N.web.shortName=E.web.shortName,N.web.favicon=E.web.favicon,N.web.themeColor=E.web.themeColor),a=N,i=e.rootFolder,d=["icon","splash.image","android.splash.image","android.adaptiveIcon.foregroundImage","android.icon","web.splash.image","web.favicon","ios.splash.image","ios.icon"],p=function(o){var e=o.split(i),r=e.length>1?e[1].trim():o;return"".concat(r.replace(/\n/g,"").trim())},function o(e,r){for(var a in void 0===r&&(r=""),e){var n=r?"".concat(r,".").concat(a):a;"string"==typeof e[a]&&d.includes(n)?e[a]=p(e[a]):"object"===l(e[a])&&null!==e[a]&&o(e[a],n)}}(a),N=a};exports.createBundle=d,exports.createNamesForPackage=t,exports.default=d,exports.getColorsForEnvironment=n,exports.getImagesForEnvironment=s,exports.getVersions=c;
2
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EnvEumFromPackage=void 0;var e=require("./create-bundle"),r=require("./setup-config.types");Object.defineProperty(exports,"EnvEumFromPackage",{enumerable:!0,get:function(){return r.EnvEumFromPackage}}),exports.default=e.createBundle;
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=create-bundle.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=get-colors-for-environment.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=get-images-for-config.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=get-versions.test.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Recursively applies relative path conversion to all asset paths in a configuration object.
3
+ * This function iterates through each property of the object. If the property is a string
4
+ * containing '/assets', it converts it using `convertAbsolutePathToRelative`. If the property
5
+ * is an object or an array, it recursively applies the same logic to its properties or elements.
6
+ * @param {object} config - The configuration object to be processed.
7
+ * @param {string} [basePath=''] - The base path for recursion, used for nested objects.
8
+ */
9
+ export declare function applyRelativePathsToConfig(config: any, basePath?: string): void;
@@ -1,3 +1,7 @@
1
- import type { BundleConfig } from "./setup-config.types";
2
- export declare const createBundle: (existingConfig: any, bundleConfig: BundleConfig) => any;
3
- //# sourceMappingURL=create-bundle.d.ts.map
1
+ import type { BundleConfig, PieceOfConfig } from "./setup-config.types";
2
+ interface PartialConfig extends Partial<PieceOfConfig> {
3
+ name: string;
4
+ slug: string;
5
+ }
6
+ export declare const createBundle: (existingConfig: PartialConfig, bundleConfig: BundleConfig) => PieceOfConfig | any;
7
+ export {};
@@ -6,4 +6,3 @@ export declare const createNamesForPackage: (environmentName: EnvType, appName:
6
6
  identifier: string;
7
7
  slug: string;
8
8
  };
9
- //# sourceMappingURL=create-names-for-package.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare function transformAssetsPath(value: string): string | undefined;
2
+ export declare const formatAssetsPath: (value: string) => string;
@@ -0,0 +1,8 @@
1
+ import { ColorsFromAssets, ImagesForEnvironment } from ".";
2
+ export declare const getSplash: (images: ImagesForEnvironment, colors: ColorsFromAssets) => {
3
+ image: string;
4
+ backgroundColor: string;
5
+ resizeMode?: "cover" | "contain";
6
+ };
7
+ export declare const getAppIcon: (images: ImagesForEnvironment) => string;
8
+ export declare const getAppBackgroundColor: (colors: ColorsFromAssets) => string;
@@ -1,3 +1,2 @@
1
1
  import type { ColorsFromAssets, EnvType } from "./setup-config.types.js";
2
2
  export declare const getColorsForEnvironment: (env: EnvType, pathForColors: string) => ColorsFromAssets;
3
- //# sourceMappingURL=get-colors-for-environment.d.ts.map
@@ -13,4 +13,3 @@ interface NameForImageType {
13
13
  }
14
14
  export declare const getImagesForEnvironment: (env: EnvType, pathToCheck?: string, namesForImages?: NameForImageType) => ImagesForEnvironment;
15
15
  export {};
16
- //# sourceMappingURL=get-images-for-config.d.ts.map
@@ -1,3 +1,2 @@
1
- import type { EnvEumFromPackage, EnvironmentConfig } from "./setup-config.types.js";
2
- export declare const getVersions: (env: EnvEumFromPackage, versionsPath: string) => EnvironmentConfig;
3
- //# sourceMappingURL=get-versions.d.ts.map
1
+ import type { EnvType, EnvironmentConfig } from "./setup-config.types.js";
2
+ export declare const getVersions: (env: EnvType, versionsPath: string) => EnvironmentConfig;
@@ -1,10 +1,4 @@
1
1
  import { createBundle } from "./create-bundle";
2
- export { createBundle } from "./create-bundle";
3
- export { createNamesForPackage } from "./create-names-for-package";
4
- export { getColorsForEnvironment } from "./get-colors-for-environment";
5
- export { getImagesForEnvironment } from "./get-images-for-config";
6
2
  export type { ImagesForEnvironment } from "./get-images-for-config";
7
- export { getVersions } from "./get-versions";
8
3
  export { AppConfigFromEnv, ColorsFromAssets, EnvEumFromPackage, ColorMode, BundleConfig, EnvType, ColorAppConfig, PieceOfConfig, AndroidVersion, SplashConfig, EnvironmentConfig, IOSVersion, } from "./setup-config.types";
9
4
  export default createBundle;
10
- //# sourceMappingURL=index.d.ts.map
@@ -3,13 +3,15 @@ export interface BundleConfig {
3
3
  colorsPath: string;
4
4
  envVariables: AppConfigFromEnv;
5
5
  imagesPath: string;
6
- rootFolder: string;
7
6
  versionsPath: string;
8
7
  projectId: string;
9
8
  }
10
9
  export interface AppConfigFromEnv {
11
10
  environment: EnvType;
12
- baseURL: string;
11
+ baseURL: {
12
+ native: string;
13
+ web: string;
14
+ };
13
15
  branding: {
14
16
  logoURL: string;
15
17
  };
@@ -18,10 +20,6 @@ export interface AppConfigFromEnv {
18
20
  primaryTagline: string;
19
21
  secondaryTagline: string;
20
22
  };
21
- jwPlayer: {
22
- playerKey: string;
23
- playerSecret: string;
24
- };
25
23
  authentication: {
26
24
  login: {
27
25
  email: string;
@@ -38,10 +36,6 @@ export interface AppConfigFromEnv {
38
36
  lastName: string;
39
37
  };
40
38
  };
41
- stripeDetails: {
42
- secretKey: string;
43
- publishableKey: string;
44
- };
45
39
  apiKeys: {
46
40
  [key: string]: string;
47
41
  };
@@ -149,4 +143,3 @@ export interface PieceOfConfig extends Partial<any> {
149
143
  };
150
144
  extra?: ExtraConfig;
151
145
  }
152
- //# sourceMappingURL=setup-config.types.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { AppConfigFromEnv, BundleConfig, PieceOfConfig } from ".";
2
+ export declare const writeConfigToJsonFile: (result: PieceOfConfig, environment: AppConfigFromEnv["environment"]) => void;
3
+ export declare const generateBundleConfigForEnvironment: (environment: AppConfigFromEnv["environment"]) => BundleConfig;
4
+ export declare const generateAppConfigForEnvironment: (appName: string, environment: AppConfigFromEnv["environment"]) => PieceOfConfig;
5
+ export declare const generateFaultyAppConfig: (name: string, slug: string) => PieceOfConfig;
6
+ export declare const productionConfig: BundleConfig;
7
+ export declare const stagingConfig: BundleConfig;
8
+ export declare const localConfig: BundleConfig;
9
+ export declare const developmentConfig: BundleConfig;
10
+ export declare const expoDevConfig: PieceOfConfig;
11
+ export declare const expoProductionConfig: PieceOfConfig;
12
+ export declare const expoStagingConfig: PieceOfConfig;
13
+ export declare const faultyConfig: PieceOfConfig;
14
+ export declare const productionResult: any;
15
+ export declare const stagingResult: any;
16
+ export declare const localResult: any;
17
+ export declare const developmentResult: any;
package/dist/esm/index.js CHANGED
@@ -1,2 +1 @@
1
- import o from"path";import e from"fs";var a=function(){return a=Object.assign||function(o){for(var e,a=1,r=arguments.length;a<r;a++)for(var n in e=arguments[a])Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o},a.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var r,n=function(r,n){if(!n)throw new Error("Path for colors is not defined");var i=o.resolve("".concat(n,"/").concat(r,".colors.json")),c=o.resolve("".concat(n,"/shared.colors.json"));try{var s=e.readFileSync(i,"utf8"),t=e.readFileSync(c,"utf8");return a(a({},JSON.parse(t)),JSON.parse(s))}catch(o){throw new Error("Error reading color files: ".concat(o))}},i={splashFileName:"app-splash",iconFileName:"app-icon",adaptiveFileName:"app-adaptive-icon",faviconFileName:"favicon"},c=function(o,e,a){try{e||(e="../assets/images"),a||(a=i);var r=require("path"),n=o.toLowerCase();return{splashImage:r.resolve("".concat(e,"/").concat(n,"-").concat(a.splashFileName,".png")).replace(/\n/g,"").trim(),iconImage:r.resolve("".concat(e,"/").concat(n,"-").concat(a.iconFileName,".png")).replace(/\n/g,"").trim(),adaptiveIconImage:r.resolve("".concat(e,"/").concat(n,"-").concat(a.adaptiveFileName,".png")).replace(/\s/g,""),faviconImage:r.resolve("".concat(e,"/").concat(n,"-favicon.png")).replace(/\n/g,"").trim()}}catch(e){throw new Error("Error getting images for environment: ".concat(o))}};!function(o){o.production="production",o.staging="staging",o.development="development",o.local="local"}(r||(r={}));var s=function(o,e){var a={name:"",slug:"",identifier:"",shortName:"",scheme:""},n="",i="";return o===r.development?(n=" Dev",i="Development"):o===r.staging?(n=" Staging",i="Staging"):o===r.local?(n=" Local",i="Local"):(n="",i="Production"),a.name="".concat(e).concat(n),a.slug="".concat(e.toLowerCase()).replace(" ",""),a.slug=a.slug.replace(/\s/g,""),a.identifier="com.".concat(a.slug,".").concat(o.toLowerCase()),a.shortName="".concat(e).concat(n).replace("The","").substring(0,12),a.scheme=i,a},t=function(a,r){try{if(!r)throw new Error("Path for versions is not defined");var n=o.resolve(r),i=e.readFileSync(n,"utf8"),c=JSON.parse(i),s=c[a];return s||(s=c.production),{android:{versionCode:s.android.versionCode},ios:{buildNumber:s.ios.buildNumber},app:{version:s.app.version}}}catch(o){throw new Error("Error getting versions for environment: ".concat(a," - ").concat(o.message))}};function l(o){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},l(o)}var d=function(o,e){var r,i,d,p,g=e.envVariables.environment,u=c(g,e.imagesPath),m=n(g,e.colorsPath),h=s(g,o.name),v=h.name,b=h.slug,f=h.shortName,C=h.scheme,w=h.identifier,y=t(g,e.versionsPath),I=y.ios,k=y.android,N={name:v,slug:b,scheme:C,version:y.app.version,icon:u.iconImage,splash:{image:u.splashImage,backgroundColor:m.splash.backgroundColor.light,resizeMode:"contain"},android:{package:w,versionCode:k.versionCode,backgroundColor:m.splash.backgroundColor.light,splash:{image:u.splashImage,backgroundColor:m.splash.backgroundColor.light,resizeMode:"contain"},adaptiveIcon:{foregroundImage:u.adaptiveIconImage},icon:u.iconImage},web:{backgroundColor:m.splash.backgroundColor.light,splash:{image:u.splashImage,backgroundColor:m.splash.backgroundColor.light,resizeMode:"contain"},shortName:f,favicon:u.faviconImage,themeColor:m.themeColor},ios:{backgroundColor:m.splash.backgroundColor.light,buildNumber:I.buildNumber,bundleIdentifier:w,splash:{backgroundColor:m.splash.backgroundColor.light,image:u.splashImage,resizeMode:"contain"},icon:u.iconImage}},S=a(a(a({},N),o),{name:N.name,slug:N.slug,version:N.version});return S.icon&&(S.icon=N.icon),S.splash&&(S.splash=N.splash),S.android&&(S.android.splash=N.android.splash,S.android.adaptiveIcon=N.android.adaptiveIcon,S.android.icon=N.android.icon,S.android.package=N.android.package,S.android.versionCode=N.android.versionCode,S.android.backgroundColor=N.android.backgroundColor),S.ios&&(S.ios.splash=N.ios.splash,S.ios.icon=N.ios.icon,S.ios.bundleIdentifier=N.ios.bundleIdentifier,S.ios.backgroundColor=N.ios.backgroundColor,S.ios.buildNumber=N.ios.buildNumber),o.extra&&(S.extra=o.extra),S.web&&(S.web.backgroundColor=N.web.backgroundColor,S.web.splash=N.web.splash,S.web.shortName=N.web.shortName,S.web.favicon=N.web.favicon,S.web.themeColor=N.web.themeColor),r=S,i=e.rootFolder,d=["icon","splash.image","android.splash.image","android.adaptiveIcon.foregroundImage","android.icon","web.splash.image","web.favicon","ios.splash.image","ios.icon"],p=function(o){var e=o.split(i),a=e.length>1?e[1].trim():o;return"".concat(a.replace(/\n/g,"").trim())},function o(e,a){for(var r in void 0===a&&(a=""),e){var n=a?"".concat(a,".").concat(r):r;"string"==typeof e[r]&&d.includes(n)?e[r]=p(e[r]):"object"===l(e[r])&&null!==e[r]&&o(e[r],n)}}(r),S=r};export{r as EnvEumFromPackage,d as createBundle,s as createNamesForPackage,d as default,n as getColorsForEnvironment,c as getImagesForEnvironment,t as getVersions};
2
- //# sourceMappingURL=index.js.map
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.EnvEumFromPackage=void 0;var e=require("./create-bundle"),r=require("./setup-config.types");Object.defineProperty(exports,"EnvEumFromPackage",{enumerable:!0,get:function(){return r.EnvEumFromPackage}}),exports.default=e.createBundle;
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=create-bundle.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=get-colors-for-environment.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=get-images-for-config.test.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=get-versions.test.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Recursively applies relative path conversion to all asset paths in a configuration object.
3
+ * This function iterates through each property of the object. If the property is a string
4
+ * containing '/assets', it converts it using `convertAbsolutePathToRelative`. If the property
5
+ * is an object or an array, it recursively applies the same logic to its properties or elements.
6
+ * @param {object} config - The configuration object to be processed.
7
+ * @param {string} [basePath=''] - The base path for recursion, used for nested objects.
8
+ */
9
+ export declare function applyRelativePathsToConfig(config: any, basePath?: string): void;
@@ -1,3 +1,7 @@
1
- import type { BundleConfig } from "./setup-config.types";
2
- export declare const createBundle: (existingConfig: any, bundleConfig: BundleConfig) => any;
3
- //# sourceMappingURL=create-bundle.d.ts.map
1
+ import type { BundleConfig, PieceOfConfig } from "./setup-config.types";
2
+ interface PartialConfig extends Partial<PieceOfConfig> {
3
+ name: string;
4
+ slug: string;
5
+ }
6
+ export declare const createBundle: (existingConfig: PartialConfig, bundleConfig: BundleConfig) => PieceOfConfig | any;
7
+ export {};
@@ -6,4 +6,3 @@ export declare const createNamesForPackage: (environmentName: EnvType, appName:
6
6
  identifier: string;
7
7
  slug: string;
8
8
  };
9
- //# sourceMappingURL=create-names-for-package.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare function transformAssetsPath(value: string): string | undefined;
2
+ export declare const formatAssetsPath: (value: string) => string;
@@ -0,0 +1,8 @@
1
+ import { ColorsFromAssets, ImagesForEnvironment } from ".";
2
+ export declare const getSplash: (images: ImagesForEnvironment, colors: ColorsFromAssets) => {
3
+ image: string;
4
+ backgroundColor: string;
5
+ resizeMode?: "cover" | "contain";
6
+ };
7
+ export declare const getAppIcon: (images: ImagesForEnvironment) => string;
8
+ export declare const getAppBackgroundColor: (colors: ColorsFromAssets) => string;
@@ -1,3 +1,2 @@
1
1
  import type { ColorsFromAssets, EnvType } from "./setup-config.types.js";
2
2
  export declare const getColorsForEnvironment: (env: EnvType, pathForColors: string) => ColorsFromAssets;
3
- //# sourceMappingURL=get-colors-for-environment.d.ts.map
@@ -13,4 +13,3 @@ interface NameForImageType {
13
13
  }
14
14
  export declare const getImagesForEnvironment: (env: EnvType, pathToCheck?: string, namesForImages?: NameForImageType) => ImagesForEnvironment;
15
15
  export {};
16
- //# sourceMappingURL=get-images-for-config.d.ts.map
@@ -1,3 +1,2 @@
1
- import type { EnvEumFromPackage, EnvironmentConfig } from "./setup-config.types.js";
2
- export declare const getVersions: (env: EnvEumFromPackage, versionsPath: string) => EnvironmentConfig;
3
- //# sourceMappingURL=get-versions.d.ts.map
1
+ import type { EnvType, EnvironmentConfig } from "./setup-config.types.js";
2
+ export declare const getVersions: (env: EnvType, versionsPath: string) => EnvironmentConfig;
@@ -1,10 +1,4 @@
1
1
  import { createBundle } from "./create-bundle";
2
- export { createBundle } from "./create-bundle";
3
- export { createNamesForPackage } from "./create-names-for-package";
4
- export { getColorsForEnvironment } from "./get-colors-for-environment";
5
- export { getImagesForEnvironment } from "./get-images-for-config";
6
2
  export type { ImagesForEnvironment } from "./get-images-for-config";
7
- export { getVersions } from "./get-versions";
8
3
  export { AppConfigFromEnv, ColorsFromAssets, EnvEumFromPackage, ColorMode, BundleConfig, EnvType, ColorAppConfig, PieceOfConfig, AndroidVersion, SplashConfig, EnvironmentConfig, IOSVersion, } from "./setup-config.types";
9
4
  export default createBundle;
10
- //# sourceMappingURL=index.d.ts.map
@@ -3,13 +3,15 @@ export interface BundleConfig {
3
3
  colorsPath: string;
4
4
  envVariables: AppConfigFromEnv;
5
5
  imagesPath: string;
6
- rootFolder: string;
7
6
  versionsPath: string;
8
7
  projectId: string;
9
8
  }
10
9
  export interface AppConfigFromEnv {
11
10
  environment: EnvType;
12
- baseURL: string;
11
+ baseURL: {
12
+ native: string;
13
+ web: string;
14
+ };
13
15
  branding: {
14
16
  logoURL: string;
15
17
  };
@@ -18,10 +20,6 @@ export interface AppConfigFromEnv {
18
20
  primaryTagline: string;
19
21
  secondaryTagline: string;
20
22
  };
21
- jwPlayer: {
22
- playerKey: string;
23
- playerSecret: string;
24
- };
25
23
  authentication: {
26
24
  login: {
27
25
  email: string;
@@ -38,10 +36,6 @@ export interface AppConfigFromEnv {
38
36
  lastName: string;
39
37
  };
40
38
  };
41
- stripeDetails: {
42
- secretKey: string;
43
- publishableKey: string;
44
- };
45
39
  apiKeys: {
46
40
  [key: string]: string;
47
41
  };
@@ -149,4 +143,3 @@ export interface PieceOfConfig extends Partial<any> {
149
143
  };
150
144
  extra?: ExtraConfig;
151
145
  }
152
- //# sourceMappingURL=setup-config.types.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { AppConfigFromEnv, BundleConfig, PieceOfConfig } from ".";
2
+ export declare const writeConfigToJsonFile: (result: PieceOfConfig, environment: AppConfigFromEnv["environment"]) => void;
3
+ export declare const generateBundleConfigForEnvironment: (environment: AppConfigFromEnv["environment"]) => BundleConfig;
4
+ export declare const generateAppConfigForEnvironment: (appName: string, environment: AppConfigFromEnv["environment"]) => PieceOfConfig;
5
+ export declare const generateFaultyAppConfig: (name: string, slug: string) => PieceOfConfig;
6
+ export declare const productionConfig: BundleConfig;
7
+ export declare const stagingConfig: BundleConfig;
8
+ export declare const localConfig: BundleConfig;
9
+ export declare const developmentConfig: BundleConfig;
10
+ export declare const expoDevConfig: PieceOfConfig;
11
+ export declare const expoProductionConfig: PieceOfConfig;
12
+ export declare const expoStagingConfig: PieceOfConfig;
13
+ export declare const faultyConfig: PieceOfConfig;
14
+ export declare const productionResult: any;
15
+ export declare const stagingResult: any;
16
+ export declare const localResult: any;
17
+ export declare const developmentResult: any;
@@ -0,0 +1 @@
1
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EnvEumFromPackage=void 0;var e=require("./create-bundle"),r=require("./setup-config.types");Object.defineProperty(exports,"EnvEumFromPackage",{enumerable:!0,get:function(){return r.EnvEumFromPackage}}),exports.default=e.createBundle}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Recursively applies relative path conversion to all asset paths in a configuration object.
3
+ * This function iterates through each property of the object. If the property is a string
4
+ * containing '/assets', it converts it using `convertAbsolutePathToRelative`. If the property
5
+ * is an object or an array, it recursively applies the same logic to its properties or elements.
6
+ * @param {object} config - The configuration object to be processed.
7
+ * @param {string} [basePath=''] - The base path for recursion, used for nested objects.
8
+ */
9
+ export declare function applyRelativePathsToConfig(config: any, basePath?: string): void;
@@ -0,0 +1,7 @@
1
+ import type { BundleConfig, PieceOfConfig } from "./setup-config.types";
2
+ interface PartialConfig extends Partial<PieceOfConfig> {
3
+ name: string;
4
+ slug: string;
5
+ }
6
+ export declare const createBundle: (existingConfig: PartialConfig, bundleConfig: BundleConfig) => PieceOfConfig | any;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { EnvType } from "./setup-config.types";
2
+ export declare const createNamesForPackage: (environmentName: EnvType, appName: string) => {
3
+ name: string;
4
+ shortName: string;
5
+ scheme: string;
6
+ identifier: string;
7
+ slug: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ export declare function transformAssetsPath(value: string): string | undefined;
2
+ export declare const formatAssetsPath: (value: string) => string;
@@ -0,0 +1,8 @@
1
+ import { ColorsFromAssets, ImagesForEnvironment } from ".";
2
+ export declare const getSplash: (images: ImagesForEnvironment, colors: ColorsFromAssets) => {
3
+ image: string;
4
+ backgroundColor: string;
5
+ resizeMode?: "cover" | "contain";
6
+ };
7
+ export declare const getAppIcon: (images: ImagesForEnvironment) => string;
8
+ export declare const getAppBackgroundColor: (colors: ColorsFromAssets) => string;
@@ -0,0 +1,2 @@
1
+ import type { ColorsFromAssets, EnvType } from "./setup-config.types.js";
2
+ export declare const getColorsForEnvironment: (env: EnvType, pathForColors: string) => ColorsFromAssets;
@@ -0,0 +1,15 @@
1
+ import type { EnvType } from "./setup-config.types.js";
2
+ export interface ImagesForEnvironment {
3
+ splashImage: string;
4
+ iconImage: string;
5
+ adaptiveIconImage: string;
6
+ faviconImage: string;
7
+ }
8
+ interface NameForImageType {
9
+ splashFileName: string;
10
+ iconFileName: string;
11
+ adaptiveFileName: string;
12
+ faviconFileName: string;
13
+ }
14
+ export declare const getImagesForEnvironment: (env: EnvType, pathToCheck?: string, namesForImages?: NameForImageType) => ImagesForEnvironment;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { EnvType, EnvironmentConfig } from "./setup-config.types.js";
2
+ export declare const getVersions: (env: EnvType, versionsPath: string) => EnvironmentConfig;
@@ -0,0 +1,4 @@
1
+ import { createBundle } from "./create-bundle";
2
+ export type { ImagesForEnvironment } from "./get-images-for-config";
3
+ export { AppConfigFromEnv, ColorsFromAssets, EnvEumFromPackage, ColorMode, BundleConfig, EnvType, ColorAppConfig, PieceOfConfig, AndroidVersion, SplashConfig, EnvironmentConfig, IOSVersion, } from "./setup-config.types";
4
+ export default createBundle;
@@ -0,0 +1,145 @@
1
+ export type ColorsFromAssets = ColorAppConfig & ColorConfig;
2
+ export interface BundleConfig {
3
+ colorsPath: string;
4
+ envVariables: AppConfigFromEnv;
5
+ imagesPath: string;
6
+ versionsPath: string;
7
+ projectId: string;
8
+ }
9
+ export interface AppConfigFromEnv {
10
+ environment: EnvType;
11
+ baseURL: {
12
+ native: string;
13
+ web: string;
14
+ };
15
+ branding: {
16
+ logoURL: string;
17
+ };
18
+ verbiage: {
19
+ displayName: string;
20
+ primaryTagline: string;
21
+ secondaryTagline: string;
22
+ };
23
+ authentication: {
24
+ login: {
25
+ email: string;
26
+ password: string;
27
+ phoneNumber: string;
28
+ firstName: string;
29
+ lastName: string;
30
+ };
31
+ register: {
32
+ email: string;
33
+ password: string;
34
+ phoneNumber: string;
35
+ firstName: string;
36
+ lastName: string;
37
+ };
38
+ };
39
+ apiKeys: {
40
+ [key: string]: string;
41
+ };
42
+ }
43
+ export interface VersionsJSON {
44
+ production: EnvironmentConfig;
45
+ staging: EnvironmentConfig;
46
+ development: EnvironmentConfig;
47
+ }
48
+ export interface AndroidVersion {
49
+ versionCode: number;
50
+ }
51
+ export interface IOSVersion {
52
+ buildNumber: string;
53
+ }
54
+ export interface AppVersion {
55
+ version: string;
56
+ }
57
+ export interface EnvironmentConfig {
58
+ ios: IOSVersion;
59
+ android: AndroidVersion;
60
+ app: AppVersion;
61
+ }
62
+ export declare enum EnvEumFromPackage {
63
+ production = "production",
64
+ staging = "staging",
65
+ development = "development",
66
+ local = "local"
67
+ }
68
+ export type EnvType = "production" | "staging" | "development" | "local" | EnvEumFromPackage;
69
+ export interface ColorMode {
70
+ light: string;
71
+ dark?: string;
72
+ }
73
+ export interface SplashConfig {
74
+ backgroundColor: ColorMode;
75
+ }
76
+ export interface AdaptiveIconConfig {
77
+ backgroundColor: ColorMode;
78
+ }
79
+ export interface StatusBarConfig {
80
+ backgroundColor: ColorMode;
81
+ }
82
+ export interface NavigationBarConfig {
83
+ backgroundColor: ColorMode;
84
+ }
85
+ export interface ColorConfig {
86
+ statusBar: StatusBarConfig;
87
+ navigationBar: NavigationBarConfig;
88
+ primaryColor: ColorMode;
89
+ }
90
+ export interface ColorAppConfig {
91
+ splash: SplashConfig;
92
+ adaptiveIcon: AdaptiveIconConfig;
93
+ iconColor: ColorMode;
94
+ themeColor: string;
95
+ }
96
+ export interface ExtraConfig {
97
+ eas: {
98
+ projectId: string;
99
+ };
100
+ env: AppConfigFromEnv;
101
+ }
102
+ export interface PieceOfConfig extends Partial<any> {
103
+ name: string;
104
+ slug: string;
105
+ version: string;
106
+ icon: string;
107
+ scheme: string;
108
+ android: {
109
+ package: string;
110
+ versionCode: number;
111
+ backgroundColor: string;
112
+ splash: {
113
+ image: string;
114
+ backgroundColor: string;
115
+ resizeMode?: "cover" | "contain";
116
+ };
117
+ adaptiveIcon: {
118
+ foregroundImage: string;
119
+ };
120
+ icon: string;
121
+ };
122
+ web: {
123
+ backgroundColor: string;
124
+ splash: {
125
+ image: string;
126
+ backgroundColor: string;
127
+ resizeMode?: "cover" | "contain";
128
+ };
129
+ shortName: string;
130
+ favicon: string;
131
+ themeColor: string;
132
+ };
133
+ ios: {
134
+ bundleIdentifier: string;
135
+ backgroundColor: string;
136
+ buildNumber: string;
137
+ splash: {
138
+ image: string;
139
+ resizeMode?: "cover" | "contain";
140
+ backgroundColor: string;
141
+ };
142
+ icon: string;
143
+ };
144
+ extra?: ExtraConfig;
145
+ }