Merge pull request #1117 from ethereum/urlResolverDeclaration

Add module declaration
pull/7/head
yann300 6 years ago committed by GitHub
commit c726b3be82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      remix-url-resolver/README.md
  2. 3
      remix-url-resolver/package.json
  3. 2
      remix-url-resolver/tsconfig.json

@ -8,8 +8,8 @@ Returns `json` object with exact same path as `import` statement.
```json ```json
{ {
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', 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: '../greeter.sol', cleanURL: '../greeter.sol',
type: 'local' type: 'local'
} }
``` ```
@ -30,3 +30,8 @@ urlResolver.resolve(fileName, urlHandler)
throw e throw e
}) })
``` ```
#### References
* [TypeScript Publishing](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)
* [DefinitelyTyped 'Create a new package' guide](https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package)

@ -2,7 +2,8 @@
"name": "remix-url-resolver", "name": "remix-url-resolver",
"version": "0.0.2", "version": "0.0.2",
"description": "Solidity import url resolver engine", "description": "Solidity import url resolver engine",
"main": "./dist/index.js", "main": "dist",
"types": "dist/index.d.ts",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"lint": "standard", "lint": "standard",

@ -5,7 +5,7 @@
"baseUrl": "./src", "baseUrl": "./src",
"outDir": "./dist", "outDir": "./dist",
"sourceMap": true, "sourceMap": true,
"declaration": false, "declaration": true,
"module": "commonjs", "module": "commonjs",
"strict": true, "strict": true,
"noImplicitAny": false, "noImplicitAny": false,

Loading…
Cancel
Save