build_node_compilers 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 75

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.2.0

  • Breaking changes: upgraded to build_runner 1.0.0, build_modules 0.4.0

0.1.12

  • Fixed function responsible for resolving module paths for dartdevc to support symlinked entrypoints.

0.1.11

  • Upgraded to latest build_runner (fixes dependency resolution with Dart 2 stable).

0.1.10

  • Handle entrypoints inside lib/ folder.

0.1.9

  • Fixed analysis warnings with latest Pub and Dart SDK.

0.1.8

  • Fixed strong mode issue with parsing dart2js_args using latest Dart 2 SDK.

0.1.7

  • Removed extra dependency constraint on analyzer package.
  • Upgraded all dependencies to latest.

0.1.6

  • Removed redundant **_test.dart glob from build config which was causing issues when build_node_compilers used together with build_web_compilers.

0.1.5

  • Expand support for package:build_config to include version 0.3.x.

0.1.4

  • Fixed deprecation warnings with latest Dart 2 dev SDK.

0.1.3

  • Remove extra dependencies in build_node_compilers (#22)

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.

Use this package as a library

1. Depend on it

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


dependencies:
  build_node_compilers: ^0.2.0

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 flutter 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.2.0 Oct 5, 2018 Go to the documentation of build_node_compilers 0.2.0 Download build_node_compilers 0.2.0 archive
0.1.12 Aug 9, 2018 Go to the documentation of build_node_compilers 0.1.12 Download build_node_compilers 0.1.12 archive
0.1.11 Aug 8, 2018 Go to the documentation of build_node_compilers 0.1.11 Download build_node_compilers 0.1.11 archive
0.1.10 Jul 27, 2018 Go to the documentation of build_node_compilers 0.1.10 Download build_node_compilers 0.1.10 archive
0.1.9 Jul 24, 2018 Go to the documentation of build_node_compilers 0.1.9 Download build_node_compilers 0.1.9 archive
0.1.8 Jun 24, 2018 Go to the documentation of build_node_compilers 0.1.8 Download build_node_compilers 0.1.8 archive
0.1.7 Jun 22, 2018 Go to the documentation of build_node_compilers 0.1.7 Download build_node_compilers 0.1.7 archive
0.1.6 Jun 11, 2018 Go to the documentation of build_node_compilers 0.1.6 Download build_node_compilers 0.1.6 archive
0.1.5 Jun 9, 2018 Go to the documentation of build_node_compilers 0.1.5 Download build_node_compilers 0.1.5 archive
0.1.4 Jun 6, 2018 Go to the documentation of build_node_compilers 0.1.4 Download build_node_compilers 0.1.4 archive

All 15 versions...

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

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

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

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

Maintenance suggestions

Maintain an example. (-10 points)

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 <3.0.0
analyzer >=0.30.0 <0.33.0 0.32.6 0.34.0
bazel_worker ^0.1.4 0.1.15
build >=0.12.8 <2.0.0 1.0.1
build_config >=0.2.6 <0.4.0 0.3.1+4
build_modules >=0.4.0 <2.0.0 1.0.2
cli_util ^0.1.2 0.1.3+2
crypto >=0.9.2 <3.0.0 2.0.6
node_preamble ^1.4.0 1.4.4
path ^1.4.2 1.6.2
pool ^1.3.6 1.3.6
scratch_space ^0.0.2 0.0.3+2
Transitive dependencies
args 1.5.1
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
csslib 0.14.6
fixnum 0.10.9
front_end 0.1.4+2 0.1.7
glob 1.1.7
graphs 0.1.3+1
html 0.13.3+3
json_annotation 2.0.0
kernel 0.3.4+2 0.3.7
logging 0.11.3+2
meta 1.1.6
package_config 1.0.5
pedantic 1.3.0
plugin 0.2.0+3
protobuf 0.10.5
pub_semver 1.4.2
pubspec_parse 0.1.2+3
source_span 1.4.1
stack_trace 1.9.3
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
a
b
build_test ^0.10.0
test ^1.0.0