Skip to content

Commit

Permalink
feat: default preset included in project with no config (#349)
Browse files Browse the repository at this point in the history
* chore: update mapeo core dependencies

* chore: update mapeo core dependencies

* chore: upload default config to mapeo-manager

* chore: add preset dependency

* chore: update package-lock

* chore: makes mapeo version exact
  • Loading branch information
ErikSin authored May 14, 2024
1 parent 31ac588 commit 09b8d11
Show file tree
Hide file tree
Showing 8 changed files with 507 additions and 167 deletions.
224 changes: 142 additions & 82 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@formatjs/intl-pluralrules": "^5.2.4",
"@formatjs/intl-relativetimeformat": "^11.2.4",
"@gorhom/bottom-sheet": "^4.5.1",
"@mapeo/ipc": "0.3.0",
"@mapeo/ipc": "0.5.0",
"@osm_borders/maritime_10000m": "^1.1.0",
"@react-native-community/hooks": "^2.8.0",
"@react-native-community/netinfo": "11.1.0",
Expand Down Expand Up @@ -103,7 +103,7 @@
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@formatjs/cli": "^6.2.0",
"@mapeo/core": "9.0.0-alpha.7",
"@mapeo/core": "9.0.0-alpha.9",
"@mapeo/schema": "3.0.0-next.15",
"@react-native-community/cli": "^12.3.6",
"@react-native/babel-preset": "^0.73.21",
Expand Down
2 changes: 2 additions & 0 deletions scripts/build-backend.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const KEEP_THESE = [
'loader.js',
// Static folders referenced by @mapeo/core code
'node_modules/@mapeo/core/drizzle',
// zip file that is the default config
'node_modules/@mapeo/default-config/dist/mapeo-default-config.mapeoconfig'
];

for (const name of KEEP_THESE) {
Expand Down
6 changes: 6 additions & 0 deletions src/backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const MIGRATIONS_FOLDER_PATH = new URL(
import.meta.url,
).pathname

const DEFAULT_CONFIG_PATH = new URL(
'./node_modules/@mapeo/default-config/dist/mapeo-default-config.mapeoconfig',
import.meta.url,
).pathname

try {
const { values } = parseArgs({
options: {
Expand All @@ -35,6 +40,7 @@ try {
rootKey: Buffer.from(values.rootKey, 'hex'),
migrationsFolderPath: MIGRATIONS_FOLDER_PATH,
sharedStoragePath: values.sharedStoragePath,
defaultConfigPath: DEFAULT_CONFIG_PATH,
}).catch((err) => {
console.error('Server startup error:', err)
})
Expand Down
Loading

0 comments on commit 09b8d11

Please sign in to comment.