@initia/builder.js
Advanced tools
Comparing version 0.1.6 to 0.1.8
{ | ||
"name": "@initia/builder.js", | ||
"version": "0.1.6", | ||
"version": "0.1.8", | ||
"description": "The JavaScript Move Builder for Initia", | ||
"license": "MIT", | ||
"author": "InitiaLabs", | ||
"author": "Initia Foundation", | ||
"keywords": [ | ||
@@ -27,60 +27,42 @@ "cryptocurrency", | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=18" | ||
}, | ||
"scripts": { | ||
"build": "tsc --module commonjs", | ||
"create-hook": "husky add .husky/pre-commit", | ||
"test": "jest", | ||
"format": "prettier --check \"./src/**/*.ts\"", | ||
"format:fix": "prettier --write \"./src/**/*.ts\"", | ||
"lint": "eslint src --ext .js,.ts", | ||
"lint:fix": "eslint src --ext .js,.ts --fix", | ||
"doc": "typedoc", | ||
"prepare": "husky install", | ||
"prepublishOnly": "npm run build" | ||
"lint": "npx eslint . --fix", | ||
"build": "tsc --build", | ||
"test": "jest --no-cache", | ||
"prepare": "husky install" | ||
}, | ||
"lint-staged": { | ||
"./src/**/*.ts": [ | ||
"npm run lint:fix", | ||
"npm run format:fix" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged", | ||
"post-checkout": "npm i" | ||
} | ||
}, | ||
"prettier": { | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"arrowParens": "avoid" | ||
}, | ||
"devDependencies": { | ||
"@types/ffi-napi": "^4.0.7", | ||
"@types/jest": "^29.0.3", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^18.7.18", | ||
"@types/ref-napi": "^3.0.7", | ||
"@types/ref-struct-di": "^1.1.9", | ||
"@typescript-eslint/eslint-plugin": "^5.38.0", | ||
"@typescript-eslint/parser": "^5.38.0", | ||
"@typescript-eslint/eslint-plugin": "^7.13.0", | ||
"@typescript-eslint/parser": "^7.13.0", | ||
"buffer": "^6.0.3", | ||
"eslint": "^8.23.1", | ||
"husky": "^6.0.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"husky": "^8.0.0", | ||
"jest": "^29.0.3", | ||
"lint-staged": "^13.0.3", | ||
"prettier": "^2.7.1", | ||
"lint-staged": "^15.2.10", | ||
"prettier": "^3.1.1", | ||
"process": "^0.11.10", | ||
"ts-jest": "^29.0.1", | ||
"ts-jest": "^29.2.3", | ||
"ts-loader": "^9.4.1", | ||
"ts-node": "^10.9.1", | ||
"typedoc": "^0.23.15", | ||
"typescript": "^4.8.3" | ||
"typedoc": "^0.26.7", | ||
"typescript": "^5.5.3" | ||
}, | ||
"dependencies": { | ||
"ffi-napi": "^4.0.3", | ||
"ref-napi": "^3.0.3", | ||
"ref-struct-di": "^1.1.1" | ||
"@eleccookie/ffi-napi": "^0.0.1", | ||
"@eleccookie/ref-napi": "^0.0.2", | ||
"@mysten/bcs": "^1.1.0", | ||
"ref-struct-di": "^1.1.1", | ||
"typescript-eslint": "^7.17.0" | ||
}, | ||
"lint-staged": { | ||
"src/**/*.ts": "npx eslint . --fix", | ||
"*.toml": "skip" | ||
} | ||
} |
@@ -21,3 +21,6 @@ # initia builder.js | ||
// ex) path.resolve(__dirname, "../relative_path") | ||
const builder = new MoveBuilder(/* path to move package */, {}); | ||
const builder = new MoveBuilder( | ||
path.resolve(__dirname, 'moon_coin'), // move package path | ||
{} // build options | ||
); | ||
@@ -28,7 +31,12 @@ // execute move compiler via ffi | ||
// load compiled module bytes as `Buffer` | ||
const compiledModuleBytes = await builder.get(/* module name */); | ||
const compiledModuleBytes = await builder.get( | ||
'moon_coin' // module name | ||
); | ||
console.info(compiledModuleBytes.toString('hex')); | ||
// change module name to what you want | ||
const nameConvertedModuleBytes = await MoveBuilder.convert_module_name(compiledModuleBytes, /* new module name */); | ||
const nameConvertedModuleBytes = await MoveBuilder.convert_module_name( | ||
compiledModuleBytes, // compiled module bytes | ||
'sun_coin' // new module name | ||
); | ||
console.info(nameConvertedModuleBytes.toString('hex')); | ||
@@ -45,8 +53,6 @@ } | ||
async function createAndCleanExample() { | ||
// recommend to use full package path, not relative path | ||
// ex) path.resolve(__dirname, "../relative_path") | ||
const builder = new MoveBuilder(/* path to move package */, {}); | ||
const builder = new MoveBuilder(path.resolve(__dirname, 'moon_coin'), {}); | ||
// create new move package | ||
await builder.new(/* package name */); | ||
await builder.new('new'/* package name */); | ||
@@ -66,5 +72,5 @@ await builder.build(); | ||
async function readExample() { | ||
const builder = new MoveBuilder(/* path to move package */, {}); | ||
const builder = new MoveBuilder(path.resolve(__dirname, 'moon_coin'), {}); | ||
const binary = await builder.get(/* module name */); | ||
const binary = await builder.get('moon_coin'); | ||
@@ -71,0 +77,0 @@ // read module bytes |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
81
0
155331841
5
10
3
80
0
9
+ Added@eleccookie/ffi-napi@^0.0.1
+ Added@eleccookie/ref-napi@^0.0.2
+ Added@mysten/bcs@^1.1.0
+ Addedtypescript-eslint@^7.17.0
+ Added@eleccookie/ref-napi@0.0.2(transitive)
+ Added@eslint-community/eslint-utils@4.4.1(transitive)
+ Added@eslint-community/regexpp@4.12.1(transitive)
+ Added@eslint/eslintrc@2.1.4(transitive)
+ Added@eslint/js@8.57.1(transitive)
+ Added@humanwhocodes/config-array@0.13.0(transitive)
+ Added@humanwhocodes/module-importer@1.0.1(transitive)
+ Added@humanwhocodes/object-schema@2.0.3(transitive)
+ Added@mysten/bcs@1.1.0(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@typescript-eslint/eslint-plugin@7.18.0(transitive)
+ Added@typescript-eslint/parser@7.18.0(transitive)
+ Added@typescript-eslint/scope-manager@7.18.0(transitive)
+ Added@typescript-eslint/type-utils@7.18.0(transitive)
+ Added@typescript-eslint/types@7.18.0(transitive)
+ Added@typescript-eslint/typescript-estree@7.18.0(transitive)
+ Added@typescript-eslint/utils@7.18.0(transitive)
+ Added@typescript-eslint/visitor-keys@7.18.0(transitive)
+ Added@ungap/structured-clone@1.2.0(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedacorn-jsx@5.3.2(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedarray-union@2.1.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase-x@5.0.0(transitive)
+ Addedbrace-expansion@1.1.112.0.1(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbs58@6.0.0(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedcross-spawn@7.0.5(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addeddoctrine@3.0.0(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedeslint@8.57.1(transitive)
+ Addedeslint-scope@7.2.2(transitive)
+ Addedeslint-visitor-keys@3.4.3(transitive)
+ Addedespree@9.6.1(transitive)
+ Addedesquery@1.6.0(transitive)
+ Addedesrecurse@4.3.0(transitive)
+ Addedestraverse@5.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfile-entry-cache@6.0.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedflat-cache@3.2.0(transitive)
+ Addedflatted@3.3.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedglob-parent@5.1.26.0.2(transitive)
+ Addedglobals@13.24.0(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedgraphemer@1.4.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedjson-buffer@3.0.1(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stable-stringify-without-jsonify@1.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
+ Addedlevn@0.4.1(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlodash.merge@4.6.2(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedminimatch@3.1.29.0.5(transitive)
+ Addednatural-compare@1.4.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptionator@0.9.4(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedprelude-ls@1.2.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtext-table@0.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedts-api-utils@1.4.0(transitive)
+ Addedtype-check@0.4.0(transitive)
+ Addedtype-fest@0.20.2(transitive)
+ Addedtypescript@5.6.3(transitive)
+ Addedtypescript-eslint@7.18.0(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removedffi-napi@^4.0.3
- Removedref-napi@^3.0.3
- Removedffi-napi@4.0.3(transitive)
- Removedget-uv-event-loop-napi-h@1.0.6(transitive)
- Removedref-napi@3.0.3(transitive)