Add a dev dependency on fibers from NPM

This commit is contained in:
Natalie Weizenbaum 2017-12-01 14:20:49 -08:00
parent 7178a91844
commit 0a67d3845f
6 changed files with 22 additions and 7 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ packages
.packages
pubspec.lock
/benchmark/source
node_modules/

View File

@ -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 }

9
package.json Normal file
View File

@ -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"
}
}

View File

@ -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"

View File

@ -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.";
}
}
}

View File

@ -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() {
@ -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.