Skip to content

Commit b1d56a4

Browse files
authored
Change terminology to refer to JS instead of Node.js (#2039)
Now that we support running in a browser, saying "Node.js" is generally inaccurate. It's still preserved in places that are genuinely Node-specific.
1 parent 89bd36b commit b1d56a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+93
-94
lines changed

lib/src/async_compile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Future<CompileResult> compileAsync(String path,
7878
sourceMap,
7979
charset);
8080

81-
deprecationLogger.summarize(node: nodeImporter != null);
81+
deprecationLogger.summarize(js: nodeImporter != null);
8282
return result;
8383
}
8484

@@ -130,7 +130,7 @@ Future<CompileResult> compileStringAsync(String source,
130130
sourceMap,
131131
charset);
132132

133-
deprecationLogger.summarize(node: nodeImporter != null);
133+
deprecationLogger.summarize(js: nodeImporter != null);
134134
return result;
135135
}
136136

lib/src/compile.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_compile.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: bac7360553f772bbf8243cca78f4f63e4bdf2755
8+
// Checksum: d6fc59fc731ebbba7d3a8cabc259e09fdc871764
99
//
1010
// ignore_for_file: unused_import
1111

@@ -87,7 +87,7 @@ CompileResult compile(String path,
8787
sourceMap,
8888
charset);
8989

90-
deprecationLogger.summarize(node: nodeImporter != null);
90+
deprecationLogger.summarize(js: nodeImporter != null);
9191
return result;
9292
}
9393

@@ -139,7 +139,7 @@ CompileResult compileString(String source,
139139
sourceMap,
140140
charset);
141141

142-
deprecationLogger.summarize(node: nodeImporter != null);
142+
deprecationLogger.summarize(js: nodeImporter != null);
143143
return result;
144144
}
145145

lib/src/importer/node_to_dart/async.dart renamed to lib/src/importer/js_to_dart/async.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ import 'dart:async';
77
import 'package:node_interop/js.dart';
88
import 'package:node_interop/util.dart';
99

10-
import '../../node/importer.dart';
11-
import '../../node/url.dart';
12-
import '../../node/utils.dart';
10+
import '../../js/importer.dart';
11+
import '../../js/url.dart';
12+
import '../../js/utils.dart';
1313
import '../../util/nullable.dart';
1414
import '../async.dart';
1515
import '../result.dart';
1616

