-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: don't export compilers depending on node in builds for browsers
- Loading branch information
Showing
8 changed files
with
104 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { readFile } from 'fs/promises'; | ||
import HttpBrowser from './Http'; | ||
import { Aci } from './Base'; | ||
import { Encoded } from '../../utils/encoder'; | ||
import getFileSystem from './getFileSystem'; | ||
|
||
/** | ||
* Contract Compiler over HTTP for Nodejs | ||
* | ||
* Inherits CompilerHttp and implements `compile`, `validate` methods | ||
* @category contract | ||
* @example CompilerHttpNode('COMPILER_URL') | ||
*/ | ||
export default class CompilerHttpNode extends HttpBrowser { | ||
override async compile(path: string): Promise<{ bytecode: Encoded.ContractBytearray; aci: Aci }> { | ||
const fileSystem = await getFileSystem(path); | ||
const sourceCode = await readFile(path, 'utf8'); | ||
return this.compileBySourceCode(sourceCode, fileSystem); | ||
} | ||
|
||
override async validate(bytecode: Encoded.ContractBytearray, path: string): Promise<boolean> { | ||
const fileSystem = await getFileSystem(path); | ||
const sourceCode = await readFile(path, 'utf8'); | ||
return this.validateBySourceCode(bytecode, sourceCode, fileSystem); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* ISC License (ISC) | ||
* Copyright (c) 2022 aeternity developers | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
* PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
export * from './chain'; | ||
export * from './utils/crypto'; | ||
export * from './utils/keystore'; | ||
export * from './utils/bytes'; | ||
export * from './tx'; | ||
export * from './tx/builder'; | ||
export * from './tx/builder/helpers'; | ||
export * from './tx/builder/constants'; | ||
export * from './tx/builder/schema'; | ||
export * from './utils/amount-formatter'; | ||
export * from './utils/hd-wallet'; | ||
export { encode, decode, Encoding } from './utils/encoder'; | ||
export * from './aens'; | ||
export { default as Contract } from './contract/Contract'; | ||
export type { ContractMethodsBase } from './contract/Contract'; | ||
export * from './oracle'; | ||
export * from './spend'; | ||
export * from './contract/ga'; | ||
|
||
export { default as AeSdkMethods } from './AeSdkMethods'; | ||
export { default as AeSdkBase } from './AeSdkBase'; | ||
export { default as AeSdk } from './AeSdk'; | ||
export { default as AeSdkAepp } from './AeSdkAepp'; | ||
export { default as AeSdkWallet } from './AeSdkWallet'; | ||
export { default as Node } from './Node'; | ||
export { default as verifyTransaction } from './tx/validator'; | ||
export { default as AccountBase } from './account/Base'; | ||
export { default as MemoryAccount } from './account/Memory'; | ||
export { default as AccountGeneralized } from './account/Generalized'; | ||
export { default as AccountLedger } from './account/Ledger'; | ||
export { default as AccountLedgerFactory } from './account/LedgerFactory'; | ||
export { default as CompilerBase } from './contract/compiler/Base'; | ||
export { default as CompilerHttp } from './contract/compiler/Http'; | ||
export { default as Channel } from './channel/Contract'; | ||
|
||
export { default as connectionProxy } from './aepp-wallet-communication/connection-proxy'; | ||
export * from './aepp-wallet-communication/schema'; | ||
export { default as walletDetector } from './aepp-wallet-communication/wallet-detector'; | ||
export { default as BrowserRuntimeConnection } from './aepp-wallet-communication/connection/BrowserRuntime'; | ||
export { default as BrowserWindowMessageConnection } from './aepp-wallet-communication/connection/BrowserWindowMessage'; | ||
export * from './utils/errors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,5 @@ | ||
/* | ||
* ISC License (ISC) | ||
* Copyright (c) 2022 aeternity developers | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
* PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
export * from './index-browser'; | ||
|
||
export * from './chain'; | ||
export * from './utils/crypto'; | ||
export * from './utils/keystore'; | ||
export * from './utils/bytes'; | ||
export * from './tx'; | ||
export * from './tx/builder'; | ||
export * from './tx/builder/helpers'; | ||
export * from './tx/builder/constants'; | ||
export * from './tx/builder/schema'; | ||
export * from './utils/amount-formatter'; | ||
export * from './utils/hd-wallet'; | ||
export { encode, decode, Encoding } from './utils/encoder'; | ||
export * from './aens'; | ||
export { default as Contract } from './contract/Contract'; | ||
export type { ContractMethodsBase } from './contract/Contract'; | ||
export * from './oracle'; | ||
export * from './spend'; | ||
export * from './contract/ga'; | ||
|
||
export { default as AeSdkMethods } from './AeSdkMethods'; | ||
export { default as AeSdkBase } from './AeSdkBase'; | ||
export { default as AeSdk } from './AeSdk'; | ||
export { default as AeSdkAepp } from './AeSdkAepp'; | ||
export { default as AeSdkWallet } from './AeSdkWallet'; | ||
export { default as Node } from './Node'; | ||
export { default as verifyTransaction } from './tx/validator'; | ||
export { default as AccountBase } from './account/Base'; | ||
export { default as MemoryAccount } from './account/Memory'; | ||
export { default as AccountGeneralized } from './account/Generalized'; | ||
export { default as AccountLedger } from './account/Ledger'; | ||
export { default as AccountLedgerFactory } from './account/LedgerFactory'; | ||
export { default as CompilerBase } from './contract/compiler/Base'; | ||
export { default as CompilerHttp } from './contract/compiler/Http'; | ||
export { default as CompilerCli } from './contract/compiler/Cli'; | ||
export { default as getFileSystem } from './contract/compiler/getFileSystem'; | ||
export { default as Channel } from './channel/Contract'; | ||
|
||
export { default as connectionProxy } from './aepp-wallet-communication/connection-proxy'; | ||
export * from './aepp-wallet-communication/schema'; | ||
export { default as walletDetector } from './aepp-wallet-communication/wallet-detector'; | ||
export { default as BrowserRuntimeConnection } from './aepp-wallet-communication/connection/BrowserRuntime'; | ||
export { default as BrowserWindowMessageConnection } from './aepp-wallet-communication/connection/BrowserWindowMessage'; | ||
export * from './utils/errors'; | ||
export { default as CompilerHttpNode } from './contract/compiler/HttpNode'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters