diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 967e9bfbd8..b08a044247 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,8 +66,8 @@ jobs: - name: Installing... run: node common/scripts/install-run-rush.js install - - name: Setting model version from git release... - run: node common/scripts/install-run-rush.js bump-model-version + - name: Model version from git tags + run: node common/scripts/install-run-rush.js model-version - name: Building... run: node common/scripts/install-run-rush.js build @@ -258,6 +258,18 @@ jobs: key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + - name: Installing... + run: node common/scripts/install-run-rush.js install + + - name: Model version from git tags + run: node common/scripts/install-run-rush.js model-version + + - name: Building... + run: node common/scripts/install-run-rush.js build + + - name: Print model version + run: node common/scripts/install-run-rush.js model-version + - name: Bundle run: node common/scripts/install-run-rush.js bundle - name: Docker build diff --git a/common/config/rush/command-line.json b/common/config/rush/command-line.json index 3a372421eb..10eb483a0e 100644 --- a/common/config/rush/command-line.json +++ b/common/config/rush/command-line.json @@ -303,15 +303,7 @@ "summary": "show model version", "description": "show model version", "safeForSimultaneousRushProcesses": true, - "shellCommand": "cd ./models/all/ && npx ts-node ./src/__showversion.ts" - }, - { - "commandKind": "global", - "name": "bump-model-version", - "summary": "set model version from git + patch +1", - "description": "set current model version", - "safeForSimultaneousRushProcesses": true, - "shellCommand": "cd ./models/all/ && npx ts-node ./src/__bumpversion.ts" + "shellCommand": "npx node ./common/scripts/show_version.js" }, { "commandKind": "global", diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 6a12a94db0..eb710e84ef 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -97,7 +97,7 @@ dependencies: version: file:projects/collaborator.tgz(@tiptap/pm@2.1.12)(bufferutil@4.0.7)(prosemirror-model@1.19.3)(svelte@4.2.5) '@rush-temp/collaborator-client': specifier: file:./projects/collaborator-client.tgz - version: file:projects/collaborator-client.tgz(@tiptap/pm@2.1.12)(bufferutil@4.0.7)(prosemirror-model@1.19.3)(svelte@4.2.5) + version: file:projects/collaborator-client.tgz(svelte@4.2.5)(ts-node@10.9.1) '@rush-temp/contact': specifier: file:./projects/contact.tgz version: file:projects/contact.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1) @@ -18166,28 +18166,16 @@ packages: - ts-node dev: false - file:projects/collaborator-client.tgz(@tiptap/pm@2.1.12)(bufferutil@4.0.7)(prosemirror-model@1.19.3)(svelte@4.2.5): - resolution: {integrity: sha512-Y2u0DCP4rKKaMr/xXErbICh/BhNLqPCEf4G/IQO2zffTM0uzMB0Iep4nitc2JQ/jbrpcH17mvIgKULdjZzUJng==, tarball: file:projects/collaborator-client.tgz} + file:projects/collaborator-client.tgz(svelte@4.2.5)(ts-node@10.9.1): + resolution: {integrity: sha512-GmFWK9622Fi4YG2ICnCrvLaE6un6N12CHzLViYJiN9o7oLS9fyzzdihncVC/FUBVPu1ON/Vab7PKmZMen+vWFQ==, tarball: file:projects/collaborator-client.tgz} id: file:projects/collaborator-client.tgz name: '@rush-temp/collaborator-client' version: 0.0.0 dependencies: - '@hocuspocus/server': 2.9.0(bufferutil@4.0.7)(yjs@13.6.8) - '@hocuspocus/transformer': 2.9.0(@tiptap/pm@2.1.12)(y-prosemirror@1.2.1)(yjs@13.6.8) - '@tiptap/core': 2.1.12(@tiptap/pm@2.1.12) - '@tiptap/html': 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12) - '@types/body-parser': 1.19.3 - '@types/compression': 1.7.3 - '@types/cors': 2.8.14 - '@types/express': 4.17.18 '@types/jest': 29.5.5 '@types/node': 16.11.68 - '@types/ws': 8.5.6 '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - body-parser: 1.19.2 - compression: 1.7.4 - cors: 2.8.5 cross-env: 7.0.3 esbuild: 0.16.17 eslint: 8.54.0 @@ -18195,39 +18183,24 @@ packages: eslint-plugin-import: 2.28.1(eslint@8.54.0) eslint-plugin-n: 15.7.0(eslint@8.54.0) eslint-plugin-promise: 6.1.1(eslint@8.54.0) - express: 4.18.2 jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1) - mongodb: 4.17.1 prettier: 3.1.0 prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2) - ts-node: 10.9.1(@types/node@16.11.68)(typescript@5.2.2) typescript: 5.2.2 - ws: 8.14.2(bufferutil@4.0.7) - y-prosemirror: 1.2.1(prosemirror-model@1.19.3)(yjs@13.6.8) - yjs: 13.6.8 transitivePeerDependencies: - '@babel/core' - '@jest/types' - - '@swc/core' - - '@swc/wasm' - - '@tiptap/pm' - - aws-crt - babel-jest - babel-plugin-macros - - bufferutil - node-notifier - - prosemirror-model - - prosemirror-state - - prosemirror-view - supports-color - svelte - - utf-8-validate - - y-protocols + - ts-node dev: false file:projects/collaborator.tgz(@tiptap/pm@2.1.12)(bufferutil@4.0.7)(prosemirror-model@1.19.3)(svelte@4.2.5): - resolution: {integrity: sha512-3i/AaU2M+nAeTR6IvfoGu0Wv586kiA3g2lBd+yIujeJ8hD1ZZxaF6rbfJ7YD8E/BwOkBuFUoz5XVYKSTrszH4w==, tarball: file:projects/collaborator.tgz} + resolution: {integrity: sha512-DF7F2NpWmslkwkGxwZ8nDLPvzRuK3nDEibOqhvTVyrikrfoaa6pwuSVfWP4W5fAUEBNGLssmHPn+ycCJjImFgQ==, tarball: file:projects/collaborator.tgz} id: file:projects/collaborator.tgz name: '@rush-temp/collaborator' version: 0.0.0 @@ -21152,7 +21125,7 @@ packages: dev: false file:projects/presentation.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1): - resolution: {integrity: sha512-7305Y8JSskN+8NyIXiggwQKSAO9h59z3dM2ZbM1Dmr5xETAU3h12rQm2YhR2DnshPpOuc9FV1JCNXMLctWrMuQ==, tarball: file:projects/presentation.tgz} + resolution: {integrity: sha512-h+mThVeZ7IO2sPO2XCzF3WMEkXtvOYD+wK41cdAh5QRnc8f2x9TJuUVFBZHwx7vBE9QJR+6t//xpuhHbUf6opg==, tarball: file:projects/presentation.tgz} id: file:projects/presentation.tgz name: '@rush-temp/presentation' version: 0.0.0 diff --git a/models/all/src/__bumpversion.ts b/common/scripts/show_version.js similarity index 64% rename from models/all/src/__bumpversion.ts rename to common/scripts/show_version.js index 8c90e0f102..4d405ce6f2 100644 --- a/models/all/src/__bumpversion.ts +++ b/common/scripts/show_version.js @@ -1,5 +1,5 @@ // -// Copyright © 2022 Hardcore Engineering Inc. +// Copyright © 2024 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 @@ -13,14 +13,11 @@ // limitations under the License. // -import { exec } from 'child_process' -import { writeFileSync } from 'fs' -import currentVersion from './version.json' +const exec = require('child_process').exec exec('git describe --tags --abbrev=0', (err, stdout, stderr) => { if (err !== null) { - console.log('Error', err) - process.exit(1) + console.log('"0.6.0"') } const rawVersion = stdout.trim().replace('v', '').split('.') if (rawVersion.length === 3) { @@ -29,12 +26,6 @@ exec('git describe --tags --abbrev=0', (err, stdout, stderr) => { minor: parseInt(rawVersion[1]), patch: parseInt(rawVersion[2]) } - const newVersion = JSON.stringify(version) - if (JSON.stringify(currentVersion) !== newVersion) { - console.log('Bumping version from', currentVersion, 'to', version) - writeFileSync('./src/version.json', newVersion) - } else { - console.log('same version already') - } + console.log(`"${version.major}.${version.minor}.${version.patch}"`) } }) diff --git a/dev/tool/package.json b/dev/tool/package.json index 206a27e32a..bc018e7489 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -9,12 +9,12 @@ "build:watch": "tsc", "lint:fix": "eslint --fix src", "start": "ts-node src/__start.ts", - "bundle": "esbuild src/__start.ts --bundle --minify --platform=node --define:process.env.MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) --define:process.env.GIT_REVISION=$(../../common/scripts/git_version.sh) > bundle.js", + "bundle": "esbuild src/__start.ts --bundle --minify --platform=node --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --define:process.env.GIT_REVISION=$(../../common/scripts/git_version.sh) > bundle.js", "docker:build": "docker build -t hardcoreeng/tool .", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/tool staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/tool", - "run-local": "cross-env SERVER_SECRET=secret MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws://localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 REKONI_URL=http://localhost:4004 MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) GIT_REVISION=$(git describe --all --long) node -r ts-node/register --max-old-space-size=18000 ./src/__start.ts", - "run": "cross-env node -r ts-node/register --max-old-space-size=8000 ./src/__start.ts", + "run-local": "cross-env SERVER_SECRET=secret MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws://localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 REKONI_URL=http://localhost:4004 MODEL_VERSION=$(node ../../common/scripts/show_version.js) GIT_REVISION=$(git describe --all --long) node -r ts-node/register --max-old-space-size=18000 ./src/__start.ts", + "run": "cross-env node -r ts-node/register --max-old-space-size=8000 MODEL_VERSION=$(node ../../common/scripts/show_version.js) ./src/__start.ts", "upgrade": "rushx run-local upgrade", "lint": "eslint src", "format": "format src", diff --git a/dev/tool/src/__start.ts b/dev/tool/src/__start.ts index 99239b1d50..56e0d910bf 100644 --- a/dev/tool/src/__start.ts +++ b/dev/tool/src/__start.ts @@ -18,7 +18,7 @@ import { prepareTools as prepareToolsRaw } from '@hcengineering/server-tool' import { Data, Tx, Version } from '@hcengineering/core' import { MinioService } from '@hcengineering/minio' import { MigrateOperation } from '@hcengineering/model' -import builder, { migrateOperations, version } from '@hcengineering/model-all' +import builder, { migrateOperations, getModelVersion } from '@hcengineering/model-all' import { devTool } from '.' import { addLocation } from '@hcengineering/platform' @@ -69,7 +69,7 @@ function prepareTools (): { } { const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim()) const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.trim()) - return { ...prepareToolsRaw(builder(enabled, disabled).getTxes()), version, migrateOperations } + return { ...prepareToolsRaw(builder(enabled, disabled).getTxes()), version: getModelVersion(), migrateOperations } } console.log(`tools git_version: ${process.env.GIT_REVISION ?? ''} model_version: ${process.env.MODEL_VERSION ?? ''}`) diff --git a/models/all/package.json b/models/all/package.json index 8b724fab5c..22db08a13f 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -8,9 +8,6 @@ "build": "tsc", "build:watch": "tsc", "lint:fix": "eslint --fix src", - "genmodel": "ts-node src/__genmodel.ts", - "version": "ts-node src/__showversion.ts", - "bumpversion": "ts-node src/__bumpversion.ts", "lint": "eslint src", "format": "format src" }, diff --git a/models/all/src/__genmodel.ts b/models/all/src/__genmodel.ts deleted file mode 100644 index 7f621e45fc..0000000000 --- a/models/all/src/__genmodel.ts +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 builder from '.' -// import { writeFileSync } from 'fs' - -const content = JSON.stringify(builder().getTxes(), undefined, 2) -console.log(content) -// writeFileSync('../../dev/storage/src/model.tx.json', content) -// writeFileSync('../../server/workspace/src/model.tx.json', content) -// writeFileSync('../../dev/tool/src/model.tx.json', content) diff --git a/models/all/src/__showversion.ts b/models/all/src/__showversion.ts deleted file mode 100644 index 0e0dc614c6..0000000000 --- a/models/all/src/__showversion.ts +++ /dev/null @@ -1,17 +0,0 @@ -// -// 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 version from './version.json' -console.log(`"${version.major}.${version.minor}.${version.patch}"`) diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 23e5dd4845..9ce64c5e12 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -14,7 +14,6 @@ // import core, { coreId, type Data, type PluginConfiguration, type Ref, type Tx, type Version } from '@hcengineering/core' -import jsonVersion from './version.json' import { Builder } from '@hcengineering/model' import { activityId, createModel as activityModel } from '@hcengineering/model-activity' @@ -34,6 +33,7 @@ import { preferenceId, createModel as preferenceModel } from '@hcengineering/mod import presentation, { presentationId, createModel as presentationModel } from '@hcengineering/model-presentation' import recruit, { recruitId, createModel as recruitModel } from '@hcengineering/model-recruit' import { requestId, createModel as requestModel } from '@hcengineering/model-request' +import { serverActivityId, createModel as serverActivityModel } from '@hcengineering/model-server-activity' import { serverAttachmentId, createModel as serverAttachmentModel } from '@hcengineering/model-server-attachment' import { serverCalendarId, createModel as serverCalendarModel } from '@hcengineering/model-server-calendar' import { serverChunterId, createModel as serverChunterModel } from '@hcengineering/model-server-chunter' @@ -46,13 +46,12 @@ import { serverLeadId, createModel as serverLeadModel } from '@hcengineering/mod import { serverNotificationId, createModel as serverNotificationModel } from '@hcengineering/model-server-notification' import { serverRecruitId, createModel as serverRecruitModel } from '@hcengineering/model-server-recruit' import { serverRequestId, createModel as serverRequestModel } from '@hcengineering/model-server-request' -import { serverSettingId, createModel as serveSettingModel } from '@hcengineering/model-server-setting' +import { createModel as serveSettingModel, serverSettingId } from '@hcengineering/model-server-setting' import { serverTagsId, createModel as serverTagsModel } from '@hcengineering/model-server-tags' import { serverTaskId, createModel as serverTaskModel } from '@hcengineering/model-server-task' import { serverTelegramId, createModel as serverTelegramModel } from '@hcengineering/model-server-telegram' import { serverTrackerId, createModel as serverTrackerModel } from '@hcengineering/model-server-tracker' import { serverViewId, createModel as serverViewModel } from '@hcengineering/model-server-view' -import { serverActivityId, createModel as serverActivityModel } from '@hcengineering/model-server-activity' import setting, { settingId, createModel as settingModel } from '@hcengineering/model-setting' import { supportId, createModel as supportModel } from '@hcengineering/model-support' import { tagsId, createModel as tagsModel } from '@hcengineering/model-tags' @@ -69,12 +68,22 @@ import { createModel as serverTranslate, translateId } from '@hcengineering/mode import { type Plugin } from '@hcengineering/platform' -export const version: Data = jsonVersion as Data - interface ConfigurablePlugin extends Omit, 'pluginId' | 'transactions'> {} type BuilderConfig = [(b: Builder) => void, Plugin] | [(b: Builder) => void, Plugin, ConfigurablePlugin | undefined] +export function getModelVersion (): Data { + const rawVersion = (process.env.MODEL_VERSION ?? '0.6.0').trim().replace('v', '').split('.') + if (rawVersion.length === 3) { + return { + major: parseInt(rawVersion[0]), + minor: parseInt(rawVersion[1]), + patch: parseInt(rawVersion[2]) + } + } + return { major: 0, minor: 6, patch: 0 } +} + /** * @public * @param enabled - a set of enabled plugins @@ -308,7 +317,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ builder.onTx = undefined } - builder.createDoc(core.class.Version, core.space.Model, version, core.version.Model) + builder.createDoc(core.class.Version, core.space.Model, getModelVersion(), core.version.Model) return builder } diff --git a/models/all/src/version.json b/models/all/src/version.json deleted file mode 100644 index 5c4c8579ea..0000000000 --- a/models/all/src/version.json +++ /dev/null @@ -1 +0,0 @@ -{ "major": 0, "minor": 6, "patch": 144 } diff --git a/pods/account/package.json b/pods/account/package.json index 771b5a7ef5..4d0a88fe6e 100644 --- a/pods/account/package.json +++ b/pods/account/package.json @@ -9,7 +9,7 @@ "build": "tsc", "build:watch": "tsc", "lint:fix": "eslint --fix src", - "bundle": "esbuild src/__start.ts --bundle --minify --platform=node > bundle.js", + "bundle": "esbuild src/__start.ts --bundle --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --minify --platform=node > bundle.js", "docker:build": "docker build -t hardcoreeng/account .", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/account staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/account", diff --git a/pods/account/src/__start.ts b/pods/account/src/__start.ts index a83729255a..beb3973d7d 100644 --- a/pods/account/src/__start.ts +++ b/pods/account/src/__start.ts @@ -15,7 +15,7 @@ import { getMethods } from '@hcengineering/account' import { Tx } from '@hcengineering/core' -import builder, { migrateOperations, version } from '@hcengineering/model-all' +import builder, { migrateOperations, getModelVersion } from '@hcengineering/model-all' import { serveAccount } from '.' const enabled = (process.env.MODEL_ENABLED ?? '*').split(',').map((it) => it.trim()) @@ -23,4 +23,4 @@ const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.tr const txes = JSON.parse(JSON.stringify(builder(enabled, disabled).getTxes())) as Tx[] -serveAccount(getMethods(version, txes, migrateOperations)) +serveAccount(getMethods(getModelVersion(), txes, migrateOperations)) diff --git a/pods/front/package.json b/pods/front/package.json index 9a623c332d..6938108196 100644 --- a/pods/front/package.json +++ b/pods/front/package.json @@ -8,14 +8,14 @@ "build": "tsc", "build:watch": "tsc", "lint:fix": "eslint --fix src", - "bundle": "esbuild src/__start.ts --define:process.env.MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) --bundle --minify --platform=node --external:sharp > bundle.js & rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/ && rm ./dist/config.json", + "bundle": "esbuild src/__start.ts --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --bundle --minify --platform=node --external:sharp > bundle.js & rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/ && rm ./dist/config.json", "docker:build": "docker build -t hardcoreeng/front .", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/front staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/front", "docker:tbuild": "docker build -t hardcoreeng/front . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/front", "lint": "eslint src", "format": "format src", - "run-local": "cross-env MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost TRANSACTOR_URL=ws://localhost:3333 SERVER_SECRET='secret' ACCOUNTS_URL=http://localhost:3000 UPLOAD_URL=/files ELASTIC_URL=http://localhost:9200 MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) PUBLIC_DIR='.' ts-node ./src/__start.ts", + "run-local": "cross-env MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost TRANSACTOR_URL=ws://localhost:3333 SERVER_SECRET='secret' ACCOUNTS_URL=http://localhost:3000 UPLOAD_URL=/files ELASTIC_URL=http://localhost:9200 MODEL_VERSION=$(node ../../common/scripts/show_version.js) PUBLIC_DIR='.' ts-node ./src/__start.ts", "test": "jest --passWithNoTests --silent" }, "devDependencies": { diff --git a/pods/server/package.json b/pods/server/package.json index 3125376518..e86a551b20 100644 --- a/pods/server/package.json +++ b/pods/server/package.json @@ -5,10 +5,10 @@ "author": "Anticrm Platform Contributors", "license": "EPL-2.0", "scripts": { - "start": "cross-env MONGO_URL=mongodb://localhost:27017 ELASTIC_URL=http://localhost:9200 MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin METRICS_CONSOLE=false SERVER_SECRET=secret REKONI_URL=http://localhost:4004 FRONT_URL=http://localhost:8080 MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) GIT_REVISION=$(git describe --all --long) node --nolazy -r ts-node/register src/__start.ts", + "start": "cross-env MONGO_URL=mongodb://localhost:27017 ELASTIC_URL=http://localhost:9200 MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin METRICS_CONSOLE=false SERVER_SECRET=secret REKONI_URL=http://localhost:4004 FRONT_URL=http://localhost:8080 MODEL_VERSION=$(node ../../common/scripts/show_version.js) GIT_REVISION=$(git describe --all --long) node --nolazy -r ts-node/register src/__start.ts", "build": "tsc", "lint:fix": "eslint --fix src", - "bundle": "esbuild src/__start.ts --bundle --sourcemap=inline --minify --platform=node --external:bufferutil --define:process.env.MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) --define:process.env.GIT_REVISION=$(../../common/scripts/git_version.sh) > bundle.js", + "bundle": "esbuild src/__start.ts --bundle --sourcemap=inline --minify --platform=node --external:bufferutil --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --define:process.env.GIT_REVISION=$(../../common/scripts/git_version.sh) > bundle.js", "bundle:u": "esbuild src/__start.ts --bundle --sourcemap=inline --minify --platform=node > bundle.js && mkdir -p ./dist && cp -r ./node_modules/uWebSockets.js/*.node ./dist", "docker:build": "docker build -t hardcoreeng/transactor .", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/transactor staging", diff --git a/server/account/src/__tests__/account.test_skip.ts b/server/account/src/__tests__/account.test_skip.ts index 40ea4d2114..5ccb58b191 100644 --- a/server/account/src/__tests__/account.test_skip.ts +++ b/server/account/src/__tests__/account.test_skip.ts @@ -14,7 +14,7 @@ // limitations under the License. // -import builder, { migrateOperations, version } from '@hcengineering/model-all' +import builder, { migrateOperations, getModelVersion } from '@hcengineering/model-all' import { randomBytes } from 'crypto' import { Db, MongoClient } from 'mongodb' import accountPlugin, { getAccount, getMethods, getWorkspace } from '..' @@ -22,7 +22,7 @@ import { setMetadata } from '@hcengineering/platform' const DB_NAME = 'test_accounts' -const methods = getMethods(version, builder().getTxes(), migrateOperations) +const methods = getMethods(getModelVersion(), builder().getTxes(), migrateOperations) describe('server', () => { const dbUri = process.env.MONGO_URL ?? 'mongodb://localhost:27017'