Skip to content

Commit

Permalink
#2029: Fix github CI / fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinEpam23 committed Jan 26, 2023
1 parent 2fc8c1d commit efd7824
Show file tree
Hide file tree
Showing 12 changed files with 49,460 additions and 19,082 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run precommit
npm run precommit
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run prepush
# npm run prepush
7 changes: 0 additions & 7 deletions .yarnrc.yml

This file was deleted.

8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for pckg in ketcher-core ketcher-react ketcher-standalone; do
echo $pckg
(cd ./packages/$pckg && npm run build)
done

(cd ./example && npm run build)

echo "\n\nDone"
6 changes: 3 additions & 3 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"@types/node": "^16.11.26",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"ketcher-core": "workspace:*",
"ketcher-react": "workspace:*",
"ketcher-standalone": "workspace:*",
"ketcher-core": "^2.6.4",
"ketcher-react": "^2.6.4",
"ketcher-standalone": "^2.6.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "^5.0.1",
Expand Down
13 changes: 6 additions & 7 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"eject": "react-scripts eject"
},
"dependencies": {
"ketcher-core": "workspace:*",
"ketcher-polymer-editor-react": "workspace:*",
"ketcher-react": "workspace:*",
"ketcher-standalone": "workspace:*",
"ketcher-core": "^2.6.4",
"ketcher-react": "^2.6.4",
"ketcher-standalone": "^2.6.4",
"normalize.css": "^8.0.1",
"react": "^17.0.2",
"react-app-polyfill": "^2.0.0",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"webpack-bundle-analyzer": "^4.7.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^4.2.4",
Expand All @@ -61,8 +61,7 @@
"shx": "^0.3.3",
"source-map-loader": "^3.0.1",
"stylelint": "13.13.1",
"typescript": "^4.5.2",
"webpack-bundle-analyzer": "^3.9.0"
"typescript": "^4.5.2"
},
"browserslist": {
"production": [
Expand Down
21 changes: 1 addition & 20 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from 'ketcher-core'

import { ErrorModal } from './ErrorModal'
import { PolymerToggler } from './PolymerToggler'
import { useState } from 'react'

const getHiddenButtonsConfig = (): ButtonsConfig => {
Expand All @@ -35,29 +34,12 @@ if (process.env.MODE === 'standalone') {
new StandaloneStructServiceProvider() as StructServiceProvider
}

const enablePolymerEditor = process.env.ENABLE_POLYMER_EDITOR === 'true'

type PolymerType = () => JSX.Element | null

let PolymerEditor: PolymerType = () => null
if (enablePolymerEditor) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { Editor } = require('ketcher-polymer-editor-react')
PolymerEditor = Editor as PolymerType
}

const App = () => {
const hiddenButtonsConfig = getHiddenButtonsConfig()
const [hasError, setHasError] = useState(false)
const [errorMessage, setErrorMessage] = useState('')
const [showPolymerEditor, setShowPolymerEditor] = useState(false)

return showPolymerEditor ? (
<>
<PolymerEditor />
<PolymerToggler toggle={setShowPolymerEditor} />
</>
) : (
return (
<>
<Editor
errorHandler={(message: string) => {
Expand All @@ -77,7 +59,6 @@ const App = () => {
)
}}
/>
{enablePolymerEditor && <PolymerToggler toggle={setShowPolymerEditor} />}
{hasError && (
<ErrorModal
message={errorMessage}
Expand Down
Loading

0 comments on commit efd7824

Please sign in to comment.