forked from EvanBacon/pillar-valley
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.config.ts
169 lines (159 loc) · 4.56 KB
/
app.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import "ts-node/register";
import withAppleSettings, {
ChildPane,
Group,
Switch,
Title,
} from "@config-plugins/apple-settings";
import { ConfigContext, ExpoConfig } from "expo/config";
import fs from "node:fs";
import path from "node:path";
import { UPDATES_API_KEYS } from "./src/apple-settings-x/shared";
module.exports = ({ config }: ConfigContext): Partial<ExpoConfig> => {
if (!config.plugins) config.plugins = [];
config.plugins.push([
"@config-plugins/react-native-dynamic-app-icon",
fs
.readdirSync(path.resolve(__dirname, "./icons/pillars"))
.sort()
.reduce<Record<string, { image: string }>>((acc, file) => {
if (!file.startsWith("default.png") && file.endsWith(".png")) {
acc[file.replace(/\.[\w]+/, "")] = {
image: `./icons/pillars/${file}`,
};
}
return acc;
}, {}),
]);
config = require("./target-plugin").withTargetsDir(config, {
appleTeamId: "QQ57RJ5UTD",
// match: "watch-app",
});
config = withAppleSettings(config as ExpoConfig, {
// The name of the .plist file to generate. Root is the default and must be provided.
Root: {
// The page object is required. It will be used to generate the .plist file.
// The contents will be converted directly to plist.
page: {
// The `PreferenceSpecifiers` defines the UI elements to generate.
PreferenceSpecifiers: [
// Child panes can be used to create nested pages.
Switch({
title: "Music and Sound ♫",
key: "p_inapp_audio",
value: true,
}),
Group({
title: "About",
footerText: "Built by Evan Bacon 🥓\nPowered by Expo 𝝠",
}),
Title({
title: "Version",
value: "",
key: "p_app_version",
}),
ChildPane({
title: "Licenses",
file: "Licenses",
}),
ChildPane({
title: "Developer Info",
file: "Developer",
}),
ChildPane({
title: "Runtime",
file: "Runtime",
}),
],
},
},
// Build-time info
Developer: {
page: {
PreferenceSpecifiers: [
Title({
title: "Bundle Identifier",
value: config.ios?.bundleIdentifier!,
key: "info_1_pref",
}),
Title({
title: "Expo SDK",
value: config.sdkVersion ?? "???",
key: "info_2_pref",
}),
Title({
title: "Scheme",
value: Array.isArray(config.scheme)
? config.scheme.join(", ")
: config.scheme!,
key: "info_3_pref",
}),
],
},
},
Runtime: {
page: {
PreferenceSpecifiers: [
Group({
// idk but this seems like a better name than "Updates" in case it shows in search.
title: "Runtime",
footerText: "Based on the last successful launch of the app",
}),
...UPDATES_API_KEYS.map(({ setting, name }) =>
Title({
title: name,
value: "[Pending]",
key: setting,
})
),
Title({
title: "Updated",
key: "p_exupdates__updatedAt",
value: "[Pending]",
}),
Group({
title: "Latest",
footerText: "Based on the running instance of the app",
}),
Title({
title: "Status",
key: "p_exupdates_live_type",
value: "[Pending]",
}),
Title({
title: "Details",
key: "p_exupdates_live_message",
value: "[Pending]",
}),
Title({
title: "Updated",
key: "p_exupdates_live__updatedAt",
value: "[Pending]",
}),
],
},
},
Licenses: {
page: {
// src/constants/Licenses.json
PreferenceSpecifiers: [
Group({
title: "Licenses",
footerText:
"Generated by Expo Config Plugins\nhttps://docs.expo.dev/config-plugins/introduction/",
}),
...Object.entries(
require("./src/constants/Licenses.json") as Record<string, any>
).map(([name, info], index) =>
Title({
title: name,
key: "license_" + index,
value: info.licenses,
})
),
],
},
},
});
return config;
};