From 0208c62b20dc3b9c0a9aa9845426c803b3e9d57e Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Tue, 6 Aug 2024 17:17:00 -0400 Subject: [PATCH 01/12] feat: added browser refresh when a new version of connect is deployed --- .env | 2 + package-lock.json | 4 +- public/service-worker.js | 59 ++++++++++ .../modal/modals/DebugSettingsModal.tsx | 86 +++++++++++++- src/renderer.ts | 3 + src/utils/registerServiceWorker.ts | 110 ++++++++++++++++++ vite.renderer.config.mts | 48 ++++++-- 7 files changed, 302 insertions(+), 10 deletions(-) create mode 100644 public/service-worker.js create mode 100644 src/utils/registerServiceWorker.ts diff --git a/.env b/.env index 17e657e8..dbfe3dba 100644 --- a/.env +++ b/.env @@ -3,6 +3,8 @@ VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/alpha/makerdao/switchboard/d/ VITE_BASE_HREF=/ ASSET_URL=/ +VITE_APP_REQUIRES_HARD_REFRESH=true + ######## RENOWN CONFIG ######## # Renown instance to use for login # VITE_RENOWN_URL=http://localhost:3000 diff --git a/package-lock.json b/package-lock.json index acc92d11..652f349f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@powerhousedao/connect", - "version": "1.0.0-dev.60", + "version": "1.0.0-dev.62", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@powerhousedao/connect", - "version": "1.0.0-dev.60", + "version": "1.0.0-dev.62", "license": "AGPL-3.0-only", "dependencies": { "@powerhousedao/design-system": "1.0.0-alpha.159", diff --git a/public/service-worker.js b/public/service-worker.js new file mode 100644 index 00000000..6dfa7e3f --- /dev/null +++ b/public/service-worker.js @@ -0,0 +1,59 @@ +const VERSION_CACHE = 'version-cache'; +const VERSION_KEY = 'app-version'; + +self.addEventListener('install', event => { + console.log('Service worker installed'); + self.skipWaiting(); +}); + +self.addEventListener('activate', event => { + console.log('Service worker activated'); + event.waitUntil(self.clients.claim()); +}); + + +self.addEventListener('message', async event => { + if (event.data && event.data.type === 'SET_APP_VERSION') { + console.log('Message received in service worker:', event.data.version); + + const cache = await caches.open(VERSION_CACHE); + await cache.put(VERSION_KEY, new Response(event.data.version)); + } + }); + +async function checkForUpdates() { + try { + const response = await fetch('/version.json', { cache: 'no-store' }); + const newVersion = await response.json(); + const cache = await caches.open(VERSION_CACHE); + const cachedResponse = await cache.match(VERSION_KEY); + + let currentVersion = ''; + + if (cachedResponse) { + currentVersion = await cachedResponse.text(); + } + + if (currentVersion === '') { + // Initial cache + await cache.put(VERSION_KEY, new Response(newVersion.version)); + } else if (currentVersion !== newVersion.version) { + // New version detected + console.log('Current version:', currentVersion); + console.log('New version:', newVersion.version); + + const clients = await self.clients.matchAll(); + clients.forEach(client => { + client.postMessage({ type: 'NEW_VERSION_AVAILABLE', requiresHardRefresh: newVersion.requiresHardRefresh }); + }); + + // Update the stored version + await cache.put(VERSION_KEY, new Response(newVersion.version)); + } + } catch (error) { + console.error('Error checking version:', error); + } +} + +// Check for updates every minute +setInterval(checkForUpdates, 60 * 1000); // 60 seconds diff --git a/src/components/modal/modals/DebugSettingsModal.tsx b/src/components/modal/modals/DebugSettingsModal.tsx index 48a5197f..e3c2a698 100644 --- a/src/components/modal/modals/DebugSettingsModal.tsx +++ b/src/components/modal/modals/DebugSettingsModal.tsx @@ -5,8 +5,9 @@ import { Icon, Modal, } from '@powerhousedao/design-system'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { useDocumentDriveServer } from 'src/hooks/useDocumentDriveServer'; +import serviceWorkerManager from 'src/utils/registerServiceWorker'; import { v4 as uuid } from 'uuid'; export interface DebugSettingsModalProps { @@ -26,6 +27,11 @@ export const DebugSettingsModal: React.FC = props => { console.log('autoRegisterPullResponder', autoRegisterPullResponder); + const [appVersion, setAppVersion] = useState(''); + const [serviceWorkerDebugMode, setServiceWorkerDebugMode] = useState({ + label: serviceWorkerManager.debug ? 'Enabled' : 'Disabled', + value: serviceWorkerManager.debug, + }); const [selectedDrive, setSelectedDrive] = useState(); const [selectedDriveTrigger, setSelectedDriveTrigger] = useState(null); @@ -41,6 +47,10 @@ export const DebugSettingsModal: React.FC = props => { registerNewPullResponderTrigger, } = useDocumentDriveServer(); + useEffect(() => { + serviceWorkerManager.setDebug(serviceWorkerDebugMode.value); + }, [serviceWorkerDebugMode]); + console.log('documentDrives', documentDrives); console.log('selectedDrive', selectedDrive); @@ -114,6 +124,13 @@ export const DebugSettingsModal: React.FC = props => {
+ + + App Version: {process.env.APP_VERSION} + +
+ +
Drive Tools:
@@ -240,6 +257,73 @@ export const DebugSettingsModal: React.FC = props => { + +
+ + Service Worker Tools: +
+ +
+
+ + { + setServiceWorkerDebugMode( + value as typeof serviceWorkerDebugMode, + ); + }} + value={serviceWorkerDebugMode} + options={[ + { label: 'Enabled', value: true }, + { label: 'Disabled', value: false }, + ]} + /> +
+
+ +
+
+ + + Version: +
+ } + value={appVersion} + onChange={element => + setAppVersion(element.target.value) + } + /> +
+
+ +
+ ); diff --git a/src/renderer.ts b/src/renderer.ts index a00fd9d6..3aab81b3 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -31,9 +31,12 @@ import App from './components/app'; import './i18n'; import './index.css'; import { DocumentEditorDebugTools } from './utils/document-editor-debug-tools'; +import serviceWorkerManager from './utils/registerServiceWorker'; if (import.meta.env.MODE === 'development') { window.documentEditorDebugTools = new DocumentEditorDebugTools(); +} else { + serviceWorkerManager.registerServiceWorker(false); } createRoot(document.getElementById('app')!).render(App); diff --git a/src/utils/registerServiceWorker.ts b/src/utils/registerServiceWorker.ts new file mode 100644 index 00000000..45dbd781 --- /dev/null +++ b/src/utils/registerServiceWorker.ts @@ -0,0 +1,110 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +type SET_APP_VERSION_MESSAGE = { + type: 'SET_APP_VERSION'; + version: string; +}; + +export type ServiceWorkerPostMessage = SET_APP_VERSION_MESSAGE; + +type NEW_VERSION_AVAILABLE_MESSAGE = { + type: 'NEW_VERSION_AVAILABLE'; + requiresHardRefresh: boolean; +}; + +export type ServiceWorkerMessage = NEW_VERSION_AVAILABLE_MESSAGE; + +class ServiceWorkerManager { + ready = false; + debug = false; + registration: ServiceWorkerRegistration | null = null; + + constructor(debug = false) { + this.debug = debug; + } + + setDebug(debug: boolean) { + this.debug = debug; + } + + registerServiceWorker(debug = false) { + this.debug = debug; + + if ('serviceWorker' in navigator) { + window.addEventListener('load', () => { + navigator.serviceWorker + .register('/service-worker.js') + .then(registration => { + // Listen for messages from the service worker + if (this.debug) { + console.log( + 'ServiceWorker registered: ', + registration, + ); + } + + navigator.serviceWorker.addEventListener( + 'message', + event => { + if (this.debug) { + console.log( + 'ServiceWorker message: ', + event, + ); + } + + if ( + event.data && + event.data.type === + 'NEW_VERSION_AVAILABLE' && + event.data.requiresHardRefresh === true + ) { + if (this.debug) { + console.log('New version available'); + } + window.location.reload(); // Reload the page to load the new version + } + }, + ); + + if (navigator.serviceWorker.controller) { + navigator.serviceWorker.controller.postMessage({ + type: 'SET_APP_VERSION', + version: process.env.APP_VERSION, + }); + } + + this.ready = true; + this.registration = registration; + }) + .catch(error => { + console.error( + 'ServiceWorker registration failed: ', + error, + ); + }); + }); + } + } + + sendMessage(message: ServiceWorkerPostMessage) { + if (this.ready && this.registration) { + const serviceWorker = + this.registration.active || + this.registration.waiting || + this.registration.installing; + if (serviceWorker) { + if (this.debug) { + console.log('Sending message to service worker: ', message); + } + serviceWorker.postMessage(message); + } else { + console.error('No active service worker found.'); + } + } else { + console.error('Service Worker is not ready yet.'); + } + } +} + +const serviceWorkerManager = new ServiceWorkerManager(); +export default serviceWorkerManager; diff --git a/vite.renderer.config.mts b/vite.renderer.config.mts index 364925f8..ce51b21e 100644 --- a/vite.renderer.config.mts +++ b/vite.renderer.config.mts @@ -1,16 +1,46 @@ import react from '@vitejs/plugin-react'; +import fs from 'fs'; import jotaiDebugLabel from 'jotai/babel/plugin-debug-label'; import jotaiReactRefresh from 'jotai/babel/plugin-react-refresh'; import path from 'path'; -import { HtmlTagDescriptor, defineConfig } from 'vite'; -import svgr from 'vite-plugin-svgr'; +import { HtmlTagDescriptor, defineConfig, loadEnv } from 'vite'; import { createHtmlPlugin } from 'vite-plugin-html'; +import svgr from 'vite-plugin-svgr'; import clientConfig from './client.config'; +const appVersion = Math.random().toString(36).substring(2, 15); + +const generateVersionPlugin = (hardRefresh = false) => { + return { + name: 'generate-version', + closeBundle() { + const versionManifest = { + version: appVersion, + requiresHardRefresh: hardRefresh, + }; + + fs.writeFileSync( + path.join('dist', 'version.json'), + JSON.stringify(versionManifest, null, 2), + ); + }, + }; +}; + export default defineConfig(({ mode }) => { - const isProd = mode === "production"; + const isProd = mode === 'production'; + const env = loadEnv(mode, process.cwd()); + + const requiresHardRefresh = env.VITE_APP_REQUIRES_HARD_REFRESH === 'true'; + return { + define: { + 'process.env': { + APP_VERSION: appVersion, + REQUIRES_HARD_REFRESH: isProd ? requiresHardRefresh : false, + }, + }, plugins: [ react({ include: 'src/**/*.tsx', @@ -23,13 +53,14 @@ export default defineConfig(({ mode }) => { minify: true, inject: { tags: [ - ...clientConfig.meta.map((meta) => ({ + ...(clientConfig.meta.map(meta => ({ ...meta, injectTo: 'head', - })) as HtmlTagDescriptor[], - ] + })) as HtmlTagDescriptor[]), + ], }, }), + generateVersionPlugin(isProd ? requiresHardRefresh : false), ], build: { minify: isProd, @@ -39,7 +70,10 @@ export default defineConfig(({ mode }) => { alias: { '@/assets': path.resolve(__dirname, './assets'), src: path.resolve(__dirname, './src'), - 'connect-config': path.resolve(__dirname, './connect.config.ts'), + 'connect-config': path.resolve( + __dirname, + './connect.config.ts', + ), path: 'rollup-plugin-node-polyfills/polyfills/path', events: 'rollup-plugin-node-polyfills/polyfills/events', }, From 28d16f2e6d49e5fbb4a193b975e23e732bf8dbd4 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 12 Aug 2024 17:04:16 +0200 Subject: [PATCH 02/12] chore: disabled search bar on all environments --- .github/workflows/build-and-deploy-arbitrum-prod.yaml | 1 + .github/workflows/build-and-deploy-arbitrum-staging.yaml | 1 + .github/workflows/build-and-deploy-makerdao-prod.yaml | 1 + .github/workflows/build-and-deploy-makerdao-staging.yaml | 1 + .github/workflows/build-and-deploy-powerhouse-develop.yaml | 1 + .github/workflows/build-and-deploy-powerhouse-prod.yaml | 1 + .github/workflows/build-and-deploy-powerhouse-staging.yaml | 1 + 7 files changed, 7 insertions(+) diff --git a/.github/workflows/build-and-deploy-arbitrum-prod.yaml b/.github/workflows/build-and-deploy-arbitrum-prod.yaml index 01fdd227..25ba2aea 100644 --- a/.github/workflows/build-and-deploy-arbitrum-prod.yaml +++ b/.github/workflows/build-and-deploy-arbitrum-prod.yaml @@ -36,6 +36,7 @@ jobs: --build-arg VITE_DISABLE_DELETE_CLOUD_DRIVES=true --build-arg VITE_DISABLE_DELETE_LOCAL_DRIVES=true --build-arg VITE_LOCAL_DRIVES_ENABLED=false + --build-arg VITE_SEARCH_BAR_ENABLED=false --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/arbitrum/switchboard/d/arbitrum --build-arg VITE_RENOWN_CHAIN_ID=42161 --build-arg VITE_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS=true diff --git a/.github/workflows/build-and-deploy-arbitrum-staging.yaml b/.github/workflows/build-and-deploy-arbitrum-staging.yaml index df1647e7..fe0f12ff 100644 --- a/.github/workflows/build-and-deploy-arbitrum-staging.yaml +++ b/.github/workflows/build-and-deploy-arbitrum-staging.yaml @@ -36,6 +36,7 @@ jobs: --build-arg VITE_LOCAL_DRIVES_ENABLED=false --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/staging/arbitrum/switchboard/d/arbitrum --build-arg VITE_RENOWN_CHAIN_ID=42161 + --build-arg VITE_SEARCH_BAR_ENABLED=false --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} --build-arg VITE_ARBITRUM_ALLOW_LIST=${{secrets.VITE_ARBITRUM_ALLOW_LIST}} diff --git a/.github/workflows/build-and-deploy-makerdao-prod.yaml b/.github/workflows/build-and-deploy-makerdao-prod.yaml index 7dc43ab2..09322a8c 100644 --- a/.github/workflows/build-and-deploy-makerdao-prod.yaml +++ b/.github/workflows/build-and-deploy-makerdao-prod.yaml @@ -28,6 +28,7 @@ jobs: --build-arg VITE_ROUTER_BASENAME=/makerdao/connect --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} + --build-arg VITE_SEARCH_BAR_ENABLED=false --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/makerdao/switchboard/d/b443d823-3e4d-4e60-ae44-45edafd5f632 --build-arg VITE_RWA_ALLOW_LIST=${{secrets.VITE_RWA_ALLOW_LIST}} process_type: web \ No newline at end of file diff --git a/.github/workflows/build-and-deploy-makerdao-staging.yaml b/.github/workflows/build-and-deploy-makerdao-staging.yaml index bc50acb4..b6c5e93f 100644 --- a/.github/workflows/build-and-deploy-makerdao-staging.yaml +++ b/.github/workflows/build-and-deploy-makerdao-staging.yaml @@ -28,6 +28,7 @@ jobs: --build-arg VITE_ROUTER_BASENAME=/staging/makerdao/connect --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} + --build-arg VITE_SEARCH_BAR_ENABLED=false --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/staging/makerdao/switchboard/d/280dd289-ec51-40f0-adad-c154967fc2b2 --build-arg VITE_RWA_ALLOW_LIST=${{secrets.VITE_RWA_ALLOW_LIST}} process_type: web \ No newline at end of file diff --git a/.github/workflows/build-and-deploy-powerhouse-develop.yaml b/.github/workflows/build-and-deploy-powerhouse-develop.yaml index 0e006bfd..e45b54d1 100644 --- a/.github/workflows/build-and-deploy-powerhouse-develop.yaml +++ b/.github/workflows/build-and-deploy-powerhouse-develop.yaml @@ -27,4 +27,5 @@ jobs: --build-arg VITE_BASE_HREF=/develop/powerhouse/connect/ --build-arg VITE_ROUTER_BASENAME=/develop/powerhouse/connect --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/develop/powerhouse/switchboard/d/core-dev + --build-arg VITE_SEARCH_BAR_ENABLED=false process_type: web \ No newline at end of file diff --git a/.github/workflows/build-and-deploy-powerhouse-prod.yaml b/.github/workflows/build-and-deploy-powerhouse-prod.yaml index 3178de26..a11290f6 100644 --- a/.github/workflows/build-and-deploy-powerhouse-prod.yaml +++ b/.github/workflows/build-and-deploy-powerhouse-prod.yaml @@ -29,4 +29,5 @@ jobs: --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/powerhouse/switchboard/d/powerhouse + --build-arg VITE_SEARCH_BAR_ENABLED=false process_type: web \ No newline at end of file diff --git a/.github/workflows/build-and-deploy-powerhouse-staging.yaml b/.github/workflows/build-and-deploy-powerhouse-staging.yaml index be64c577..cffca31d 100644 --- a/.github/workflows/build-and-deploy-powerhouse-staging.yaml +++ b/.github/workflows/build-and-deploy-powerhouse-staging.yaml @@ -29,4 +29,5 @@ jobs: --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} --build-arg VITE_DEFAULT_DRIVES_URL=https://apps.powerhouse.io/staging/powerhouse/switchboard/d/powerhouse + --build-arg VITE_SEARCH_BAR_ENABLED=false process_type: web \ No newline at end of file From aeadba1524bf31ed04b9a44b6de57a32cfdec0c3 Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Mon, 12 Aug 2024 11:16:37 -0400 Subject: [PATCH 03/12] feat: fix fix-urlBranchMap --- src/hooks/useLoadInitialData.tsx | 1 + src/hooks/utils.ts | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/hooks/useLoadInitialData.tsx b/src/hooks/useLoadInitialData.tsx index cb7a561b..320a4754 100644 --- a/src/hooks/useLoadInitialData.tsx +++ b/src/hooks/useLoadInitialData.tsx @@ -36,6 +36,7 @@ export const useLoadInitialData = () => { async function checkLatestVersion() { const result = await isLatestVersion(); + if (result === null) return; if (!result) { toast(, { type: 'connect-warning', diff --git a/src/hooks/utils.ts b/src/hooks/utils.ts index f203d1c1..cd8b99f1 100644 --- a/src/hooks/utils.ts +++ b/src/hooks/utils.ts @@ -4,9 +4,9 @@ export const isElectron = window.navigator.userAgent.includes('Electron'); export const isMac = window.navigator.appVersion.includes('Mac'); const urlBranchMap: Record = { - 'alpha/makerdao': 'deployments/staging/makerdao', - 'alpha/arbitrum': 'arb-ltip', - 'alpha/powerhouse': 'staging', + 'staging/makerdao': 'deployments/staging/makerdao', + 'staging/arbitrum': 'arb-ltip', + 'staging/powerhouse': 'staging', makerdao: 'deployments/makerdao', arbitrum: 'deployments/arbitrum', arbgrants: 'deployments/arbitrum', @@ -40,5 +40,10 @@ const fetchLatestVersion = async () => { export const isLatestVersion = async () => { const deployed = await fetchLatestVersion(); - return !deployed || deployed === currentVersion; + + if (deployed) { + return deployed === currentVersion; + } + + return null; }; From e72917dc8ec21df72a72b892615359331ae66e53 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 12 Aug 2024 16:25:11 +0000 Subject: [PATCH 04/12] chore(release): set `package.json` to 1.0.0-dev.66 [skip ci] # [1.0.0-dev.66](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.65...v1.0.0-dev.66) (2024-08-12) ### Features * fix fix-urlBranchMap ([aeadba1](https://github.com/powerhouse-inc/document-model-electron/commit/aeadba1524bf31ed04b9a44b6de57a32cfdec0c3)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c26c33..de507c3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.0.0-dev.66](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.65...v1.0.0-dev.66) (2024-08-12) + + +### Features + +* fix fix-urlBranchMap ([aeadba1](https://github.com/powerhouse-inc/document-model-electron/commit/aeadba1524bf31ed04b9a44b6de57a32cfdec0c3)) + # [1.0.0-dev.65](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.64...v1.0.0-dev.65) (2024-08-11) diff --git a/package.json b/package.json index 68e6aed2..618e6731 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@powerhousedao/connect", "productName": "Powerhouse-Connect", - "version": "1.0.0-dev.65", + "version": "1.0.0-dev.66", "description": "Powerhouse Connect", "main": ".vite/build/main.js", "license": "AGPL-3.0-only", From c2255c9c9830d285d23e798aa0d799a396e2bb7b Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Mon, 12 Aug 2024 13:01:48 -0400 Subject: [PATCH 05/12] feat: use pkg version instead of random ver --- public/service-worker.js | 4 ---- vite.renderer.config.mts | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/public/service-worker.js b/public/service-worker.js index 6dfa7e3f..97b1e910 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -2,20 +2,16 @@ const VERSION_CACHE = 'version-cache'; const VERSION_KEY = 'app-version'; self.addEventListener('install', event => { - console.log('Service worker installed'); self.skipWaiting(); }); self.addEventListener('activate', event => { - console.log('Service worker activated'); event.waitUntil(self.clients.claim()); }); self.addEventListener('message', async event => { if (event.data && event.data.type === 'SET_APP_VERSION') { - console.log('Message received in service worker:', event.data.version); - const cache = await caches.open(VERSION_CACHE); await cache.put(VERSION_KEY, new Response(event.data.version)); } diff --git a/vite.renderer.config.mts b/vite.renderer.config.mts index ce51b21e..e0923b67 100644 --- a/vite.renderer.config.mts +++ b/vite.renderer.config.mts @@ -6,10 +6,11 @@ import path from 'path'; import { HtmlTagDescriptor, defineConfig, loadEnv } from 'vite'; import { createHtmlPlugin } from 'vite-plugin-html'; import svgr from 'vite-plugin-svgr'; +import pkg from './package.json'; import clientConfig from './client.config'; -const appVersion = Math.random().toString(36).substring(2, 15); +const appVersion = pkg.version; const generateVersionPlugin = (hardRefresh = false) => { return { From d5a8face9f25e54cf1bd51c9118db1fff80394b0 Mon Sep 17 00:00:00 2001 From: acaldas Date: Mon, 12 Aug 2024 18:03:37 +0100 Subject: [PATCH 06/12] fix: fixes undefined this in logger methods --- src/services/logger.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/services/logger.ts b/src/services/logger.ts index 3387d9c3..4286dea9 100644 --- a/src/services/logger.ts +++ b/src/services/logger.ts @@ -5,6 +5,16 @@ import { ILogger, setLogger } from 'document-drive/logger'; class ConnectLogger implements ILogger { #logger: ILogger = console; + constructor() { + // Bind all methods to the current instance + this.log = this.log.bind(this); + this.info = this.info.bind(this); + this.warn = this.warn.bind(this); + this.error = this.error.bind(this); + this.debug = this.debug.bind(this); + this.trace = this.trace.bind(this); + } + set logger(logger: ILogger) { this.#logger = logger; } From 49242570c4a9f3dbdf0adb8b5752c9fe193af179 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 12 Aug 2024 17:05:27 +0000 Subject: [PATCH 07/12] chore(release): set `package.json` to 1.0.0-dev.67 [skip ci] # [1.0.0-dev.67](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.66...v1.0.0-dev.67) (2024-08-12) ### Bug Fixes * fixes undefined this in logger methods ([d5a8fac](https://github.com/powerhouse-inc/document-model-electron/commit/d5a8face9f25e54cf1bd51c9118db1fff80394b0)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de507c3e..3eb2319d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.0.0-dev.67](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.66...v1.0.0-dev.67) (2024-08-12) + + +### Bug Fixes + +* fixes undefined this in logger methods ([d5a8fac](https://github.com/powerhouse-inc/document-model-electron/commit/d5a8face9f25e54cf1bd51c9118db1fff80394b0)) + # [1.0.0-dev.66](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.65...v1.0.0-dev.66) (2024-08-12) diff --git a/package.json b/package.json index 618e6731..2d60c306 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@powerhousedao/connect", "productName": "Powerhouse-Connect", - "version": "1.0.0-dev.66", + "version": "1.0.0-dev.67", "description": "Powerhouse Connect", "main": ".vite/build/main.js", "license": "AGPL-3.0-only", From 78c2745394a6d0ae1508e71ef8284e7d4c7711e7 Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Mon, 12 Aug 2024 12:36:46 -0400 Subject: [PATCH 08/12] feat: update design-system and document-model-libs ver --- package-lock.json | 227 +++------------------------------------------- package.json | 4 +- 2 files changed, 13 insertions(+), 218 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6bb86c3f..daf3aadf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,21 @@ { "name": "@powerhousedao/connect", - "version": "1.0.0-dev.62", + "version": "1.0.0-dev.66", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@powerhousedao/connect", - "version": "1.0.0-dev.62", + "version": "1.0.0-dev.66", "license": "AGPL-3.0-only", "dependencies": { - "@powerhousedao/design-system": "1.0.0-alpha.159", + "@powerhousedao/design-system": "1.0.0-alpha.160", "@sentry/react": "^7.109.0", "@tanstack/react-virtual": "^3.8.1", "did-key-creator": "^1.2.0", "document-drive": "^1.0.0-alpha.88", "document-model": "1.7.0", - "document-model-libs": "^1.82.0", + "document-model-libs": "^1.83.0", "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.0", "electron-store": "^8.1.0", @@ -6819,9 +6819,9 @@ } }, "node_modules/@powerhousedao/design-system": { - "version": "1.0.0-alpha.159", - "resolved": "https://registry.npmjs.org/@powerhousedao/design-system/-/design-system-1.0.0-alpha.159.tgz", - "integrity": "sha512-h/DedTdv7SCDziPuaoKuYuY7sLnEUAKWyQYKJT/hE1Ih6qCu4M1AiLucJuQxPMvbX8LUiCzn2A4fCm03SMLQ4Q==", + "version": "1.0.0-alpha.160", + "resolved": "https://registry.npmjs.org/@powerhousedao/design-system/-/design-system-1.0.0-alpha.160.tgz", + "integrity": "sha512-QL/tyyXnguac5vgVOKPC7NzQ9ot/PaMyJ9EJeYBDx8KufmuYFPUM2pRx9Df/5Q5yQ+XK46mOO2HsSVuVYWfgdw==", "dependencies": { "@internationalized/date": "^3.5.1", "@radix-ui/react-dialog": "^1.0.5", @@ -15641,9 +15641,9 @@ } }, "node_modules/document-model-libs": { - "version": "1.82.0", - "resolved": "https://registry.npmjs.org/document-model-libs/-/document-model-libs-1.82.0.tgz", - "integrity": "sha512-718kbi3sdWWlOWGmXaujhk0hOEJE/omLZ7wT+DaSkw4+mlnNz4ItBAAo3GoHRWcqucRDsF3wEm8uj5keGpONDA==", + "version": "1.83.0", + "resolved": "https://registry.npmjs.org/document-model-libs/-/document-model-libs-1.83.0.tgz", + "integrity": "sha512-GbgsUgW47+K051vu63bazdY05GBKTLNDNnasjoZ9lcLMbsY+FycknMGRbscuvCneNFQk131GQWPuzxD2WxobAw==", "dependencies": { "@acaldas/graphql-codegen-typescript-validation-schema": "^0.12.3", "@graphql-codegen/core": "^4.0.2", @@ -24045,7 +24045,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24062,7 +24061,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24074,13 +24072,11 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24097,7 +24093,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24112,13 +24107,11 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { "version": "2.2.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24134,7 +24127,6 @@ }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "7.5.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24183,7 +24175,6 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "8.3.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24202,7 +24193,6 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24214,7 +24204,6 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "5.0.8", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24234,7 +24223,6 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24250,7 +24238,6 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24265,7 +24252,6 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "7.1.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24281,7 +24267,6 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24290,7 +24275,6 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24299,7 +24283,6 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "5.2.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24317,7 +24300,6 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "7.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24329,7 +24311,6 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24341,7 +24322,6 @@ }, "node_modules/npm/node_modules/@npmcli/redact": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24350,7 +24330,6 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "8.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24367,17 +24346,14 @@ }, "node_modules/npm/node_modules/@pkgjs/parseargs": { "version": "0.11.0", - "dev": true, "inBundle": true, "license": "MIT", - "optional": true, "engines": { "node": ">=14" } }, "node_modules/npm/node_modules/@sigstore/bundle": { "version": "2.3.2", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24389,7 +24365,6 @@ }, "node_modules/npm/node_modules/@sigstore/core": { "version": "1.1.0", - "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -24398,7 +24373,6 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.3.2", - "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -24407,7 +24381,6 @@ }, "node_modules/npm/node_modules/@sigstore/sign": { "version": "2.3.2", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24424,7 +24397,6 @@ }, "node_modules/npm/node_modules/@sigstore/tuf": { "version": "2.3.4", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24437,7 +24409,6 @@ }, "node_modules/npm/node_modules/@sigstore/verify": { "version": "1.2.1", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -24451,7 +24422,6 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24460,7 +24430,6 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24473,7 +24442,6 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24482,7 +24450,6 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "7.1.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24494,7 +24461,6 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24507,7 +24473,6 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24516,7 +24481,6 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "6.2.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24528,25 +24492,21 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24561,7 +24521,6 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.3.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24573,7 +24532,6 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24582,7 +24540,6 @@ }, "node_modules/npm/node_modules/cacache": { "version": "18.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24605,7 +24562,6 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24617,7 +24573,6 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24626,7 +24581,6 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "4.0.0", - "dev": true, "funding": [ { "type": "github", @@ -24641,7 +24595,6 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "4.1.1", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -24653,7 +24606,6 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24662,7 +24614,6 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24675,7 +24626,6 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.3", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24684,7 +24634,6 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24696,19 +24645,16 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24722,7 +24668,6 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24737,7 +24682,6 @@ }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -24749,7 +24693,6 @@ }, "node_modules/npm/node_modules/debug": { "version": "4.3.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24766,13 +24709,11 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", - "dev": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -24781,29 +24722,24 @@ }, "node_modules/npm/node_modules/eastasianwidth": { "version": "0.2.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", - "dev": true, "inBundle": true, "license": "MIT", - "optional": true, "dependencies": { "iconv-lite": "^0.6.2" } }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24812,19 +24748,16 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24833,7 +24766,6 @@ }, "node_modules/npm/node_modules/foreground-child": { "version": "3.2.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24849,7 +24781,6 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24861,7 +24792,6 @@ }, "node_modules/npm/node_modules/glob": { "version": "10.4.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24884,13 +24814,11 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24902,13 +24830,11 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", - "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "7.0.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24921,7 +24847,6 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "7.0.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -24934,10 +24859,8 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", - "dev": true, "inBundle": true, "license": "MIT", - "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -24947,7 +24870,6 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -24959,7 +24881,6 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24968,7 +24889,6 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -24977,7 +24897,6 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.3", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -24986,7 +24905,6 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "6.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25004,7 +24922,6 @@ }, "node_modules/npm/node_modules/ip-address": { "version": "9.0.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25017,7 +24934,6 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25029,7 +24945,6 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "5.1.0", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -25041,7 +24956,6 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25050,19 +24964,16 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { "version": "3.4.0", - "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -25080,13 +24991,11 @@ }, "node_modules/npm/node_modules/jsbn": { "version": "1.1.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.2", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25095,7 +25004,6 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", - "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -25104,7 +25012,6 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", - "dev": true, "engines": [ "node >= 0.2.0" ], @@ -25113,19 +25020,16 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "8.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25138,7 +25042,6 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "6.1.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25157,7 +25060,6 @@ }, "node_modules/npm/node_modules/libnpmexec": { "version": "8.1.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25178,7 +25080,6 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "5.0.12", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25190,7 +25091,6 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "10.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25203,7 +25103,6 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "6.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25216,7 +25115,6 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "7.0.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25231,7 +25129,6 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "9.0.9", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25250,7 +25147,6 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "7.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25262,7 +25158,6 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "6.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25275,7 +25170,6 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "6.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25291,7 +25185,6 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "10.2.2", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25300,7 +25193,6 @@ }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "13.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25323,7 +25215,6 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "9.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25338,7 +25229,6 @@ }, "node_modules/npm/node_modules/minipass": { "version": "7.1.2", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25347,7 +25237,6 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25359,7 +25248,6 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25376,7 +25264,6 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25388,7 +25275,6 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25400,7 +25286,6 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25412,7 +25297,6 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25424,7 +25308,6 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25436,7 +25319,6 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25448,7 +25330,6 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25461,7 +25342,6 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25473,7 +25353,6 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", - "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -25485,13 +25364,11 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25500,7 +25377,6 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25509,7 +25385,6 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "10.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25533,7 +25408,6 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/proc-log": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25542,7 +25416,6 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.2.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25557,7 +25430,6 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "6.0.2", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -25571,7 +25443,6 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25580,7 +25451,6 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25592,7 +25462,6 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.3.0", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -25604,7 +25473,6 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25613,7 +25481,6 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "11.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25628,7 +25495,6 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "8.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25640,7 +25506,6 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "9.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25655,7 +25520,6 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "10.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25668,7 +25532,6 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "17.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25687,7 +25550,6 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -25696,7 +25558,6 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25711,13 +25572,11 @@ }, "node_modules/npm/node_modules/package-json-from-dist": { "version": "1.0.0", - "dev": true, "inBundle": true, "license": "BlueOak-1.0.0" }, "node_modules/npm/node_modules/pacote": { "version": "18.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25748,7 +25607,6 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25762,7 +25620,6 @@ }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25771,7 +25628,6 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.11.1", - "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -25787,7 +25643,6 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25800,7 +25655,6 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "4.2.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25809,7 +25663,6 @@ }, "node_modules/npm/node_modules/proggy": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25818,7 +25671,6 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -25827,7 +25679,6 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -25836,13 +25687,11 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25855,7 +25704,6 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25867,7 +25715,6 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", - "dev": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -25875,7 +25722,6 @@ }, "node_modules/npm/node_modules/read": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25887,7 +25733,6 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25896,7 +25741,6 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -25909,7 +25753,6 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25918,14 +25761,11 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", - "dev": true, "inBundle": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/npm/node_modules/semver": { "version": "7.6.2", - "dev": true, "inBundle": true, "license": "ISC", "bin": { @@ -25937,7 +25777,6 @@ }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -25949,7 +25788,6 @@ }, "node_modules/npm/node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25958,7 +25796,6 @@ }, "node_modules/npm/node_modules/signal-exit": { "version": "4.1.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -25970,7 +25807,6 @@ }, "node_modules/npm/node_modules/sigstore": { "version": "2.3.1", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -25987,7 +25823,6 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -25997,7 +25832,6 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.8.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26011,7 +25845,6 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "8.0.4", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26025,7 +25858,6 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -26035,7 +25867,6 @@ }, "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26045,13 +25876,11 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", - "dev": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26061,19 +25890,16 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.18", - "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/sprintf-js": { "version": "1.1.3", - "dev": true, "inBundle": true, "license": "BSD-3-Clause" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26085,7 +25911,6 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26100,7 +25925,6 @@ "node_modules/npm/node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26114,7 +25938,6 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26127,7 +25950,6 @@ "node_modules/npm/node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26139,7 +25961,6 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26151,7 +25972,6 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.2.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26168,7 +25988,6 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26180,7 +25999,6 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26192,7 +26010,6 @@ }, "node_modules/npm/node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26201,19 +26018,16 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26222,7 +26036,6 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "2.2.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26236,7 +26049,6 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26248,7 +26060,6 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26260,13 +26071,11 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -26276,7 +26085,6 @@ }, "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26286,7 +26094,6 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26295,13 +26102,11 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/which": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26316,7 +26121,6 @@ }, "node_modules/npm/node_modules/which/node_modules/isexe": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -26325,7 +26129,6 @@ }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26343,7 +26146,6 @@ "node_modules/npm/node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26360,7 +26162,6 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26375,7 +26176,6 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -26387,13 +26187,11 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26410,7 +26208,6 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -26425,7 +26222,6 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -26438,7 +26234,6 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC" }, diff --git a/package.json b/package.json index 618e6731..b2ef3c59 100644 --- a/package.json +++ b/package.json @@ -89,13 +89,13 @@ "xvfb-maybe": "^0.2.1" }, "dependencies": { - "@powerhousedao/design-system": "1.0.0-alpha.159", + "@powerhousedao/design-system": "1.0.0-alpha.160", "@sentry/react": "^7.109.0", "@tanstack/react-virtual": "^3.8.1", "did-key-creator": "^1.2.0", "document-drive": "^1.0.0-alpha.88", "document-model": "1.7.0", - "document-model-libs": "^1.82.0", + "document-model-libs": "^1.83.0", "electron-is-dev": "^3.0.1", "electron-squirrel-startup": "^1.0.0", "electron-store": "^8.1.0", From 527ade65403b3af6d305aa49256d962d1d86c9cb Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 12 Aug 2024 17:08:54 +0000 Subject: [PATCH 09/12] chore(release): set `package.json` to 1.0.0-dev.68 [skip ci] # [1.0.0-dev.68](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.67...v1.0.0-dev.68) (2024-08-12) ### Features * added browser refresh when a new version of connect is deployed ([0208c62](https://github.com/powerhouse-inc/document-model-electron/commit/0208c62b20dc3b9c0a9aa9845426c803b3e9d57e)) * use pkg version instead of random ver ([c2255c9](https://github.com/powerhouse-inc/document-model-electron/commit/c2255c9c9830d285d23e798aa0d799a396e2bb7b)) --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eb2319d..911dcf48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# [1.0.0-dev.68](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.67...v1.0.0-dev.68) (2024-08-12) + + +### Features + +* added browser refresh when a new version of connect is deployed ([0208c62](https://github.com/powerhouse-inc/document-model-electron/commit/0208c62b20dc3b9c0a9aa9845426c803b3e9d57e)) +* use pkg version instead of random ver ([c2255c9](https://github.com/powerhouse-inc/document-model-electron/commit/c2255c9c9830d285d23e798aa0d799a396e2bb7b)) + # [1.0.0-dev.67](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.66...v1.0.0-dev.67) (2024-08-12) diff --git a/package.json b/package.json index 2d60c306..82f26447 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@powerhousedao/connect", "productName": "Powerhouse-Connect", - "version": "1.0.0-dev.67", + "version": "1.0.0-dev.68", "description": "Powerhouse Connect", "main": ".vite/build/main.js", "license": "AGPL-3.0-only", From aa3290793ccc541609ab9928a949201c89a5b857 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 12 Aug 2024 17:18:28 +0000 Subject: [PATCH 10/12] chore(release): set `package.json` to 1.0.0-dev.69 [skip ci] # [1.0.0-dev.69](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.68...v1.0.0-dev.69) (2024-08-12) ### Features * update design-system and document-model-libs ver ([78c2745](https://github.com/powerhouse-inc/document-model-electron/commit/78c2745394a6d0ae1508e71ef8284e7d4c7711e7)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 911dcf48..1d0061e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.0.0-dev.69](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.68...v1.0.0-dev.69) (2024-08-12) + + +### Features + +* update design-system and document-model-libs ver ([78c2745](https://github.com/powerhouse-inc/document-model-electron/commit/78c2745394a6d0ae1508e71ef8284e7d4c7711e7)) + # [1.0.0-dev.68](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.67...v1.0.0-dev.68) (2024-08-12) diff --git a/package.json b/package.json index 35a09deb..ece74d39 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@powerhousedao/connect", "productName": "Powerhouse-Connect", - "version": "1.0.0-dev.68", + "version": "1.0.0-dev.69", "description": "Powerhouse Connect", "main": ".vite/build/main.js", "license": "AGPL-3.0-only", From 0c9d5fee4b79d387c985ecd3ee755f0ae83fe399 Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Mon, 12 Aug 2024 19:20:55 -0400 Subject: [PATCH 11/12] feat: added drive operations context --- src/components/editors.tsx | 72 +++------------------------ src/hooks/useDocumentDriveServer.ts | 30 +++++++++-- src/utils/signature.ts | 77 +++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 69 deletions(-) create mode 100644 src/utils/signature.ts diff --git a/src/components/editors.tsx b/src/components/editors.tsx index 2386188e..c8d220b4 100644 --- a/src/components/editors.tsx +++ b/src/components/editors.tsx @@ -2,16 +2,11 @@ import { FILE, RevisionHistory } from '@powerhousedao/design-system'; import { Action, ActionErrorCallback, - ActionSigner, BaseAction, Document, EditorContext, Operation, - OperationSignatureContext, - Reducer, - User, actions, - utils, } from 'document-model/document'; import { useAtomValue } from 'jotai'; import { Suspense, useEffect, useMemo, useState } from 'react'; @@ -28,6 +23,7 @@ import { DocumentDispatchCallback, useDocumentDispatch, } from 'src/utils/document-model'; +import { addActionContext, signOperation } from 'src/utils/signature'; import Button from './button'; import { EditorLoader } from './editor-loader'; @@ -43,43 +39,6 @@ export type EditorProps< onChange?: (document: Document) => void; }; -const signOperation = async ( - operation: Operation, - sign: (data: Uint8Array) => Promise, - documentId: string, - document: Document, - reducer?: Reducer, - user?: User, -) => { - if (!user) return operation; - if (!operation.context) return operation; - if (!operation.context.signer) return operation; - if (!reducer) { - logger.error( - `Document model '${document.documentType}' does not have a reducer`, - ); - return operation; - } - - const context: Omit< - OperationSignatureContext, - 'operation' | 'previousStateHash' - > = { - documentId, - signer: operation.context.signer, - }; - - const signedOperation = await utils.buildSignedOperation( - operation, - reducer, - document, - context, - sign, - ); - - return signedOperation; -}; - export function DocumentEditor(props: EditorProps) { const { selectedNode, @@ -118,29 +77,6 @@ export function DocumentEditor(props: EditorProps) { const canRedo = !!document?.clipboard.length; useUndoRedoShortcuts({ undo, redo, canUndo, canRedo }); - function addActionContext(action: Action): Action { - if (!user) return action; - const signer: ActionSigner = { - app: { - name: 'Connect', - key: connectDid || '', - }, - user: { - address: user.address, - networkId: user.networkId, - chainId: user.chainId, - }, - signatures: [], - }; - - return { - ...action, - context: { - signer, - }, - }; - } - function dispatch( action: BaseAction | Action, onErrorCallback?: ActionErrorCallback, @@ -168,7 +104,11 @@ export function DocumentEditor(props: EditorProps) { .catch(logger.error); }; - _dispatch(addActionContext(action), callback, onErrorCallback); + _dispatch( + addActionContext(action, connectDid, user), + callback, + onErrorCallback, + ); } useEffect(() => { diff --git a/src/hooks/useDocumentDriveServer.ts b/src/hooks/useDocumentDriveServer.ts index 80f2df79..4530e49a 100644 --- a/src/hooks/useDocumentDriveServer.ts +++ b/src/hooks/useDocumentDriveServer.ts @@ -15,6 +15,8 @@ import { import { isDocumentDrive } from 'document-drive/utils'; import { DocumentDriveAction, + DocumentDriveLocalState, + DocumentDriveState, Trigger, actions, utils as documentDriveUtils, @@ -27,8 +29,11 @@ import { Document, Operation, utils } from 'document-model/document'; import { useCallback, useMemo } from 'react'; import { logger } from 'src/services/logger'; import { useGetDocumentModel } from 'src/store/document-model'; +import { useUser } from 'src/store/user'; import { DefaultDocumentDriveServer } from 'src/utils/document-drive-server'; import { loadFile } from 'src/utils/file'; +import { addActionContext, signOperation } from 'src/utils/signature'; +import { useConnectCrypto, useConnectDid } from './useConnectCrypto'; import { useDocumentDrives } from './useDocumentDrives'; import { useUserPermissions } from './useUserPermissions'; @@ -45,6 +50,9 @@ export function useDocumentDriveServer( ) { const { isAllowedToCreateDocuments, isAllowedToEditDocuments } = useUserPermissions(); + const user = useUser(); + const connectDid = useConnectDid(); + const { sign } = useConnectCrypto(); if (!server) { throw new Error('Invalid Document Drive Server'); @@ -81,7 +89,9 @@ export function useDocumentDriveServer( throw new Error(`Drive with id ${driveId} not found`); } - drive = reducer(drive, action); + const driveCopy = { ...drive }; + + drive = reducer(drive, addActionContext(action, connectDid, user)); const scope = action.scope ?? 'global'; const operations = drive.operations[scope]; const operation = operations.findLast( @@ -91,10 +101,24 @@ export function useDocumentDriveServer( throw new Error('There was an error applying the operation'); } + // sign operation + const signedOperation = await signOperation< + DocumentDriveState, + DocumentDriveAction, + DocumentDriveLocalState + >( + operation as Operation, + sign, + driveId, + driveCopy, + reducer, + user, + ); + try { const result = await server.queueDriveOperation( driveId, - operation, + signedOperation, ); if (result.status !== 'SUCCESS') { @@ -116,7 +140,7 @@ export function useDocumentDriveServer( return drive; } }, - [documentDrives, refreshDocumentDrives, server], + [documentDrives, refreshDocumentDrives, server, sign, user, connectDid], ); const addDocument = useCallback( diff --git a/src/utils/signature.ts b/src/utils/signature.ts new file mode 100644 index 00000000..b12337c1 --- /dev/null +++ b/src/utils/signature.ts @@ -0,0 +1,77 @@ +import { + Action, + ActionSigner, + Document, + Operation, + OperationSignatureContext, + Reducer, + User, + utils, +} from 'document-model/document'; +import { logger } from 'src/services/logger'; +import type { User as RenownUser } from 'src/services/renown/types'; + +export async function signOperation< + State = unknown, + A extends Action = Action, + LocalState = unknown, +>( + operation: Operation, + sign: (data: Uint8Array) => Promise, + documentId: string, + document: Document, + reducer?: Reducer, + user?: User, +) { + if (!user) return operation; + if (!operation.context) return operation; + if (!operation.context.signer) return operation; + if (!reducer) { + logger.error( + `Document model '${document.documentType}' does not have a reducer`, + ); + return operation; + } + + const context: Omit< + OperationSignatureContext, + 'operation' | 'previousStateHash' + > = { + documentId, + signer: operation.context.signer, + }; + + const signedOperation = await utils.buildSignedOperation< + State, + A, + LocalState + >(operation, reducer, document, context, sign); + + return signedOperation; +} + +export function addActionContext( + action: A, + connectDid?: string, + user?: RenownUser, +) { + if (!user) return action; + + const signer: ActionSigner = { + app: { + name: 'Connect', + key: connectDid || '', + }, + user: { + address: user.address, + networkId: user.networkId, + chainId: user.chainId, + }, + signatures: [], + }; + + return { + context: { signer }, + ...action, + }; +} From 00dc9dbbec8df4b4215e674cadbc73d26eff7c09 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 13 Aug 2024 12:44:46 +0000 Subject: [PATCH 12/12] chore(release): set `package.json` to 1.0.0-dev.70 [skip ci] # [1.0.0-dev.70](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.69...v1.0.0-dev.70) (2024-08-13) ### Features * added drive operations context ([0c9d5fe](https://github.com/powerhouse-inc/document-model-electron/commit/0c9d5fee4b79d387c985ecd3ee755f0ae83fe399)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0061e4..29230f30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.0.0-dev.70](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.69...v1.0.0-dev.70) (2024-08-13) + + +### Features + +* added drive operations context ([0c9d5fe](https://github.com/powerhouse-inc/document-model-electron/commit/0c9d5fee4b79d387c985ecd3ee755f0ae83fe399)) + # [1.0.0-dev.69](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.68...v1.0.0-dev.69) (2024-08-12) diff --git a/package.json b/package.json index ece74d39..9298b867 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@powerhousedao/connect", "productName": "Powerhouse-Connect", - "version": "1.0.0-dev.69", + "version": "1.0.0-dev.70", "description": "Powerhouse Connect", "main": ".vite/build/main.js", "license": "AGPL-3.0-only",