This commit is contained in:
mike12345567 2021-01-27 18:09:32 +00:00
parent 48dc9f9533
commit c04dd20805
2 changed files with 32 additions and 29 deletions

View File

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

View File

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