@oxy.so/app-preset 2.2.1 → 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/README.md CHANGED
@@ -14,7 +14,7 @@ and JSON.
14
14
 
15
15
  | Piece | Import | Replaces |
16
16
  | --- | --- | --- |
17
- | Config plugin | `['@oxy.so/app-preset', {}]` | `withSharedUserId` + iOS keychain entitlement + `expo-build-properties` + `@oxy.so/services/plugins/withSharedIdentityReader` |
17
+ | Config plugin | `['@oxy.so/app-preset', {}]` | iOS keychain entitlement + `expo-build-properties` + `@oxy.so/services/plugins/withOxySharedPermissions` |
18
18
  | Android release build | `@oxy.so/app-preset/plugin/withOxyAndroidRelease` | R8 `-optimize` ProGuard file + shared-keystore release signing (opt-in, see below) |
19
19
  | Android WebP resources | `@oxy.so/app-preset/plugin/withOxyAndroidWebp` | re-encoding generated mipmaps/splash bitmaps to real lossless WebP (opt-in, needs `sharp`) |
20
20
  | Oxy Updates (OTA) | `@oxy.so/app-preset/plugin/withOxyUpdates` | the `expo-updates` manifest URL, release channel, `runtimeVersion` policy and the shared code-signing certificate (opt-in, see below) |
@@ -35,25 +35,29 @@ plugins: [
35
35
  ]
36
36
  ```
37
37
 
38
- This adds `android:sharedUserId="so.oxy.shared"`, the iOS
39
- `keychain-access-groups` entitlement (`$(AppIdentifierPrefix)group.so.oxy.shared`),
40
- the Oxy `expo-build-properties` defaults (iOS `deploymentTarget 16.4`; Android
41
- `compileSdk 36` / `targetSdk 35` / ProGuard + resource shrinking), and the
42
- `@oxy.so/services` shared-identity reader plugin (Android signature permission +
43
- `<queries>` for silent "Sign in with Oxy").
38
+ This adds the iOS `keychain-access-groups` entitlement
39
+ (`$(AppIdentifierPrefix)group.so.oxy.shared`), the Oxy `expo-build-properties`
40
+ defaults (iOS `deploymentTarget 16.4`; Android `compileSdk 36` / `targetSdk 35` /
41
+ ProGuard + resource shrinking), and `@oxy.so/services/plugins/withOxySharedPermissions`:
42
+ the app declares and requests the signature-level `so.oxy.permission.IDENTITY` and
43
+ `so.oxy.permission.DEVICE_SESSION`, with `<queries>` for the Commons and Accounts
44
+ providers. That is how silent "Sign in with Oxy" works on Android: each Oxy app
45
+ has its own UID, and Commons — the only holder of the identity key — answers over
46
+ signature-protected IPC. **Never add `android:sharedUserId`.**
44
47
 
45
- Each piece is individually disableable and overridable:
48
+ The iOS and build-property pieces are overridable:
46
49
 
47
50
  ```js
48
51
  ['@oxy.so/app-preset', {
49
- sharedUserId: 'so.oxy.shared', // false → skip android:sharedUserId
50
52
  keychainGroup: 'group.so.oxy.shared', // false → skip iOS keychain entitlement
51
53
  ios: { deploymentTarget: '17.0' }, // deep-merges over defaults; false → skip iOS build props
52
54
  android: { targetSdkVersion: 34 }, // deep-merges over defaults; false → skip Android build props
53
- sharedIdentityReader: true, // false → skip @oxy.so/services reader plugin
54
55
  }]
