Skip to content

Commit

Permalink
Merge pull request #457 from evoluhq/examples
Browse files Browse the repository at this point in the history
chore: tidy examples
  • Loading branch information
steida authored Aug 10, 2024
2 parents 5b82dc7 + 99c5fd9 commit cdb7ff4
Show file tree
Hide file tree
Showing 60 changed files with 5,315 additions and 395 deletions.
47 changes: 0 additions & 47 deletions examples/electron-app/package.json

This file was deleted.

26 changes: 13 additions & 13 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "my-app",
"name": "@example/nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -10,19 +10,19 @@
},
"dependencies": {
"@evolu/react": "latest",
"next": "~14.1.0",
"react": "18.2.0",
"react-dom": "18.2.0"
"next": "^14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@types/node": "^20.10.3",
"@types/react": "~18.3.1",
"@types/react-dom": "~18.2.25",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint-config-next": "~14.1.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"typescript": "^5.3.2"
"@types/node": "^22.1.0",
"@types/react": "~18.3.3",
"@types/react-dom": "~18.3.0",
"autoprefixer": "^10.4.20",
"eslint": "8.57.0",
"eslint-config-next": "~14.2.5",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
47 changes: 47 additions & 0 deletions examples/react-electron/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@example/react-electron",
"productName": "react-electron-app",
"version": "0.1.0",
"description": "My Electron application description",
"main": ".webpack/main",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx ."
},
"keywords": [],
"author": {
"name": "Daniel Steigerwald",
"email": "[email protected]"
},
"license": "MIT",
"devDependencies": {
"@electron-forge/cli": "7.4.0",
"@electron-forge/maker-deb": "7.4.0",
"@electron-forge/maker-rpm": "7.4.0",
"@electron-forge/maker-squirrel": "7.4.0",
"@electron-forge/maker-zip": "7.4.0",
"@electron-forge/plugin-auto-unpack-natives": "7.4.0",
"@electron-forge/plugin-webpack": "7.4.0",
"@vercel/webpack-asset-relocator-loader": "1.7.4",
"css-loader": "7.1.2",
"electron": "31.3.1",
"eslint": "8.57.0",
"eslint-plugin-import": "^2.29.1",
"fork-ts-checker-webpack-plugin": "9.0.2",
"node-loader": "2.0.0",
"style-loader": "4.0.0",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"typescript": "5.5.4"
},
"dependencies": {
"@evolu/react": "latest",
"@types/react-dom": "~18.3.0",
"electron-squirrel-startup": "1.0.1",
"react": "18.3.1",
"react-dom": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const evolu = createEvolu(Database, {
},
});

