Skip to content

Latest commit

 

History

History
128 lines (95 loc) · 6.41 KB

CHANGELOG.md

File metadata and controls

128 lines (95 loc) · 6.41 KB

node-ffi-packager logotype, impossible cubes in green

README · Changelog · Development

Change summaries and notable excerpts from the commit log.

v2.0.2

  • e375b03 Revert to void pointers for recursive type definitions

v2.0.1

  • 2e5beae Do not register type js_voidPointer before js_void

v2.0.0

⚠ Breaking changes

  • Target Node.js v12, v14, v16.
    • Execution on v14, v16 may fail with Check failed: result.second due to bug #96 in ffi-napi.
      • One workaround is to ensure there is only a single copy of ffi-napi in the node_modules tree.
      • Inspect with npm ls ffi-napi.
  • The package name is now @ffi-packager/ffi-generate.
  • Switched to async/await, in particular for the exported async generate(...) function.
  • Exports in the generated code have changed.
    • The CONSTANTS property was renamed to constants.
    • Exported functions under {{module}} property (defaulted to the value of library) was renamed to functions.
    • All exported types were moved from the top-level scope to a types property.
  • Changed options for generate(...) and command line arguments for ffi-generate.
    • The module (-m, --module) option was removed.
      • Instead, the hardcoded property name functions is used.
      • This breaks previously generated code, which used either the name of the library (default) or a custom module name.
    • The file_only (--file_only) option was renamed to singleFile (--single-file).
    • The strict flag was removed. It was unused anyhow.
    • The --libclang argument was removed.
      • It should be autodetected by ffi-generate by calling the llvm-config tool (make sure it's on your PATH).
      • Can also be set using the LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH on macOS) environment variable.
    • The filename option was renamed to filepath.
  • Enum numbers larger than the largest "safe" max/min integer number handleable by javascript are output as strings.
  • Generated typedef output was simplified to be a javascript alias/variable reassignment.
  • The union support was fixed.
    • Now union is handled in a similar way to struct.
    • Output may differ from v1.0.0.
  • Naming changes.
    • Naming of anonymous types, functions, and properties changed.
    • Base types and typedefs are recursed, with intermediate types output and aliased.
    • "Javascript types" from ref-napi are now (directly) referenced only once, in variables prefixed with js_.
  • See also changes in the expected test output in test/ files.

Features

  • Output enum constants, even if they were not referenced by any function.
  • Allow the library option to be null.
    • This means that no dynamic library is loaded, and instead functions are mapped to what is available in the current process.
    • Allows mapping functions to libraries which have already been loaded, either implicitly by the executing binary (such as node) or manually with FFI.DynamicLibrary(...).
  • The generated code is partially sorted (constants, types, functions) to help with diffing between versions.
  • Added a generated file header with some metadata.
  • Improved documentation, example usage.
    • Added DEVELOP.md.
    • Moved examples to the examples/ directory.
  • Reduced console output for non-debug situations.
    • Debug output can easily be enabled; see DEVELOP.md.
  • Generated code is formatted using prettier.

Other changes

  • Internal code improvements.
    • Code has been reformatted, cleaned up, modernized.
    • Code partially split up to files and functions.
    • Uses class statements rather than class-like functions.
  • Added tests with a code coverage of 90% for branches, 95%+ for statements and lines, 100% for functions.
    • Reports are generated when running code coverage tests, both on the command line and in the coverage/ directory.
  • Tests, linting, and code coverage are checked with commit hooks.
  • Regenerated the ffi layer in node-libclang.
  • Workaround for va_list was both added and removed, as it is now handled by recursing deeper into base types.

v1.0.0

Forked by Joel Purra for use in node-ffi-packager.

v0.0.8

See commit log.

v0.0.7

See commit log.

v0.0.6

See commit log.

v0.0.4

See commit log.

v0.0.3

See commit log.

v0.0.2

See commit log.

v0.0.1

See commit log.


node-ffi-generate Copyright © 2011, 2012, 2013, 2014 Timothy J Fontaine, © 2020, 2021 Joel Purra. Released under MIT License.