@zwave-js/config 14.2.0 → 14.3.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/build/cjs/_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "14.
|
|
1
|
+
export declare const PACKAGE_VERSION = "14.3.0";
|
|
2
2
|
//# sourceMappingURL=_version.d.ts.map
|
package/build/cjs/_version.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
PACKAGE_VERSION: () => PACKAGE_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const PACKAGE_VERSION = "14.
|
|
24
|
+
const PACKAGE_VERSION = "14.3.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
PACKAGE_VERSION
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/_version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"14.
|
|
4
|
+
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"14.3.0\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;AACO,MAAM,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/cjs/utils.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils.ts", "../../../../node_modules/.store/@alcalzone-esm2cjs-npm-1.
|
|
3
|
+
"sources": ["../../src/utils.ts", "../../../../node_modules/.store/@alcalzone-esm2cjs-npm-1.4.0-48b35052c6/package/shims/import.meta.url/shim.js"],
|
|
4
4
|
"sourcesContent": ["import { copyFilesRecursive, formatId, padVersion } from \"@zwave-js/shared\";\nimport fs from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport semverGte from \"semver/functions/gte.js\";\nimport semverInc from \"semver/functions/inc.js\";\nimport semverLte from \"semver/functions/lte.js\";\nimport semverSatisfies from \"semver/functions/satisfies.js\";\nimport semverValid from \"semver/functions/valid.js\";\nimport type { ConfigLogger } from \"./Logger.js\";\nimport { PACKAGE_VERSION } from \"./_version.js\";\nimport type { DeviceConfigIndexEntry } from \"./devices/DeviceConfig.js\";\n\nconst require = createRequire(import.meta.url);\n\n/** The absolute path of the embedded configuration directory */\nexport const configDir = path.resolve(\n\tpath.dirname(require.resolve(\"@zwave-js/config/package.json\")),\n\t\"config\",\n);\n\n/** The (optional) absolute path of an external configuration directory */\nexport function getExternalConfigDirEnvVariable(): string | undefined {\n\treturn process.env.ZWAVEJS_EXTERNAL_CONFIG;\n}\n\nexport function getDeviceEntryPredicate(\n\tmanufacturerId: number,\n\tproductType: number,\n\tproductId: number,\n\tfirmwareVersion?: string,\n): (entry: DeviceConfigIndexEntry) => boolean {\n\treturn (entry) => {\n\t\tif (entry.manufacturerId !== formatId(manufacturerId)) return false;\n\t\tif (entry.productType !== formatId(productType)) return false;\n\t\tif (entry.productId !== formatId(productId)) return false;\n\t\tif (firmwareVersion != undefined) {\n\t\t\t// A firmware version was given, only look at files with a matching firmware version\n\t\t\treturn (\n\t\t\t\tsemverLte(\n\t\t\t\t\tpadVersion(entry.firmwareVersion.min),\n\t\t\t\t\tpadVersion(firmwareVersion),\n\t\t\t\t)\n\t\t\t\t&& semverGte(\n\t\t\t\t\tpadVersion(entry.firmwareVersion.max),\n\t\t\t\t\tpadVersion(firmwareVersion),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t};\n}\n\nexport type SyncExternalConfigDirResult =\n\t| {\n\t\tsuccess: false;\n\t}\n\t| {\n\t\tsuccess: true;\n\t\tversion: string;\n\t};\n\n/**\n * Synchronizes or updates the external config directory and returns whether the directory is in a state that can be used\n */\nexport async function syncExternalConfigDir(\n\textConfigDir: string,\n\tlogger: ConfigLogger,\n): Promise<SyncExternalConfigDirResult> {\n\tif (!extConfigDir) return { success: false };\n\n\t// Make sure the config dir exists\n\ttry {\n\t\tawait fs.mkdir(extConfigDir, { recursive: true });\n\t} catch {\n\t\tlogger.print(\n\t\t\t`Synchronizing external config dir failed - directory could not be created`,\n\t\t\t\"error\",\n\t\t);\n\t\treturn { success: false };\n\t}\n\n\tconst externalVersionFilename = path.join(extConfigDir, \"version\");\n\tconst currentVersion = PACKAGE_VERSION;\n\tconst supportedRange = `>=${currentVersion} <${\n\t\tsemverInc(\n\t\t\tcurrentVersion,\n\t\t\t\"patch\",\n\t\t)\n\t}`;\n\n\t// We remember the config version that was copied there in a file called \"version\"\n\t// If that either...\n\t// ...isn't there,\n\t// ...can't be read,\n\t// ...doesn't contain a matching version (>= current && nightly)\n\t// wipe the external config dir and recreate it\n\tlet wipe = false;\n\tlet externalVersion: string | undefined;\n\ttry {\n\t\texternalVersion = await fs.readFile(externalVersionFilename, \"utf8\");\n\t\tif (!semverValid(externalVersion)) {\n\t\t\twipe = true;\n\t\t} else if (\n\t\t\t!semverSatisfies(externalVersion, supportedRange, {\n\t\t\t\tincludePrerelease: true,\n\t\t\t})\n\t\t) {\n\t\t\twipe = true;\n\t\t}\n\t} catch {\n\t\twipe = true;\n\t}\n\n\t// Nothing to wipe, the external dir is good to go\n\tif (!wipe) return { success: true, version: externalVersion! };\n\n\t// Wipe and override the external dir\n\ttry {\n\t\tlogger.print(`Synchronizing external config dir ${extConfigDir}...`);\n\t\tawait fs.rm(extConfigDir, { recursive: true, force: true });\n\t\tawait fs.mkdir(extConfigDir, { recursive: true });\n\t\tawait copyFilesRecursive(\n\t\t\tconfigDir,\n\t\t\textConfigDir,\n\t\t\t(src) => src.endsWith(\".json\"),\n\t\t);\n\t\tawait fs.writeFile(externalVersionFilename, currentVersion, \"utf8\");\n\t\texternalVersion = currentVersion;\n\t} catch {\n\t\t// Something went wrong\n\t\tlogger.print(\n\t\t\t`Synchronizing external config dir failed - using embedded config`,\n\t\t\t\"error\",\n\t\t);\n\t\treturn { success: false };\n\t}\n\n\treturn { success: true, version: externalVersion };\n}\n\nexport function versionInRange(\n\tversion: string,\n\tmin: string,\n\tmax: string,\n): boolean {\n\treturn (\n\t\tsemverGte(padVersion(version), padVersion(min))\n\t\t&& semverLte(padVersion(version), padVersion(max))\n\t);\n}\n", "export const __import_meta_url =\n typeof document === 'undefined' ? new (require('url'.replace('', '')).URL)('file:' + __filename).href :\n (document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href)\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACAO,IAAM,oBACX,OAAO,aAAa,cAAc,KAAK,QAAQ,MAAM,QAAQ,IAAI,EAAE,CAAC,GAAE,IAAK,UAAU,UAAU,EAAE,OAC9F,SAAS,iBAAiB,SAAS,cAAc,OAAO,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;ADFlG,oBAAyD;AACzD,sBAAe;AACf,yBAA8B;AAC9B,uBAAiB;AACjB,iBAAsB;AACtB,iBAAsB;AACtB,iBAAsB;AACtB,uBAA4B;AAC5B,mBAAwB;AAExB,qBAAgC;AAGhC,MAAMA,eAAU,kCAAc,iBAAe;AAGtC,MAAM,YAAY,iBAAAC,QAAK,QAC7B,iBAAAA,QAAK,QAAQD,SAAQ,QAAQ,+BAA+B,CAAC,GAC7D,QAAQ;AAIH,SAAU,kCAA+B;AAC9C,SAAO,QAAQ,IAAI;AACpB;AAEM,SAAU,wBACf,gBACA,aACA,WACA,iBAAwB;AAExB,SAAO,CAAC,UAAS;AAChB,QAAI,MAAM,uBAAmB,wBAAS,cAAc;AAAG,aAAO;AAC9D,QAAI,MAAM,oBAAgB,wBAAS,WAAW;AAAG,aAAO;AACxD,QAAI,MAAM,kBAAc,wBAAS,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AM;AAClE,sBAAkB;EACnB,QAAQ;AAEP,WAAO,MACN,oEACA,OAAO;AAER,WAAO,EAAE,SAAS,MAAK;EACxB;AAEA,SAAO,EAAE,SAAS,MAAM,SAAS,gBAAe;AACjD;AAEM,SAAU,eACf,SACA,KACA,KAAW;AAEX,aACC,WAAAD,aAAU,0BAAW,OAAO,OAAG,0BAAW,GAAG,CAAC,SAC3C,WAAAD,aAAU,0BAAW,OAAO,OAAG,0BAAW,GAAG,CAAC;AAEnD;",
|
|
6
6
|
"names": ["require", "path", "semverLte", "semverGte", "fs", "semverInc", "semverValid", "semverSatisfies"]
|
package/build/esm/_version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "14.
|
|
1
|
+
export declare const PACKAGE_VERSION = "14.3.0";
|
|
2
2
|
//# sourceMappingURL=_version.d.ts.map
|
package/build/esm/_version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwave-js/config",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.0",
|
|
4
4
|
"description": "zwave-js: configuration files",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"test:dirty": "tsx ../maintenance/src/resolveDirtyTests.ts --run"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@zwave-js/core": "14.
|
|
62
|
-
"@zwave-js/shared": "14.
|
|
61
|
+
"@zwave-js/core": "14.3.0",
|
|
62
|
+
"@zwave-js/shared": "14.3.0",
|
|
63
63
|
"alcalzone-shared": "^5.0.0",
|
|
64
64
|
"ansi-colors": "^4.1.3",
|
|
65
65
|
"json-logic-js": "^2.0.5",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"winston": "^3.15.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@alcalzone/esm2cjs": "^1.
|
|
71
|
+
"@alcalzone/esm2cjs": "^1.4.0",
|
|
72
72
|
"@microsoft/api-extractor": "^7.47.9",
|
|
73
73
|
"@types/js-levenshtein": "^1.1.3",
|
|
74
74
|
"@types/json-logic-js": "^2.0.7",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@types/sinon": "^17.0.3",
|
|
79
79
|
"@types/xml2js": "^0.4.14",
|
|
80
80
|
"@types/yargs": "^17.0.33",
|
|
81
|
-
"@zwave-js/maintenance": "14.
|
|
81
|
+
"@zwave-js/maintenance": "14.3.0",
|
|
82
82
|
"comment-json": "^4.2.5",
|
|
83
83
|
"del-cli": "^6.0.0",
|
|
84
84
|
"es-main": "^1.3.0",
|