Skip to content

Commit

Permalink
Add a dev dependency on fibers from NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Dec 1, 2017
1 parent 7178a91 commit 0a67d38
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ packages
.packages
pubspec.lock
/benchmark/source
node_modules/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ install:
- if-node . "$HOME/.nvm/nvm.sh"
- if-node nvm install "$NODE_VERSION"
- if-node nvm use "$NODE_VERSION"
- SASS_MINIFY_JS=false if-node pub run grinder npm_package
- SASS_MINIFY_JS=false if-node pub run grinder before_test

# Download sass-spec and install its dependencies if we're running specs.
- if-specs() { if [ "$TASK" = specs ]; then "$@"; fi }
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"//": [
"This isn't the official package.json for Dart Sass. It's just used to ",
"install dependencies used for testing the Node API."
],
"devDependencies": {
"fibers": ">=1.0.0 <3.0.0"
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ dev_dependencies:
stream_channel: "^1.0.0"
test_descriptor: "^1.0.0"
test_process: "^1.0.0-rc.1"
test: "^0.12.26"
test: "^0.12.29"
xml: "^2.4.0"
yaml: "^2.0.0"
2 changes: 1 addition & 1 deletion test/ensure_npm_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ hybridMain(StreamChannel channel) async {
var entryLastModified = entry.lastModifiedSync();
if (lastModified.isBefore(entryLastModified)) {
throw "${entry.path} was modified after NPM package was generated.\n"
"Run pub run grinder npm_package.";
"Run pub run grinder before_test.";
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ final _sdkDir = p.dirname(p.dirname(Platform.resolvedExecutable));
main(List<String> args) => grind(args);

@DefaultTask('Compile async code and reformat.')
all() {
format();
synchronize();
}
@Depends(format, synchronize)
all() {}

@Task('Run the Dart formatter.')
format() {
Expand Down Expand Up @@ -100,6 +98,13 @@ npm_package() {
_writeNpmPackage('build/npm-old', json..addAll({"name": "dart-sass"}));
}

@Task('Installs dependencies from npm.')
npm_install() => run("npm", arguments: ["install"]);

@Task('Runs the tasks that are required for running tests.')
@Depends(npm_package, npm_install)
before_test() {}

/// Writes a Dart Sass NPM package to the directory at [destination].
///
/// The [json] will be used as the package's package.json.
Expand Down

0 comments on commit 0a67d38

Please sign in to comment.