@oxy.so/app-preset 3.0.0 → 3.1.0
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/babel/index.js +1 -3
- package/build-id/index.js +4 -1
- package/css/base.css +9 -1
- package/metro/index.js +10 -3
- package/package.json +1 -1
- package/plugin/withOxyAndroidRelease.js +1 -2
- package/plugin/withOxyAppPreset.js +7 -11
- package/plugin/withOxyBuildProperties.js +5 -6
- package/plugin/withOxyUpdates.js +14 -14
- package/tsconfig/backend.json +3 -2
- package/tsconfig/base.json +1 -7
package/babel/index.js
CHANGED
|
@@ -20,9 +20,7 @@
|
|
|
20
20
|
module.exports = function oxyBabelPreset(api) {
|
|
21
21
|
api.cache(true);
|
|
22
22
|
return {
|
|
23
|
-
presets: [
|
|
24
|
-
['babel-preset-expo', { unstable_transformImportMeta: true }],
|
|
25
|
-
],
|
|
23
|
+
presets: [['babel-preset-expo', { unstable_transformImportMeta: true }]],
|
|
26
24
|
plugins: [
|
|
27
25
|
// The module-resolver must come first for correct module resolution.
|
|
28
26
|
[
|
package/build-id/index.js
CHANGED
|
@@ -16,7 +16,10 @@ function resolveOxyBuildId(projectRoot = process.cwd()) {
|
|
|
16
16
|
const ciCommit = process.env.GITHUB_SHA || process.env.EAS_BUILD_GIT_COMMIT_HASH;
|
|
17
17
|
if (ciCommit) return ciCommit;
|
|
18
18
|
try {
|
|
19
|
-
return execFileSync('git', ['rev-parse', 'HEAD'], {
|
|
19
|
+
return execFileSync('git', ['rev-parse', 'HEAD'], {
|
|
20
|
+
cwd: projectRoot,
|
|
21
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
22
|
+
})
|
|
20
23
|
.toString()
|
|
21
24
|
.trim();
|
|
22
25
|
} catch {
|
package/css/base.css
CHANGED
|
@@ -61,7 +61,15 @@
|
|
|
61
61
|
restatement is not a re-skin, it is what stops NativeWind's own unlayered default
|
|
62
62
|
from overriding Bloom. Do not "tidy" it away. */
|
|
63
63
|
:root {
|
|
64
|
-
--font-sans: var(
|
|
64
|
+
--font-sans: var(
|
|
65
|
+
--bloom-font-sans,
|
|
66
|
+
Inter,
|
|
67
|
+
-apple-system,
|
|
68
|
+
BlinkMacSystemFont,
|
|
69
|
+
"Segoe UI",
|
|
70
|
+
Roboto,
|
|
71
|
+
sans-serif
|
|
72
|
+
);
|
|
65
73
|
|
|
66
74
|
@media ios {
|
|
67
75
|
--font-sans: Inter;
|
package/metro/index.js
CHANGED
|
@@ -73,7 +73,10 @@ function createOxyMetroConfig(projectRoot, options = {}) {
|
|
|
73
73
|
config.projectRoot = projectRoot;
|
|
74
74
|
|
|
75
75
|
// Include the monorepo root so Metro resolves hoisted deps in root node_modules/.
|
|
76
|
-
config.watchFolders = unique([
|
|
76
|
+
config.watchFolders = unique([
|
|
77
|
+
monorepoRoot,
|
|
78
|
+
...extraWatchFolders.map((folder) => path.resolve(folder)),
|
|
79
|
+
]);
|
|
77
80
|
|
|
78
81
|
const blockList = [
|
|
79
82
|
blockPath(path.join(monorepoRoot, 'packages/backend')),
|
|
@@ -94,7 +97,9 @@ function createOxyMetroConfig(projectRoot, options = {}) {
|
|
|
94
97
|
/\.spec\.(js|ts|tsx|jsx)$/,
|
|
95
98
|
/\.md$/,
|
|
96
99
|
/(?:^|[/\\])README(?:\.[^/\\]+)?$/,
|
|
97
|
-
...extraBlockList.map((pattern) =>
|
|
100
|
+
...extraBlockList.map((pattern) =>
|
|
101
|
+
typeof pattern === 'string' ? blockPath(pattern) : pattern,
|
|
102
|
+
),
|
|
98
103
|
];
|
|
99
104
|
|
|
100
105
|
const extraNodeModules = {};
|
|
@@ -134,7 +139,9 @@ function createOxyMetroConfig(projectRoot, options = {}) {
|
|
|
134
139
|
// '…/empty.svg')} />`) — there is no react-native-svg-transformer configured,
|
|
135
140
|
// so removing `svg` from assetExts leaves it unresolvable (breaks the build).
|
|
136
141
|
assetExts: [
|
|
137
|
-
...config.resolver.assetExts.filter(
|
|
142
|
+
...config.resolver.assetExts.filter(
|
|
143
|
+
(extension) => !svgTransformerPath || extension !== 'svg',
|
|
144
|
+
),
|
|
138
145
|
'wasm',
|
|
139
146
|
'woff2',
|
|
140
147
|
'woff',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/app-preset",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "The Oxy distro of Expo — centralized Expo config plugin, Metro/Babel/ESLint factories, Tailwind base CSS and TypeScript bases shared by every Oxy app (Mention, Homiio, Allo, accounts, …). A zero-build package: apps replace copy-pasted config with a single dependency bump.",
|
|
5
5
|
"main": "./app.plugin.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -49,8 +49,7 @@ const DEFAULT_PROGUARD = 'getDefaultProguardFile("proguard-android.txt")';
|
|
|
49
49
|
const OPTIMIZED_PROGUARD = 'getDefaultProguardFile("proguard-android-optimize.txt")';
|
|
50
50
|
|
|
51
51
|
const DEBUG_SIGNING_CONFIG = 'signingConfig signingConfigs.debug';
|
|
52
|
-
const CONDITIONAL_SIGNING_CONFIG =
|
|
53
|
-
`signingConfig project.hasProperty('${STORE_FILE}') ? signingConfigs.release : signingConfigs.debug`;
|
|
52
|
+
const CONDITIONAL_SIGNING_CONFIG = `signingConfig project.hasProperty('${STORE_FILE}') ? signingConfigs.release : signingConfigs.debug`;
|
|
54
53
|
|
|
55
54
|
const RELEASE_SIGNING_CONFIG = ` release {
|
|
56
55
|
// Populated only when the Oxy release keystore properties are
|
|
@@ -40,11 +40,11 @@ const { projectRootOf, requireFromProject } = require('./requireFromProject');
|
|
|
40
40
|
|
|
41
41
|
const REMOVED_OPTIONS = {
|
|
42
42
|
sharedUserId:
|
|
43
|
-
'Oxy Android apps no longer share a UID: they share the identity and the session with Commons '
|
|
44
|
-
|
|
43
|
+
'Oxy Android apps no longer share a UID: they share the identity and the session with Commons ' +
|
|
44
|
+
'over signature-protected IPC. Remove the option (and any android:sharedUserId).',
|
|
45
45
|
sharedIdentityReader:
|
|
46
|
-
'the reader plugin is gone; every Oxy app now applies @oxy.so/services/plugins/withOxySharedPermissions, '
|
|
47
|
-
|
|
46
|
+
'the reader plugin is gone; every Oxy app now applies @oxy.so/services/plugins/withOxySharedPermissions, ' +
|
|
47
|
+
'which the preset always does. Remove the option.',
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
module.exports = function withOxyAppPreset(config, options = {}) {
|
|
@@ -54,11 +54,7 @@ module.exports = function withOxyAppPreset(config, options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const {
|
|
58
|
-
keychainGroup = 'group.so.oxy.shared',
|
|
59
|
-
ios = {},
|
|
60
|
-
android = {},
|
|
61
|
-
} = options;
|
|
57
|
+
const { keychainGroup = 'group.so.oxy.shared', ios = {}, android = {} } = options;
|
|
62
58
|
|
|
63
59
|
let next = config;
|
|
64
60
|
|
|
@@ -78,8 +74,8 @@ module.exports = function withOxyAppPreset(config, options = {}) {
|
|
|
78
74
|
);
|
|
79
75
|
} catch (error) {
|
|
80
76
|
throw new Error(
|
|
81
|
-
"[@oxy.so/app-preset] needs '@oxy.so/services' 11 or later (for plugins/withOxySharedPermissions). "
|
|
82
|
-
|
|
77
|
+
"[@oxy.so/app-preset] needs '@oxy.so/services' 11 or later (for plugins/withOxySharedPermissions). " +
|
|
78
|
+
`Install it in the app. (${error instanceof Error ? error.message : String(error)})`,
|
|
83
79
|
);
|
|
84
80
|
}
|
|
85
81
|
next = withOxySharedPermissions(next);
|
|
@@ -42,9 +42,8 @@ function deepMerge(base, override) {
|
|
|
42
42
|
}
|
|
43
43
|
const result = { ...base };
|
|
44
44
|
for (const [key, value] of Object.entries(override)) {
|
|
45
|
-
result[key] =
|
|
46
|
-
? deepMerge(result[key], value)
|
|
47
|
-
: value;
|
|
45
|
+
result[key] =
|
|
46
|
+
isPlainObject(value) && isPlainObject(result[key]) ? deepMerge(result[key], value) : value;
|
|
48
47
|
}
|
|
49
48
|
return result;
|
|
50
49
|
}
|
|
@@ -55,9 +54,9 @@ function resolveBuildPropertiesPlugin(projectRoot) {
|
|
|
55
54
|
mod = requireFromProject('expo-build-properties', projectRoot);
|
|
56
55
|
} catch (error) {
|
|
57
56
|
throw new Error(
|
|
58
|
-
"[@oxy.so/app-preset] withOxyBuildProperties requires the peer dependency 'expo-build-properties'. "
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
"[@oxy.so/app-preset] withOxyBuildProperties requires the peer dependency 'expo-build-properties'. " +
|
|
58
|
+
'Install it with `npx expo install expo-build-properties`, or disable it by passing ' +
|
|
59
|
+
'`{ ios: false, android: false }` to the preset.',
|
|
61
60
|
);
|
|
62
61
|
}
|
|
63
62
|
const plugin = typeof mod === 'function' ? mod : mod.withBuildProperties || mod.default;
|
package/plugin/withOxyUpdates.js
CHANGED
|
@@ -99,9 +99,9 @@ module.exports = function withOxyUpdates(config, options = {}) {
|
|
|
99
99
|
|
|
100
100
|
if (typeof clientId !== 'string' || clientId.trim().length === 0) {
|
|
101
101
|
throw new Error(
|
|
102
|
-
`[${PLUGIN_NAME}] a non-empty \`clientId\` is required. Pass this app's registered `
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
`[${PLUGIN_NAME}] a non-empty \`clientId\` is required. Pass this app's registered ` +
|
|
103
|
+
'ApplicationCredential publicKey (oxy_dk_...), normally from an ' +
|
|
104
|
+
'EXPO_PUBLIC_OXY_CLIENT_ID-backed constant.',
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -122,9 +122,9 @@ module.exports = function withOxyUpdates(config, options = {}) {
|
|
|
122
122
|
const projectRoot = config._internal?.projectRoot;
|
|
123
123
|
if (typeof projectRoot !== 'string') {
|
|
124
124
|
throw new Error(
|
|
125
|
-
`[${PLUGIN_NAME}] could not resolve the project root from the Expo config, so the `
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
`[${PLUGIN_NAME}] could not resolve the project root from the Expo config, so the ` +
|
|
126
|
+
'code-signing certificate path cannot be made project-relative (expo-updates joins it ' +
|
|
127
|
+
'onto the project root). Upgrade @expo/config, or pass `{ codeSigning: false }`.',
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
// expo-updates reads this as `path.join(projectRoot, value)`, so it must be
|
|
@@ -133,17 +133,17 @@ module.exports = function withOxyUpdates(config, options = {}) {
|
|
|
133
133
|
updates.codeSigningMetadata = { keyid: CODE_SIGNING_KEY_ID, alg: CODE_SIGNING_ALG };
|
|
134
134
|
} else if (codeSigning === 'require') {
|
|
135
135
|
throw new Error(
|
|
136
|
-
`[${PLUGIN_NAME}] code signing is required but the Oxy Updates certificate is missing at `
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
`[${PLUGIN_NAME}] code signing is required but the Oxy Updates certificate is missing at ` +
|
|
137
|
+
`${certificatePath}. Generate the ecosystem keypair with oxy-api's ` +
|
|
138
|
+
'`bun scripts/generate-updates-code-signing.ts`, commit the certificate into ' +
|
|
139
|
+
'@oxy.so/app-preset, and set the private key as UPDATES_CODE_SIGNING_PRIVATE_KEY on oxy-api.',
|
|
140
140
|
);
|
|
141
141
|
} else {
|
|
142
142
|
const warning =
|
|
143
|
-
'The Oxy Updates code-signing certificate is not present in @oxy.so/app-preset, so this build '
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
'The Oxy Updates code-signing certificate is not present in @oxy.so/app-preset, so this build ' +
|
|
144
|
+
'will accept UNSIGNED update manifests for its entire lifetime (the certificate is baked in ' +
|
|
145
|
+
'at build time). Do not ship this binary to a store. See the app-preset README, section ' +
|
|
146
|
+
'"Oxy Updates (OTA)".';
|
|
147
147
|
WarningAggregator.addWarningForPlatform('android', PLUGIN_NAME, warning);
|
|
148
148
|
WarningAggregator.addWarningForPlatform('ios', PLUGIN_NAME, warning);
|
|
149
149
|
}
|
package/tsconfig/backend.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"//": "@oxy.so/app-preset — Node/Bun backend TypeScript config. Compiled with tsc to dist/ (CommonJS) and THAT emitted output is what the Docker/ECS image runs — module format and emit layout are a runtime contract. Overrides the Oxy base only where this becomes an emitting CommonJS Node service. Consumers set their own `rootDir`/`outDir`/`include` (and `paths` to resolve workspace deps from source during type-check).",
|
|
4
|
+
"//module": "Node16, not commonjs + node10. TypeScript 7 (and `bun check`) removes `moduleResolution: node`/`node10` (TS5108), and TypeScript 5.x rejects `bundler` with `commonjs` (TS5095), so Node16 is the one setting valid on both. Node16 emits CommonJS for every file whose nearest package.json has no `\"type\": \"module\"` — byte-identical to `commonjs` — with one exception: a dynamic `import()` stays a real `import()` (needing a `.js` extension on a relative path) instead of becoming `require()`. A package that sets `\"type\": \"module\"` gets ESM output.",
|
|
4
5
|
"extends": "./base.json",
|
|
5
6
|
"compilerOptions": {
|
|
6
|
-
"module": "
|
|
7
|
-
"moduleResolution": "
|
|
7
|
+
"module": "node16",
|
|
8
|
+
"moduleResolution": "node16",
|
|
8
9
|
"noEmit": false,
|
|
9
10
|
"declaration": true
|
|
10
11
|
}
|
package/tsconfig/base.json
CHANGED