Move services to public (#6156)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-07-28 14:55:43 +07:00
committed by Andrey Sobolev
parent 9aad4a4561
commit ddecae80dd
578 changed files with 109084 additions and 390 deletions
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
extends: ['./node_modules/@hcengineering/platform-rig/profiles/default/eslint.config.json'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
}
}
+4
View File
@@ -0,0 +1,4 @@
*
!/lib/**
!CHANGELOG.md
/lib/**/__tests__/
+4
View File
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
"rigPackageName": "@hcengineering/platform-rig"
}
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
roots: ["./src"],
coverageReporters: ["text-summary", "html"]
}
+44
View File
@@ -0,0 +1,44 @@
{
"name": "@hcengineering/diffview",
"version": "0.6.0",
"main": "lib/index.js",
"svelte": "src/index.ts",
"types": "types/index.d.ts",
"files": [
"lib/**/*",
"types/**/*",
"tsconfig.json"
],
"author": "Copyright © Hardcore Engineering Inc.",
"license": "EPL-2.0",
"scripts": {
"build": "compile",
"build:watch": "compile",
"format": "format src",
"test": "jest --passWithNoTests --silent",
"_phase:build": "compile transpile src",
"_phase:test": "jest --passWithNoTests --silent",
"_phase:format": "format src",
"_phase:validate": "compile validate"
},
"devDependencies": {
"@hcengineering/platform-rig": "^0.6.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-n": "^15.4.0",
"eslint": "^8.54.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"prettier": "^3.1.0",
"typescript": "^5.3.3",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"@types/jest": "^29.5.5"
},
"dependencies": {
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/ui": "^0.6.15"
}
}
+59
View File
@@ -0,0 +1,59 @@
//
// Copyright © 2023 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 type { IntlString, Plugin } from '@hcengineering/platform'
import { plugin } from '@hcengineering/platform'
import { AnyComponent } from '@hcengineering/ui'
export * from './types'
/**
* @public
*/
export const diffviewId = 'diffview' as Plugin
/**
* @public
*/
export type Diff = string
/**
* @public
*/
export type DiffViewMode = 'unified' | 'split'
/**
* @public
*/
export interface DiffFileId {
fileName: string
sha: string
}
/**
* @public
*/
export default plugin(diffviewId, {
component: {
DiffView: '' as AnyComponent,
InlineDiffView: '' as AnyComponent
},
string: {
ViewMode: '' as IntlString,
Unified: '' as IntlString,
Split: '' as IntlString,
Viewed: '' as IntlString
}
})
+123
View File
@@ -0,0 +1,123 @@
//
// Copyright © 2023 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.
//
/**
* @public
*/
export enum DiffLineType {
INSERT = 'insert',
DELETE = 'delete',
CONTEXT = 'context',
EMPTY = 'empty'
}
/**
* @public
*/
export interface DiffLineDeleted {
type: DiffLineType.DELETE
oldNumber: number
newNumber: undefined
}
/**
* @public
*/
export interface DiffLineInserted {
type: DiffLineType.INSERT
oldNumber: undefined
newNumber: number
}
/**
* @public
*/
export interface DiffLineContext {
type: DiffLineType.CONTEXT
oldNumber: number
newNumber: number
}
/**
* @public
*/
export interface DiffLineEmpty {
type: DiffLineType.EMPTY
oldNumber: undefined
newNumber: undefined
}
/**
* @public
*/
export interface DiffLineContent {
prefix: string
content: string
}
/**
* @public
*/
export type DiffLine = (DiffLineDeleted | DiffLineInserted | DiffLineContext | DiffLineEmpty) & DiffLineContent
/**
* @public
*/
export const EmptyLine: DiffLine = {
type: DiffLineType.EMPTY,
oldNumber: undefined,
newNumber: undefined,
prefix: '',
content: ''
}
/**
* @public
*/
export interface DiffHunk {
header: string
lines: DiffLine[]
oldStartLine: number
newStartLine: number
}
/**
* @public
*/
export interface DiffFileStats {
addedLines: number
deletedLines: number
}
/**
* @public
*/
export type DiffFileType = 'add' | 'delete' | 'modify' | 'rename' | 'copy'
/**
* @public
*/
export interface DiffFile {
fileName: string
sha: string
hunks: DiffHunk[]
diffType: DiffFileType
language: string
oldName: string
newName: string
isBinary?: boolean
isTooBig?: boolean
stats: DiffFileStats
}
+10
View File
@@ -0,0 +1,10 @@
{
"extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib",
"declarationDir": "./types",
"tsBuildInfoFile": ".build/build.tsbuildinfo"
}
}