Replace toml config with a javascript file

This commit is contained in:
2021-04-02 18:12:13 +02:00
parent 6e1e82c2c5
commit 6446303277
22 changed files with 265 additions and 180 deletions
@@ -1,5 +1,11 @@
{
"resources":{
"includes":[{"pattern":"\\QMETA-INF/services/org.slf4j.spi.SLF4JServiceProvider\\E"}]},
"bundles":[]
"resources": {
"includes": [
{"pattern": "\\QMETA-INF/services/org.slf4j.spi.SLF4JServiceProvider\\E"},
{"pattern": "\\Qinit/index.d.ts\\E"},
{"pattern": "\\Qinit/index.js\\E"},
{"pattern": "\\Qinit/README.md\\E"}
]
},
"bundles": []
}
+1
View File
@@ -0,0 +1 @@
# {{ name }}
+46
View File
@@ -0,0 +1,46 @@
/**
* Print a message to the console
*
* @param message
*/
declare function echo(message: string): void
/**
* Prompt a user for text input
*
* @param text - The text to display for the prompt
* @param def - A default value
*/
declare function prompt(text: string, def?: string): string
/**
* Prompt a user for text input
*
* @param text - The text to display for the prompt
* @param def - A default value
*/
declare function promptBoolean(text: string, def?: boolean): boolean
/**
* Renders a template
*
* @param name - The template name
* @param context - The template context
*/
declare function render(name: string, context: any): string
/**
* Write a string to a file
*
* @param input - The content of the file
* @param output - The output path
*/
declare function write(input: string, output: string): void
/**
* Copy a file
*
* @param input - The input path
* @param output - The output path
*/
declare function copy(input: string, output: string): void
+7
View File
@@ -0,0 +1,7 @@
echo("Example")
const name = prompt("Project name")
const ctx = {name: name}
write(render("README.md", ctx), "README.md")