Skip to content

Commit

Permalink
chore: update core and ipc to v2.0.0 (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 authored Oct 17, 2024
1 parent 314cb1d commit fe74e7e
Show file tree
Hide file tree
Showing 14 changed files with 5,086 additions and 3,899 deletions.
6,072 changes: 2,579 additions & 3,493 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
},
"dependencies": {
"@bam.tech/react-native-image-resizer": "^3.0.7",
"@comapeo/ipc": "1.0.1",
"@comapeo/ipc": "2.0.0",
"@dev-plugins/react-navigation": "^0.0.6",
"@dr.pogodin/react-native-fs": "^2.24.1",
"@formatjs/intl-getcanonicallocales": "^2.3.0",
"@formatjs/intl-locale": "^3.3.2",
"@formatjs/intl-pluralrules": "^5.2.4",
Expand Down Expand Up @@ -116,7 +115,7 @@
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@comapeo/core": "1.0.1",
"@comapeo/core": "2.0.0",
"@comapeo/schema": "1.0.0",
"@formatjs/cli": "^6.2.0",
"@react-native-community/cli": "^12.3.6",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ or [this](https://github.com/facebook/react-native/pull/43756) is merged.

## @comapeo/ipc

### [Change imports to avoid calling unavailable code](./@comapeo+ipc+1.0.1.patch)
### [Change imports to avoid calling unavailable code](./@comapeo+ipc+2.0.0.patch)

There was an error while running app via Expo because of exports in `rpc-reflector` package. To remove this patch, `rpc-reflector` would need to be updated not to use `encode-decode.js` file which indirect usage results in errors.

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-backend.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const KEEP_THESE = [
// zip file that is the default config
'node_modules/@mapeo/default-config/dist/mapeo-default-config.comapeocat',
// Offline fallback map
'node_modules/mapeo-offline-map',
'node_modules/@comapeo/fallback-smp',
];

for (const name of KEEP_THESE) {
Expand Down
13 changes: 0 additions & 13 deletions src/backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const MIGRATIONS_FOLDER_PATH = new URL(
'./node_modules/@comapeo/core/drizzle',
import.meta.url,
).pathname
const FALLBACK_MAP_PATH = new URL(
'./node_modules/mapeo-offline-map',
import.meta.url,
).pathname

const DEFAULT_CONFIG_PATH = new URL(
'./node_modules/@mapeo/default-config/dist/mapeo-default-config.comapeocat',
Expand All @@ -24,28 +20,19 @@ try {
options: {
version: { type: 'string' },
rootKey: { type: 'string' },
sharedStoragePath: { type: 'string' },
},
})

if (typeof values.rootKey !== 'string') {
throw new Error('backend did not receive root key from front end')
}

if (typeof values.sharedStoragePath !== 'string') {
throw new Error(
'backend did not receive shared storage path from front end',
)
}

// Do not await this as we want this to run indefinitely
init({
version: values.version,
rootKey: Buffer.from(values.rootKey, 'hex'),
migrationsFolderPath: MIGRATIONS_FOLDER_PATH,
sharedStoragePath: values.sharedStoragePath,
defaultConfigPath: DEFAULT_CONFIG_PATH,
fallbackMapPath: FALLBACK_MAP_PATH,
}).catch((err) => {
console.error('Server startup error:', err)
})
Expand Down
Loading

0 comments on commit fe74e7e

Please sign in to comment.