Skip to content

Commit

Permalink
feat: support for Deno, Biome, and Taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarrio committed Aug 26, 2024
1 parent bc42d3f commit ba50040
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 135 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export TF_VAR_r2_api_token=deadbeef
export TF_VAR_r2_api_token=deadbeef
export TF_VAR_cf_account_id=deadbeef
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"arrterian.nix-env-selector"
]
}
"recommendations": ["arrterian.nix-env-selector"]
}
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"nixEnvSelector.nixFile": "${workspaceFolder}/shell.nix"
}
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix",
"cSpell.words": ["deno", "terragrunt"],
"deno.enable": true
}
44 changes: 44 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://taskfile.dev

version: '3'

vars:
TF_VAR_: Hello, World!

tasks:
init:secrets:
dir: "scripts/"
cmds:
- onboard_secrets.sh

init:terragrunt:
dir: "infrastructure/"
cmds:
- terragrunt init

validate:
dir: "infrastructure/"
cmds:
- terragrunt validate

upgrade-providers:
dir: "infrastructure/"
cmds:
- terragrunt init -upgrade
- terragrunt providers lock -platform=darwin_amd64 -platform=linux_amd64 -platform=darwin_arm64 -platform=linux_arm64

plan:
dir: "infrastructure/"
cmds:
- task: init
- terragrunt plan {{.CLI_ARGS}}

show:
dir: "infrastructure/"
cmds:
- terragrunt show {{.CLI_ARGS}}

apply:
dir: "infrastructure/"
cmds:
- terragrunt apply {{.CLI_ARGS}}
16 changes: 16 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"ignore": [".direnv"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
},
"ignore": [".direnv"]
}
}
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
default = pkgs.mkShell {
packages = with pkgs; [
# General dev tools
biome
deno
git
go-task

# NodeJS development
nodejs_18
Expand All @@ -24,6 +27,9 @@
opentofu
cf-terraforming

# secrets management
age

(pkgs.writeShellScriptBin
"cftofu"
"cf-terraforming --terraform-binary-path ${pkgs.opentofu}/bin/tofu -t $TF_VAR_r2_api_token $@"
Expand Down
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"name": "@org/repository",
"version": "1.0.0",
"description": "Monorepository for the node-nix-template",
"main": "index.js",
"repository": "https://github.com/tcarrio/node-nix-template",
"author": "",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"@types/node": "^20.12.12",
"ts-node": "^10.9.2"
}
"name": "@org/repository",
"version": "1.0.0",
"description": "Monorepository for the node-nix-template",
"main": "index.js",
"repository": "https://github.com/tcarrio/node-nix-template",
"author": "",
"license": "MIT",
"private": true,
"workspaces": ["packages/*"],
"devDependencies": {
"@types/node": "^20.12.12",
"ts-node": "^10.9.2"
}
}
20 changes: 9 additions & 11 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@org/example",
"version": "1.0.0",
"description": "Example package in @org",
"main": "index.js",
"author": "",
"license": "MIT",
"private": true,
"dependencies": {
},
"devDependencies": {
}
"name": "@org/example",
"version": "1.0.0",
"description": "Example package in @org",
"main": "index.js",
"author": "",
"license": "MIT",
"private": true,
"dependencies": {},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion packages/example/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {};
export {};
4 changes: 2 additions & 2 deletions packages/example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "../../tsconfig.json"
}
"extends": "../../tsconfig.json"
}
10 changes: 10 additions & 0 deletions scripts/onboard_secrets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env deno

import { parse } from "https://deno.land/[email protected]/flags/mod.ts";

const flags = parse(Deno.args, {
boolean: ["help", "save"],
string: ["name", "color"],
alias: { help: "h" },
default: { color: "blue" },
});
198 changes: 99 additions & 99 deletions tsconfig.json

Large diffs are not rendered by default.

0 comments on commit ba50040

Please sign in to comment.