-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add ketcher-core package folder * configure re-export inside ketcher-core package * update signature of RemoteStructServiceProvider * update dependencies in ketcher-standalone * update Editor props interface * make _editor property writable * mark structservice fields as readonly * reorder dependencies in package.json * update tsconfig.json
- Loading branch information
1 parent
b6ddb9b
commit cacc433
Showing
34 changed files
with
1,240 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "../../.babelrc" } |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry = "https://registry.npmjs.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[](https://www.npmjs.com/package/ketcher-core) | ||
[](https://www.npmjs.com/package/ketcher-core) | ||
[](https://opensource.org/licenses/Apache-2.0) | ||
|
||
Copyright (c) 2020 [EPAM Systems, Inc.](https://www.epam.com/) | ||
|
||
Ketcher is an open-source web-based chemical structure editor incorporating high performance, good portability, light weight, and ability to easily integrate into a custom web-application. Ketcher is designed for chemists, laboratory scientists and technicians who draw structures and reactions. | ||
|
||
For more details please look at the following [link](https://github.com/epam/ketcher/blob/master/README.md). | ||
|
||
## Installation | ||
|
||
Ketcher library is available as an [NPM](https://www.npmjs.com/) package. Install it either with NPM: | ||
|
||
```sh | ||
npm install --save ketcher-core | ||
``` | ||
|
||
or [Yarn](https://yarnpkg.com/): | ||
|
||
```sh | ||
yarn add ketcher-core | ||
``` | ||
|
||
## Usage | ||
|
||
### Indigo Service | ||
|
||
Ketcher uses Indigo Service for server operations. | ||
You may pass it as a property while Editor component is used or just add api_path query parameter: | ||
|
||
```sh | ||
<Editor staticResourcesUrl={process.env.PUBLIC_URL} apiPath={link to Indigo service} /> | ||
or | ||
http://localhost:3000/?api_path={link to Indigo service} | ||
``` | ||
|
||
You can find the instruction for service installation | ||
[here](http://lifescience.opensource.epam.com/indigo/service/index.html). | ||
|
||
### 3D Viewer | ||
|
||
Ketcher uses Miew for viewing and editing data in 3D. | ||
For use of this functionality you should add the link to miew by your own: | ||
|
||
```sh | ||
... | ||
import Miew from 'miew' | ||
import 'miew/dist/Miew.min.css' | ||
... | ||
;(global as any).Miew = Miew | ||
... | ||
``` | ||
|
||
You can find the latest version of viewer [here](https://github.com/epam/miew). | ||
The last checked version - [0.9.0](https://github.com/epam/miew/releases/tag/v0.9.0). | ||
|
||
## License | ||
|
||
Please read [LICENSE](./../../LICENSE) and [NOTICE](./../../NOTICE) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"name": "ketcher-core", | ||
"version": "1.0.0", | ||
"description": "Web-based molecule sketcher", | ||
"license": "Apache-2.0", | ||
"homepage": "http://lifescience.opensource.epam.com/ketcher", | ||
"author": { | ||
"name": "EPAM Life Sciences", | ||
"url": "http://lifescience.opensource.epam.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/epam/ketcher.git", | ||
"directory": "packages/ketcher-core" | ||
}, | ||
"keywords": [ | ||
"molecule", | ||
"sketcher", | ||
"chemistry" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/epam/ketcher/issues" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.modern.js", | ||
"source": "src/index.ts", | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"build": "cross-env NODE_ENV=production rollup -c -m true --silent", | ||
"start": "cross-env NODE_ENV=development rollup -c -m true -w", | ||
"test": "run-s test:unit test:lint prettier stylelint test:build", | ||
"test:build": "run-s build", | ||
"test:lint": "eslint src --ext .ts,.tsx,.js,.jsx", | ||
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom", | ||
"test:watch": "react-scripts test --env=jsdom", | ||
"prettier": "prettier --check \"src/**/*.{js,jsx,json,ts,tsx}\"", | ||
"prettier:write": "prettier --write \"src/**/*.{js,jsx,json,ts,tsx}\"", | ||
"stylelint": "stylelint \"src/**/*.{css,less,scss}\" --formatter verbose", | ||
"stylelint:fix": "stylelint \"src/**/*.{css,less,scss}\" --formatter verbose --fix" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.12.5" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.12.3", | ||
"@babel/plugin-proposal-class-properties": "^7.12.1", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.12.1", | ||
"@babel/plugin-transform-runtime": "^7.12.1", | ||
"@babel/preset-env": "^7.12.1", | ||
"@babel/preset-typescript": "^7.12.1", | ||
"@rollup/plugin-babel": "^5.2.1", | ||
"@rollup/plugin-commonjs": "^16.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^10.0.0", | ||
"@rollup/plugin-replace": "^2.3.4", | ||
"@rollup/plugin-strip": "^2.0.0", | ||
"@rollup/plugin-typescript": "^8.1.0", | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/user-event": "^7.2.1", | ||
"@types/jest": "^25.1.4", | ||
"@types/node": "^12.12.38", | ||
"@typescript-eslint/eslint-plugin": "^4.0.0", | ||
"@typescript-eslint/parser": "^4.0.0", | ||
"babel-eslint": "^10.0.0", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^6.8.0", | ||
"eslint-config-react-app": "^6.0.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-jest": "^24.0.0", | ||
"eslint-plugin-jsx-a11y": "^6.3.1", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-react-hooks": "^4.0.8", | ||
"eslint-plugin-testing-library": "^3.9.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.0.4", | ||
"react-scripts": "^3.4.1", | ||
"rollup": "^2.33.1", | ||
"rollup-plugin-cleanup": "^3.2.1", | ||
"rollup-plugin-copy": "^3.3.0", | ||
"rollup-plugin-delete": "^2.0.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"rollup-plugin-visualizer": "^4.2.0", | ||
"typescript": "^4.1.3" | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external' | ||
import babel from '@rollup/plugin-babel' | ||
import replace from '@rollup/plugin-replace' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import typescript from 'rollup-plugin-typescript2' | ||
import json from '@rollup/plugin-json' | ||
import del from 'rollup-plugin-delete' | ||
import cleanup from 'rollup-plugin-cleanup' | ||
import strip from '@rollup/plugin-strip' | ||
import pkg from './package.json' | ||
|
||
const mode = { | ||
PRODUCTION: 'production', | ||
DEVELOPMENT: 'development' | ||
} | ||
|
||
const extensions = ['.js', '.ts'] | ||
const isProduction = process.env.NODE_ENV === mode.PRODUCTION | ||
|
||
const config = { | ||
input: pkg.source, | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
exports: 'named', | ||
format: 'cjs' | ||
}, | ||
{ | ||
file: pkg.module, | ||
exports: 'named', | ||
format: 'es' | ||
} | ||
], | ||
external: [ | ||
'url', | ||
'remark-parse', | ||
'unified', | ||
'asap', | ||
'object-assign', | ||
'unist-util-visit', | ||
'unist-util-visit-parents', | ||
'xtend' | ||
], | ||
plugins: [ | ||
del({ | ||
targets: 'dist/*', | ||
runOnce: true | ||
}), | ||
peerDepsExternal({ includeDependencies: true }), | ||
resolve({ extensions, preferBuiltins: false }), | ||
commonjs(), | ||
typescript(), | ||
replace( | ||
{ | ||
'process.env.NODE_ENV': JSON.stringify( | ||
isProduction ? mode.PRODUCTION : mode.DEVELOPMENT | ||
) | ||
}, | ||
{ | ||
include: 'src/**/*.{js,ts}' | ||
} | ||
), | ||
|
||
json(), | ||
babel({ | ||
extensions, | ||
babelHelpers: 'runtime', | ||
include: ['src/**/*'] | ||
}), | ||
cleanup({ extensions, comments: 'none' }), | ||
...(isProduction ? [strip()] : []) | ||
] | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { | ||
RemoteStructService, | ||
RemoteStructServiceProvider, | ||
ChemicalMimeType | ||
} from './infrastructure/services' | ||
|
||
import type { | ||
StructService, | ||
StructServiceOptions, | ||
AromatizeData, | ||
AromatizeResult, | ||
AutomapData, | ||
AutomapResult, | ||
CalculateCipData, | ||
CalculateCipResult, | ||
CalculateData, | ||
CalculateResult, | ||
CheckData, | ||
CheckResult, | ||
CleanData, | ||
CleanResult, | ||
ConvertData, | ||
ConvertResult, | ||
DearomatizeData, | ||
DearomatizeResult, | ||
InfoResult, | ||
LayoutData, | ||
LayoutResult, | ||
RecognizeResult, | ||
ServiceMode, | ||
StructServiceProvider | ||
} from './infrastructure/services' | ||
|
||
export { RemoteStructService, RemoteStructServiceProvider, ChemicalMimeType } | ||
export type { | ||
StructService, | ||
StructServiceOptions, | ||
AromatizeData, | ||
AromatizeResult, | ||
AutomapData, | ||
AutomapResult, | ||
CalculateCipData, | ||
CalculateCipResult, | ||
CalculateData, | ||
CalculateResult, | ||
CheckData, | ||
CheckResult, | ||
CleanData, | ||
CleanResult, | ||
ConvertData, | ||
ConvertResult, | ||
DearomatizeData, | ||
DearomatizeResult, | ||
InfoResult, | ||
LayoutData, | ||
LayoutResult, | ||
RecognizeResult, | ||
ServiceMode, | ||
StructServiceProvider | ||
} |
59 changes: 59 additions & 0 deletions
59
packages/ketcher-core/src/infrastructure/services/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { | ||
RemoteStructService, | ||
RemoteStructServiceProvider, | ||
ChemicalMimeType | ||
} from './struct' | ||
import type { | ||
StructService, | ||
StructServiceOptions, | ||
AromatizeData, | ||
AromatizeResult, | ||
AutomapData, | ||
AutomapResult, | ||
CalculateCipData, | ||
CalculateCipResult, | ||
CalculateData, | ||
CalculateResult, | ||
CheckData, | ||
CheckResult, | ||
CleanData, | ||
CleanResult, | ||
ConvertData, | ||
ConvertResult, | ||
DearomatizeData, | ||
DearomatizeResult, | ||
InfoResult, | ||
LayoutData, | ||
LayoutResult, | ||
RecognizeResult, | ||
ServiceMode, | ||
StructServiceProvider | ||
} from './struct' | ||
|
||
export { RemoteStructService, RemoteStructServiceProvider, ChemicalMimeType } | ||
export type { | ||
StructService, | ||
StructServiceOptions, | ||
AromatizeData, | ||
AromatizeResult, | ||
AutomapData, | ||
AutomapResult, | ||
CalculateCipData, | ||
CalculateCipResult, | ||
CalculateData, | ||
CalculateResult, | ||
CheckData, | ||
CheckResult, | ||
CleanData, | ||
CleanResult, | ||
ConvertData, | ||
ConvertResult, | ||
DearomatizeData, | ||
DearomatizeResult, | ||
InfoResult, | ||
LayoutData, | ||
LayoutResult, | ||
RecognizeResult, | ||
ServiceMode, | ||
StructServiceProvider | ||
} |
Oops, something went wrong.