@matter/nodejs
Advanced tools
Comparing version 0.11.5-alpha.0-20241109-2e3dccaa9 to 0.11.5-alpha.0-20241112-858f60251
@@ -9,14 +9,16 @@ "use strict"; | ||
*/ | ||
let needCrypto = true; | ||
try { | ||
const crypto = import_general.Crypto.get(); | ||
if (crypto.mock !== true) { | ||
needCrypto = false; | ||
import_general.Boot.init(() => { | ||
let needCrypto = true; | ||
try { | ||
const crypto = import_general.Crypto.get(); | ||
if (crypto.mock !== true) { | ||
needCrypto = false; | ||
} | ||
} catch (error) { | ||
import_general.NoProviderError.accept(error); | ||
} | ||
} catch (error) { | ||
import_general.NoProviderError.accept(error); | ||
} | ||
if (needCrypto) { | ||
import_general.Crypto.get = (0, import_general.singleton)(() => new import_NodeJsCrypto.NodeJsCrypto()); | ||
} | ||
if (needCrypto) { | ||
import_general.Crypto.get = (0, import_general.singleton)(() => new import_NodeJsCrypto.NodeJsCrypto()); | ||
} | ||
}); | ||
//# sourceMappingURL=register.js.map |
@@ -9,3 +9,5 @@ "use strict"; | ||
*/ | ||
import_general.Environment.default = (0, import_NodeJsEnvironment.NodeJsEnvironment)(); | ||
import_general.Boot.init(() => { | ||
import_general.Environment.default = (0, import_NodeJsEnvironment.NodeJsEnvironment)(); | ||
}); | ||
//# sourceMappingURL=register.js.map |
@@ -9,9 +9,17 @@ "use strict"; | ||
*/ | ||
try { | ||
import_general.Network.get(); | ||
} catch (error) { | ||
import_general.NoProviderError.accept(error); | ||
import_general.Network.get = (0, import_general.singleton)(() => new import_NodeJsNetwork.NodeJsNetwork()); | ||
process.on("beforeExit", () => void import_general.Network.get().close()); | ||
} | ||
let closeNetwork; | ||
import_general.Boot.init(() => { | ||
closeNetwork?.(); | ||
try { | ||
import_general.Network.get(); | ||
} catch (error) { | ||
import_general.NoProviderError.accept(error); | ||
import_general.Network.get = (0, import_general.singleton)(() => new import_NodeJsNetwork.NodeJsNetwork()); | ||
closeNetwork = () => { | ||
void import_general.Network.get().close(); | ||
process.off("beforeExit", close); | ||
}; | ||
process.on("beforeExit", closeNetwork); | ||
} | ||
}); | ||
//# sourceMappingURL=register.js.map |
@@ -6,16 +6,18 @@ /** | ||
*/ | ||
import { Crypto, NoProviderError, singleton } from "#general"; | ||
import { Boot, Crypto, NoProviderError, singleton } from "#general"; | ||
import { NodeJsCrypto } from "./NodeJsCrypto.js"; | ||
let needCrypto = true; | ||
try { | ||
const crypto = Crypto.get(); | ||
if (crypto.mock !== true) { | ||
needCrypto = false; | ||
Boot.init(() => { | ||
let needCrypto = true; | ||
try { | ||
const crypto = Crypto.get(); | ||
if (crypto.mock !== true) { | ||
needCrypto = false; | ||
} | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
} | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
} | ||
if (needCrypto) { | ||
Crypto.get = singleton(() => new NodeJsCrypto()); | ||
} | ||
if (needCrypto) { | ||
Crypto.get = singleton(() => new NodeJsCrypto()); | ||
} | ||
}); | ||
//# sourceMappingURL=register.js.map |
@@ -6,5 +6,7 @@ /** | ||
*/ | ||
import { Environment } from "#general"; | ||
import { Boot, Environment } from "#general"; | ||
import { NodeJsEnvironment } from "./NodeJsEnvironment.js"; | ||
Environment.default = NodeJsEnvironment(); | ||
Boot.init(() => { | ||
Environment.default = NodeJsEnvironment(); | ||
}); | ||
//# sourceMappingURL=register.js.map |
@@ -6,11 +6,19 @@ /** | ||
*/ | ||
import { Network, NoProviderError, singleton } from "#general"; | ||
import { Boot, Network, NoProviderError, singleton } from "#general"; | ||
import { NodeJsNetwork } from "./NodeJsNetwork.js"; | ||
try { | ||
Network.get(); | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
Network.get = singleton(() => new NodeJsNetwork()); | ||
process.on("beforeExit", () => void Network.get().close()); | ||
} | ||
let closeNetwork; | ||
Boot.init(() => { | ||
closeNetwork?.(); | ||
try { | ||
Network.get(); | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
Network.get = singleton(() => new NodeJsNetwork()); | ||
closeNetwork = () => { | ||
void Network.get().close(); | ||
process.off("beforeExit", close); | ||
}; | ||
process.on("beforeExit", closeNetwork); | ||
} | ||
}); | ||
//# sourceMappingURL=register.js.map |
{ | ||
"name": "@matter/nodejs", | ||
"version": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"version": "0.11.5-alpha.0-20241112-858f60251", | ||
"description": "Node.js platform support for matter.js", | ||
@@ -47,14 +47,14 @@ "keywords": [ | ||
"dependencies": { | ||
"@matter/general": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/node": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/protocol": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/types": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/general": "0.11.5-alpha.0-20241112-858f60251", | ||
"@matter/node": "0.11.5-alpha.0-20241112-858f60251", | ||
"@matter/protocol": "0.11.5-alpha.0-20241112-858f60251", | ||
"@matter/types": "0.11.5-alpha.0-20241112-858f60251", | ||
"node-localstorage": "^3.0.5" | ||
}, | ||
"devDependencies": { | ||
"@matter/model": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/protocol": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/tools": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/testing": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@project-chip/matter.js": "0.11.5-alpha.0-20241109-2e3dccaa9", | ||
"@matter/model": "0.11.5-alpha.0-20241112-858f60251", | ||
"@matter/protocol": "0.11.5-alpha.0-20241112-858f60251", | ||
"@matter/tools": "0.11.5-alpha.0-20241112-858f60251", | ||
"@matter/testing": "0.11.5-alpha.0-20241112-858f60251", | ||
"@project-chip/matter.js": "0.11.5-alpha.0-20241112-858f60251", | ||
"@types/bytebuffer": "^5.0.49", | ||
@@ -61,0 +61,0 @@ "@types/node-localstorage": "^1.3.3" |
@@ -7,20 +7,22 @@ /** | ||
import { Crypto, NoProviderError, singleton } from "#general"; | ||
import { Boot, Crypto, NoProviderError, singleton } from "#general"; | ||
import { NodeJsCrypto } from "./NodeJsCrypto.js"; | ||
// Check if Crypto singleton is already registered | ||
let needCrypto = true; | ||
try { | ||
const crypto = Crypto.get(); | ||
Boot.init(() => { | ||
// Check if a Crypto singleton is already registered | ||
let needCrypto = true; | ||
try { | ||
const crypto = Crypto.get(); | ||
if ((crypto as { mock?: boolean }).mock !== true) { | ||
needCrypto = false; | ||
if ((crypto as { mock?: boolean }).mock !== true) { | ||
needCrypto = false; | ||
} | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
} | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
} | ||
// Register if necessary | ||
if (needCrypto) { | ||
Crypto.get = singleton(() => new NodeJsCrypto()); | ||
} | ||
// Register if necessary | ||
if (needCrypto) { | ||
Crypto.get = singleton(() => new NodeJsCrypto()); | ||
} | ||
}); |
@@ -7,5 +7,7 @@ /** | ||
import { Environment } from "#general"; | ||
import { Boot, Environment } from "#general"; | ||
import { NodeJsEnvironment } from "./NodeJsEnvironment.js"; | ||
Environment.default = NodeJsEnvironment(); | ||
Boot.init(() => { | ||
Environment.default = NodeJsEnvironment(); | ||
}); |
@@ -7,15 +7,26 @@ /** | ||
import { Network, NoProviderError, singleton } from "#general"; | ||
import { Boot, Network, NoProviderError, singleton } from "#general"; | ||
import { NodeJsNetwork } from "./NodeJsNetwork.js"; | ||
// Check if Network singleton is already registered and auto register if not | ||
try { | ||
Network.get(); | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
let closeNetwork: undefined | (() => void); | ||
Network.get = singleton(() => new NodeJsNetwork()); | ||
Boot.init(() => { | ||
closeNetwork?.(); | ||
// Ensure network gets cleaned up on exit | ||
process.on("beforeExit", () => void Network.get().close()); | ||
} | ||
// Check if Network singleton is already registered and auto register if not | ||
try { | ||
Network.get(); | ||
} catch (error) { | ||
NoProviderError.accept(error); | ||
Network.get = singleton(() => new NodeJsNetwork()); | ||
closeNetwork = () => { | ||
void Network.get().close(); | ||
process.off("beforeExit", close); | ||
}; | ||
// Ensure network gets cleaned up on exit | ||
process.on("beforeExit", closeNetwork); | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
295321
5634
+ Added@matter/general@0.11.5-alpha.0-20241112-858f60251(transitive)
+ Added@matter/model@0.11.5-alpha.0-20241112-858f60251(transitive)
+ Added@matter/node@0.11.5-alpha.0-20241112-858f60251(transitive)
+ Added@matter/protocol@0.11.5-alpha.0-20241112-858f60251(transitive)
+ Added@matter/types@0.11.5-alpha.0-20241112-858f60251(transitive)
- Removed@matter/general@0.11.5-alpha.0-20241109-2e3dccaa9(transitive)
- Removed@matter/model@0.11.5-alpha.0-20241109-2e3dccaa9(transitive)
- Removed@matter/node@0.11.5-alpha.0-20241109-2e3dccaa9(transitive)
- Removed@matter/protocol@0.11.5-alpha.0-20241109-2e3dccaa9(transitive)
- Removed@matter/types@0.11.5-alpha.0-20241109-2e3dccaa9(transitive)