1717
/// A wrapper for a potentially-asynchronous JS API importer that exposes it as
1818
/// a Dart [AsyncImporter].
19-
class NodeToDartAsyncImporter extends AsyncImporter {
19+
class JSToDartAsyncImporter extends AsyncImporter {
2020
/// The wrapped canonicalize function.
2121
final Object? Function(String, CanonicalizeOptions) _canonicalize;
2222

2323
/// The wrapped load function.
2424
final Object? Function(JSUrl) _load;
2525

26-
NodeToDartAsyncImporter(this._canonicalize, this._load);
26+
JSToDartAsyncImporter(this._canonicalize, this._load);
2727

2828
FutureOr<Uri?> canonicalize(Uri url) async {
2929
var result = _canonicalize(

lib/src/importer/node_to_dart/async_file.dart renamed to lib/src/importer/js_to_dart/async_file.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ import 'dart:async';
77
import 'package:node_interop/js.dart';
88
import 'package:node_interop/util.dart';
99

10-
import '../../node/importer.dart';
11-
import '../../node/url.dart';
12-
import '../../node/utils.dart';
10+
import '../../js/importer.dart';
11+
import '../../js/url.dart';
12+
import '../../js/utils.dart';
1313
import '../async.dart';
1414
import '../filesystem.dart';
1515
import '../result.dart';
1616
import '../utils.dart';
1717

1818
/// A filesystem importer to use for most implementation details of
19-
/// [NodeToDartAsyncFileImporter].
19+
/// [JSToDartAsyncFileImporter].
2020
///
2121
/// This allows us to avoid duplicating logic between the two importers.
2222
final _filesystemImporter = FilesystemImporter('.');
2323

2424
/// A wrapper for a potentially-asynchronous JS API file importer that exposes
2525
/// it as a Dart [AsyncImporter].
26-
class NodeToDartAsyncFileImporter extends AsyncImporter {
26+
class JSToDartAsyncFileImporter extends AsyncImporter {
2727
/// The wrapped `findFileUrl` function.
2828
final Object? Function(String, CanonicalizeOptions) _findFileUrl;
2929

30-
NodeToDartAsyncFileImporter(this._findFileUrl);
30+
JSToDartAsyncFileImporter(this._findFileUrl);
3131

3232
FutureOr<Uri?> canonicalize(Uri url) async {
3333
if (url.scheme == 'file') return _filesystemImporter.canonicalize(url);

lib/src/importer/node_to_dart/file.dart renamed to lib/src/importer/js_to_dart/file.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
import 'package:node_interop/js.dart';
66

77
import '../../importer.dart';
8-
import '../../node/importer.dart';
9-
import '../../node/url.dart';
10-
import '../../node/utils.dart';
8+
import '../../js/importer.dart';
9+
import '../../js/url.dart';
10+
import '../../js/utils.dart';
1111
import '../utils.dart';
1212

1313
/// A filesystem importer to use for most implementation details of
14-
/// [NodeToDartAsyncFileImporter].
14+
/// [JSToDartAsyncFileImporter].
1515
///
1616
/// This allows us to avoid duplicating logic between the two importers.
1717
final _filesystemImporter = FilesystemImporter('.');
1818

1919
/// A wrapper for a potentially-asynchronous JS API file importer that exposes
2020
/// it as a Dart [AsyncImporter].
21-
class NodeToDartFileImporter extends Importer {
21+
class JSToDartFileImporter extends Importer {
2222
/// The wrapped `findFileUrl` function.
2323
final Object? Function(String, CanonicalizeOptions) _findFileUrl;
2424

25-
NodeToDartFileImporter(this._findFileUrl);
25+
JSToDartFileImporter(this._findFileUrl);
2626

2727
Uri? canonicalize(Uri url) {
2828
if (url.scheme == 'file') return _filesystemImporter.canonicalize(url);

lib/src/importer/node_to_dart/sync.dart renamed to lib/src/importer/js_to_dart/sync.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
import 'package:node_interop/js.dart';
66

77
import '../../importer.dart';
8-
import '../../node/importer.dart';
9-
import '../../node/url.dart';
10-
import '../../node/utils.dart';
8+
import '../../js/importer.dart';
9+
import '../../js/url.dart';
10+
import '../../js/utils.dart';
1111
import '../../util/nullable.dart';
1212

1313
/// A wrapper for a synchronous JS API importer that exposes it as a Dart
1414
/// [Importer].
15-
class NodeToDartImporter extends Importer {
15+
class JSToDartImporter extends Importer {
1616
/// The wrapped canonicalize function.
1717
final Object? Function(String, CanonicalizeOptions) _canonicalize;
1818

1919
/// The wrapped load function.
2020
final Object? Function(JSUrl) _load;
2121

22-
NodeToDartImporter(this._canonicalize, this._load);
22+
JSToDartImporter(this._canonicalize, this._load);
2323

2424
Uri? canonicalize(Uri url) {
2525
var result = _canonicalize(

lib/src/importer/legacy_node/implementation.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import 'package:path/path.dart' as p;
99
import 'package:tuple/tuple.dart';
1010

1111
import '../../io.dart';
12-
import '../../node/function.dart';
13-
import '../../node/legacy/importer_result.dart';
14-
import '../../node/legacy/render_context.dart';
15-
import '../../node/utils.dart';
12+
import '../../js/function.dart';
13+
import '../../js/legacy/importer_result.dart';
14+
import '../../js/legacy/render_context.dart';
15+
import '../../js/utils.dart';
1616
import '../../util/nullable.dart';
1717
import '../utils.dart';
1818

lib/src/io.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import 'package:path/path.dart' as p;
66

77
import 'io/interface.dart'
88
if (dart.library.io) 'io/vm.dart'
9-
if (dart.library.js) 'io/node.dart';
9+
if (dart.library.js) 'io/js.dart';
1010
import 'utils.dart';
1111
import 'util/character.dart';
1212

1313
export 'io/interface.dart'
1414
if (dart.library.io) 'io/vm.dart'
15-
if (dart.library.js) 'io/node.dart';
15+
if (dart.library.js) 'io/js.dart';
1616

1717
/// A cache of return values for directories in [_realCasePath].
1818
final _realCaseCache = <String, String>{};

lib/src/io/node.dart renamed to lib/src/io/js.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'package:source_span/source_span.dart';
1414
import 'package:watcher/watcher.dart';
1515

1616
import '../exception.dart';
17-
import '../node/chokidar.dart';
17+
import '../js/chokidar.dart';
1818

1919
@JS('process')
2020
external final Process? process; // process is null in the browser

lib/src/node.dart renamed to lib/src/js.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
44

5-
import 'node/exception.dart';
6-
import 'node/exports.dart';
7-
import 'node/compile.dart';
8-
import 'node/legacy.dart';
9-
import 'node/legacy/types.dart';
10-
import 'node/legacy/value.dart';
11-
import 'node/logger.dart';
12-
import 'node/source_span.dart';
13-
import 'node/utils.dart';
14-
import 'node/value.dart';
5+
import 'js/exception.dart';
6+
import 'js/exports.dart';
7+
import 'js/compile.dart';
8+
import 'js/legacy.dart';
9+
import 'js/legacy/types.dart';
10+
import 'js/legacy/value.dart';
11+
import 'js/logger.dart';
12+
import 'js/source_span.dart';
13+
import 'js/utils.dart';
14+
import 'js/value.dart';
1515
import 'value.dart';
1616

17-
/// The entrypoint for the Node.js module.
17+
/// The entrypoint for the JavaScript module.
1818
///
1919
/// This sets up exports that can be called from JS.
2020
void main() {
@@ -41,7 +41,7 @@ void main() {
4141
exports.sassFalse = sassFalse;
4242
exports.Exception = exceptionClass;
4343
exports.Logger = LoggerNamespace(
44-
silent: NodeLogger(
44+
silent: JSLogger(
4545
warn: allowInteropNamed('sass.Logger.silent.warn', (_, __) {}),
4646
debug: allowInteropNamed('sass.Logger.silent.debug', (_, __) {})));
4747

0 commit comments

Comments
 (0)