bare-module-traverse 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -21,6 +21,9 @@ type AliasableExtension =
21
21
  | '.js'
22
22
  | '.cjs'
23
23
  | '.mjs'
24
+ | '.ts'
25
+ | '.cts'
26
+ | '.mts'
24
27
  | '.json'
25
28
  | '.bundle'
26
29
  | '.bare'
package/index.js CHANGED
@@ -220,7 +220,8 @@ exports.module = function* (url, source, attributes, artifacts, visited, opts =
220
220
  if (aliases !== null && extension in aliases) extension = aliases[extension]
221
221
 
222
222
  switch (extension) {
223
- case '.js': {
223
+ case '.js':
224
+ case '.ts': {
224
225
  const isESM =
225
226
  defaultType === constants.MODULE || (info !== null && info.type === 'module')
226
227
 
@@ -228,9 +229,11 @@ exports.module = function* (url, source, attributes, artifacts, visited, opts =
228
229
  break
229
230
  }
230
231
  case '.cjs':
232
+ case '.cts':
231
233
  type = constants.SCRIPT
232
234
  break
233
235
  case '.mjs':
236
+ case '.mts':
234
237
  type = constants.MODULE
235
238
  break
236
239
  case '.json':
@@ -24,7 +24,7 @@ module.exports = function (entry, parentURL, opts = {}) {
24
24
  if (entry.type & lex.constants.ASSET) {
25
25
  conditions = conditions.map((conditions) => ['asset', ...conditions])
26
26
  } else {
27
- extensions = ['.js', '.cjs', '.mjs', '.json', '.bare', '.node']
27
+ extensions = ['.js', '.cjs', '.mjs', '.ts', '.cts', '.mts', '.json', '.bare', '.node']
28
28
 
29
29
  if (entry.type & lex.constants.REQUIRE) {
30
30
  conditions = conditions.map((conditions) => ['require', ...conditions])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module-traverse",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "Low-level module graph traversal for Bare",
5
5
  "exports": {
6
6
  ".": {
@@ -55,7 +55,7 @@
55
55
  "homepage": "https://github.com/holepunchto/bare-module-traverse#readme",
56
56
  "dependencies": {
57
57
  "bare-addon-resolve": "^1.5.0",
58
- "bare-module-lexer": "^1.4.0",
58
+ "bare-module-lexer": "^1.6.0",
59
59
  "bare-module-resolve": "^1.7.0"
60
60
  },
61
61
  "devDependencies": {