diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index dee334eab2..6711330e78 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -23,6 +23,8 @@ specifiers: '@rush-temp/dev-server': file:./projects/dev-server.tgz '@rush-temp/dev-server-chunter-resources': file:./projects/dev-server-chunter-resources.tgz '@rush-temp/dev-storage': file:./projects/dev-storage.tgz + '@rush-temp/devmodel': file:./projects/devmodel.tgz + '@rush-temp/devmodel-resources': file:./projects/devmodel-resources.tgz '@rush-temp/elastic': file:./projects/elastic.tgz '@rush-temp/front': file:./projects/front.tgz '@rush-temp/login': file:./projects/login.tgz @@ -172,6 +174,8 @@ dependencies: '@rush-temp/dev-server': file:projects/dev-server.tgz_typescript@4.4.3 '@rush-temp/dev-server-chunter-resources': file:projects/dev-server-chunter-resources.tgz_typescript@4.4.3 '@rush-temp/dev-storage': file:projects/dev-storage.tgz_typescript@4.4.3 + '@rush-temp/devmodel': file:projects/devmodel.tgz_typescript@4.4.3 + '@rush-temp/devmodel-resources': file:projects/devmodel-resources.tgz_e1367da94684b005adf08f025c517b1a '@rush-temp/elastic': file:projects/elastic.tgz_typescript@4.4.3 '@rush-temp/front': file:projects/front.tgz_typescript@4.4.3 '@rush-temp/login': file:projects/login.tgz_typescript@4.4.3 @@ -9877,6 +9881,62 @@ packages: - typescript dev: false + file:projects/devmodel-resources.tgz_e1367da94684b005adf08f025c517b1a: + resolution: {integrity: sha512-eA8s5XJOwP4vu/EVRb73vl3z0C2K4cqsp3Pa2E0TREP2K78AjJPSGxIZD6WEwjg4K2L1dCOCG9kWGSShWwAt3A==, tarball: file:projects/devmodel-resources.tgz} + id: file:projects/devmodel-resources.tgz + name: '@rush-temp/devmodel-resources' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 5.4.0_87dbf04088b125598d0271706532eaf3 + '@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.3 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_05a8ea1454e6ca4c9f98b94b8f3abf9c + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.1.1_eslint@7.32.0 + eslint-plugin-svelte3: 3.2.1_eslint@7.32.0+svelte@3.43.1 + prettier: 2.4.1 + prettier-plugin-svelte: 2.5.0_prettier@2.4.1+svelte@3.43.1 + sass: 1.42.1 + svelte: 3.43.1 + svelte-check: 2.2.10_3708ed3db7329f2cbf76db19160094b1 + svelte-loader: 3.1.2_svelte@3.43.1 + svelte-preprocess: 4.9.8_b1ccfb371c7d68f75291f5a547be0b14 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + - typescript + dev: false + + file:projects/devmodel.tgz_typescript@4.4.3: + resolution: {integrity: sha512-1VtK6jXB5uH+z3VGtIESE9fE1UgUfAKsmmLjl5YAfe++WcWAZqQzuaRShcFvQiKGR2FfTyAEtSdq+J6CqEdc0g==, tarball: file:projects/devmodel.tgz} + id: file:projects/devmodel.tgz + name: '@rush-temp/devmodel' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.1 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.4.0_87dbf04088b125598d0271706532eaf3 + '@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.3 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_05a8ea1454e6ca4c9f98b94b8f3abf9c + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.1.1_eslint@7.32.0 + prettier: 2.4.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + file:projects/elastic.tgz_typescript@4.4.3: resolution: {integrity: sha512-uoPGQmOAopNC8F64rYWrRDU1s3/u70CNQeBYz7EH/PE6mR0QsYIFJW3U6/LgeDWsMXNge+5fKkjwAJh0+EQtBA==, tarball: file:projects/elastic.tgz} id: file:projects/elastic.tgz @@ -10434,7 +10494,7 @@ packages: dev: false file:projects/prod.tgz_sass@1.42.1+typescript@4.4.3: - resolution: {integrity: sha512-ZgzyuEX4q/KCtkXfJOVOSHEBZEYI6FrJJO2tYxQaynmSq7AQpjIp3XB0uwoagnD3dyzH/S3qAXqvQ7ltgPXhbQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-jYkFXSc3TaFdljpFFcRvEWTmtHKLA7nQUn+9kSDD9/J91/LmQEv3yEyJH89kb1ETNiTK6vnuLlp9br+RZipWVg==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 diff --git a/dev/client-resources/src/index.ts b/dev/client-resources/src/index.ts index 6cb7ceee90..946246534f 100644 --- a/dev/client-resources/src/index.ts +++ b/dev/client-resources/src/index.ts @@ -14,7 +14,9 @@ // import { createClient, Client } from '@anticrm/core' +import { getMetadata, getResource } from '@anticrm/platform' import { connect } from './connection' +import clientPlugin from '@anticrm/client' /*! * Anticrm Platform™ Client Dev Plugin @@ -30,6 +32,13 @@ export default async () => { if (client === undefined) { client = await createClient(connect) } + // Check if we had dev hook for client. + // Check if we had dev hook for client. + const hook = getMetadata(clientPlugin.metadata.ClientHook) + if (hook !== undefined) { + const hookProc = await getResource(hook) + client = await hookProc(client) + } return client } } diff --git a/dev/prod/package.json b/dev/prod/package.json index ae6bf14b15..31d48a4004 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -78,6 +78,8 @@ "@anticrm/activity-resources": "~0.6.0", "@anticrm/telegram": "~0.6.0", "@anticrm/telegram-resources": "~0.6.0", + "@anticrm/devmodel": "~0.6.0", + "@anticrm/devmodel-resources": "~0.6.0", "@anticrm/workbench-assets": "~0.6.0" } } diff --git a/dev/prod/src/platform-dev.ts b/dev/prod/src/platform-dev.ts index f9a5394ce2..6b3e704b0d 100644 --- a/dev/prod/src/platform-dev.ts +++ b/dev/prod/src/platform-dev.ts @@ -22,6 +22,10 @@ import { serverRecruitId } from '@anticrm/server-recruit' import { serverViewId } from '@anticrm/server-view' import { setMetadata } from '@anticrm/platform' + +import devmodel, { devModelId } from '@anticrm/devmodel' +import client from '@anticrm/client' + export function configurePlatformDev() { setMetadata(login.metadata.OverrideLoginToken, process.env.LOGIN_TOKEN_DEV) setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT_DEV) @@ -30,9 +34,21 @@ export function configurePlatformDev() { addLocation(serverChunterId, () => import(/* webpackChunkName: "server-chunter" */ '@anticrm/dev-server-chunter-resources')) addLocation(serverRecruitId, () => import(/* webpackChunkName: "server-recruit" */ '@anticrm/server-recruit-resources')) addLocation(serverViewId, () => import(/* webpackChunkName: "server-view" */ '@anticrm/server-view-resources')) + + // Set devmodel to hook client to be able to present all activity + enableDevModel() } + export function configurePlatformDevServer() { console.log('Use Endpoint override:', process.env.LOGIN_ENDPOINT) setMetadata(login.metadata.OverrideEndpoint, process.env.LOGIN_ENDPOINT) + + // Set devmodel to hook client to be able to present all activity + enableDevModel() +} + +function enableDevModel() { + setMetadata(client.metadata.ClientHook, devmodel.hook.Hook) + addLocation(devModelId, () => import(/* webpackChunkName: "devmodel" */ '@anticrm/devmodel-resources')) } diff --git a/packages/ui/src/components/ActionIcon.svelte b/packages/ui/src/components/ActionIcon.svelte index ba498e9b21..69543866cf 100644 --- a/packages/ui/src/components/ActionIcon.svelte +++ b/packages/ui/src/components/ActionIcon.svelte @@ -24,7 +24,7 @@ export let direction: TooltipAligment | undefined = undefined export let icon: Asset | AnySvelteComponent export let size: 'small' | 'medium' | 'large' - export let action: (ev?: Event) => Promise + export let action: (ev?: Event) => Promise | void export let invisible: boolean = false diff --git a/plugins/client-resources/src/index.ts b/plugins/client-resources/src/index.ts index 1a4830571d..af8ba3ce07 100644 --- a/plugins/client-resources/src/index.ts +++ b/plugins/client-resources/src/index.ts @@ -16,6 +16,8 @@ import { createClient, Client, TxHander } from '@anticrm/core' import { connect } from './connection' +import clientPlugin from '@anticrm/client' +import { getMetadata, getResource } from '@anticrm/platform' export { connect } /*! @@ -31,11 +33,18 @@ export default async () => { function: { GetClient: async (token: string, endpoint: string): Promise => { if (client === undefined) { - return await createClient((handler: TxHander) => { + client = await createClient((handler: TxHander) => { const url = new URL(`/${token}`, endpoint) console.log('connecting to', url.href) return connect(url.href, handler) }) + + // Check if we had dev hook for client. + const hook = getMetadata(clientPlugin.metadata.ClientHook) + if (hook !== undefined) { + const hookProc = await getResource(hook) + client = await hookProc(client) + } } return client } diff --git a/plugins/client/src/index.ts b/plugins/client/src/index.ts index 5107b4cb2d..49de1e44b8 100644 --- a/plugins/client/src/index.ts +++ b/plugins/client/src/index.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import { plugin } from '@anticrm/platform' +import { Metadata, plugin } from '@anticrm/platform' import type { Plugin, Resource } from '@anticrm/platform' import type { Client } from '@anticrm/core' // import type { LiveQuery } from '@anticrm/query' @@ -25,10 +25,23 @@ import type { Client } from '@anticrm/core' */ export const clientId = 'client' as Plugin +/** + * @public + */ +export type ClientHook = (client: Client) => Promise + +/** + * @public + */ +export type ClientFactory = (token: string, endpoint: string) => Promise + export default plugin(clientId, { + metadata: { + ClientHook: '' as Metadata> + }, function: { - GetClient: '' as Resource<(token: string, endpoint: string) => Promise> + GetClient: '' as Resource } } ) diff --git a/plugins/devmodel-resources/.eslintrc.js b/plugins/devmodel-resources/.eslintrc.js new file mode 100644 index 0000000000..b4ad5961e2 --- /dev/null +++ b/plugins/devmodel-resources/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/ui/config/eslint.config.json'], + parserOptions: { tsconfigRootDir: __dirname }, + settings: { + 'svelte3/ignore-styles': () => true + } +}; \ No newline at end of file diff --git a/plugins/devmodel-resources/package.json b/plugins/devmodel-resources/package.json new file mode 100644 index 0000000000..ccedff614c --- /dev/null +++ b/plugins/devmodel-resources/package.json @@ -0,0 +1,48 @@ +{ + "name": "@anticrm/devmodel-resources", + "version": "0.6.0", + "main": "src/index.ts", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "svelte-check", + "lint": "eslint src", + "lint:fix": "eslint --fix src", + "format": "prettier --write --plugin-search-dir=. src && eslint --fix src", + "svelte-check": "svelte-check" + }, + "devDependencies": { + "svelte-loader":"^3.1.2", + "sass":"^1.37.5", + "svelte-preprocess":"^4.7.4", + "@anticrm/platform-rig":"~0.6.0", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-svelte3": "~3.2.1", + "prettier-plugin-svelte": "^2.2.0", + "eslint": "^7.32.0", + "prettier": "^2.4.1", + "svelte-check": "^2.2.10" + }, + "dependencies": { + "@anticrm/core":"~0.6.11", + "@anticrm/platform":"~0.6.5", + "@anticrm/ui":"~0.6.0", + "@anticrm/presentation":"~0.6.2", + "@anticrm/activity":"~0.6.0", + "svelte":"^3.37.0", + "@anticrm/chunter":"~0.6.1", + "@anticrm/text-editor":"~0.6.0", + "@anticrm/contact":"~0.6.2", + "@anticrm/view": "~0.6.0", + "@anticrm/view-resources": "~0.6.0", + "@anticrm/client": "~0.6.1", + "@anticrm/devmodel": "~0.6.0", + "@anticrm/model": "~0.6.0", + "@anticrm/workbench": "~0.6.1" + } +} diff --git a/plugins/devmodel-resources/postcss.config.js b/plugins/devmodel-resources/postcss.config.js new file mode 100644 index 0000000000..88752c6cb0 --- /dev/null +++ b/plugins/devmodel-resources/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: [ + require('autoprefixer') + ] +} diff --git a/plugins/devmodel-resources/src/components/ContentPopup.svelte b/plugins/devmodel-resources/src/components/ContentPopup.svelte new file mode 100644 index 0000000000..5bb9b8ef84 --- /dev/null +++ b/plugins/devmodel-resources/src/components/ContentPopup.svelte @@ -0,0 +1,15 @@ + + +
+  {JSON.stringify(content, undefined, 2)}
+
+ + \ No newline at end of file diff --git a/plugins/devmodel-resources/src/components/ModelView.svelte b/plugins/devmodel-resources/src/components/ModelView.svelte new file mode 100644 index 0000000000..5539f02424 --- /dev/null +++ b/plugins/devmodel-resources/src/components/ModelView.svelte @@ -0,0 +1,82 @@ + + + + +
+ + + + + + + + + + {#each txes as tx} + + + + + + {/each} + +
IDClassBody
{tx.objectId}{tx.objectClass} + + Content + +
+
+
+ diff --git a/plugins/devmodel-resources/src/components/QueryView.svelte b/plugins/devmodel-resources/src/components/QueryView.svelte new file mode 100644 index 0000000000..25f809b29f --- /dev/null +++ b/plugins/devmodel-resources/src/components/QueryView.svelte @@ -0,0 +1,87 @@ + + + + +
+ + + + + + + + + + + + + + {#each queries as q} + + + + + + + + + + {/each} + +
IndexClassQueryOptionsResult CountResultActions
{queries.indexOf(q)}{q._class}{JSON.stringify(q.query)}{JSON.stringify(q.options ?? {})}{q.result.length} + + Results + + + { + }}/> +
+
+
+ + diff --git a/plugins/devmodel-resources/src/index.ts b/plugins/devmodel-resources/src/index.ts new file mode 100644 index 0000000000..cdd3b3d38e --- /dev/null +++ b/plugins/devmodel-resources/src/index.ts @@ -0,0 +1,130 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { IntlString, Resources } from '@anticrm/platform' +import ModelView from './components/ModelView.svelte' +import QueryView from './components/QueryView.svelte' +import core, { Class, Client, Doc, DocumentQuery, FindOptions, Ref, FindResult, Hierarchy, ModelDb, Tx, TxResult, WithLookup } from '@anticrm/core' +import { Builder } from '@anticrm/model' +import workbench from '@anticrm/workbench' +import view from '@anticrm/view' +import devmodel from './plugin' + +export interface TxWitHResult { + tx: Tx + result: TxResult +} + +export interface QueryWithResult { + _class: Ref> + query: DocumentQuery + options?: FindOptions + result: FindResult + findOne: boolean +} + +export const transactions: TxWitHResult[] = [] +export const notifications: Tx[] = [] +export const queries: QueryWithResult[] = [] + +class ModelClient implements Client { + constructor (readonly client: Client) { + } + + notify (tx: Tx): void { + this.client.notify?.(tx) + notifications.push(tx) + } + + getHierarchy (): Hierarchy { + return this.client.getHierarchy() + } + + getModel (): ModelDb { + return this.client.getModel() + } + + async findOne (_class: Ref>, query: DocumentQuery, options?: FindOptions): Promise | undefined> { + const result = await this.client.findOne(_class, query, options) + console.info('devmodel# findOne=>', _class, query, options, 'result => ', result, ' =>model', this.client.getModel()) + queries.push({ _class, query, options, result: result !== undefined ? [result] : [], findOne: true }) + return result + } + + async findAll(_class: Ref>, query: DocumentQuery, options?: FindOptions): Promise> { + const result = await this.client.findAll(_class, query, options) + console.info('devmodel# findAll=>', _class, query, options, 'result => ', result, ' =>model', this.client.getModel()) + queries.push({ _class, query, options, result, findOne: false }) + return result + } + + async tx (tx: Tx): Promise { + const result = await this.client.tx(tx) + console.info('devmodel# tx=>', tx, result) + transactions.push({ tx, result }) + return result + } +} +export async function Hook (client: Client): Promise { + console.info('devmodel# Client HOOKED by DevModel') + + // Client is alive here, we could hook with some model extensions special for DevModel plugin. + const builder = new Builder() + + builder.createDoc(workbench.class.Application, core.space.Model, { + label: 'DevModel' as IntlString, + icon: view.icon.Table, + hidden: false, + navigatorModel: { + spaces: [ + ], + specials: [ + { + label: 'Transactions' as IntlString, + icon: view.icon.Table, + id: 'transactions', + component: devmodel.component.ModelView + }, + { + label: 'Queries' as IntlString, + icon: view.icon.Table, + id: 'queries', + component: devmodel.component.QueryView + } + ] + } + }, devmodel.ids.DevModelApp) + + const model = client.getModel() + for (const tx of builder.getTxes()) { + await model.tx(tx) + } + + return new ModelClient(client) +} + +export function toIntl (value: string): IntlString { + return value as IntlString +} + +export default async (): Promise => ({ + component: { + ModelView, + QueryView + }, + hook: { + Hook + } +}) diff --git a/plugins/devmodel-resources/src/plugin.ts b/plugins/devmodel-resources/src/plugin.ts new file mode 100644 index 0000000000..88f5f43607 --- /dev/null +++ b/plugins/devmodel-resources/src/plugin.ts @@ -0,0 +1,25 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import devmodel, { devModelId } from '@anticrm/devmodel' +import { mergeIds } from '@anticrm/platform' +import { Ref } from '@anticrm/core' +import { Application } from '@anticrm/workbench' + +export default mergeIds(devModelId, devmodel, { + ids: { + DevModelApp: '' as Ref + } +}) diff --git a/plugins/devmodel-resources/svelte.config.js b/plugins/devmodel-resources/svelte.config.js new file mode 100644 index 0000000000..944a06f73e --- /dev/null +++ b/plugins/devmodel-resources/svelte.config.js @@ -0,0 +1,5 @@ +const sveltePreprocess = require('svelte-preprocess') + +module.exports = { + preprocess: sveltePreprocess() +}; \ No newline at end of file diff --git a/plugins/devmodel-resources/tsconfig.json b/plugins/devmodel-resources/tsconfig.json new file mode 100644 index 0000000000..cabe5aefad --- /dev/null +++ b/plugins/devmodel-resources/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "esnext", + "module": "esnext", + "declaration": true, + "outDir": "./lib", + "strict": true, + "esModuleInterop": true, + "lib": [ + "esnext", + "dom" + ] + } +} \ No newline at end of file diff --git a/plugins/devmodel/.eslintrc.js b/plugins/devmodel/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/plugins/devmodel/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/plugins/devmodel/.npmignore b/plugins/devmodel/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/plugins/devmodel/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/plugins/devmodel/config/rig.json b/plugins/devmodel/config/rig.json new file mode 100644 index 0000000000..b2569948de --- /dev/null +++ b/plugins/devmodel/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@anticrm/platform-rig", + "rigProfile": "default" +} diff --git a/plugins/devmodel/package.json b/plugins/devmodel/package.json new file mode 100644 index 0000000000..d1bb16e09a --- /dev/null +++ b/plugins/devmodel/package.json @@ -0,0 +1,32 @@ +{ + "name": "@anticrm/devmodel", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/platform-rig":"~0.6.0", + "@types/heft-jest":"^1.0.2", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.1", + "eslint": "^7.32.0", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.41.1" + }, + "dependencies": { + "@anticrm/platform":"~0.6.5", + "@anticrm/core":"~0.6.12", + "@anticrm/ui": "~0.6.0", + "@anticrm/client": "~0.6.1" + } +} diff --git a/plugins/devmodel/src/index.ts b/plugins/devmodel/src/index.ts new file mode 100644 index 0000000000..008ae48288 --- /dev/null +++ b/plugins/devmodel/src/index.ts @@ -0,0 +1,39 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import type { Asset, Plugin, Resource } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' +import type { AnyComponent } from '@anticrm/ui' +import { ClientHook } from '@anticrm/client' + +/** + * @public + */ +export const devModelId = 'devmodel' as Plugin + +export default plugin(devModelId, { + icon: { + Activity: '' as Asset + }, + component: { + ModelView: '' as AnyComponent, + QueryView: '' as AnyComponent, + TransactionView: '' as AnyComponent, + NotificationsView: '' as AnyComponent + }, + hook: { + Hook: '' as Resource + } +}) diff --git a/plugins/devmodel/tsconfig.json b/plugins/devmodel/tsconfig.json new file mode 100644 index 0000000000..32045300ce --- /dev/null +++ b/plugins/devmodel/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "lib": ["esnext", "dom"] + } +} \ No newline at end of file diff --git a/rush.json b/rush.json index 5db27a4fee..d55f159286 100644 --- a/rush.json +++ b/rush.json @@ -855,6 +855,16 @@ "packageName": "@anticrm/model-telegram", "projectFolder": "models/telegram", "shouldPublish": true - } + }, + { + "packageName": "@anticrm/devmodel-resources", + "projectFolder": "plugins/devmodel-resources", + "shouldPublish": true + }, + { + "packageName": "@anticrm/devmodel", + "projectFolder": "plugins/devmodel", + "shouldPublish": true + }, ] }