Skip to content

Commit

Permalink
[ci] release (#191)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Aug 18, 2023
1 parent a5c90b6 commit 2e064a9
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 45 deletions.
5 changes: 0 additions & 5 deletions .changeset/curvy-stingrays-bathe.md

This file was deleted.

8 changes: 8 additions & 0 deletions apps/native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# native

## 0.0.73

### Patch Changes

- Updated dependencies [a5c90b6]
- [email protected]
- [email protected]

## 0.0.72

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "native",
"version": "0.0.72",
"version": "0.0.73",
"private": true,
"main": "index.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions apps/server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# server

## 0.0.73

### Patch Changes

- [email protected]

## 0.0.72

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "0.0.72",
"version": "0.0.73",
"private": true,
"type": "module",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions apps/web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# web

## 0.0.73

### Patch Changes

- Updated dependencies [a5c90b6]
- [email protected]

## 0.0.72

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "0.0.72",
"version": "0.0.73",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
7 changes: 7 additions & 0 deletions packages/evolu-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# evolu-server

## 1.0.12

### Patch Changes

- Updated dependencies [a5c90b6]
- [email protected]

## 1.0.11

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/evolu-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "evolu-server",
"version": "1.0.11",
"version": "1.0.12",
"description": "Node.js server for Evolu library",
"author": "Daniel Steigerwald <[email protected]>",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions packages/evolu/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# evolu

## 6.2.2

### Patch Changes

- a5c90b6: Fix undefined window bug, refactor index.ts

## 6.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/evolu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "evolu",
"version": "6.2.1",
"version": "6.2.2",
"description": "React Hooks library for local-first apps with end-to-end encrypted backup and sync using SQLite and CRDT.",
"keywords": [
"evolu",
Expand Down
2 changes: 1 addition & 1 deletion packages/evolu/src/DbWorkerWebLive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export const DbWorkerWebLive = Layer.mergeAll(
Bip39Live,
Layer.merge(HmacLive, Sha512Live).pipe(Layer.provide(Slip21Live)),
NanoIdLive,
SyncWorkerLive
SyncWorkerLive,
).pipe(Layer.provide(DbWorkerLive));
2 changes: 1 addition & 1 deletion packages/evolu/src/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface FetchError {

export type Fetch = (
url: string,
body: Uint8Array
body: Uint8Array,
) => Effect.Effect<never, FetchError, Response>;

export const Fetch = Context.Tag<Fetch>("evolu/Fetch");
Expand Down
16 changes: 8 additions & 8 deletions packages/evolu/src/Platform.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const isChromeWithOpfs = (): boolean =>
navigator.userAgentData.brands.find(
({ brand, version }) =>
// Chrome or Chromium
brand.includes("Chrom") && Number(version) >= 109
brand.includes("Chrom") && Number(version) >= 109,
) != null;

const isFirefoxWithOpfs = (): boolean => {
Expand All @@ -44,17 +44,17 @@ export const SyncLockLive = Layer.effect(
const syncLockName = "evolu:sync";

const hasLock: Predicate.Predicate<LockInfo[] | undefined> = (
lockInfos
lockInfos,
) => {
if (lockInfos == null) return false;
return ReadonlyArray.some(
lockInfos,
(lockInfo) => lockInfo.name === syncLockName
(lockInfo) => lockInfo.name === syncLockName,
);
};

const isSyncing = Effect.promise(() => navigator.locks.query()).pipe(
Effect.map(({ pending, held }) => hasLock(pending) || hasLock(held))
Effect.map(({ pending, held }) => hasLock(pending) || hasLock(held)),
);

let isSyncingResolve: null | ((value: undefined) => void) = null;
Expand All @@ -74,7 +74,7 @@ export const SyncLockLive = Layer.effect(
});

return { acquire, release };
})
}),
);

export const FetchLive = Layer.succeed(
Expand All @@ -91,8 +91,8 @@ export const FetchLive = Layer.succeed(
},
}),
catch: (): FetchError => ({ _tag: "FetchError" }),
})
)
}),
),
);

export const AppStateLive = Layer.effect(
Expand Down Expand Up @@ -139,5 +139,5 @@ export const AppStateLive = Layer.effect(
});

