@waves/ride-js
Advanced tools
Comparing version 2.2.1 to 2.2.2-beta.1
{ | ||
"name": "@waves/ride-js", | ||
"version": "2.2.1", | ||
"description": "Js compiler v1.4.6 for Ride - Waves smart contract language.", | ||
"version": "2.2.2-beta.1", | ||
"description": "Js compiler for Ride - Waves smart contract language.", | ||
"main": "src/index.js", | ||
@@ -9,3 +9,3 @@ "typings": "src/index.d.ts", | ||
"build": "./node_modules/.bin/webpack --config webpack.config.js", | ||
"test": "jest", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"prepublishOnly": "npm run build", | ||
@@ -37,11 +37,6 @@ "getNewCompiler": "sh scripts/getNewCompiler.sh" | ||
"devDependencies": { | ||
"@types/jest": "^23.3.14", | ||
"chai": "^4.2.0", | ||
"copy-webpack-plugin": "^4.5.2", | ||
"ts-jest": "^24.0.2", | ||
"jest": "^24.0.2", | ||
"ts-node": "^7.0.1", | ||
"typed-ts-events": "^1.1.1", | ||
"mocha": "^5.2.0", | ||
"webpack": "^4.16.0", | ||
"typescript": "^3.7.2", | ||
"webpack-cli": "^3.0.8", | ||
@@ -51,3 +46,2 @@ "webpack-closure-compiler": "^2.1.6" | ||
"dependencies": { | ||
"@jest/globals": "^27.5.1", | ||
"@waves/ts-lib-crypto": "^1.4.3", | ||
@@ -54,0 +48,0 @@ "axios": "^0.19.0" |
@@ -11,14 +11,6 @@ # Ride-js | ||
sbt langJS/fullOptJS | ||
sbt replJS/fullOptJS | ||
``` | ||
* From `waves` project copy ```./lang/js/target/lang-opt.js``` to ```./src``` of `ride-js` | ||
* From `waves` project copy ```./repl/js/target/repl-opt.js``` to ```./src``` of `ride-js` | ||
# Workaround | ||
If there is error with compiling try | ||
```sbt | ||
sbt clean && sbt lang/clean | ||
``` | ||
### Tasks | ||
* `npm run build` builds minified version that can be included as script tag. Add RideJS variable to global scope | ||
* `npm run build` builds minified version that can be included as script tag. Add RideJS variable to global scope |
@@ -11,3 +11,2 @@ export interface ICompilationResult { | ||
userFunctionsComplexity?: Record<string, number> | ||
stateCallsComplexities?: Record<string, number> | ||
} | ||
@@ -68,3 +67,3 @@ } | ||
contentType: number, | ||
scriptType: number, | ||
scriptType: number | ||
imports: string[] | ||
@@ -85,20 +84,8 @@ } | ||
export function compile( | ||
code: string, | ||
estimatorVersion?: number, | ||
needCompaction?: boolean, | ||
removeUnusedCode?: boolean, | ||
libraries?: Record<string, string> | ||
): ICompilationResult | ICompilationError; | ||
export function compile(code: string, estimatorVersion?: number, libraries?: Record<string, string>): ICompilationResult | ICompilationError; | ||
export function parseAndCompile( | ||
code: string, | ||
estimatorVersion?: number, | ||
needCompaction?: boolean, | ||
removeUnusedCode?: boolean, | ||
libraries?: Record<string, string> | ||
): IParseAndCompileResult | ICompilationError; | ||
export function flattenCompilationResult(compiled: ICompilationResult | ICompilationError): IFlattenedCompilationResult | ||
export function parseAndCompile(code: string, estimatorVersion?: number, lastInsertedCharPos?: number | undefined): IParseAndCompileResult | ICompilationError; | ||
export function scriptInfo(code: string): IScriptInfo | ICompilationError; | ||
@@ -227,3 +214,3 @@ | ||
decList: (ILet | IFunc)[] | ||
annFuncList: IAnnotatedFunc//todo fix | ||
annFuncList: IAnnotatedFunc[] | ||
} | ||
@@ -239,4 +226,2 @@ | ||
type: 'ANNOTATION', | ||
posStart: 80, | ||
posEnd: 143, | ||
name: IName, | ||
@@ -250,8 +235,13 @@ argList: IName[] | ||
expr: TExpr | ||
argList: TArgument[], | ||
argList: TArgument[] | ||
body: IBlock | IFunctionCall | ||
} | ||
export type TArgument = { argName: IName, typeList: TArgumentType[] } | ||
export type TArgumentType = { typeName: IName, typeParam?: any } | ||
export type TArgument = { argName: IName, type: TArgumentType } | ||
export type TArgumentType = { typeName: IName, typeParam?: ITypeParam } | ||
export interface ITypeParam extends IPos { | ||
value: { isUnion: boolean, typeList: TArgumentType[] } | ||
} | ||
export interface IFunctionCall extends IExprNode { | ||
@@ -258,0 +248,0 @@ type: 'FUNCTION_CALL' |
require('./interop'); | ||
const crypto = require('@waves/ts-lib-crypto'); | ||
const scalaJsCompiler = require('./lang-opt.js'); | ||
const replJs = require('./repl-opt.js'); | ||
function wrappedCompile(code, estimatorVersion = 3, needCompaction = false, removeUnusedCode = false, libraries = {}) { | ||
function wrappedCompile(code, estimatorVersion = 2) { | ||
if (typeof code !== 'string') { | ||
@@ -13,3 +12,3 @@ return { | ||
try { | ||
const result = scalaJsCompiler.compile(code, estimatorVersion, needCompaction, removeUnusedCode, libraries); | ||
const result = scalaJsCompiler.compile(code, estimatorVersion); | ||
if (result.error) { | ||
@@ -23,3 +22,10 @@ try { | ||
const bytes = new Uint8Array(result.result); | ||
const {ast, complexity, verifierComplexity, callableComplexities, userFunctionComplexities, globalVariableComplexities, stateCallsComplexities} = result; | ||
const { | ||
ast, | ||
complexity, | ||
verifierComplexity, | ||
callableComplexities, | ||
userFunctionComplexities, | ||
globalVariableComplexities | ||
} = result; | ||
return { | ||
@@ -35,4 +41,3 @@ result: { | ||
userFunctionComplexities, | ||
globalVariableComplexities, | ||
stateCallsComplexities | ||
globalVariableComplexities | ||
} | ||
@@ -51,4 +56,4 @@ } | ||
const repl = (opts != null) | ||
? replJs.repl(new replJs.NodeConnectionSettings(opts.nodeUrl, opts.chainId.charCodeAt(0), opts.address)) | ||
: replJs.repl(); | ||
? scalaJsCompiler.repl(new scalaJsCompiler.NodeConnectionSettings(opts.nodeUrl, opts.chainId.charCodeAt(0), opts.address)) | ||
: scalaJsCompiler.repl(); | ||
@@ -58,3 +63,3 @@ const wrapReconfigure = (repl) => { | ||
return (opts) => { | ||
const settings = new replJs.NodeConnectionSettings(opts.nodeUrl, opts.chainId.charCodeAt(0), opts.address); | ||
const settings = new scalaJsCompiler.NodeConnectionSettings(opts.nodeUrl, opts.chainId.charCodeAt(0), opts.address); | ||
const newRepl = reconfigureFn(settings); | ||
@@ -61,0 +66,0 @@ newRepl.reconfigure = wrapReconfigure(newRepl); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
6
5350042
22413
2
15
- Removed@jest/globals@^27.5.1
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@jest/environment@27.5.1(transitive)
- Removed@jest/fake-timers@27.5.1(transitive)
- Removed@jest/globals@27.5.1(transitive)
- Removed@jest/types@27.5.1(transitive)
- Removed@sinonjs/commons@1.8.6(transitive)
- Removed@sinonjs/fake-timers@8.1.0(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@3.0.4(transitive)
- Removed@types/node@22.10.1(transitive)
- Removed@types/stack-utils@2.0.3(transitive)
- Removed@types/yargs@16.0.9(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.05.2.0(transitive)
- Removedbraces@3.0.3(transitive)
- Removedchalk@4.1.2(transitive)
- Removedci-info@3.9.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removeddiff-sequences@27.5.1(transitive)
- Removedescape-string-regexp@2.0.0(transitive)
- Removedexpect@27.5.1(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedis-number@7.0.0(transitive)
- Removedjest-diff@27.5.1(transitive)
- Removedjest-get-type@27.5.1(transitive)
- Removedjest-matcher-utils@27.5.1(transitive)
- Removedjest-message-util@27.5.1(transitive)
- Removedjest-mock@27.5.1(transitive)
- Removedjest-util@27.5.1(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpretty-format@27.5.1(transitive)
- Removedreact-is@17.0.2(transitive)
- Removedslash@3.0.0(transitive)
- Removedstack-utils@2.0.6(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedtype-detect@4.0.8(transitive)
- Removedundici-types@6.20.0(transitive)