bare-module 7.5.0 → 7.5.1

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/lib/loader.js CHANGED
@@ -2,6 +2,7 @@ const Semaphore = require('promaphore')
2
2
  const traverse = require('bare-module-traverse')
3
3
  const { startsWithWindowsDriveLetter } = require('bare-module-resolve')
4
4
  const lex = require('bare-module-lexer')
5
+ const hostParser = require('bare-host-parser')
5
6
  const { isURL, pathToFileURL } = require('bare-url')
6
7
  const { urlToPath } = require('./url')
7
8
  const ModuleProtocol = require('./protocol')
@@ -973,7 +974,7 @@ module.exports = class ModuleLoader {
973
974
  const opts = { resolutions: this._resolutions, engines: Bare.versions }
974
975
 
975
976
  if (host !== null) {
976
- opts.conditions = host.split('-')
977
+ opts.conditions = hostParser.conditions(host)
977
978
 
978
979
  if (condition === 'addon') opts.hosts = [host]
979
980
  }
package/lib/module.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const lex = require('bare-module-lexer')
2
2
  const { conditionMatches } = require('bare-module-resolve')
3
3
  const strip = require('bare-type-stripper')
4
+ const hostParser = require('bare-host-parser')
4
5
  const binding = require('../binding')
5
6
  const { urlToPath, urlToDirname } = require('./url')
6
7
  const errors = require('./errors')
@@ -9,7 +10,7 @@ const { REEXPORT, ADDON, ASSET } = lex.constants
9
10
 
10
11
  const DEFERRED_PROTOCOL = 'deferred:'
11
12
 
12
- const nativeConditions = Bare.Addon.host.split('-')
13
+ const nativeConditions = hostParser.conditions(Bare.Addon.host)
13
14
 
14
15
  const UNLINKED = 0
15
16
  const LINKED = 1
@@ -378,9 +379,9 @@ function conditionsFor(condition, host) {
378
379
  ]
379
380
  }
380
381
 
381
- if (condition === 'addon') return [[...base, ...host.split('-')]]
382
+ if (condition === 'addon') return [[...base, ...hostParser.conditions(host)]]
382
383
 
383
- return [[...base, ...nativeConditions, ...host.split('-')]]
384
+ return [[...base, ...nativeConditions, ...hostParser.conditions(host)]]
384
385
  }
385
386
 
386
387
  function pickCondition(entry, conditions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "description": "The module system that powers Bare",
5
5
  "exports": {
6
6
  "./package": "./package.json",
@@ -47,6 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "bare-bundle": "^1.11.0",
50
+ "bare-host-parser": "^1.0.0",
50
51
  "bare-module-lexer": "^1.7.0",
51
52
  "bare-module-resolve": "^1.12.6",
52
53
  "bare-module-traverse": "~2.7.0",