Skip to content

Commit

Permalink
chore!: update dependencies to prepare for 1.0 release (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Sep 17, 2024
1 parent 286a8ef commit 742d45c
Show file tree
Hide file tree
Showing 35 changed files with 119 additions and 142 deletions.
66 changes: 20 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"homepage": "https://github.com/digidem/comapeo-core#readme",
"devDependencies": {
"@bufbuild/buf": "^1.26.1",
"@mapeo/default-config": "4.0.1-alpha.0",
"@mapeo/mock-data": "1.0.3-alpha.7",
"@mapeo/default-config": "5.0.0",
"@mapeo/mock-data": "2.0.0",
"@sinonjs/fake-timers": "^10.0.2",
"@types/b4a": "^1.6.0",
"@types/bogon": "^1.0.2",
Expand Down Expand Up @@ -158,7 +158,7 @@
"@fastify/type-provider-typebox": "^4.0.0",
"@hyperswarm/secret-stream": "^6.1.2",
"@mapeo/crypto": "1.0.0-alpha.10",
"@mapeo/schema": "3.0.0-next.28",
"@comapeo/schema": "1.0.0",
"@mapeo/sqlite-indexer": "1.0.0-alpha.9",
"@sinclair/typebox": "^0.29.6",
"b4a": "^1.6.3",
Expand Down
18 changes: 9 additions & 9 deletions src/config-import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import yauzl from 'yauzl-promise'
import { validate, valueSchemas } from '@mapeo/schema'
import { validate, valueSchemas } from '@comapeo/schema'
import { json, buffer } from 'node:stream/consumers'
import { assert, isDefined } from './utils.js'
import path from 'node:path'
Expand Down Expand Up @@ -28,7 +28,7 @@ const ICON_NAME_REGEX = /([a-zA-Z0-9-]+)-([a-zA-Z]+)@(\d+)x\.[a-zA-Z]+$/
* }} TranslationsFile
*/

/** @typedef {NonNullable<import('@mapeo/schema').ProjectSettingsValue['configMetadata']>} MetadataFile */
/** @typedef {NonNullable<import('@comapeo/schema').ProjectSettingsValue['configMetadata']>} MetadataFile */

