mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
Remove unused workspace package (#566)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
c35a982619
commit
e3d9919c3e
@ -96,7 +96,6 @@ specifiers:
|
||||
'@rush-temp/workbench': file:./projects/workbench.tgz
|
||||
'@rush-temp/workbench-assets': file:./projects/workbench-assets.tgz
|
||||
'@rush-temp/workbench-resources': file:./projects/workbench-resources.tgz
|
||||
'@rush-temp/workspace': file:./projects/workspace.tgz
|
||||
'@rushstack/heft': ^0.41.1
|
||||
'@rushstack/heft-jest-plugin': ^0.1.15
|
||||
'@tiptap/core': ~2.0.0-beta.93
|
||||
@ -260,7 +259,6 @@ dependencies:
|
||||
'@rush-temp/workbench': file:projects/workbench.tgz
|
||||
'@rush-temp/workbench-assets': file:projects/workbench-assets.tgz
|
||||
'@rush-temp/workbench-resources': file:projects/workbench-resources.tgz_476f694f64637160ae71e12ff57815b9
|
||||
'@rush-temp/workspace': file:projects/workspace.tgz
|
||||
'@rushstack/heft': 0.41.1
|
||||
'@rushstack/heft-jest-plugin': 0.1.36_@rushstack+heft@0.41.1
|
||||
'@tiptap/core': 2.0.0-beta.118
|
||||
@ -11676,32 +11674,3 @@ packages:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/workspace.tgz:
|
||||
resolution: {integrity: sha512-YI/sT3YoO5I4h5IxDaQiW3DpmJ4debbG2AdYBK7a3hZcXInHy5JBYlH26oX8C03HkIFoyjXAKAs4rbhd7juy7w==, tarball: file:projects/workspace.tgz}
|
||||
name: '@rush-temp/workspace'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
'@rushstack/heft': 0.41.1
|
||||
'@types/heft-jest': 1.0.2
|
||||
'@types/minio': 7.0.10
|
||||
'@types/node': 16.10.3
|
||||
'@typescript-eslint/eslint-plugin': 5.4.0_87dbf04088b125598d0271706532eaf3
|
||||
'@typescript-eslint/parser': 5.4.0_eslint@7.32.0+typescript@4.4.3
|
||||
esbuild: 0.12.29
|
||||
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
|
||||
jwt-simple: 0.5.6
|
||||
minio: 7.0.19
|
||||
mongodb: 4.1.3
|
||||
prettier: 2.4.1
|
||||
ts-node: 10.2.1_8304ecd715830f7c190b4d1dea90b100
|
||||
typescript: 4.4.3
|
||||
transitivePeerDependencies:
|
||||
- '@swc/core'
|
||||
- '@swc/wasm'
|
||||
- supports-color
|
||||
dev: false
|
||||
|
@ -766,11 +766,6 @@
|
||||
"projectFolder": "server/elastic",
|
||||
"shouldPublish": true
|
||||
},
|
||||
{
|
||||
"packageName": "@anticrm/workspace",
|
||||
"projectFolder": "server/workspace",
|
||||
"shouldPublish": true
|
||||
},
|
||||
{
|
||||
"packageName": "@anticrm/contrib",
|
||||
"projectFolder": "server/contrib",
|
||||
|
@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: './tsconfig.json'
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
*
|
||||
!/lib/**
|
||||
!CHANGELOG.md
|
||||
/lib/**/__tests__/
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "@anticrm/workspace",
|
||||
"entries": [
|
||||
{
|
||||
"version": "0.6.0",
|
||||
"tag": "@anticrm/workspace_v0.6.0",
|
||||
"date": "Fri, 20 Aug 2021 16:21:03 GMT",
|
||||
"comments": {
|
||||
"dependency": [
|
||||
{
|
||||
"comment": "Updating dependency \"@anticrm/core\" from `~0.6.10` to `~0.6.11`"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Change Log - @anticrm/workspace
|
||||
|
||||
This log was last generated on Fri, 20 Aug 2021 16:21:03 GMT and should not be manually modified.
|
||||
|
||||
## 0.6.0
|
||||
Fri, 20 Aug 2021 16:21:03 GMT
|
||||
|
||||
_Initial release_
|
||||
|
@ -1,11 +0,0 @@
|
||||
FROM node
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY bundle.js ./
|
||||
|
||||
ENV TRANSACTOR_URL ws://transactor/
|
||||
ENV MINIO_ENDPOINT minio
|
||||
|
||||
EXPOSE 8080
|
||||
CMD [ "bash" ]
|
@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||
# Copyright © 2021 Hardcore Engineering Inc.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
rushx bundle
|
||||
rushx docker:build
|
||||
rushx docker:push
|
@ -1,18 +0,0 @@
|
||||
// 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"
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "@anticrm/workspace",
|
||||
"version": "0.6.0",
|
||||
"main": "lib/index.js",
|
||||
"author": "Anticrm Platform Contributors",
|
||||
"license": "EPL-2.0",
|
||||
"scripts": {
|
||||
"create": "ts-node src/__create.ts",
|
||||
"build": "heft build",
|
||||
"build:watch": "tsc",
|
||||
"lint:fix": "eslint --fix src",
|
||||
"bundle": "esbuild src/__create.ts --bundle --minify --platform=node > bundle.js",
|
||||
"docker:build": "docker build -t anticrm/tools .",
|
||||
"docker:push": "docker push anticrm/tools",
|
||||
"lint": "eslint 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",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-promise": "^5.1.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint": "^7.32.0",
|
||||
"ts-node": "^10.2.1",
|
||||
"esbuild": "^0.12.24",
|
||||
"@types/minio": "^7.0.10",
|
||||
"@types/node": "^16.7.5",
|
||||
"@typescript-eslint/parser": "^5.4.0",
|
||||
"eslint-config-standard-with-typescript": "^21.0.1",
|
||||
"prettier": "^2.4.1",
|
||||
"@rushstack/heft": "^0.41.1",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@anticrm/core": "~0.6.11",
|
||||
"mongodb": "^4.1.0",
|
||||
"@anticrm/contrib": "~0.6.0",
|
||||
"jwt-simple": "^0.5.6",
|
||||
"minio": "^7.0.19",
|
||||
"@anticrm/model-all": "~0.6.0"
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||
# Copyright © 2021 Hardcore Engineering Inc.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace default mng-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
|
||||
export MINIO_ACCESS_KEY=$(kubectl get secret --namespace default minio -o jsonpath="{.data.access-key}" | base64 --decode)
|
||||
export MINIO_SECRET_KEY=$(kubectl get secret --namespace default minio -o jsonpath="{.data.secret-key}" | base64 --decode)
|
||||
|
||||
kubectl run mng-mongodb-client --rm --tty -i --restart='Never' \
|
||||
--env="MONGO_URL=mongodb://root:$MONGODB_ROOT_PASSWORD@mng-mongodb:27017/" \
|
||||
--env="MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY" \
|
||||
--env="MINIO_SECRET_KEY=$MINIO_SECRET_KEY" --image anticrm/tools --command -- bash
|
@ -1,67 +0,0 @@
|
||||
//
|
||||
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||
// Copyright © 2021 Hardcore Engineering Inc.
|
||||
//
|
||||
// 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 { createWorkspace } from '.'
|
||||
import { Client } from 'minio'
|
||||
|
||||
const mongoUrl = process.env.MONGO_URL
|
||||
if (mongoUrl === undefined) {
|
||||
console.error('please provide mongodb url.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const transactorUrl = process.env.TRANSACTOR_URL
|
||||
if (transactorUrl === undefined) {
|
||||
console.error('please provide transactor url.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const minioEndpoint = process.env.MINIO_ENDPOINT
|
||||
if (minioEndpoint === undefined) {
|
||||
console.error('please provide minio endpoint')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const minioAccessKey = process.env.MINIO_ACCESS_KEY
|
||||
if (minioAccessKey === undefined) {
|
||||
console.error('please provide minio access key')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const minioSecretKey = process.env.MINIO_SECRET_KEY
|
||||
if (minioSecretKey === undefined) {
|
||||
console.error('please provide minio secret key')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const db = process.argv[2]
|
||||
if (db === undefined) {
|
||||
console.error('Please specify the database.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const minio = new Client({
|
||||
endPoint: minioEndpoint,
|
||||
port: 9000,
|
||||
useSSL: false,
|
||||
accessKey: minioAccessKey,
|
||||
secretKey: minioSecretKey
|
||||
})
|
||||
|
||||
console.log('creating model...')
|
||||
createWorkspace(mongoUrl, db, transactorUrl, minio).then(() => {
|
||||
console.log('done.')
|
||||
}).catch(error => { console.error(error) })
|
@ -1,58 +0,0 @@
|
||||
//
|
||||
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
||||
// Copyright © 2021 Hardcore Engineering Inc.
|
||||
//
|
||||
// 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 { createContributingClient } from '@anticrm/contrib'
|
||||
import core, { DOMAIN_TX } from '@anticrm/core'
|
||||
import builder from '@anticrm/model-all'
|
||||
import { encode } from 'jwt-simple'
|
||||
import { Client } from 'minio'
|
||||
import { Document, MongoClient } from 'mongodb'
|
||||
|
||||
const txes = builder.getTxes()
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export async function createWorkspace (mongoUrl: string, dbName: string, clientUrl: string, minio: Client): Promise<void> {
|
||||
const client = new MongoClient(mongoUrl)
|
||||
try {
|
||||
await client.connect()
|
||||
const db = client.db(dbName)
|
||||
|
||||
console.log('dropping database...')
|
||||
await db.dropDatabase()
|
||||
|
||||
console.log('creating model...')
|
||||
const model = txes.filter(tx => tx.objectSpace === core.space.Model)
|
||||
const result = await db.collection(DOMAIN_TX).insertMany(model as Document[])
|
||||
console.log(`${result.insertedCount} model transactions inserted.`)
|
||||
|
||||
console.log('creating data...')
|
||||
const data = txes.filter(tx => tx.objectSpace !== core.space.Model)
|
||||
const token = encode({ email: 'anticrm@hc.engineering', workspace: dbName }, 'secret')
|
||||
const url = new URL(`/${token}`, clientUrl)
|
||||
const contrib = await createContributingClient(url.href)
|
||||
for (const tx of data) {
|
||||
await contrib.tx(tx)
|
||||
}
|
||||
contrib.close()
|
||||
|
||||
console.log('create minio bucket')
|
||||
if (!await minio.bucketExists(dbName)) { await minio.makeBucket(dbName, 'k8s') }
|
||||
} finally {
|
||||
await client.close()
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json",
|
||||
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user