embark/packages/stack/compiler/README.md

63 lines
1.7 KiB
Markdown
Raw Normal View History

feat: normalize README and package.json bugs, homepage, description Make changes by running these commands in the root of the monorepo: **bugs** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.bugs=\ \"https://github.com/embark-framework/embark/issues\""' ``` **homepage** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.homepage=\ \"https://github.com/embark-framework/embark/tree/master/${DIRPATH}#readme\""' ``` Don't commit changes to private packages, with the exceptions of embark-typings and embark-reset because those may switch from private to public, and also because the latter will be included in `node_modules` of embark even if it is private since embark-reset is presently a bundled dependency of embark. Don't include the homepage and bugs fields in dapps generated from the template packages, except for the demo. Set those dapps' description field to an empty string. Ensure every package (inc. private packages) has a description. Ensure every package (inc. private packages) has a README that begins with: ```markdown `[pkgJson.name]` ================ > [pkgJson.description] Visit [embark.status.im](https://embark.status.im/) to get started with [Embark](https://github.com/embark-framework/embark). ``` Don't include the README in dapps generated from the template packages, except for the demo.
2019-03-08 19:58:27 +00:00
# `embark-compiler`
feat: normalize README and package.json bugs, homepage, description Make changes by running these commands in the root of the monorepo: **bugs** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.bugs=\ \"https://github.com/embark-framework/embark/issues\""' ``` **homepage** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.homepage=\ \"https://github.com/embark-framework/embark/tree/master/${DIRPATH}#readme\""' ``` Don't commit changes to private packages, with the exceptions of embark-typings and embark-reset because those may switch from private to public, and also because the latter will be included in `node_modules` of embark even if it is private since embark-reset is presently a bundled dependency of embark. Don't include the homepage and bugs fields in dapps generated from the template packages, except for the demo. Set those dapps' description field to an empty string. Ensure every package (inc. private packages) has a description. Ensure every package (inc. private packages) has a README that begins with: ```markdown `[pkgJson.name]` ================ > [pkgJson.description] Visit [embark.status.im](https://embark.status.im/) to get started with [Embark](https://github.com/embark-framework/embark). ``` Don't include the README in dapps generated from the template packages, except for the demo.
2019-03-08 19:58:27 +00:00
> Embark compiler module
Abstracts the compiler interface and exposes a plugin api to register contract
extensions and how to handle them. It accepts command requests to compile and
returns the aggregated compilation result.
feat: normalize README and package.json bugs, homepage, description Make changes by running these commands in the root of the monorepo: **bugs** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.bugs=\ \"https://github.com/embark-framework/embark/issues\""' ``` **homepage** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.homepage=\ \"https://github.com/embark-framework/embark/tree/master/${DIRPATH}#readme\""' ``` Don't commit changes to private packages, with the exceptions of embark-typings and embark-reset because those may switch from private to public, and also because the latter will be included in `node_modules` of embark even if it is private since embark-reset is presently a bundled dependency of embark. Don't include the homepage and bugs fields in dapps generated from the template packages, except for the demo. Set those dapps' description field to an empty string. Ensure every package (inc. private packages) has a description. Ensure every package (inc. private packages) has a README that begins with: ```markdown `[pkgJson.name]` ================ > [pkgJson.description] Visit [embark.status.im](https://embark.status.im/) to get started with [Embark](https://github.com/embark-framework/embark). ``` Don't include the README in dapps generated from the template packages, except for the demo.
2019-03-08 19:58:27 +00:00
## API
**command: `compiler:contracts:compile`**
arguments:
* `contractFiles` - <array of embark File Objects>
2019-01-14 11:21:40 +00:00
* `options` - <object> config object `{isCoverage: boolean (default: false)}`
response:
* `error`
* `compiledObject` - compilation result
```
{
runtimeBytecode: <deployed bytecode>
realRuntimeByteCode: <deployed bytecode without swarm hash>
code: <bytecode>
abiDefinition: <abi object>
swarmHash: (optional)
gasEstimates: (optional)
functionHashes: (optional)
filename: (optional) <contract relative filename>
originalFilename: (optional) <contract real filename>
}
```
example:
```
2019-01-14 11:21:40 +00:00
import { File } from 'src/lib/core/file.js';
const contractFiles = [(new File({path: "simplestorage.sol", type: "custom", resolver: (cb) => { return cb(".. contract code...") }}))];
embark.events.request("compiler:contracts:compile", contractFiles, {}, (err, compiledObject) => {
})
```
feat: normalize README and package.json bugs, homepage, description Make changes by running these commands in the root of the monorepo: **bugs** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.bugs=\ \"https://github.com/embark-framework/embark/issues\""' ``` **homepage** ```shell npx lerna exec --concurrency 1 --stream -- \ 'DIRPATH=$(realpath $PWD --relative-to=$LERNA_ROOT_PATH); \ npx json -I -f package.json -e "this.homepage=\ \"https://github.com/embark-framework/embark/tree/master/${DIRPATH}#readme\""' ``` Don't commit changes to private packages, with the exceptions of embark-typings and embark-reset because those may switch from private to public, and also because the latter will be included in `node_modules` of embark even if it is private since embark-reset is presently a bundled dependency of embark. Don't include the homepage and bugs fields in dapps generated from the template packages, except for the demo. Set those dapps' description field to an empty string. Ensure every package (inc. private packages) has a description. Ensure every package (inc. private packages) has a README that begins with: ```markdown `[pkgJson.name]` ================ > [pkgJson.description] Visit [embark.status.im](https://embark.status.im/) to get started with [Embark](https://github.com/embark-framework/embark). ``` Don't include the README in dapps generated from the template packages, except for the demo.
2019-03-08 19:58:27 +00:00
## Plugins
2020-01-19 20:19:30 +00:00
This module enables the `registerCompiler` plugin API. see [documentation](https://framework.embarklabs.io/docs/plugin_reference.html#embark-registerCompiler-extension-callback-contractFiles-doneCallback)
***embark.registerCompiler***
arguments:
* `extension` - extension of the contract language (e.g `.sol`)
* response callback
* `contractFiles`: filenames matching the extension
* `callback(error, compiledObject)`
2020-01-19 20:19:30 +00:00
Visit [framework.embarklabs.io](https://framework.embarklabs.io/) to get started with
[Embark](https://github.com/embarklabs/embark).