55
56
  ```
56
57
 
58
+ The `sharedUserId` and `sharedIdentityReader` options were removed in 3.0.0 and
59
+ throw if passed. `@oxy.so/services` 11+ is a required peer.
60
+
57
61
  #### Android release-build plugins (opt-in)
58
62
 
59
63
  These two are deliberately NOT part of `['@oxy.so/app-preset', {}]`: one writes a
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'], { cwd: projectRoot, stdio: ['ignore', 'pipe', 'ignore'] })
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(--bloom-font-sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
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([monorepoRoot, ...extraWatchFolders.map((folder) => path.resolve(folder))]);
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) => typeof pattern === 'string' ? blockPath(pattern) : 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((extension) => !svgTransformerPath || extension !== 'svg'),
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": "2.2.1",
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": {
@@ -10,7 +10,6 @@
10
10
  ".": "./app.plugin.js",
11
11
  "./app.plugin.js": "./app.plugin.js",
12
12
  "./plugin/withOxyAppPreset": "./plugin/withOxyAppPreset.js",
13
- "./plugin/withSharedUserId": "./plugin/withSharedUserId.js",
14
13
  "./plugin/withOxyKeychain": "./plugin/withOxyKeychain.js",
15
14
  "./plugin/withOxyBuildProperties": "./plugin/withOxyBuildProperties.js",
16
15
  "./plugin/withOxyAndroidRelease": "./plugin/withOxyAndroidRelease.js",
@@ -64,10 +63,10 @@
64
63
  "prepublishOnly": "node ../../scripts/assert-bun-publish.mjs",
65
64
  "test": "node --test __tests__/*.test.js"
66
65
  },
67
- "//peerDependencies": "THE TWO @oxy.so PEERS ARE DELIBERATE. This package couples to them by FILE PATH, not by API: `css/base.css` imports `@oxy.so/bloom/design-tokens/theme.css`, and `plugin/withOxyAppPreset.js` optionally requires `@oxy.so/services/plugins/withSharedIdentityReader`. Both peers retain a measured floor and a breaking-major cap so compatible patches deduplicate in consumers. Never replace either constraint with `*` or an uncapped range.",
66
+ "//peerDependencies": "THE TWO @oxy.so PEERS ARE DELIBERATE. This package couples to them by FILE PATH, not by API: `css/base.css` imports `@oxy.so/bloom/design-tokens/theme.css`, and `plugin/withOxyAppPreset.js` requires `@oxy.so/services/plugins/withOxySharedPermissions` (services 11+, where it first exists, so the services floor is the major that ships it). Both peers retain a measured floor and a breaking-major cap so compatible patches deduplicate in consumers. Never replace either constraint with `*` or an uncapped range.",
68
67
  "peerDependencies": {
69
68
  "@oxy.so/bloom": "^2.0.0 || ^3.0.0 || ^4.2.0 || ^5.1.0 || ^6.0.0",
70
- "@oxy.so/services": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
69
+ "@oxy.so/services": "^11.0.0",
71
70
  "babel-plugin-module-resolver": "*",
72
71
  "babel-preset-expo": "*",
73
72
  "eslint": ">=9.0.0",
@@ -88,9 +87,6 @@
88
87
  "@oxy.so/bloom": {
89
88
  "optional": true
90
89
  },
91
- "@oxy.so/services": {
92
- "optional": true
93
- },
94
90
  "babel-plugin-module-resolver": {
95
91
  "optional": true
96
92
  },
@@ -27,11 +27,12 @@
27
27
  * -jarfile <aab>` / `apksigner verify --print-certs <apk>`) rather than
28
28
  * assumed.
29
29
  *
30
- * The certificate MUST be the shared Oxy ecosystem one: every Oxy app sets
31
- * `android:sharedUserId="so.oxy.shared"` (see withSharedUserId) and Android
32
- * requires every app sharing that UID to be signed with the SAME
33
- * certificate. An app-specific key breaks "sign in once, use everywhere" and
34
- * makes the app refuse to install next to its siblings.
30
+ * The certificate MUST be the shared Oxy ecosystem one: Oxy apps share the
31
+ * identity and the device session through `signature`-level permissions
32
+ * (`withOxySharedPermissions`) and providers that check the caller's
33
+ * certificate. An app-specific key is refused by Commons, and its duplicate
34
+ * permission declaration makes Android refuse to install it next to its
35
+ * siblings (INSTALL_FAILED_DUPLICATE_PERMISSION).
35
36
  *
36
37
  * @param {import('expo/config').ExpoConfig} config
37
38
  */
@@ -48,8 +49,7 @@ const DEFAULT_PROGUARD = 'getDefaultProguardFile("proguard-android.txt")';
48
49
  const OPTIMIZED_PROGUARD = 'getDefaultProguardFile("proguard-android-optimize.txt")';
49
50
 
50
51
  const DEBUG_SIGNING_CONFIG = 'signingConfig signingConfigs.debug';
51
- const CONDITIONAL_SIGNING_CONFIG =
52
- `signingConfig project.hasProperty('${STORE_FILE}') ? signingConfigs.release : signingConfigs.debug`;
52
+ const CONDITIONAL_SIGNING_CONFIG = `signingConfig project.hasProperty('${STORE_FILE}') ? signingConfigs.release : signingConfigs.debug`;
53
53
 
