From 825ade52f7a93b2078ef35bfbd21a54521ede9b2 Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Sat, 7 Aug 2021 09:04:30 +0200 Subject: [PATCH] add `dev-client-resources` Signed-off-by: Andrey Platov --- common/config/rush/pnpm-lock.yaml | 20 + dev/client-resources/.eslintrc.js | 6 + dev/client-resources/.npmignore | 4 + dev/client-resources/config/rig.json | 18 + dev/client-resources/package.json | 26 + .../src/__tests__/client.test.ts | 31 + dev/client-resources/src/connection.ts | 45 + dev/client-resources/src/index.ts | 37 + dev/client-resources/src/model.tx.json | 1018 +++++++++++++++++ dev/client-resources/tsconfig.json | 8 + packages/platform/src/resource.ts | 1 + packages/platform/tsconfig.json | 2 +- plugins/client-resources/tsconfig.json | 1 - rush.json | 5 + 14 files changed, 1220 insertions(+), 2 deletions(-) create mode 100644 dev/client-resources/.eslintrc.js create mode 100644 dev/client-resources/.npmignore create mode 100644 dev/client-resources/config/rig.json create mode 100644 dev/client-resources/package.json create mode 100644 dev/client-resources/src/__tests__/client.test.ts create mode 100644 dev/client-resources/src/connection.ts create mode 100644 dev/client-resources/src/index.ts create mode 100644 dev/client-resources/src/model.tx.json create mode 100644 dev/client-resources/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 838e246acf..718f5b38bc 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -6,6 +6,7 @@ specifiers: '@rush-temp/client-resources': file:./projects/client-resources.tgz '@rush-temp/contact': file:./projects/contact.tgz '@rush-temp/core': file:./projects/core.tgz + '@rush-temp/dev-client-resources': file:./projects/dev-client-resources.tgz '@rush-temp/dev-server': file:./projects/dev-server.tgz '@rush-temp/dev-storage': file:./projects/dev-storage.tgz '@rush-temp/login': file:./projects/login.tgz @@ -75,6 +76,7 @@ dependencies: '@rush-temp/client-resources': file:projects/client-resources.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/contact': file:projects/contact.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/core': file:projects/core.tgz_6c259fadfeb3a4b20890aefe87070b8b + '@rush-temp/dev-client-resources': file:projects/dev-client-resources.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/dev-server': file:projects/dev-server.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/dev-storage': file:projects/dev-storage.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/login': file:projects/login.tgz_6c259fadfeb3a4b20890aefe87070b8b @@ -7889,6 +7891,24 @@ packages: - typescript dev: false + file:projects/dev-client-resources.tgz_6c259fadfeb3a4b20890aefe87070b8b: + resolution: {integrity: sha512-EUDIrb3wXy6PHSbUnxEkKagNVsM5jKUBg0qSdd6/BriulwYZ5C1BlLqS58oDWxaySjHBSMGyaKN4Ath5QYrI8A==, tarball: file:projects/dev-client-resources.tgz} + id: file:projects/dev-client-resources.tgz + name: '@rush-temp/dev-client-resources' + version: 0.0.0 + dependencies: + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 4.28.5_a8e83fcad666e1ba86be4b2e27a20aea + eslint: 7.32.0 + eslint-plugin-import: 2.23.4_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 4.3.1 + transitivePeerDependencies: + - '@typescript-eslint/parser' + - supports-color + - typescript + dev: false + file:projects/dev-server.tgz_6c259fadfeb3a4b20890aefe87070b8b: resolution: {integrity: sha512-Zj6rBT3x7MGKM3H4RDuT7heWMI14fruf/LO0bAuLaJf99SWtkug9mNgFSnrLJyxoKUimhOBT1BHNVOH53MNOCg==, tarball: file:projects/dev-server.tgz} id: file:projects/dev-server.tgz diff --git a/dev/client-resources/.eslintrc.js b/dev/client-resources/.eslintrc.js new file mode 100644 index 0000000000..89f8151bd4 --- /dev/null +++ b/dev/client-resources/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + project: './tsconfig.json' + } +} \ No newline at end of file diff --git a/dev/client-resources/.npmignore b/dev/client-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/dev/client-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/dev/client-resources/config/rig.json b/dev/client-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/dev/client-resources/config/rig.json @@ -0,0 +1,18 @@ +// The "rig.json" file directs tools to look for their config files in an external package. +// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + /** + * (Required) The name of the rig package to inherit from. + * It should be an NPM package name with the "-rig" suffix. + */ + "rigPackageName": "@anticrm/platform-rig" + + /** + * (Optional) Selects a config profile from the rig package. The name must consist of + * lowercase alphanumeric words separated by hyphens, for example "sample-profile". + * If omitted, then the "default" profile will be used." + */ + // "rigProfile": "your-profile-name" +} diff --git a/dev/client-resources/package.json b/dev/client-resources/package.json new file mode 100644 index 0000000000..0f521b2688 --- /dev/null +++ b/dev/client-resources/package.json @@ -0,0 +1,26 @@ +{ + "name": "@anticrm/dev-client-resources", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "lint:fix": "eslint --fix src" + }, + "devDependencies": { + "@anticrm/platform-rig":"~0.6.0", + "@types/heft-jest":"^1.0.2", + "@typescript-eslint/eslint-plugin":"4", + "eslint-plugin-import":"2", + "eslint-plugin-promise":"4", + "eslint-plugin-node":"11", + "eslint":"^7.32.0" + }, + "dependencies": { + "@anticrm/platform":"~0.6.3", + "@anticrm/core":"~0.6.0", + "@anticrm/client":"~0.6.0", + "@anticrm/dev-storage":"~0.6.3" + } +} diff --git a/dev/client-resources/src/__tests__/client.test.ts b/dev/client-resources/src/__tests__/client.test.ts new file mode 100644 index 0000000000..1363c63862 --- /dev/null +++ b/dev/client-resources/src/__tests__/client.test.ts @@ -0,0 +1,31 @@ +// +// 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 { connect } from '../connection' +import core, { createClient } from '@anticrm/core' + +describe('client', () => { + it('should create connection', async () => { + const conn = await connect(() => {}) + const txes = await conn.findAll(core.class.Tx, {}) + expect(txes.length).toBe(25) + }) + + it('should create client', async () => { + const client = await createClient(connect) + const txes = await client.findAll(core.class.Class, {}) + expect(txes.length).toBe(18) + }) +}) diff --git a/dev/client-resources/src/connection.ts b/dev/client-resources/src/connection.ts new file mode 100644 index 0000000000..b5975b005e --- /dev/null +++ b/dev/client-resources/src/connection.ts @@ -0,0 +1,45 @@ +// +// 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 type { + Tx, + Storage, + Ref, + Doc, + Class, + DocumentQuery, + FindResult, + FindOptions, + TxHander +} from '@anticrm/core' +import { createStorage, ServerStorage } from '@anticrm/dev-storage' + +class ServerStorageWrapper implements Storage { + constructor (private readonly storage: ServerStorage, private readonly handler: TxHander) {} + + findAll (_class: Ref>, query: DocumentQuery, options?: FindOptions): Promise> { + return this.storage.findAll(_class, query, options) + } + + async tx (tx: Tx): Promise { + const derived = await this.storage.tx(tx) + for (const tx of derived) { this.handler(tx) } + } +} + +export async function connect (handler: (tx: Tx) => void): Promise { + const serverStorage = await createStorage() + return new ServerStorageWrapper(serverStorage, handler) +} diff --git a/dev/client-resources/src/index.ts b/dev/client-resources/src/index.ts new file mode 100644 index 0000000000..6cb7ceee90 --- /dev/null +++ b/dev/client-resources/src/index.ts @@ -0,0 +1,37 @@ +// +// 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 { createClient, Client } from '@anticrm/core' +import { connect } from './connection' + +/*! + * Anticrm Platform™ Client Dev Plugin + * © 2020 Anticrm Platform Contributors. All Rights Reserved. + * Licensed under the Eclipse Public License, Version 2.0 + */ +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => { + let client: Client + return { + function: { + GetClient: async (): Promise => { + if (client === undefined) { + client = await createClient(connect) + } + return client + } + } + } +} diff --git a/dev/client-resources/src/model.tx.json b/dev/client-resources/src/model.tx.json new file mode 100644 index 0000000000..f8f795b450 --- /dev/null +++ b/dev/client-resources/src/model.tx.json @@ -0,0 +1,1018 @@ +[ + { + "_id": "610828bdad975a4e5f24b461", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Obj", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0 + } + }, + { + "_id": "610828bdad975a4e5f24b462", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Doc", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Obj" + } + }, + { + "_id": "610828bdad975a4e5f24b463", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Type", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b464", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.TypeString", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Type" + } + }, + { + "_id": "610828bdad975a4e5f24b465", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Attribute", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b466", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Account", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b467", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Space", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b468", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Tx", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "tx", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b469", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.TxUpdateDoc", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Tx" + } + }, + { + "_id": "610828bdad975a4e5f24b46a", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.TxMixin", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Tx" + } + }, + { + "_id": "610828bdad975a4e5f24b46b", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.TxCreateDoc", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Tx" + } + }, + { + "_id": "610828bdad975a4e5f24b46c", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Class", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b46d", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "core.class.Mixin", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Class" + } + }, + { + "_id": "610828bdad975a4e5f24b46e", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "view.class.Viewlet", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b46f", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "view.class.ViewletDescriptor", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b470", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "view.mixin.AttributePresenter", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Class" + } + }, + { + "_id": "610828bdad975a4e5f24b471", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "view.mixin.AttributeEditor", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669333, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Class" + } + }, + { + "_id": "610828bdad975a4e5f24b472", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669333, + "objectId": "core.class.TypeString", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "view.mixin.AttributeEditor", + "attributes": { + "editor": "view.component.StringEditor" + } + }, + { + "_id": "610828bdad975a4e5f24b473", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669333, + "objectId": "core.class.TypeString", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "view.mixin.AttributePresenter", + "attributes": { + "presenter": "view.component.StringPresenter" + } + }, + { + "_id": "610828bdad975a4e5f24b474", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "view.viewlet.Table", + "objectClass": "view.class.ViewletDescriptor", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "label": "Table", + "icon": "view.icon.Table", + "component": "table.component.TableView" + } + }, + { + "_id": "610828bdad975a4e5f24b475", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "workbench.mixin.SpaceView", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Class" + } + }, + { + "_id": "610828bdad975a4e5f24b476", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "workbench.class.Application", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "domain": "model", + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b477", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "contact.class.Contact", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b478", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "contact.class.Organization", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "contact.class.Contact" + } + }, + { + "_id": "610828bdad975a4e5f24b479", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "contact.class.Person", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "contact.class.Contact", + "label": "Person" + } + }, + { + "_id": "610828bdad975a4e5f24b47a", + "objectId": "610828bdad975a4e5f24b47b", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669178, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "firstName", + "label": "First name", + "attributeOf": "contact.class.Person" + } + }, + { + "_id": "610828bdad975a4e5f24b47c", + "objectId": "610828bdad975a4e5f24b47d", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669178, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "lastName", + "label": "Last name", + "attributeOf": "contact.class.Person" + } + }, + { + "_id": "610828bdad975a4e5f24b47e", + "objectId": "610828bdad975a4e5f24b47f", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669178, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "email", + "label": "Email", + "attributeOf": "contact.class.Person" + } + }, + { + "_id": "610828bdad975a4e5f24b480", + "objectId": "610828bdad975a4e5f24b481", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669178, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "phone", + "label": "Phone", + "attributeOf": "contact.class.Person" + } + }, + { + "_id": "610828bdad975a4e5f24b482", + "objectId": "610828bdad975a4e5f24b483", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669178, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "city", + "label": "City", + "attributeOf": "contact.class.Person" + } + }, + { + "_id": "610828bdad975a4e5f24b484", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669334, + "objectId": "contact.class.Person", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "view.mixin.AttributePresenter", + "attributes": { + "presenter": "contact.component.PersonPresenter" + } + }, + { + "_id": "610828bdad975a4e5f24b485", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "chunter.class.Backlink", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b486", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "chunter.class.Message", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc", + "triggers": [ + "chunter-server.trigger.OnMessage" + ] + } + }, + { + "_id": "610828bdad975a4e5f24b487", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "chunter.class.Channel", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Space", + "label": "chunter.string.Channel", + "icon": "chunter.icon.Hashtag" + } + }, + { + "_id": "610828bdad975a4e5f24b488", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669334, + "objectId": "chunter.class.Channel", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "workbench.mixin.SpaceView", + "attributes": { + "view": { + "class": "chunter.class.Message" + } + } + }, + { + "_id": "610828bdad975a4e5f24b489", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "chunter.viewlet.Chat", + "objectClass": "view.class.ViewletDescriptor", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "label": "Chat", + "icon": "view.icon.Table", + "component": "chunter.component.ChannelView" + } + }, + { + "_id": "610828bdad975a4e5f24b48a", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b48b", + "objectClass": "view.class.Viewlet", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "attachTo": "chunter.class.Message", + "descriptor": "chunter.viewlet.Chat", + "open": "X", + "config": {} + } + }, + { + "_id": "610828bdad975a4e5f24b48c", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b48d", + "objectClass": "workbench.class.Application", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "label": "chunter.string.ApplicationLabelChunter", + "icon": "chunter.icon.Chunter", + "navigatorModel": { + "spaces": [ + { + "label": "chunter.string.Channels", + "spaceClass": "chunter.class.Channel", + "addSpaceLabel": "chunter.string.CreateChannel", + "createComponent": "chunter.component.CreateChannel" + } + ] + } + } + }, + { + "_id": "610828bdad975a4e5f24b48e", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b48f", + "objectClass": "chunter.class.Channel", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "name": "general", + "description": "General Channel", + "private": false, + "members": [] + } + }, + { + "_id": "610828bdad975a4e5f24b490", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b491", + "objectClass": "chunter.class.Channel", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "name": "random", + "description": "Random Talks", + "private": false, + "members": [] + } + }, + { + "_id": "610828bdad975a4e5f24b492", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "task.class.Task", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b493", + "objectId": "610828bdad975a4e5f24b494", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669332, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "title", + "label": "Title", + "attributeOf": "task.class.Task" + } + }, + { + "_id": "610828bdad975a4e5f24b495", + "objectId": "610828bdad975a4e5f24b496", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669332, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "description", + "label": "Description", + "attributeOf": "task.class.Task" + } + }, + { + "_id": "610828bdad975a4e5f24b497", + "objectId": "610828bdad975a4e5f24b498", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669332, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "assignee", + "label": "Assignee", + "attributeOf": "task.class.Task" + } + }, + { + "_id": "610828bdad975a4e5f24b499", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "task.class.Project", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Space", + "label": "Project", + "icon": "task.icon.Task" + } + }, + { + "_id": "610828bdad975a4e5f24b49a", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669334, + "objectId": "task.class.Project", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "workbench.mixin.SpaceView", + "attributes": { + "view": { + "class": "task.class.Task", + "createItemDialog": "task.component.CreateTask" + } + } + }, + { + "_id": "610828bdad975a4e5f24b49b", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b49c", + "objectClass": "view.class.Viewlet", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "attachTo": "task.class.Task", + "descriptor": "view.viewlet.Table", + "open": "ZX", + "options": { + "lookup": { + "assignee": "contact.class.Person" + } + }, + "config": [ + "title", + "$lookup.assignee" + ] + } + }, + { + "_id": "610828bdad975a4e5f24b49d", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b49e", + "objectClass": "workbench.class.Application", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "label": "task.string.ApplicationLabelTask", + "icon": "task.icon.Task", + "navigatorModel": { + "spaces": [ + { + "label": "task.string.Projects", + "spaceClass": "task.class.Project", + "addSpaceLabel": "task.string.CreateProject", + "createComponent": "task.component.CreateProject" + } + ] + } + } + }, + { + "_id": "610828bdad975a4e5f24b49f", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b4a0", + "objectClass": "task.class.Project", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "name": "demo", + "description": "Demo Project", + "private": false, + "members": [] + } + }, + { + "_id": "610828bdad975a4e5f24b4a1", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "recruit.class.Applicant", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Doc" + } + }, + { + "_id": "610828bdad975a4e5f24b4a2", + "objectId": "610828bdad975a4e5f24b4a3", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669299, + "objectSpace": "core.space.Model", + "objectClass": "core.class.Attribute", + "attributes": { + "type": { + "_class": "core.class.TypeString" + }, + "name": "candidate", + "label": "Candidate", + "attributeOf": "recruit.class.Applicant" + } + }, + { + "_id": "610828bdad975a4e5f24b4a4", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "recruit.class.Candidate", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "contact.class.Person", + "label": "Candidate" + } + }, + { + "_id": "610828bdad975a4e5f24b4a5", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "recruit.class.Candidates", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Space", + "label": "recruit.string.CandidatePools", + "icon": "recruit.icon.RecruitApplication" + } + }, + { + "_id": "610828bdad975a4e5f24b4a6", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "recruit.class.Vacancy", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "kind": 0, + "extends": "core.class.Space", + "label": "recruit.string.Vacancy", + "icon": "recruit.icon.Vacancy" + } + }, + { + "_id": "610828bdad975a4e5f24b4a7", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669334, + "objectId": "recruit.class.Vacancy", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "workbench.mixin.SpaceView", + "attributes": { + "view": { + "class": "recruit.class.Applicant", + "createItemDialog": "recruit.component.CreateApplication" + } + } + }, + { + "_id": "610828bdad975a4e5f24b4a8", + "_class": "core.class.TxMixin", + "space": "core.space.Tx", + "modifiedBy": "core.account.System", + "modifiedOn": 1627924669334, + "objectId": "recruit.class.Candidates", + "objectClass": "core.class.Class", + "objectSpace": "core.space.Model", + "mixin": "workbench.mixin.SpaceView", + "attributes": { + "view": { + "class": "recruit.class.Candidate", + "createItemDialog": "recruit.component.CreateCandidate" + } + } + }, + { + "_id": "610828bdad975a4e5f24b4a9", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b4aa", + "objectClass": "workbench.class.Application", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "label": "recruit.string.RecruitApplication", + "icon": "recruit.icon.RecruitApplication", + "navigatorModel": { + "spaces": [ + { + "label": "recruit.string.Vacancies", + "spaceClass": "recruit.class.Vacancy", + "addSpaceLabel": "recruit.string.CreateVacancy", + "createComponent": "recruit.component.CreateVacancy" + }, + { + "label": "recruit.string.CandidatePools", + "spaceClass": "recruit.class.Candidates", + "addSpaceLabel": "recruit.string.CreateCandidates", + "createComponent": "recruit.component.CreateCandidates" + } + ] + } + } + }, + { + "_id": "610828bdad975a4e5f24b4ab", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "recruit.space.CandidatesPublic", + "objectClass": "recruit.class.Candidates", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "name": "public", + "description": "Public Candidates", + "private": false, + "members": [] + } + }, + { + "_id": "610828bdad975a4e5f24b4ac", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b4ad", + "objectClass": "view.class.Viewlet", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "attachTo": "recruit.class.Candidate", + "descriptor": "view.viewlet.Table", + "open": "recruit.component.EditCandidate", + "config": [ + "", + "email", + "phone", + "city" + ] + } + }, + { + "_id": "610828bdad975a4e5f24b4ae", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b4af", + "objectClass": "view.class.Viewlet", + "objectSpace": "core.space.Model", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "attachTo": "recruit.class.Applicant", + "descriptor": "view.viewlet.Table", + "open": "recruit.component.EditCandidate", + "options": { + "lookup": { + "candidate": "recruit.class.Candidate" + } + }, + "config": [ + "$lookup.candidate", + "$lookup.candidate.email", + "$lookup.candidate.city" + ] + } + }, + { + "_id": "610828bdad975a4e5f24b4b0", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b4b1", + "objectClass": "recruit.class.Candidate", + "objectSpace": "recruit.space.CandidatesPublic", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "firstName": "Andrey", + "lastName": "P.", + "email": "andrey@hc.engineering", + "phone": "+1 646 667 6832", + "city": "Monte Carlo" + } + }, + { + "_id": "610828bdad975a4e5f24b4b2", + "_class": "core.class.TxCreateDoc", + "space": "core.space.Tx", + "objectId": "610828bdad975a4e5f24b4b3", + "objectClass": "recruit.class.Candidate", + "objectSpace": "recruit.space.CandidatesPublic", + "modifiedOn": 1627924669334, + "modifiedBy": "core.account.System", + "attributes": { + "firstName": "Marina", + "lastName": "M.", + "email": "marina@hc.engineering", + "phone": "+1 646 777 3333", + "city": "Los Angeles" + } + } +] \ No newline at end of file diff --git a/dev/client-resources/tsconfig.json b/dev/client-resources/tsconfig.json new file mode 100644 index 0000000000..b629b14fd0 --- /dev/null +++ b/dev/client-resources/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/packages/platform/src/resource.ts b/packages/platform/src/resource.ts index ecc009cb7c..235c754629 100644 --- a/packages/platform/src/resource.ts +++ b/packages/platform/src/resource.ts @@ -55,6 +55,7 @@ export function addLocation ( function getLocation (plugin: Plugin): PluginLoader { const location = locations.get(plugin) if (location === undefined) { + console.log(plugin) throw new PlatformError( new Status(Severity.ERROR, platform.status.NoLocationForPlugin, { plugin diff --git a/packages/platform/tsconfig.json b/packages/platform/tsconfig.json index dd705c98a5..d3d45172be 100644 --- a/packages/platform/tsconfig.json +++ b/packages/platform/tsconfig.json @@ -4,6 +4,6 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./lib", - "lib": ["esnext", "esnext.intl"] + "lib": ["esnext", "esnext.intl", "dom"] } } \ No newline at end of file diff --git a/plugins/client-resources/tsconfig.json b/plugins/client-resources/tsconfig.json index 32045300ce..b629b14fd0 100644 --- a/plugins/client-resources/tsconfig.json +++ b/plugins/client-resources/tsconfig.json @@ -4,6 +4,5 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./lib", - "lib": ["esnext", "dom"] } } \ No newline at end of file diff --git a/rush.json b/rush.json index 7f5a4d880d..1113ba2881 100644 --- a/rush.json +++ b/rush.json @@ -586,5 +586,10 @@ "projectFolder": "plugins/task", "shouldPublish": true }, + { + "packageName": "@anticrm/dev-client-resources", + "projectFolder": "dev/client-resources", + "shouldPublish": true + }, ] }