build_node_compilers 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 67

build_node_compilers

This library provides builders for compiling Dart code to Node-compatible JavaScript modules. Both dartdevc and dart2js compilers are supported.

Installation

This package is intended to be used as a development dependency for users of node_interop libraries. Simply add the following to your pubspec.yaml:

dev_dependencies:
  build_runner: # needed to run the build
  build_node_compilers:

Configuration

Create build.yaml file in your project with following contents:

targets:
  $default:
    sources:
      - "node/**"
      - "test/**" # Include this if you want to compile tests.
      - "example/**" # Include this if you want to compile examples.

To build your project run following:

pub run build_runner build --output=build/

Note that for projects using node_interop packages the convention is to put main application files (Dart files containing main function) in the top-level node/ directory. (This is to avoid confusion (and filename collisions) with apps targeting browsers in web/ and package-level binaries in bin/ recognized by Pub).

By default, the dartdevc compiler is used, which is the Dart Development Compiler.

If you would like to opt into dart2js you will need to override compiler option to build_runner which would look something like this:

pub run build_runner build \
  --define="build_node_compilers|entrypoint=compiler=dart2js" \
  --output=build/

0.1.2

  • Upgraded dependencies to match with latest version of build_web_compilers.

0.1.1

  • Create .packages file and use the new frontend with dart2js.

0.1.0+1

  • Use --use-old-frontend with dart2js as a stopgap until we can add support for .packages files.
  • Fixed deprecation warnings.

0.1.0

  • Initial version based on build_web_compilers.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  build_node_compilers: "^0.1.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:build_node_compilers/build_node_compilers.dart';
        
Version Uploaded Documentation Archive
0.1.2 Apr 4, 2018 Go to the documentation of build_node_compilers 0.1.2 Download build_node_compilers 0.1.2 archive
0.1.1 Mar 19, 2018 Go to the documentation of build_node_compilers 0.1.1 Download build_node_compilers 0.1.1 archive
0.1.0+1 Mar 18, 2018 Go to the documentation of build_node_compilers 0.1.0+1 Download build_node_compilers 0.1.0+1 archive
0.1.0 Feb 9, 2018 Go to the documentation of build_node_compilers 0.1.0 Download build_node_compilers 0.1.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
34 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
67
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:build_node_compilers/build_node_compilers.dart with components: io, isolate, build.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use build_node_compilers.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.37 <2.0.0
analyzer >=0.30.0 <0.32.0 0.31.1 0.31.2-alpha.1
bazel_worker ^0.1.4 0.1.9
build ^0.12.0 0.12.2
build_config ^0.2.5 0.2.6+1
build_modules ^0.2.0 0.2.1
build_runner ^0.8.0 0.8.3
cli_util ^0.1.2 0.1.2+1
crypto >=0.9.2 <3.0.0 2.0.2+1
logging ^0.11.2 0.11.3+1
node_preamble ^1.4.0 1.4.0
path ^1.4.2 1.5.1
scratch_space ^0.0.2 0.0.2+1
Transitive dependencies
args 1.4.2
async 2.0.6
build_resolvers 0.2.0+1
built_collection 3.1.1
built_value 5.4.3
charcode 1.1.1
code_builder 3.0.3
collection 1.14.9
convert 2.0.1
csslib 0.14.1
dart_style 1.0.9+1 1.0.10
fixnum 0.10.7
front_end 0.1.0-alpha.9 0.1.0-alpha.11
glob 1.1.5
graphs 0.1.1
html 0.13.3
http_multi_server 2.0.4
http_parser 3.1.1
io 0.3.2+1
isolate 1.1.0 2.0.0
json_annotation 0.2.3
kernel 0.3.0-alpha.9 0.3.0-alpha.11
matcher 0.12.2
meta 1.1.2
mime 0.9.6
package_config 1.0.3
plugin 0.2.0+2
pool 1.3.4
protobuf 0.7.2
quiver 0.29.0+1
shelf 0.7.2
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.5
stream_transform 0.0.11
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
yaml 2.1.13
Dev dependencies
a
b
build_test ^0.10.0
json_serializable ^0.3.0
source_gen ^0.7.0
test ^0.12.24