/**
* @typedef {Parameters<import('./icon-api.js').IconApi['create']>[0]} IconData
Expand Down Expand Up @@ -121,7 +121,7 @@ export async function readConfig(configPath) {
},

/**
* @returns {Iterable<{ name: string, value: import('@mapeo/schema').FieldValue }>}
* @returns {Iterable<{ name: string, value: import('@comapeo/schema').FieldValue }>}
*/
*fields() {
const { fields } = presetsFile
Expand Down Expand Up @@ -151,7 +151,7 @@ export async function readConfig(configPath) {
},

/**
* @returns {Iterable<{ fieldNames: string[], iconName: string | undefined, value: import('@mapeo/schema').PresetValue, name: string}>}
* @returns {Iterable<{ fieldNames: string[], iconName: string | undefined, value: import('@comapeo/schema').PresetValue, name: string}>}
*/
*presets() {
const { presets } = presetsFile
Expand Down Expand Up @@ -232,7 +232,7 @@ export async function readConfig(configPath) {
}
}
},
/** @returns {Iterable<{ name: string, value:Omit<import('@mapeo/schema').TranslationValue, 'docRef'>}>} */
/** @returns {Iterable<{ name: string, value:Omit<import('@comapeo/schema').TranslationValue, 'docRef'>}>} */
*translations() {
if (!translationsFile) return
for (const [lang, languageTranslations] of Object.entries(
Expand Down Expand Up @@ -365,7 +365,7 @@ function translationsForLanguage(warnings) {
/**
* schemaNames in configs are in plural but in the schemas are in singular
* @param {ValidDocTypes} schemaNamePlural
* @returns {import('@mapeo/schema').TranslationValue['docRefType']}
* @returns {import('@comapeo/schema').TranslationValue['docRefType']}
*/
function schemaNamePluralToDocRefType(schemaNamePlural) {
if (schemaNamePlural === 'fields') return 'field'
Expand All @@ -382,7 +382,7 @@ function translationsForDocType(warnings) {
/** @param {Object} opts
* @param {string} opts.languageCode
* @param {string | undefined} opts.regionCode
* @param {import('@mapeo/schema').TranslationValue['docRefType']} opts.docRefType
* @param {import('@comapeo/schema').TranslationValue['docRefType']} opts.docRefType
* @param {Record<ValidDocTypes, unknown>} opts.languageTranslationsForDocType
*/
return function* ({
Expand Down Expand Up @@ -417,7 +417,7 @@ function translationForValue(warnings) {
* @param {Object} opts
* @param {string} opts.languageCode
* @param {string | undefined} opts.regionCode
* @param {import('@mapeo/schema').TranslationValue['docRefType']} opts.docRefType
* @param {import('@comapeo/schema').TranslationValue['docRefType']} opts.docRefType
* @param {string} opts.docName
* @param {Record<string,unknown>} opts.fieldsToTranslate
*/
Expand Down Expand Up @@ -460,7 +460,7 @@ function translationForValue(warnings) {
function translateMessageObject(warnings) {
/**
* @param {Object} opts
* @param {Omit<import('@mapeo/schema').TranslationValue, 'docRef'>} opts.value
* @param {Omit<import('@comapeo/schema').TranslationValue, 'docRef'>} opts.value
* @param {string} opts.docName
* @param {Record<string,{label:string,value:string}>} opts.message
*/
Expand Down
10 changes: 5 additions & 5 deletions src/core-ownership.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { verifySignature, sign } from '@mapeo/crypto'
import { parseVersionId } from '@mapeo/schema'
import { parseVersionId } from '@comapeo/schema'
import { defaultGetWinner } from '@mapeo/sqlite-indexer'
import assert from 'node:assert/strict'
import sodium from 'sodium-universal'
Expand Down Expand Up @@ -42,8 +42,8 @@ export class CoreOwnership extends TypedEmitter {
* import('./datastore/index.js').DataStore<'auth'>,
* typeof import('./schema/project.js').coreOwnershipTable,
* 'coreOwnership',
* import('@mapeo/schema').CoreOwnership,
* import('@mapeo/schema').CoreOwnershipValue
* import('@comapeo/schema').CoreOwnership,
* import('@comapeo/schema').CoreOwnershipValue
* >} opts.dataType
* @param {Record<Namespace, KeyPair>} opts.coreKeypairs
* @param {KeyPair} opts.identityKeypair
Expand Down Expand Up @@ -155,8 +155,8 @@ export class CoreOwnership extends TypedEmitter {
* the doc with the lowest index (e.g. the first)
*
* @param {CoreOwnershipWithSignatures} doc
* @param {import('@mapeo/schema').VersionIdObject} version
* @returns {import('@mapeo/schema').CoreOwnership}
* @param {import('@comapeo/schema').VersionIdObject} version
* @returns {import('@comapeo/schema').CoreOwnership}
*/
export function mapAndValidateCoreOwnership(doc, { coreDiscoveryKey }) {
if (
Expand Down
4 changes: 2 additions & 2 deletions src/datastore/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TypedEmitter } from 'tiny-typed-emitter'
import { encode, decode, getVersionId, parseVersionId } from '@mapeo/schema'
import { encode, decode, getVersionId, parseVersionId } from '@comapeo/schema'
import MultiCoreIndexer from 'multi-core-indexer'
import pDefer from 'p-defer'
import { discoveryKey } from 'hypercore-crypto'
import { NAMESPACE_SCHEMAS } from '../constants.js'
import { createMap } from '../utils.js'
/** @import { MapeoDoc } from '@mapeo/schema' */
/** @import { MapeoDoc } from '@comapeo/schema' */

/**
* For each schemaName in this dataStore, emits an array of docIds that have
Expand Down
2 changes: 1 addition & 1 deletion src/datatype/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// declaration for DataType is written manually below, and copied into the
// `dist` folder at build-time. The types are checked in `test-types/data-types.ts`

import { type MapeoDoc, type MapeoValue } from '@mapeo/schema'
import { type MapeoDoc, type MapeoValue } from '@comapeo/schema'
import {
type MapeoDocMap,
type MapeoValueMap,
Expand Down
4 changes: 2 additions & 2 deletions src/datatype/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { validate } from '@mapeo/schema'
import { validate } from '@comapeo/schema'
import { getTableConfig } from 'drizzle-orm/sqlite-core'
import { eq, inArray, sql } from 'drizzle-orm'
import { randomBytes } from 'node:crypto'
Expand All @@ -7,7 +7,7 @@ import { NotFoundError } from '../errors.js'
import { TypedEmitter } from 'tiny-typed-emitter'
import { parse as parseBCP47 } from 'bcp-47'
import { setProperty, getProperty } from 'dot-prop'
/** @import { MapeoDoc, MapeoValue } from '@mapeo/schema' */
/** @import { MapeoDoc, MapeoValue } from '@comapeo/schema' */
/** @import { MapeoDocMap, MapeoValueMap } from '../types.js' */
/** @import { DataStore } from '../datastore/index.js' */

Expand Down
4 changes: 2 additions & 2 deletions src/fastify-plugins/icons.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Type as T } from '@sinclair/typebox'
import fp from 'fastify-plugin'
import { docSchemas } from '@mapeo/schema'
import { docSchemas } from '@comapeo/schema'

import { kGetIconBlob } from '../icon-api.js'
import { HEX_REGEX_32_BYTES, Z_BASE_32_REGEX_32_BYTES } from './constants.js'
Expand Down Expand Up @@ -134,7 +134,7 @@ function extractSizeAndPixelDensity(input) {

/**
* @param {string} value
* @returns {asserts value is Exclude<import('@mapeo/schema').Icon['variants'][number]['size'],'size_unspecified'>}
* @returns {asserts value is Exclude<import('@comapeo/schema').Icon['variants'][number]['size'],'size_unspecified'>}
*/
function assertValidSize(value) {
if (
Expand Down
10 changes: 5 additions & 5 deletions src/icon-api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @import { PresetValue, IconValue } from '@mapeo/schema' */
/** @import { PresetValue, IconValue } from '@comapeo/schema' */

export const kGetIconBlob = Symbol('getIcon')

Expand Down Expand Up @@ -38,8 +38,8 @@ export class IconApi {
* import('./datastore/index.js').DataStore<'config'>,
* typeof import('./schema/project.js').iconTable,
* 'icon',
* import('@mapeo/schema').Icon,
* import('@mapeo/schema').IconValue
* import('@comapeo/schema').Icon,
* import('@comapeo/schema').IconValue
* >} opts.iconDataType
* @param {import('./datastore/index.js').DataStore<'config'>} opts.iconDataStore
* @param {() => Promise<string>} opts.getMediaBaseUrl
Expand All @@ -52,10 +52,10 @@ export class IconApi {

/**
* @param {object} icon
* @param {import('@mapeo/schema').IconValue['name']} icon.name
* @param {import('@comapeo/schema').IconValue['name']} icon.name
* @param {Array<(BitmapOpts | SvgOpts) & { blob: Buffer }>} icon.variants
*
* @returns {Promise<import('@mapeo/schema').Icon>}
* @returns {Promise<import('@comapeo/schema').Icon>}
*/
async create(icon) {
if (icon.variants.length < 1) {
Expand Down
4 changes: 2 additions & 2 deletions src/index-writer/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { decode } from '@mapeo/schema'
import { decode } from '@comapeo/schema'
import SqliteIndexer from '@mapeo/sqlite-indexer'
import { getTableConfig } from 'drizzle-orm/sqlite-core'
import { getBacklinkTableName } from '../schema/utils.js'
import { discoveryKey } from 'hypercore-crypto'
import { Logger } from '../logger.js'
/** @import { MapeoDoc, VersionIdObject } from '@mapeo/schema' */
/** @import { MapeoDoc, VersionIdObject } from '@comapeo/schema' */
/** @import { MapeoDocTables } from '../datatype/index.js' */

/**
Expand Down
2 changes: 1 addition & 1 deletion src/mapeo-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
kRequestFullStop,
kRescindFullStopRequest,
} from './sync/sync-api.js'
/** @import { ProjectSettingsValue as ProjectValue } from '@mapeo/schema' */
/** @import { ProjectSettingsValue as ProjectValue } from '@comapeo/schema' */
/** @import { SetNonNullable } from 'type-fest' */
/** @import { CoreStorage, Namespace } from './types.js' */
/** @import { DeviceInfoParam } from './schema/client.js' */
Expand Down
Loading

0 comments on commit 742d45c

Please sign in to comment.