1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00
This commit is contained in:
mike12345567 2021-01-27 18:09:32 +00:00
parent 56c7f8094c
commit b7e7dbba65
2 changed files with 32 additions and 29 deletions

View file

@ -34,15 +34,17 @@
}))
return [...acc, ...viewsArr]
}, [])
$: queries = $backendUiStore.queries.filter(query => query.queryVerb === "read").map(query => ({
label: query.name,
name: query.name,
tableId: query._id,
...query,
schema: query.schema,
parameters: query.parameters,
type: "query",
}))
$: queries = $backendUiStore.queries
.filter(query => query.queryVerb === "read")
.map(query => ({
label: query.name,
name: query.name,
tableId: query._id,
...query,
schema: query.schema,
parameters: query.parameters,
type: "query",
}))
$: bindableProperties = getBindableProperties(
$currentAsset.props,
$store.selectedComponentId

View file

@ -10,14 +10,7 @@ const FILENAME = "../manifest.json"
* https://github.com/helpers/handlebars-helpers
*/
const COLLECTIONS = [
"math",
"array",
"number",
"url",
"string",
"comparison",
]
const COLLECTIONS = ["math", "array", "number", "url", "string", "comparison"]
const outputJSON = {}
@ -59,7 +52,8 @@ function getCommentInfo(file, func) {
// from here work back until we have the comment
if (lookForward(lines, funcLines, idx)) {
let fromIdx = idx
let start = 0, end = 0
let start = 0,
end = 0
do {
if (lines[fromIdx].includes("*/")) {
end = fromIdx
@ -96,7 +90,10 @@ function getCommentInfo(file, func) {
function run() {
const foundNames = []
for (let collection of COLLECTIONS) {
const collectionFile = fs.readFileSync(`../node_modules/handlebars-helpers/lib/${collection}.js`, "utf8")
const collectionFile = fs.readFileSync(
`../node_modules/handlebars-helpers/lib/${collection}.js`,
"utf8"
)
const collectionInfo = {}
// collect information about helper
let hbsHelperInfo = helpers[collection]()
@ -115,7 +112,14 @@ function run() {
const jsDocInfo = getCommentInfo(collectionFile, fnc)
let args = jsDocInfo.tags
.filter(tag => tag.title === "param")
.map(tag => tag.description && tag.description.replace(/`/g, "").split(" ")[0].trim())
.map(
tag =>
tag.description &&
tag.description
.replace(/`/g, "")
.split(" ")[0]
.trim()
)
collectionInfo[name] = fixSpecialCases(name, {
args,
numArgs: args.length,
@ -127,17 +131,14 @@ function run() {
}
// add the date helper
outputJSON["date"] = {
"date": {
args: [
"datetime",
"format"
],
date: {
args: ["datetime", "format"],
numArgs: 2,
example: "{{date now \"YYYY\"}}",
description: "Format a date using moment.js data formatting."
}
example: '{{date now "YYYY"}}',
description: "Format a date using moment.js data formatting.",
},
}
fs.writeFileSync(FILENAME, JSON.stringify(outputJSON, null, 2))
}
run()
run()