Skip to content

Commit bd4cc36

Browse files
committed
Rename the npm package "sass".
We'll continue to build the "dart-sass" package for the time being to ease migration, but I expect to move entirely to "sass" by 1.0.0 stable.
1 parent 54d4f3f commit bd4cc36

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dart-sass",
2+
"name": "sass",
33
"description": "A Dart implementation of Sass, compiled to JS.",
44
"license": "MIT",
55
"bugs": "https://github.com/sass/dart-sass/issues",

tool/grind.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,22 @@ js() {
7171
@Task('Build a pure-JS npm package.')
7272
@Depends(js)
7373
npm_package() {
74-
var dir = new Directory('build/npm');
74+
var json = JSON.decode(new File('package/package.json').readAsStringSync());
75+
json['version'] = _version;
76+
77+
_writeNpmPackage('build/npm', json);
78+
_writeNpmPackage('build/npm-old', json..addAll({"name": "dart-sass"}));
79+
}
80+
81+
/// Writes a Dart Sass NPM package to the directory at [destination].
82+
///
83+
/// The [json] will be used as the package's package.json.
84+
void _writeNpmPackage(String destination, Map<String, dynamic> json) {
85+
var dir = new Directory(destination);
7586
if (dir.existsSync()) dir.deleteSync(recursive: true);
7687
dir.createSync(recursive: true);
7788

78-
log("copying package/package.json to build/npm");
79-
var json = JSON.decode(new File('package/package.json').readAsStringSync());
80-
json['version'] = _version;
89+
log("copying package/package.json to $destination");
8190
new File(p.join(dir.path, 'package.json'))
8291
.writeAsStringSync(JSON.encode(json));
8392

0 commit comments

Comments
 (0)