Force registration to be re-created
Removing YAML support makes current registration files invalid, and seed.js will prompt to set up a new one. This is good, because old ones are incompatible and new ones had to be set up anyway.
This commit is contained in:
parent
6a15f4fc0f
commit
76caaa1468
3 changed files with 3 additions and 30 deletions
17
package-lock.json
generated
17
package-lock.json
generated
|
@ -27,7 +27,6 @@
|
||||||
"get-stream": "^6.0.1",
|
"get-stream": "^6.0.1",
|
||||||
"h3": "^1.12.0",
|
"h3": "^1.12.0",
|
||||||
"heatsync": "^2.5.3",
|
"heatsync": "^2.5.3",
|
||||||
"js-yaml": "^4.1.0",
|
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"prettier-bytes": "^1.0.4",
|
"prettier-bytes": "^1.0.4",
|
||||||
|
@ -1017,11 +1016,6 @@
|
||||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/argparse": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
|
||||||
},
|
|
||||||
"node_modules/as-table": {
|
"node_modules/as-table": {
|
||||||
"version": "1.0.55",
|
"version": "1.0.55",
|
||||||
"resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz",
|
"resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz",
|
||||||
|
@ -1931,17 +1925,6 @@
|
||||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
|
||||||
"version": "4.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
|
||||||
"dependencies": {
|
|
||||||
"argparse": "^2.0.1"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"js-yaml": "bin/js-yaml.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/just-kebab-case": {
|
"node_modules/just-kebab-case": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/just-kebab-case/-/just-kebab-case-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/just-kebab-case/-/just-kebab-case-4.2.0.tgz",
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
"get-stream": "^6.0.1",
|
"get-stream": "^6.0.1",
|
||||||
"h3": "^1.12.0",
|
"h3": "^1.12.0",
|
||||||
"heatsync": "^2.5.3",
|
"heatsync": "^2.5.3",
|
||||||
"js-yaml": "^4.1.0",
|
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"prettier-bytes": "^1.0.4",
|
"prettier-bytes": "^1.0.4",
|
||||||
|
|
|
@ -4,7 +4,6 @@ const fs = require("fs")
|
||||||
const crypto = require("crypto")
|
const crypto = require("crypto")
|
||||||
const assert = require("assert").strict
|
const assert = require("assert").strict
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
const yaml = require("js-yaml")
|
|
||||||
|
|
||||||
const registrationFilePath = path.join(process.cwd(), "registration.yaml")
|
const registrationFilePath = path.join(process.cwd(), "registration.yaml")
|
||||||
|
|
||||||
|
@ -60,18 +59,10 @@ function getTemplateRegistration() {
|
||||||
function readRegistration() {
|
function readRegistration() {
|
||||||
/** @type {import("../types").AppServiceRegistrationConfig} */ // @ts-ignore
|
/** @type {import("../types").AppServiceRegistrationConfig} */ // @ts-ignore
|
||||||
let result = null
|
let result = null
|
||||||
if (fs.existsSync(registrationFilePath)) {
|
try {
|
||||||
const content = fs.readFileSync(registrationFilePath, "utf8")
|
const content = fs.readFileSync(registrationFilePath, "utf8")
|
||||||
if (content.startsWith("{")) { // Use JSON parser
|
result = JSON.parse(content)
|
||||||
result = JSON.parse(content)
|
} catch (e) {}
|
||||||
checkRegistration(result)
|
|
||||||
} else { // Use YAML parser
|
|
||||||
result = yaml.load(content)
|
|
||||||
checkRegistration(result)
|
|
||||||
// Convert to JSON
|
|
||||||
writeRegistration(result)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue