init - add project files
This commit is contained in:
27
.vscode/launch.json
vendored
Normal file
27
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug Metaprogram",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/cmd/metagen",
|
||||
"args": ["--env=dev", "build"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
"name": "Debug HTTP Server",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/cmd/server",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"preLaunchTask": "Metagen: Build"
|
||||
}
|
||||
]
|
||||
}
|
||||
30
.vscode/page.code-snippets
vendored
Normal file
30
.vscode/page.code-snippets
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"page": {
|
||||
"prefix": "page",
|
||||
"body": [
|
||||
"package ${1:packagename}",
|
||||
"",
|
||||
"import (",
|
||||
" . \"maragu.dev/gomponents\"",
|
||||
" . \"maragu.dev/gomponents/html\"",
|
||||
" \"net/http\"",
|
||||
" \"maxwarden/middleware\"",
|
||||
" . \"maxwarden/handlers/app\"",
|
||||
")",
|
||||
"",
|
||||
"// @Identity",
|
||||
"// @Protected",
|
||||
"// @CookieSession",
|
||||
"func ${2:Name}Page(w http.ResponseWriter, r *http.Request) {",
|
||||
" identity := middleware.GetIdentity(r)",
|
||||
" func() Node {",
|
||||
" return AppLayout(\"Another Page\", *identity,",
|
||||
" P(Text(\"This is another test page\")),",
|
||||
" )",
|
||||
" }().Render(w)",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Page with middleware and a basic view."
|
||||
}
|
||||
}
|
||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"*.page": "go",
|
||||
"*.component": "go"
|
||||
}
|
||||
}
|
||||
51
.vscode/tasks.json
vendored
Normal file
51
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"type": "shell",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Metagen: Build",
|
||||
"command": "go",
|
||||
"args": ["run", "./cmd/metagen", "--env=dev", "build"],
|
||||
"group": "build",
|
||||
},
|
||||
{
|
||||
"label": "Metagen: Migrate Up",
|
||||
"command": "go",
|
||||
"args": ["run", "./cmd/metagen", "--env=dev", "migrate", "up"],
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "Metagen: Migrate Down",
|
||||
"command": "go",
|
||||
"args": ["run", "./cmd/metagen", "--env=dev", "migrate", "down"],
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "Metagen: Migrate Goto",
|
||||
"command": "go",
|
||||
"args": ["run", "./cmd/metagen", "--env=dev", "migrate", "goto", "${input:migration-number-goto}"],
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "Metagen: Migrate Create",
|
||||
"command": "go",
|
||||
"args": ["run", "./cmd/metagen", "--env=dev", "migrate", "create", "${input:migration-name}"],
|
||||
"group": "build"
|
||||
},
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"id": "migration-name",
|
||||
"description": "Enter Migration Name:",
|
||||
"default": "",
|
||||
"type": "promptString"
|
||||
},
|
||||
{
|
||||
"id": "migration-number-goto",
|
||||
"description": "Enter migration number to apply up to:",
|
||||
"default": "",
|
||||
"type": "promptString"
|
||||
},
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user