54
54
  const RELEASE_SIGNING_CONFIG = ` release {
55
55
  // Populated only when the Oxy release keystore properties are
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Expo Config Plugin: withOxyAppPreset
3
3
  *
4
- * The single config-plugin entry every Oxy app adds in place of the four
5
- * copy-pasted plugin entries (`withSharedUserId`, keychain entitlement,
6
- * `expo-build-properties`, `@oxy.so/services/plugins/withSharedIdentityReader`).
4
+ * The single config-plugin entry every Oxy app adds in place of the copy-pasted
5
+ * plugin entries (iOS keychain entitlement, `expo-build-properties`,
6
+ * `@oxy.so/services/plugins/withOxySharedPermissions`).
7
7
  *
8
8
  * In app.config.js / app.json:
9
9
  *
@@ -12,43 +12,51 @@
12
12
  * ['@oxy.so/app-preset', {}],
13
13
  * ]
14
14
  *
15
- * Each piece is individually disableable by passing its option as `false`:
15
+ * Options:
16
16
  *
17
17
  * ['@oxy.so/app-preset', {
18
- * sharedUserId: 'so.oxy.shared', // false → skip android:sharedUserId
19
18
  * keychainGroup: 'group.so.oxy.shared', // false → skip iOS keychain entitlement
20
19
  * ios: { deploymentTarget: '17.0' }, // false → skip iOS build properties
21
20
  * android: { targetSdkVersion: 34 }, // false → skip Android build properties
22
- * sharedIdentityReader: true, // false → skip @oxy.so/services reader plugin
23
21
  * }]
24
22
  *
23
+ * Android never gets `android:sharedUserId`: each Oxy app has its own UID and
24
+ * shares the identity and the device session with Commons over
25
+ * signature-protected IPC. `withOxySharedPermissions` (always applied) declares
26
+ * and requests the two Oxy signature permissions and the `<queries>` for the
27
+ * host authorities. The removed `sharedUserId` and `sharedIdentityReader`
28
+ * options throw, so an app config that still passes them fails loudly instead
29
+ * of silently doing something else.
30
+ *
25
31
  * @param {import('expo/config').ExpoConfig} config
26
32
  * @param {object} [options]
27
- * @param {string|false} [options.sharedUserId='so.oxy.shared']
28
33
  * @param {string|false} [options.keychainGroup='group.so.oxy.shared']
29
34
  * @param {object|false} [options.ios]
30
35
  * @param {object|false} [options.android]
31
- * @param {boolean} [options.sharedIdentityReader=true]
32
36
  */
33
- const withSharedUserId = require('./withSharedUserId');
34
37
  const withOxyKeychain = require('./withOxyKeychain');
35
38
  const withOxyBuildProperties = require('./withOxyBuildProperties');
36
39
  const { projectRootOf, requireFromProject } = require('./requireFromProject');
37
40
 
41
+ const REMOVED_OPTIONS = {
42
+ sharedUserId:
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
+ sharedIdentityReader:
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
+ };
49
+
38
50
  module.exports = function withOxyAppPreset(config, options = {}) {
39
- const {
40
- sharedUserId = 'so.oxy.shared',
41
- keychainGroup = 'group.so.oxy.shared',
42
- ios = {},
43
- android = {},
44
- sharedIdentityReader = true,
45
- } = options;
51
+ for (const [name, reason] of Object.entries(REMOVED_OPTIONS)) {
52
+ if (Object.hasOwn(options, name)) {
53
+ throw new Error(`[@oxy.so/app-preset] The \`${name}\` option was removed: ${reason}`);
54
+ }
55
+ }
46
56
 
47
- let next = config;
57
+ const { keychainGroup = 'group.so.oxy.shared', ios = {}, android = {} } = options;
48
58
 
49
- if (sharedUserId !== false) {
50
- next = withSharedUserId(next, sharedUserId);
51
- }
59
+ let next = config;
52
60
 