export const NextJsExample = memo(function NextJsExample() {
export const Example = memo(function NextJsExample() {
const [currentTab, setCurrentTab] = useState<"todos" | "categories">("todos");

const handleTabClick = () =>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vite-react-pwa",
"name": "@example/react-vite-pwa",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -10,26 +10,26 @@
"preview": "vite preview"
},
"dependencies": {
"@effect/schema": "^0.70.0",
"@evolu/react": "^8.0.2",
"effect": "^3.2.7",
"@effect/schema": "^0.70.2",
"@evolu/react": "latest",
"effect": "^3.6.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"workbox-window": "^7.1.0"
},
"devDependencies": {
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@vite-pwa/assets-generator": "^0.2.4",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.6",
"typescript": "^5.2.2",
"vite": "^5.2.10",
"vite-plugin-pwa": "^0.20.0",
"eslint-plugin-react-refresh": "^0.4.9",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite-plugin-pwa": "^0.20.1",
"workbox-core": "^7.1.0"
},
"resolutions": {
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/
export default defineConfig({
optimizeDeps: {
exclude: [
// Do not pre-bundle `@evolu/common-web`. Why? Worker relative import path resolution fails on registration because `@evolu/common-web/dist/*.worker.js`
// is not present in Vite's pre-bundled dependencies cache (typically `node_modules/.vite/deps`).
// @see https://github.com/vitejs/vite/issues/13314#issuecomment-1560745780
"@evolu/common-web",
],
// Another workaround for Vite bug: https://github.com/radix-ui/primitives/discussions/1915#discussioncomment-5733178
exclude: ["@evolu/react", "@sqlite.org/sqlite-wasm"],
include: ["react-dom"],
},
worker: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 10 additions & 12 deletions examples/vite/package.json → examples/react-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vite-evolu",
"name": "@example/react-vite",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -10,24 +10,22 @@
"preview": "vite preview"
},
"dependencies": {
"@effect/schema": "^0.70.0",
"@evolu/common": "^5.2.3",
"@evolu/common-web": "^8.1.1",
"@evolu/react": "^8.1.0",
"effect": "^3.5.1",
"@effect/schema": "^0.70.2",
"@evolu/react": "latest",
"effect": "^3.6.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint": "8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "^5.2.2",
"vite": "^5.3.1"
"eslint-plugin-react-refresh": "^0.4.9",
"typescript": "^5.5.4",
"vite": "^5.4.0"
}
}
File renamed without changes
File renamed without changes.
24 changes: 11 additions & 13 deletions examples/vite/src/App.tsx → examples/react-vite/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import * as S from "@effect/schema/Schema";
import { formatError } from "@effect/schema/TreeFormatter";
import {
ExtractRow,
NonEmptyString1000,
SqliteBoolean,
String,
cast,
createIndexes,
database,
id,
parseMnemonic,
table,
} from "@evolu/common";
import { createEvolu } from "@evolu/common-web";
import {
EvoluProvider,
NotNull,
id,
jsonArrayFrom,
useEvolu,
useEvoluError,
useOwner,
useQuery,
String,
NonEmptyString1000,
SqliteBoolean,
database,
table,
ExtractRow,
cast,
createEvolu,
createIndexes,
parseMnemonic,
} from "@evolu/react";
import { Effect, Exit } from "effect";
import {
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
optimizeDeps: {
exclude: ["@evolu/common-web"],
exclude: ["@evolu/react", "@sqlite.org/sqlite-wasm"],
include: ["react-dom"],
},
worker: { format: "es" },
});
54 changes: 27 additions & 27 deletions examples/remix/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "remix",
"name": "@example/remix",
"private": true,
"sideEffects": false,
"type": "module",
Expand All @@ -11,37 +11,37 @@
"typecheck": "tsc"
},
"dependencies": {
"@effect/schema": "^0.70.0",
"@evolu/common": "5.2.3",
"@evolu/common-web": "8.1.1",
"@evolu/react": "8.1.0",
"@evolu/server": "7.0.13",
"@remix-run/node": "^2.10.2",
"@remix-run/react": "^2.10.2",
"@remix-run/serve": "^2.10.2",
"effect": "^3.4.7",
"isbot": "^4.1.0",
"@effect/schema": "^0.70.2",
"@evolu/common": "latest",
"@evolu/common-web": "latest",
"@evolu/react": "latest",
"@evolu/server": "latest",
"@remix-run/node": "^2.11.1",
"@remix-run/react": "^2.11.1",
"@remix-run/serve": "^2.11.1",
"effect": "^3.6.1",
"isbot": "^5.1.14",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@remix-run/dev": "^2.10.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"autoprefixer": "^10.4.19",
"eslint": "^8.38.0",
"@remix-run/dev": "^2.11.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"autoprefixer": "^10.4.20",
"eslint": "8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.4",
"typescript": "^5.1.6",
"vite": "^5.1.0",
"vite-tsconfig-paths": "^4.2.1"
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite-tsconfig-paths": "^5.0.0"
},
"engines": {
"node": ">=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/remix/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig({
tsconfigPaths(),
],
optimizeDeps: {
exclude: ["@evolu/common-web"],
exclude: ["@evolu/common-web", "@sqlite.org/sqlite-wasm"],
},
worker: { format: "es" },
});
Loading

0 comments on commit cdb7ff4

Please sign in to comment.