c79f0c3472
* remove `wraps` syntax enhancements for imports and support new `import * as module from ...` syntax - default imports are the wrong construct for importing everything from a module * moved tests from transpiler to jasmine and karma - transpiler tests are included when running karma in main project folder - transpiler is reloaded after every test run in karma, so no need to restart karma when the transpiler has been changed. - removed own gulp build for transpiler and `postinstall.sh` as they are no more needed. - transpiler tests are now executed in Dart AND JavaScript (used to be executed only in Dart), which allowed to catch some bugs (see the bug with the import specification above). * made tests work in dart as well by using the following hack: - dependencies are loaded from the `build` folder, which makes running `gulp build` necessary before running karma for dart - for this to work, the dependencies are included in main `pubspec.yaml` of project - reason for the hack: `karma-dart` loads all `packages` urls directly from disc (should rather use the karma file list) * added explicit annotations `FIELD`, `ABSTRACT`, ... to `facade/lang.*` - needed for now that we can run tests and don't get errors for undefined annotations. * added `README.md` with details about the build and tests |
||
---|---|---|
modules | ||
tools/transpiler | ||
.gitignore | ||
LICENSE | ||
README.md | ||
TODO.md | ||
file2modulename.js | ||
gulpfile.js | ||
karma-dart.conf.js | ||
karma-js.conf.js | ||
package.json | ||
pubspec.yaml | ||
test-main.dart | ||
test-main.js |
README.md
Build
Prerequisites:
npm install
pub get
install -g gulp
install -g karma
Folder structure
modules/*
: modules that will be loaded in the browsertools/*
: tools that are needed to build Angular
File endings
*.js
: javascript files that get transpiled to Dart and EcmaScript 5*.es6
: javascript files that get transpiled only to EcmaScript 5*.es5
: javascript files that don't get transpiled*.dart
: dart files that don't get transpiled
Build:
gulp build
-> result is inbuild
folder
- will also to
pubg get
for the subfolders inmodules
and rundartanalyzer
for every file that matches<module>/src/<module>.dart
, e.g.di/src/di.dart
gulp clean
-> cleans thebuild
folder
Tests:
karma start karma-js.conf.js
: JS testskarma start karma-dart.conf.js
: JS tests
Notes for all tests:
The karma preprocessor is setup in a way so that after every test run the transpiler is reloaded. With that it is possible to make changes to the preprocessor and run the tests without exiting karma (just touch a test file that you would like to run).
Restriction for Dart tests (for now):
- Due to a bug
karma-dart
plugin, this will use the files in thebuild
folder for resolvingpackage:
dependencies (created e.g. forimport ... from 'di:di'
). So you need to executegulp build
before this.