From 5e6544c9436498e1f6119e5c0fbc8db9bd7c6ccd Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Sat, 7 Aug 2021 08:34:28 +0200 Subject: [PATCH] add `view` and `task` Signed-off-by: Andrey Platov --- common/config/rush/pnpm-lock.yaml | 42 ++++++++++++++++++++- plugins/contact/.eslintrc.js | 6 +++ plugins/contact/.npmignore | 4 ++ plugins/contact/config/rig.json | 18 +++++++++ plugins/contact/package.json | 24 ++++++++++++ plugins/contact/src/index.ts | 62 +++++++++++++++++++++++++++++++ plugins/contact/tsconfig.json | 9 +++++ plugins/task/.eslintrc.js | 6 +++ plugins/task/.npmignore | 4 ++ plugins/task/config/rig.json | 18 +++++++++ plugins/task/package.json | 25 +++++++++++++ plugins/task/src/index.ts | 47 +++++++++++++++++++++++ plugins/task/tsconfig.json | 9 +++++ rush.json | 10 +++++ 14 files changed, 283 insertions(+), 1 deletion(-) create mode 100644 plugins/contact/.eslintrc.js create mode 100644 plugins/contact/.npmignore create mode 100644 plugins/contact/config/rig.json create mode 100644 plugins/contact/package.json create mode 100644 plugins/contact/src/index.ts create mode 100644 plugins/contact/tsconfig.json create mode 100644 plugins/task/.eslintrc.js create mode 100644 plugins/task/.npmignore create mode 100644 plugins/task/config/rig.json create mode 100644 plugins/task/package.json create mode 100644 plugins/task/src/index.ts create mode 100644 plugins/task/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5016204837..838e246acf 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4,6 +4,7 @@ specifiers: '@microsoft/api-extractor': ^7.18.4 '@rush-temp/client': file:./projects/client.tgz '@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-server': file:./projects/dev-server.tgz '@rush-temp/dev-storage': file:./projects/dev-storage.tgz @@ -23,6 +24,7 @@ specifiers: '@rush-temp/server': file:./projects/server.tgz '@rush-temp/server-core': file:./projects/server-core.tgz '@rush-temp/server-ws': file:./projects/server-ws.tgz + '@rush-temp/task': file:./projects/task.tgz '@rush-temp/theme': file:./projects/theme.tgz '@rush-temp/ui': file:./projects/ui.tgz '@rush-temp/view': file:./projects/view.tgz @@ -71,6 +73,7 @@ dependencies: '@microsoft/api-extractor': 7.18.4 '@rush-temp/client': file:projects/client.tgz_6c259fadfeb3a4b20890aefe87070b8b '@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-server': file:projects/dev-server.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/dev-storage': file:projects/dev-storage.tgz_6c259fadfeb3a4b20890aefe87070b8b @@ -90,6 +93,7 @@ dependencies: '@rush-temp/server': file:projects/server.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/server-core': file:projects/server-core.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/server-ws': file:projects/server-ws.tgz_6c259fadfeb3a4b20890aefe87070b8b + '@rush-temp/task': file:projects/task.tgz_6c259fadfeb3a4b20890aefe87070b8b '@rush-temp/theme': file:projects/theme.tgz_c38cf1a7a413db8918b0b4754c21e4c5 '@rush-temp/ui': file:projects/ui.tgz_c38cf1a7a413db8918b0b4754c21e4c5 '@rush-temp/view': file:projects/view.tgz_6c259fadfeb3a4b20890aefe87070b8b @@ -7848,6 +7852,24 @@ packages: - typescript dev: false + file:projects/contact.tgz_6c259fadfeb3a4b20890aefe87070b8b: + resolution: {integrity: sha512-E2FyqDyeXYb/VjF5t3ZQO4qMLhzN6gVVEFRFlLuM2Bvp0PGPdRBbMCK80r3Vc01JQ5gHE/ujJsSXoAVzSvBsOg==, tarball: file:projects/contact.tgz} + id: file:projects/contact.tgz + name: '@rush-temp/contact' + 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/core.tgz_6c259fadfeb3a4b20890aefe87070b8b: resolution: {integrity: sha512-H49oedby3HV+eR2uQZAI0kIJ8Yxh8uIR+sLg4Ox0JAy4UJtfP5AmyWltddqaUdQIcfYrb2BrhDSDSxddlDWhpg==, tarball: file:projects/core.tgz} id: file:projects/core.tgz @@ -8015,7 +8037,7 @@ packages: dev: false file:projects/model-view.tgz_6c259fadfeb3a4b20890aefe87070b8b: - resolution: {integrity: sha512-p41TPHPPPtNlJatDd5UuUunmRUewUcU+/15EUBds6teIXCq5t54VBhkio3qE4SIuIeu9x+vDoKbJg49g1H6xmw==, tarball: file:projects/model-view.tgz} + resolution: {integrity: sha512-PZs8hdwec3zUdA0bOIW7W18xuw7Cu90GEEsLRx5YGYJfCVxfSVsbssDg5WphQPbnIslxCUZVS8hxLVM3q/FroA==, tarball: file:projects/model-view.tgz} id: file:projects/model-view.tgz name: '@rush-temp/model-view' version: 0.0.0 @@ -8238,6 +8260,24 @@ packages: - typescript dev: false + file:projects/task.tgz_6c259fadfeb3a4b20890aefe87070b8b: + resolution: {integrity: sha512-ek7KDmIP3XRC1qC7Z/ePwY/ZVbXXc4c6TfQTutmSPFnLzEZIzBgb6fWAlfp8zvYE3zJfF4k9r/n/c5wmmyzF3Q==, tarball: file:projects/task.tgz} + id: file:projects/task.tgz + name: '@rush-temp/task' + 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/theme.tgz_c38cf1a7a413db8918b0b4754c21e4c5: resolution: {integrity: sha512-LLq+6SEKjH+rv8a9NMUF+uUZBaT0NYj0PDJvVsJEO5PeheKKgDPZrAm4VsKNNr23NAIjipSgiaZKWEb0aQi7qg==, tarball: file:projects/theme.tgz} id: file:projects/theme.tgz diff --git a/plugins/contact/.eslintrc.js b/plugins/contact/.eslintrc.js new file mode 100644 index 0000000000..89f8151bd4 --- /dev/null +++ b/plugins/contact/.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/plugins/contact/.npmignore b/plugins/contact/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/plugins/contact/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/plugins/contact/config/rig.json b/plugins/contact/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/plugins/contact/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/plugins/contact/package.json b/plugins/contact/package.json new file mode 100644 index 0000000000..b9a435e31b --- /dev/null +++ b/plugins/contact/package.json @@ -0,0 +1,24 @@ +{ + "name": "@anticrm/contact", + "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" + } +} diff --git a/plugins/contact/src/index.ts b/plugins/contact/src/index.ts new file mode 100644 index 0000000000..55156e90b4 --- /dev/null +++ b/plugins/contact/src/index.ts @@ -0,0 +1,62 @@ +// +// 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 { plugin } from '@anticrm/platform' +import type { Plugin } from '@anticrm/platform' +import type { Doc, Ref, Class } from '@anticrm/core' + +/** + * @public + */ +export interface Contact extends Doc { +} + +/** + * @public + */ +export interface Person extends Contact { + firstName: string + lastName: string + email: string + phone: string + city: string +} + +/** + * @public + */ +export interface Organization extends Contact { + name: string +} + +/** + * @public + */ +export interface Employee extends Person { + +} + +/** + * @public + */ +export const contactId = 'contact' as Plugin + +export default plugin(contactId, { + class: { + Contact: '' as Ref>, + Person: '' as Ref>, + Organization: '' as Ref> + } +}) diff --git a/plugins/contact/tsconfig.json b/plugins/contact/tsconfig.json new file mode 100644 index 0000000000..32045300ce --- /dev/null +++ b/plugins/contact/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/plugins/task/.eslintrc.js b/plugins/task/.eslintrc.js new file mode 100644 index 0000000000..89f8151bd4 --- /dev/null +++ b/plugins/task/.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/plugins/task/.npmignore b/plugins/task/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/plugins/task/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/plugins/task/config/rig.json b/plugins/task/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/plugins/task/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/plugins/task/package.json b/plugins/task/package.json new file mode 100644 index 0000000000..f4e56b379b --- /dev/null +++ b/plugins/task/package.json @@ -0,0 +1,25 @@ +{ + "name": "@anticrm/task", + "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/contact":"~0.6.0" + } +} diff --git a/plugins/task/src/index.ts b/plugins/task/src/index.ts new file mode 100644 index 0000000000..4e5fd474e5 --- /dev/null +++ b/plugins/task/src/index.ts @@ -0,0 +1,47 @@ +// +// 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 { plugin } from '@anticrm/platform' +import type { Plugin, Asset } from '@anticrm/platform' +import type { Space, Doc, Ref, Class } from '@anticrm/core' +import type { Employee } from '@anticrm/contact' + +/** + * @public + */ +export interface Project extends Space {} + +/** + * @public + */ +export interface Task extends Doc { + title: string + description: string + assignee: Ref +} + +/** + * @public + */ +export const taskId = 'task' as Plugin + +export default plugin(taskId, { + class: { + Task: '' as Ref> + }, + icon: { + Task: '' as Asset + } +}) diff --git a/plugins/task/tsconfig.json b/plugins/task/tsconfig.json new file mode 100644 index 0000000000..32045300ce --- /dev/null +++ b/plugins/task/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 281876674f..7f5a4d880d 100644 --- a/rush.json +++ b/rush.json @@ -576,5 +576,15 @@ "projectFolder": "models/view", "shouldPublish": true }, + { + "packageName": "@anticrm/contact", + "projectFolder": "plugins/contact", + "shouldPublish": true + }, + { + "packageName": "@anticrm/task", + "projectFolder": "plugins/task", + "shouldPublish": true + }, ] }