return AppState.of({ onFocus, onReconnect, reset });
})
}),
);
22 changes: 11 additions & 11 deletions packages/evolu/src/React.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ type UseQuery<S extends Schema> = <
FilterMapRow extends Row,
>(
queryCallback: OrNullOrFalse<QueryCallback<S, QueryRow>>,
filterMap: (row: QueryRow) => OrNullOrFalse<FilterMapRow>
filterMap: (row: QueryRow) => OrNullOrFalse<FilterMapRow>,
) => {
/**
* Rows from the database. They can be filtered and mapped by `filterMap`.
Expand Down Expand Up @@ -221,7 +221,7 @@ type UseMutation<S extends Schema> = () => {
type Create<S extends Schema> = <T extends keyof S>(
table: T,
values: Simplify<PartialOnlyForNullable<CastableForMutate<Omit<S[T], "id">>>>,
onComplete?: () => void
onComplete?: () => void,
) => {
readonly id: S[T]["id"];
};
Expand All @@ -242,7 +242,7 @@ type Update<S extends Schema> = <T extends keyof S>(
CastableForMutate<Omit<S[T], "id"> & Pick<CommonColumns, "isDeleted">>
> & { id: S[T]["id"] }
>,
onComplete?: () => void
onComplete?: () => void,
) => {
readonly id: S[T]["id"];
};
Expand All @@ -258,7 +258,7 @@ export const ReactLive = Layer.effect(
const useQuery: UseQuery<Schema> = (queryCallback, filterMap) => {
const query = useMemo(
() => (queryCallback ? evolu.createQuery(queryCallback) : null),
[queryCallback]
[queryCallback],
);

const promise = useMemo(() => {
Expand All @@ -271,7 +271,7 @@ export const ReactLive = Layer.effect(
const subscribedRows = useSyncExternalStore(
useMemo(() => evolu.subscribeQuery(query), [query]),
useMemo(() => () => evolu.getQuery(query), [query]),
Function.constNull
Function.constNull,
);

// Use useRef until React Forget release.
Expand All @@ -283,7 +283,7 @@ export const ReactLive = Layer.effect(
let cachedRow = cache.get(row);
if (cachedRow !== undefined) return cachedRow;
cachedRow = Option.fromNullable(
filterMapRef.current(row as never)
filterMapRef.current(row as never),
) as never;
cache.set(row, cachedRow);
return cachedRow;
Expand All @@ -302,21 +302,21 @@ export const ReactLive = Layer.effect(
create: evolu.mutate as Create<Schema>,
update: evolu.mutate as Update<Schema>,
}),
[]
[],
);

const useEvoluError: Hooks<Schema>["useEvoluError"] = () =>
useSyncExternalStore(
evolu.subscribeError,
evolu.getError,
Function.constNull
Function.constNull,
);

const useOwner: Hooks<Schema>["useOwner"] = () =>
useSyncExternalStore(
evolu.subscribeOwner,
evolu.getOwner,
Function.constNull
Function.constNull,
);

const useOwnerActions: Hooks<Schema>["useOwnerActions"] = () =>
Expand All @@ -327,7 +327,7 @@ export const ReactLive = Layer.effect(
useSyncExternalStore(
evolu.subscribeSyncState,
evolu.getSyncState,
() => syncStateInitial
() => syncStateInitial,
);

return React.of({
Expand All @@ -340,5 +340,5 @@ export const ReactLive = Layer.effect(
useSyncState,
},
});
})
}),
);
1 change: 0 additions & 1 deletion packages/evolu/src/index.native.ts
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

26 changes: 13 additions & 13 deletions packages/evolu/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NoOpServerDbWorker = Effect.sync(() =>
DbWorker.of({
postMessage: Function.constVoid,
onMessage: Function.constVoid,
})
}),
);

const OpfsDbWorker = Effect.sync(() => {
Expand All @@ -52,12 +52,12 @@ const LocalStorageDbWorker = Effect.sync(() => {
Effect.map((a) => {
const importedDbWorker = DbWorker.pipe(
Effect.provideLayer(a.DbWorkerWebLive),
Effect.runSync
Effect.runSync,
);
importedDbWorker.onMessage = dbWorker.onMessage;
return importedDbWorker.postMessage;
}),
Effect.runPromise
Effect.runPromise,
);

const dbWorker = DbWorker.of({
Expand All @@ -81,21 +81,21 @@ const DbWorkerLive = Layer.effect(
? NoOpServerDbWorker
: platform.name === "web-with-opfs"
? OpfsDbWorker
: LocalStorageDbWorker
: LocalStorageDbWorker,
);
})
}),
);

export const create = <From, To extends Schema>(
schema: S.Schema<From, To>,
config?: Partial<Config>
config?: Partial<Config>,
): React<To>["hooks"] => {
const configLive = ConfigLive(config);

const dbWorkerLive = PlatformLive.pipe(Layer.provide(DbWorkerLive));

const appStateLive = Layer.mergeAll(PlatformLive, configLive).pipe(
Layer.provide(AppStateLive)
Layer.provide(AppStateLive),
);

const mutateLive = Layer.mergeAll(
Expand All @@ -104,11 +104,11 @@ export const create = <From, To extends Schema>(
OnCompletesLive,
TimeLive,
SubscribedQueriesLive,
LoadingPromisesLive
LoadingPromisesLive,
).pipe(Layer.provide(MutateLive));

const ownerActionsLive = Layer.mergeAll(dbWorkerLive, Bip39Live).pipe(
Layer.provide(OwnerActionsLive)
Layer.provide(OwnerActionsLive),
);

const queryStoreLive = Layer.mergeAll(
Expand All @@ -117,7 +117,7 @@ export const create = <From, To extends Schema>(
SubscribedQueriesLive,
LoadingPromisesLive,
RowsCacheStoreLive,
FlushSyncLive
FlushSyncLive,
).pipe(Layer.provide(QueryStoreLive));

const evoluLive = Layer.mergeAll(
Expand All @@ -127,16 +127,16 @@ export const create = <From, To extends Schema>(
mutateLive,
ownerActionsLive,
queryStoreLive,
SubscribedQueriesLive
SubscribedQueriesLive,
).pipe(Layer.provide(EvoluLive(schema)));

const reactLive = Layer.mergeAll(evoluLive, PlatformLive).pipe(
Layer.provide(ReactLive)
Layer.provide(ReactLive),
);

return React.pipe(
Effect.map((react) => react.hooks as React<To>["hooks"]),
Effect.provideLayer(reactLive),
Effect.runSync
Effect.runSync,
);
};

1 comment on commit 2e064a9

@vercel
Copy link

@vercel vercel bot commented on 2e064a9 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

evolu – ./

evolu-git-main-evolu.vercel.app
evolu-evolu.vercel.app
evolu.vercel.app
evolu.dev
www.evolu.dev

Please sign in to comment.