53
61
  if (keychainGroup !== false) {
54
62
  next = withOxyKeychain(next, keychainGroup);
@@ -58,18 +66,19 @@ module.exports = function withOxyAppPreset(config, options = {}) {
58
66
  next = withOxyBuildProperties(next, { ios, android });
59
67
  }
60
68
 
61
- if (sharedIdentityReader !== false) {
62
- let withSharedIdentityReader;
63
- try {
64
- withSharedIdentityReader = requireFromProject('@oxy.so/services/plugins/withSharedIdentityReader', projectRootOf(config));
65
- } catch (error) {
66
- throw new Error(
67
- "[@oxy.so/app-preset] sharedIdentityReader is enabled but the peer dependency '@oxy.so/services' "
68
- + 'is not installed. Install it, or pass `{ sharedIdentityReader: false }` to the preset.',
69
- );
70
- }
71
- next = withSharedIdentityReader(next);
69
+ let withOxySharedPermissions;
70
+ try {
71
+ withOxySharedPermissions = requireFromProject(
72
+ '@oxy.so/services/plugins/withOxySharedPermissions',
73
+ projectRootOf(config),
74
+ );
75
+ } catch (error) {
76
+ throw new Error(
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)})`,
79
+ );
72
80
  }
81
+ next = withOxySharedPermissions(next);
73
82
 
74
83
  return next;
75
84
  };
@@ -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] = isPlainObject(value) && isPlainObject(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
- + "Install it with `npx expo install expo-build-properties`, or disable it by passing "
60
- + '`{ ios: false, android: false }` to the preset.',
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;
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Adds an iOS `keychain-access-groups` entitlement so Oxy apps signed with the
5
5
  * same Team ID can share Keychain items — the iOS half of "sign in once, use
6
- * everywhere" (the Android half is withSharedUserId + the shared-identity
7
- * native module). The group is prefixed with `$(AppIdentifierPrefix)` so Xcode
6
+ * everywhere" (the Android half is Commons' identity host, reached over
7
+ * signature-protected IPC; see `withOxySharedPermissions` in @oxy.so/services). The group is prefixed with `$(AppIdentifierPrefix)` so Xcode
8
8
  * expands it to the Team ID at build time.
9
9
  *
10
10
  * Merge-not-overwrite: if the app (or another plugin, e.g. expo-build-properties)
@@ -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
- + 'ApplicationCredential publicKey (oxy_dk_...), normally from an '
104
- + 'EXPO_PUBLIC_OXY_CLIENT_ID-backed constant.',
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
- + '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 }`.',
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
- + `${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.',
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
- + '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)".';
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
  }
@@ -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": "commonjs",
7
- "moduleResolution": "node",
7
+ "module": "node16",
8
+ "moduleResolution": "node16",
8
9
  "noEmit": false,
9
10
  "declaration": true
10
11
  }
@@ -21,11 +21,5 @@
21
21
 
22
22
  "noEmit": true
23
23
  },
24
- "exclude": [
25
- "node_modules",
26
- "**/node_modules",
27
- "**/dist",
28
- "**/build",
29
- "**/.expo"
30
- ]
24
+ "exclude": ["node_modules", "**/node_modules", "**/dist", "**/build", "**/.expo"]
31
25
  }
@@ -1,36 +0,0 @@
1
- /**
2
- * Expo Config Plugin: withSharedUserId
3
- *
4
- * Adds android:sharedUserId to AndroidManifest.xml to enable cross-app data
5
- * sharing between Oxy apps (Mention, Homiio, accounts, Commons, …).
6
- *
7
- * This allows:
8
- * - Shared cryptographic identity storage
9
- * - Cross-app authentication (sign in once, use everywhere)
10
- * - Shared session tokens
11
- *
12
- * IMPORTANT:
13
- * - All Oxy apps MUST use the same sharedUserId: "so.oxy.shared"
14
- * - Apps MUST be signed with the same certificate
15
- * - Cannot change sharedUserId after publishing (requires reinstall)
16
- *
17
- * @see https://developer.android.com/guide/topics/manifest/manifest-element#uid
18
- *
19
- * @param {import('expo/config').ExpoConfig} config
20
- * @param {string} [sharedUserId='so.oxy.shared'] The android:sharedUserId value.
21
- */
22
- const { withAndroidManifest } = require('expo/config-plugins');
23
-
24
- module.exports = function withSharedUserId(config, sharedUserId = 'so.oxy.shared') {
25
- return withAndroidManifest(config, async (config) => {
26
- const androidManifest = config.modResults.manifest;
27
-
28
- // Add sharedUserId to the manifest root element
29
- androidManifest.$ = {
30
- ...androidManifest.$,
31
- 'android:sharedUserId': sharedUserId,
32
- };
33
-
34
- return config;
35
- });
36
- };