Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
241b334c
Commit
241b334c
authored
Jul 01, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting errors
parent
936f4e81
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
57 additions
and
55 deletions
+57
-55
.eslintrc
libs/remix-ui/publish-to-storage/.eslintrc
+14
-12
publish-to-storage.tsx
...emix-ui/publish-to-storage/src/lib/publish-to-storage.tsx
+6
-5
publishOnSwarm.tsx
libs/remix-ui/publish-to-storage/src/lib/publishOnSwarm.tsx
+1
-1
publishToIPFS.tsx
libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx
+1
-1
.eslintrc
libs/remix-ui/solidity-compiler/.eslintrc
+15
-12
compiler-container.tsx
...remix-ui/solidity-compiler/src/lib/compiler-container.tsx
+3
-3
contract-selection.tsx
...remix-ui/solidity-compiler/src/lib/contract-selection.tsx
+9
-9
compiler-helpers.ts
...ix-ui/solidity-compiler/src/lib/logic/compiler-helpers.ts
+2
-2
compiler-utils.ts
...emix-ui/solidity-compiler/src/lib/logic/compiler-utils.ts
+1
-1
index.ts
libs/remix-ui/solidity-compiler/src/lib/logic/index.ts
+0
-0
compiler.ts
libs/remix-ui/solidity-compiler/src/lib/reducers/compiler.ts
+0
-0
solidity-compiler.tsx
.../remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
+3
-7
package.json
package.json
+2
-2
No files found.
libs/remix-ui/publish-to-storage/.eslintrc
View file @
241b334c
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"jsx": "react",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"env": {
"browser": true,
"es6": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
"extends": "../../../.eslintrc",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"standard/no-callback-literal": "off"
}
]
}
libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx
View file @
241b334c
import
React
,
{
useEffect
,
useState
}
from
'react'
// eslint-disable-line
import
{
ModalDialog
}
from
'@remix-ui/modal-dialog'
// eslint-disable-line
import
{
RemixUiPublishToStorageProps
}
from
'./types'
import
{
RemixUiPublishToStorageProps
}
from
'./types'
// eslint-disable-line
import
{
publishToIPFS
}
from
'./publishToIPFS'
import
{
publishToSwarm
}
from
'./publishOnSwarm'
...
...
@@ -31,10 +31,11 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
// triggered each time there's a new verified publish (means hash correspond)
fileProvider
.
addExternal
(
'swarm/'
+
result
.
item
.
hash
,
result
.
item
.
content
)
}
catch
(
err
)
{
let
parseError
=
err
try
{
er
r
=
JSON
.
stringify
(
err
)
parseErro
r
=
JSON
.
stringify
(
err
)
}
catch
(
e
)
{}
modal
(
`Swarm Publish Failed`
,
publishMessageFailed
(
storage
,
er
r
))
modal
(
'Swarm Publish Failed'
,
publishMessageFailed
(
storage
,
parseErro
r
))
}
}
else
{
try
{
...
...
@@ -44,7 +45,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
// triggered each time there's a new verified publish (means hash correspond)
fileProvider
.
addExternal
(
'ipfs/'
+
result
.
item
.
hash
,
result
.
item
.
content
)
}
catch
(
err
)
{
modal
(
`IPFS Publish Failed`
,
publishMessageFailed
(
storage
,
err
))
modal
(
'IPFS Publish Failed'
,
publishMessageFailed
(
storage
,
err
))
}
}
}
...
...
@@ -86,7 +87,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
...
prevState
.
modal
,
hide
:
false
,
message
,
title
,
title
}
}
})
...
...
libs/remix-ui/publish-to-storage/src/lib/publishOnSwarm.tsx
View file @
241b334c
...
...
@@ -6,7 +6,7 @@ export const publishToSwarm = async (contract, fileManager) => {
// gather list of files to publish
const
sources
=
[]
let
metadata
le
t
item
=
{
content
:
null
,
hash
:
null
}
cons
t
item
=
{
content
:
null
,
hash
:
null
}
const
uploaded
=
[]
try
{
...
...
libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx
View file @
241b334c
...
...
@@ -10,7 +10,7 @@ export const publishToIPFS = async (contract, fileManager) => {
// gather list of files to publish
const
sources
=
[]
let
metadata
le
t
item
=
{
content
:
null
,
hash
:
null
}
cons
t
item
=
{
content
:
null
,
hash
:
null
}
const
uploaded
=
[]
try
{
...
...
libs/remix-ui/solidity-compiler/.eslintrc
View file @
241b334c
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"jsx": "react",
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"env": {
"browser": true,
"es6": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
"extends": "../../../.eslintrc",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
]
}
libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
View file @
241b334c
...
...
@@ -100,7 +100,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
resetCompilerMode
()(
dispatch
)
break
case
'compilationFinished'
:
compilationFinished
(
compilerContainer
.
compiler
.
args
)
compilationFinished
()
resetCompilerMode
()(
dispatch
)
break
}
...
...
@@ -274,7 +274,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
if
(
state
.
autoCompile
)
compile
()
}
const
compilationFinished
=
(
{
success
,
data
,
source
}
)
=>
{
const
compilationFinished
=
()
=>
{
if
(
!
compileIcon
.
current
)
return
compileIcon
.
current
.
setAttribute
(
'title'
,
'idle'
)
compileIcon
.
current
.
classList
.
remove
(
'remixui_spinningIcon'
)
...
...
@@ -514,7 +514,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<
select
value=
{
state
.
selectedVersion
||
state
.
defaultVersion
}
onChange=
{
(
e
)
=>
handleLoadVersion
(
e
.
target
.
value
)
}
className=
"custom-select"
id=
"versionSelector"
disabled=
{
state
.
allversions
.
length
<=
0
}
>
{
state
.
allversions
.
length
<=
0
&&
<
option
disabled
data
-
id=
{
state
.
selectedVersion
===
state
.
defaultVersion
?
'selected'
:
''
}
>
{
state
.
defaultVersion
}
</
option
>
}
{
state
.
allversions
.
length
<=
0
&&
<
option
disabled
data
-
id=
{
state
.
selectedVersion
===
'builtin'
?
'selected'
:
''
}
>
builtin
</
option
>
}
{
state
.
customVersions
.
map
((
url
,
i
)
=>
<
option
key=
{
i
}
data
-
id=
{
state
.
selectedVersion
===
url
?
'selected'
:
''
}
value=
{
url
}
>
custom
</
option
>
)
}
{
state
.
customVersions
.
map
((
url
,
i
)
=>
<
option
key=
{
i
}
data
-
id=
{
state
.
selectedVersion
===
url
?
'selected'
:
''
}
value=
{
url
}
>
custom
</
option
>)
}
{
state
.
allversions
.
map
((
build
,
i
)
=>
{
return
_shouldBeAdded
(
build
.
longVersion
)
?
<
option
key=
{
i
}
value=
{
build
.
path
}
data
-
id=
{
state
.
selectedVersion
===
build
.
path
?
'selected'
:
''
}
>
{
build
.
longVersion
}
</
option
>
...
...
libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx
View file @
241b334c
import
React
,
{
useState
,
useEffect
}
from
'react'
// eslint-disable-line
import
{
ContractSelectionProps
}
from
'./types'
import
{
PublishToStorage
}
from
'@remix-ui/publish-to-storage'
import
{
TreeView
,
TreeViewItem
}
from
'@remix-ui/tree-view'
import
{
CopyToClipboard
}
from
'@remix-ui/clipboard'
import
{
PublishToStorage
}
from
'@remix-ui/publish-to-storage'
// eslint-disable-line
import
{
TreeView
,
TreeViewItem
}
from
'@remix-ui/tree-view'
// eslint-disable-line
import
{
CopyToClipboard
}
from
'@remix-ui/clipboard'
// eslint-disable-line
import
'./css/style.css'
...
...
@@ -98,7 +98,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
}
const
extractData
=
(
item
)
=>
{
le
t
ret
=
{
children
:
null
,
self
:
null
}
cons
t
ret
=
{
children
:
null
,
self
:
null
}
if
(
item
instanceof
Array
)
{
ret
.
children
=
item
.
map
((
item
,
index
)
=>
({
key
:
index
,
value
:
item
}))
...
...
@@ -121,8 +121,8 @@ export const ContractSelection = (props: ContractSelectionProps) => {
if
(
details
[
propertyName
]
!==
''
)
{
try
{
node
=
<
div
>
{
(
typeof
details
[
propertyName
]
===
'object'
)
?
<
TreeView
id=
"treeView"
>
{
(
typeof
details
[
propertyName
]
===
'object'
)
?
<
TreeView
id=
"treeView"
>
{
Object
.
keys
(
details
[
propertyName
]).
map
((
innerkey
)
=>
renderData
(
details
[
propertyName
][
innerkey
],
innerkey
,
innerkey
))
}
...
...
@@ -187,8 +187,8 @@ export const ContractSelection = (props: ContractSelectionProps) => {
return
(
// define swarm logo
<>
{
contractList
.
length
?
<
section
className=
"remixui_compilerSection pt-3"
>
{
contractList
.
length
?
<
section
className=
"remixui_compilerSection pt-3"
>
{
/* Select Compiler Version */
}
<
div
className=
"mb-3"
>
<
label
className=
"remixui_compilerLabel form-check-label"
htmlFor=
"compiledContracts"
>
Contract
</
label
>
...
...
@@ -197,7 +197,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
</
select
>
</
div
>
<
article
className=
"mt-2 pb-0"
>
<
button
id=
"publishOnSwarm"
className=
"btn btn-secondary btn-block"
title=
"Publish on Swarm"
onClick=
{
()
=>
{
handlePublishToStorage
(
'swarm'
)}
}
>
<
button
id=
"publishOnSwarm"
className=
"btn btn-secondary btn-block"
title=
"Publish on Swarm"
onClick=
{
()
=>
{
handlePublishToStorage
(
'swarm'
)
}
}
>
<
span
>
Publish on Swarm
</
span
>
<
img
id=
"swarmLogo"
className=
"remixui_storageLogo ml-2"
src=
"assets/img/swarm.webp"
/>
</
button
>
...
...
libs/remix-ui/solidity-compiler/src/lib/logic/compiler-helpers.ts
View file @
241b334c
...
...
@@ -4,7 +4,7 @@ import { Compiler } from '@remix-project/remix-solidity'
import
{
CompilerAbstract
}
from
'./compiler-abstract'
export
const
compile
=
async
(
compilationTargets
,
settings
,
contentResolverCallback
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
)
=>
{
const
compiler
=
new
Compiler
(
contentResolverCallback
)
compiler
.
set
(
'evmVersion'
,
settings
.
evmVersion
)
compiler
.
set
(
'optimize'
,
settings
.
optimize
)
...
...
@@ -14,6 +14,6 @@ export const compile = async (compilationTargets, settings, contentResolverCallb
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
compilationData
,
source
)
=>
{
resolve
(
new
CompilerAbstract
(
settings
.
version
,
compilationData
,
source
))
})
compiler
.
event
.
register
(
'compilerLoaded'
,
_
=>
compiler
.
compile
(
compilationTargets
,
''
))
compiler
.
event
.
register
(
'compilerLoaded'
,
()
=>
compiler
.
compile
(
compilationTargets
,
''
))
})
}
libs/remix-ui/solidity-compiler/src/lib/logic/compiler-utils.ts
View file @
241b334c
...
...
@@ -38,7 +38,7 @@ function browserSupportWorker () {
// returns a promise for minixhr
export
function
promisedMiniXhr
(
url
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
)
=>
{
minixhr
(
url
,
(
json
,
event
)
=>
{
resolve
({
json
,
event
})
})
...
...
libs/remix-ui/solidity-compiler/src/lib/logic/index.ts
View file @
241b334c
libs/remix-ui/solidity-compiler/src/lib/reducers/compiler.ts
View file @
241b334c
libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
View file @
241b334c
import
React
,
{
useState
}
from
'react'
// eslint-disable-line
import
{
SolidityCompilerProps
}
from
'./types'
import
{
CompilerContainer
}
from
'./compiler-container'
// eslint-disable-line
import
{
ContractSelection
}
from
'./contract-selection'
import
{
ContractSelection
}
from
'./contract-selection'
// eslint-disable-line
import
{
Toaster
}
from
'@remix-ui/toaster'
// eslint-disable-line
import
{
ModalDialog
}
from
'@remix-ui/modal-dialog'
// eslint-disable-line
import
{
Renderer
}
from
'@remix-ui/renderer'
import
{
Renderer
}
from
'@remix-ui/renderer'
// eslint-disable-line
import
'./css/style.css'
export
const
SolidityCompiler
=
(
props
:
SolidityCompilerProps
)
=>
{
const
{
plugin
,
plugin
:
{
editor
,
config
,
queryParams
,
compileTabLogic
,
currentFile
,
fileProvider
,
fileManager
,
contractsDetails
,
contractMap
,
compileErrors
,
isHardHatProject
,
setHardHatCompilation
,
configurationSettings
}
}
=
props
const
{
plugin
,
plugin
:
{
editor
,
config
,
queryParams
,
compileTabLogic
,
currentFile
,
fileProvider
,
fileManager
,
contractsDetails
,
contractMap
,
compileErrors
,
isHardHatProject
,
setHardHatCompilation
,
configurationSettings
}
}
=
props
const
[
state
,
setState
]
=
useState
({
contractsDetails
:
{},
eventHandlers
:
{},
...
...
@@ -36,10 +36,6 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
})
}
const
clearAnnotations
=
()
=>
{
plugin
.
call
(
'editor'
,
'clearAnnotations'
)
}
const
updateCurrentVersion
=
(
value
)
=>
{
setCurrentVersion
(
value
)
plugin
.
setSelectedVersion
(
value
)
...
...
package.json
View file @
241b334c
...
...
@@ -41,8 +41,8 @@
"workspace-schematic"
:
"nx workspace-schematic"
,
"dep-graph"
:
"nx dep-graph"
,
"help"
:
"nx help"
,
"lint:libs"
:
"nx run-many --target=lint --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd,remix-ui-tree-view,remix-ui-modal-dialog,remix-ui-toaster,remix-ui-file-explorer,remix-ui-debugger-ui,remix-ui-workspace,remix-ui-static-analyser,remix-ui-checkbox,remix-ui-settings,remix-core-plugin"
,
"build:libs"
:
"nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd
,remix-core-plugin
"
,
"lint:libs"
:
"nx run-many --target=lint --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd,remix-ui-tree-view,remix-ui-modal-dialog,remix-ui-toaster,remix-ui-file-explorer,remix-ui-debugger-ui,remix-ui-workspace,remix-ui-static-analyser,remix-ui-checkbox,remix-ui-settings,remix-core-plugin
,remix-ui-renderer,remix-ui-publish-to-storage,remix-ui-solidity-compiler
"
,
"build:libs"
:
"nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd"
,
"test:libs"
:
"nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd"
,
"publish:libs"
:
"npm run build:libs && lerna publish --skip-git && npm run bumpVersion:libs"
,
"build:e2e"
:
"tsc -p apps/remix-ide-e2e/tsconfig.e2e.json"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment