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
e209a820
Commit
e209a820
authored
Jul 07, 2020
by
aniket-engg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint working for remix-url-resolver
parent
24d5fa2e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
33 deletions
+52
-33
.eslintrc
libs/remix-url-resolver/.eslintrc
+17
-0
resolve.ts
libs/remix-url-resolver/src/resolve.ts
+6
-2
tsconfig.json
libs/remix-url-resolver/tsconfig.json
+6
-19
tsconfig.lib.json
libs/remix-url-resolver/tsconfig.lib.json
+17
-0
workspace.json
workspace.json
+6
-12
No files found.
libs/remix-url-resolver/.eslintrc
0 → 100644
View file @
e209a820
{
"extends": "../../.eslintrc",
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"env": {
"browser": true,
"amd": true,
"node": true,
"es6": true
},
"ignorePatterns": ["!**/*"]
}
\ No newline at end of file
libs/remix-url-resolver/src/resolve.ts
View file @
e209a820
...
@@ -27,8 +27,9 @@ export class RemixURLResolver {
...
@@ -27,8 +27,9 @@ export class RemixURLResolver {
* @params filePath path of the file in github
* @params filePath path of the file in github
*/
*/
async
handleGithubCall
(
root
:
string
,
filePath
:
string
)
{
async
handleGithubCall
(
root
:
string
,
filePath
:
string
)
{
//eslint-disable-next-line no-useless-catch
try
{
try
{
le
t
req
:
string
=
'https://api.github.com/repos/'
+
root
+
'/contents/'
+
filePath
cons
t
req
:
string
=
'https://api.github.com/repos/'
+
root
+
'/contents/'
+
filePath
const
response
:
AxiosResponse
=
await
axios
.
get
(
req
)
const
response
:
AxiosResponse
=
await
axios
.
get
(
req
)
return
Buffer
.
from
(
response
.
data
.
content
,
'base64'
).
toString
()
return
Buffer
.
from
(
response
.
data
.
content
,
'base64'
).
toString
()
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -41,6 +42,7 @@ export class RemixURLResolver {
...
@@ -41,6 +42,7 @@ export class RemixURLResolver {
* @params cleanURL
* @params cleanURL
*/
*/
async
handleHttp
(
url
:
string
,
_
:
string
)
{
async
handleHttp
(
url
:
string
,
_
:
string
)
{
//eslint-disable-next-line no-useless-catch
try
{
try
{
const
response
:
AxiosResponse
=
await
axios
.
get
(
url
)
const
response
:
AxiosResponse
=
await
axios
.
get
(
url
)
return
response
.
data
return
response
.
data
...
@@ -54,6 +56,7 @@ export class RemixURLResolver {
...
@@ -54,6 +56,7 @@ export class RemixURLResolver {
* @params cleanURL
* @params cleanURL
*/
*/
async
handleHttps
(
url
:
string
,
_
:
string
)
{
async
handleHttps
(
url
:
string
,
_
:
string
)
{
//eslint-disable-next-line no-useless-catch
try
{
try
{
const
response
:
AxiosResponse
=
await
axios
.
get
(
url
)
const
response
:
AxiosResponse
=
await
axios
.
get
(
url
)
return
response
.
data
return
response
.
data
...
@@ -71,6 +74,7 @@ export class RemixURLResolver {
...
@@ -71,6 +74,7 @@ export class RemixURLResolver {
async
handleIPFS
(
url
:
string
)
{
async
handleIPFS
(
url
:
string
)
{
// replace ipfs:// with /ipfs/
// replace ipfs:// with /ipfs/
url
=
url
.
replace
(
/^ipfs:
\/\/?
/
,
'ipfs/'
)
url
=
url
.
replace
(
/^ipfs:
\/\/?
/
,
'ipfs/'
)
//eslint-disable-next-line no-useless-catch
try
{
try
{
const
req
=
'https://gateway.ipfs.io/'
+
url
const
req
=
'https://gateway.ipfs.io/'
+
url
// If you don't find greeter.sol on ipfs gateway use local
// If you don't find greeter.sol on ipfs gateway use local
...
@@ -112,7 +116,7 @@ export class RemixURLResolver {
...
@@ -112,7 +116,7 @@ export class RemixURLResolver {
}
}
public
async
resolve
(
filePath
:
string
,
customHandlers
?:
Handler
[]):
Promise
<
Imported
>
{
public
async
resolve
(
filePath
:
string
,
customHandlers
?:
Handler
[]):
Promise
<
Imported
>
{
var
imported
:
Imported
=
this
.
previouslyHandled
[
filePath
]
let
imported
:
Imported
=
this
.
previouslyHandled
[
filePath
]
if
(
imported
)
{
if
(
imported
)
{
return
imported
return
imported
}
}
...
...
libs/remix-url-resolver/tsconfig.json
View file @
e209a820
{
{
"compileOnSave"
:
false
,
"extends"
:
"../../tsconfig.json"
,
"include"
:
[
"./src"
],
"compilerOptions"
:
{
"compilerOptions"
:
{
"baseUrl"
:
"./src"
,
"types"
:
[
"node"
],
"outDir"
:
"./dist"
,
"sourceMap"
:
true
,
"declaration"
:
true
,
"module"
:
"commonjs"
,
"module"
:
"commonjs"
,
"strict"
:
true
,
"esModuleInterop"
:
true
"noImplicitAny"
:
false
,
},
"strictPropertyInitialization"
:
false
,
"include"
:
[
"**/*.ts"
]
"experimentalDecorators"
:
true
,
}
"target"
:
"es5"
,
"typeRoots"
:
[
"node_modules/@types"
],
"lib"
:
[
"dom"
,
"es2018"
],
"paths"
:
{
"remix-url-resolver"
:
[
"./"
]
}
}
}
\ No newline at end of file
libs/remix-url-resolver/tsconfig.lib.json
0 → 100644
View file @
e209a820
{
"extends"
:
"./tsconfig.json"
,
"compilerOptions"
:
{
"module"
:
"commonjs"
,
"outDir"
:
"../../dist/out-tsc"
,
"declaration"
:
true
,
"rootDir"
:
"./src"
,
"types"
:
[
"node"
]
},
"exclude"
:
[
"**/*.spec.ts"
,
"tests/"
],
"include"
:
[
"**/*.ts"
]
}
\ No newline at end of file
workspace.json
View file @
e209a820
...
@@ -354,14 +354,14 @@
...
@@ -354,14 +354,14 @@
"schematics"
:
{},
"schematics"
:
{},
"architect"
:
{
"architect"
:
{
"lint"
:
{
"lint"
:
{
"builder"
:
"@nrwl/
workspace:run-commands
"
,
"builder"
:
"@nrwl/
linter:lint
"
,
"options"
:
{
"options"
:
{
"
commands"
:
[
"
linter"
:
"eslint"
,
{
"config"
:
"libs/remix-url-resolver/.eslintrc"
,
"command"
:
"./../../node_modules/.bin/npm-run-all lint"
"tsConfig"
:
[
}
"libs/remix-url-resolver/tsconfig.lib.json"
],
],
"
cwd"
:
"libs/remix-url-resolver"
"
exclude"
:
[
"**/node_modules/**"
,
"libs/remix-url-resolver/tests/**/*"
]
}
}
},
},
"test"
:
{
"test"
:
{
...
@@ -369,9 +369,6 @@
...
@@ -369,9 +369,6 @@
"options"
:
{
"options"
:
{
"commands"
:
[
"commands"
:
[
{
{
"command"
:
"rm -rf ../../dist"
},
{
"command"
:
"./../../node_modules/.bin/npm-run-all test"
"command"
:
"./../../node_modules/.bin/npm-run-all test"
}
}
],
],
...
@@ -383,9 +380,6 @@
...
@@ -383,9 +380,6 @@
"options"
:
{
"options"
:
{
"commands"
:
[
"commands"
:
[
{
{
"command"
:
"rm -rf ../../dist"
},
{
"command"
:
"./../../node_modules/.bin/npm-run-all build"
"command"
:
"./../../node_modules/.bin/npm-run-all build"
}
}
],
],
...
...
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