rename package to remix-url-resolver

pull/7/head
0mkar 6 years ago
parent 383cc05c5b
commit e86037322d
  1. 0
      remix-url-resolver/.gitignore
  2. 0
      remix-url-resolver/README.md
  3. 6
      remix-url-resolver/package.json
  4. 0
      remix-url-resolver/src/index.ts
  5. 2
      remix-url-resolver/src/resolve.ts
  6. 0
      remix-url-resolver/tests/example_1/greeter.sol
  7. 0
      remix-url-resolver/tests/example_1/mortal.sol
  8. 22
      remix-url-resolver/tests/test.ts
  9. 2
      remix-url-resolver/tsconfig.json
  10. 0
      remix-url-resolver/tslint.json

@ -1,10 +1,10 @@
{
"name": "remix-resolve",
"name": "remix-url-resolver",
"version": "0.0.1",
"description": "Solidity import resolver engine",
"description": "Solidity import url resolver engine",
"main": "./src/index.js",
"bin": {
"remix-resolve": "./bin/remix-resolve"
"remix-url-resolver": "./bin/remix-url-resolver"
},
"scripts": {
"build": "tsc",

@ -16,7 +16,7 @@ interface Handler {
handle(match: any): any;
}
export class RemixResolve {
export class RemixURLResolver {
private previouslyHandled: PreviouslyHandledImports
constructor() {
this.previouslyHandled = {}

@ -1,4 +1,4 @@
import { RemixResolve } from '../src'
import { RemixURLResolver } from '../src'
import * as fs from 'fs'
import * as path from 'path'
import * as assert from 'assert'
@ -7,8 +7,8 @@ describe('testRunner', () => {
describe('# RemixResolve.resolve()', () => {
describe('* test without AppManager', () => {
describe('test example_1 [local imports]', () => {
const remixResolve = new RemixResolve()
const fileName: string = '../remix-resolve/tests/example_1/greeter.sol'
const remixURLResolve = new RemixURLResolver()
const fileName: string = '../remix-url-resolver/tests/example_1/greeter.sol'
let results: object = {}
before(done => {
@ -31,7 +31,7 @@ describe('testRunner', () => {
handle: (match: Array<string>) => { return handleLocal(match[2], match[3]) }
}
]
remixResolve.resolve(fileName, localFSHandler)
remixURLResolve.resolve(fileName, localFSHandler)
.then((sources: object) => {
results = sources
done()
@ -47,7 +47,7 @@ describe('testRunner', () => {
it('should return contract content of given local path', () => {
const expt = {
content: 'pragma solidity ^0.5.0;\nimport "./mortal.sol";\n\ncontract Greeter is Mortal {\n /* Define variable greeting of the type string */\n string greeting;\n\n /* This runs when the contract is executed */\n constructor(string memory _greeting) public {\n greeting = _greeting;\n }\n\n /* Main function */\n function greet() public view returns (string memory) {\n return greeting;\n }\n}\n',
cleanURL: '../remix-resolve/tests/example_1/greeter.sol',
cleanURL: '../remix-url-resolver/tests/example_1/greeter.sol',
type: 'local'
}
assert.deepEqual(results, expt)
@ -55,12 +55,12 @@ describe('testRunner', () => {
})
// Test github import
describe('test getting github imports', () => {
const remixResolve = new RemixResolve()
const remixURLResolve = new RemixURLResolver()
const fileName: string = 'github.com/ethereum/populus/docs/assets/Greeter.sol'
let results: object = {}
before(done => {
remixResolve.resolve(fileName)
remixURLResolve.resolve(fileName)
.then((sources: object) => {
results = sources
done()
@ -84,12 +84,12 @@ describe('testRunner', () => {
})
// Test https imports
describe('test getting https imports', () => {
const remixResolve = new RemixResolve()
const remixURLResolve = new RemixURLResolver()
const fileName: string = 'https://gist.githubusercontent.com/roneilr/7901633d7c2f52957d22/raw/d9b9d54760f6e4f4cfbac4b321bee6a6983a1048/greeter.sol'
let results: object = {}
before(done => {
remixResolve.resolve(fileName)
remixURLResolve.resolve(fileName)
.then((sources: object) => {
results = sources
done()
@ -114,12 +114,12 @@ describe('testRunner', () => {
// Test http imports
describe('test getting http imports', () => {
const remixResolve = new RemixResolve()
const remixURLResolve = new RemixURLResolver()
const fileName: string = 'http://gist.githubusercontent.com/roneilr/7901633d7c2f52957d22/raw/d9b9d54760f6e4f4cfbac4b321bee6a6983a1048/greeter.sol'
let results: object = {}
before(done => {
remixResolve.resolve(fileName)
remixURLResolve.resolve(fileName)
.then((sources: object) => {
results = sources
done()

@ -15,7 +15,7 @@
"typeRoots": ["node_modules/@types"],
"lib": ["dom", "es2018"],
"paths": {
"remix-resolve": ["./"]
"remix-url-resolver": ["./"]
}
}
}
Loading…
Cancel
Save