specweave 0.22.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +211 -0
- package/README.md +5 -5
- package/bin/specweave.js +5 -8
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/CodeValidator.js +1 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +10 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client-v2.js +26 -0
- package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +7 -0
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.d.ts +1 -0
- package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-to-profiles.js +12 -1
- package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -1
- package/dist/src/cli/commands/next-command.d.ts +52 -0
- package/dist/src/cli/commands/next-command.d.ts.map +1 -0
- package/dist/src/cli/commands/next-command.js +204 -0
- package/dist/src/cli/commands/next-command.js.map +1 -0
- package/dist/src/cli/commands/sync-specs.d.ts +16 -0
- package/dist/src/cli/commands/sync-specs.d.ts.map +1 -0
- package/dist/src/cli/commands/sync-specs.js +130 -0
- package/dist/src/cli/commands/sync-specs.js.map +1 -0
- package/dist/src/cli/count-tasks.d.ts +20 -0
- package/dist/src/cli/count-tasks.d.ts.map +1 -0
- package/dist/src/cli/count-tasks.js +50 -0
- package/dist/src/cli/count-tasks.js.map +1 -0
- package/dist/src/config/ConfigManager.d.ts.map +1 -1
- package/dist/src/config/ConfigManager.js +2 -1
- package/dist/src/config/ConfigManager.js.map +1 -1
- package/dist/src/config/types.d.ts +50 -50
- package/dist/src/core/cicd/state-manager.d.ts +8 -0
- package/dist/src/core/cicd/state-manager.d.ts.map +1 -1
- package/dist/src/core/cicd/state-manager.js +60 -15
- package/dist/src/core/cicd/state-manager.js.map +1 -1
- package/dist/src/core/cost-tracker.d.ts.map +1 -1
- package/dist/src/core/cost-tracker.js +2 -1
- package/dist/src/core/cost-tracker.js.map +1 -1
- package/dist/src/core/iac/template-engine.d.ts.map +1 -1
- package/dist/src/core/iac/template-engine.js +28 -0
- package/dist/src/core/iac/template-engine.js.map +1 -1
- package/dist/src/core/iac/template-generator.d.ts +53 -0
- package/dist/src/core/iac/template-generator.d.ts.map +1 -0
- package/dist/src/core/iac/template-generator.js +125 -0
- package/dist/src/core/iac/template-generator.js.map +1 -0
- package/dist/src/core/increment/status-auto-transition.js +3 -3
- package/dist/src/core/increment/status-auto-transition.js.map +1 -1
- package/dist/src/core/living-docs/CodeValidator.js +1 -1
- package/dist/src/core/living-docs/CodeValidator.js.map +1 -1
- package/dist/src/core/living-docs/content-distributor.d.ts.map +1 -1
- package/dist/src/core/living-docs/content-distributor.js +11 -1
- package/dist/src/core/living-docs/content-distributor.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +166 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -0
- package/dist/src/core/living-docs/living-docs-sync.js +726 -0
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -0
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts +7 -3
- package/dist/src/core/living-docs/task-project-specific-generator.d.ts.map +1 -1
- package/dist/src/core/living-docs/task-project-specific-generator.js +40 -24
- package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -1
- package/dist/src/core/plugin-loader.d.ts +7 -0
- package/dist/src/core/plugin-loader.d.ts.map +1 -1
- package/dist/src/core/plugin-loader.js +18 -1
- package/dist/src/core/plugin-loader.js.map +1 -1
- package/dist/src/core/serverless/platform-data-loader.d.ts +8 -0
- package/dist/src/core/serverless/platform-data-loader.d.ts.map +1 -1
- package/dist/src/core/serverless/platform-data-loader.js +14 -0
- package/dist/src/core/serverless/platform-data-loader.js.map +1 -1
- package/dist/src/core/serverless/types.d.ts +1 -1
- package/dist/src/core/serverless/types.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.d.ts +6 -2
- package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.js +11 -5
- package/dist/src/core/status-line/status-line-manager.js.map +1 -1
- package/dist/src/core/status-line/task-counter.d.ts +69 -0
- package/dist/src/core/status-line/task-counter.d.ts.map +1 -0
- package/dist/src/core/status-line/task-counter.js +107 -0
- package/dist/src/core/status-line/task-counter.js.map +1 -0
- package/dist/src/core/workflow/autonomous-executor.d.ts +111 -0
- package/dist/src/core/workflow/autonomous-executor.d.ts.map +1 -0
- package/dist/src/core/workflow/autonomous-executor.js +275 -0
- package/dist/src/core/workflow/autonomous-executor.js.map +1 -0
- package/dist/src/core/workflow/backlog-scanner.d.ts +94 -0
- package/dist/src/core/workflow/backlog-scanner.d.ts.map +1 -0
- package/dist/src/core/workflow/backlog-scanner.js +170 -0
- package/dist/src/core/workflow/backlog-scanner.js.map +1 -0
- package/dist/src/core/workflow/command-invoker.d.ts +86 -0
- package/dist/src/core/workflow/command-invoker.d.ts.map +1 -0
- package/dist/src/core/workflow/command-invoker.js +131 -0
- package/dist/src/core/workflow/command-invoker.js.map +1 -0
- package/dist/src/core/workflow/cost-estimator.d.ts +120 -0
- package/dist/src/core/workflow/cost-estimator.d.ts.map +1 -0
- package/dist/src/core/workflow/cost-estimator.js +222 -0
- package/dist/src/core/workflow/cost-estimator.js.map +1 -0
- package/dist/src/core/workflow/index.d.ts +20 -0
- package/dist/src/core/workflow/index.d.ts.map +1 -0
- package/dist/src/core/workflow/index.js +24 -0
- package/dist/src/core/workflow/index.js.map +1 -0
- package/dist/src/core/workflow/state-manager.d.ts +107 -0
- package/dist/src/core/workflow/state-manager.d.ts.map +1 -0
- package/dist/src/core/workflow/state-manager.js +126 -0
- package/dist/src/core/workflow/state-manager.js.map +1 -0
- package/dist/src/core/workflow/workflow-orchestrator.d.ts +93 -0
- package/dist/src/core/workflow/workflow-orchestrator.d.ts.map +1 -0
- package/dist/src/core/workflow/workflow-orchestrator.js +195 -0
- package/dist/src/core/workflow/workflow-orchestrator.js.map +1 -0
- package/dist/src/init/architecture/types.d.ts +10 -10
- package/dist/src/metrics/dora-calculator.js +2 -2
- package/dist/src/metrics/dora-calculator.js.map +1 -1
- package/dist/src/utils/pricing-constants.d.ts +5 -2
- package/dist/src/utils/pricing-constants.d.ts.map +1 -1
- package/dist/src/utils/pricing-constants.js +3 -2
- package/dist/src/utils/pricing-constants.js.map +1 -1
- package/package.json +4 -4
- package/plugins/specweave/agents/infrastructure/AGENT.md +88 -46
- package/plugins/specweave/agents/pm/AGENT.md +58 -1
- package/plugins/specweave/commands/specweave-archive-features.md +1 -1
- package/plugins/specweave/commands/specweave-archive-increments.md +1 -1
- package/plugins/specweave/commands/specweave-check-hooks.md +5 -0
- package/plugins/specweave/commands/specweave-done.md +12 -0
- package/plugins/specweave/commands/specweave-plan.md +1 -1
- package/plugins/specweave/commands/specweave-progress.md +108 -379
- package/plugins/specweave/commands/specweave-reopen.md +1 -1
- package/plugins/specweave/commands/specweave-restore-feature.md +1 -1
- package/plugins/specweave/commands/specweave-sync-specs.md +20 -48
- package/plugins/specweave/hooks/lib/update-status-line.sh +44 -35
- package/plugins/specweave/hooks/lib/validate-spec-status.sh +163 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +17 -35
- package/plugins/specweave/lib/hooks/update-tasks-md.js +52 -9
- package/plugins/specweave/lib/hooks/update-tasks-md.ts +77 -16
- package/plugins/specweave/templates/iac/aws-lambda/defaults.json +24 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/README.md.hbs +260 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/environments/dev.tfvars.hbs +34 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/environments/prod.tfvars.hbs +37 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/environments/staging.tfvars.hbs +35 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/outputs.tf.hbs +77 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/providers.tf.hbs +36 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/variables.tf.hbs +115 -0
- package/plugins/specweave/templates/iac/azure-functions/defaults.json +25 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/README.md.hbs +268 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/environments/dev.tfvars.hbs +34 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/environments/prod.tfvars.hbs +46 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/environments/staging.tfvars.hbs +34 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/main.tf.hbs +225 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/outputs.tf.hbs +89 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/provider.tf.hbs +27 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/providers.tf.hbs +35 -0
- package/plugins/specweave/templates/iac/azure-functions/templates/variables.tf.hbs +124 -0
- package/plugins/specweave/templates/iac/firebase/defaults.json +29 -0
- package/plugins/specweave/templates/iac/firebase/templates/README.md.hbs +35 -0
- package/plugins/specweave/templates/iac/firebase/templates/environments/dev.tfvars.hbs +7 -0
- package/plugins/specweave/templates/iac/firebase/templates/environments/prod.tfvars.hbs +7 -0
- package/plugins/specweave/templates/iac/firebase/templates/environments/staging.tfvars.hbs +7 -0
- package/plugins/specweave/templates/iac/firebase/templates/main.tf.hbs +90 -0
- package/plugins/specweave/templates/iac/firebase/templates/outputs.tf.hbs +15 -0
- package/plugins/specweave/templates/iac/firebase/templates/providers.tf.hbs +23 -0
- package/plugins/specweave/templates/iac/firebase/templates/variables.tf.hbs +42 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/defaults.json +26 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/README.md.hbs +299 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/dev.tfvars.hbs +36 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/prod.tfvars.hbs +48 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/staging.tfvars.hbs +41 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/main.tf.hbs +192 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/outputs.tf.hbs +66 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/providers.tf.hbs +25 -0
- package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/variables.tf.hbs +119 -0
- package/plugins/specweave/templates/iac/supabase/defaults.json +15 -0
- package/plugins/specweave/templates/iac/supabase/templates/README.md.hbs +46 -0
- package/plugins/specweave/templates/iac/supabase/templates/main.tf.hbs +50 -0
- package/plugins/specweave-github/agents/github-manager/AGENT.md +39 -7
- package/plugins/specweave-github/commands/specweave-github-create-issue.md +5 -5
- package/plugins/specweave-github/lib/CodeValidator.ts +1 -1
- package/plugins/specweave-github/lib/github-client-v2.js +29 -0
- package/plugins/specweave-github/lib/github-client-v2.ts +30 -0
- package/plugins/specweave-github/lib/task-sync.js +4 -0
- package/plugins/specweave-github/lib/task-sync.ts +7 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +2022 -0
- package/src/templates/CLAUDE.md.template +31 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts +0 -116
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts.map +0 -1
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js +0 -356
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Terraform and Azure Provider Configuration
|
|
2
|
+
# Generated by SpecWeave Serverless Architecture Intelligence
|
|
3
|
+
|
|
4
|
+
terraform {
|
|
5
|
+
required_version = ">= 1.5.0"
|
|
6
|
+
|
|
7
|
+
required_providers {
|
|
8
|
+
azurerm = {
|
|
9
|
+
source = "hashicorp/azurerm"
|
|
10
|
+
version = "~> 3.0"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
provider "azurerm" {
|
|
16
|
+
features {
|
|
17
|
+
resource_group {
|
|
18
|
+
prevent_deletion_if_contains_resources = false
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
key_vault {
|
|
22
|
+
purge_soft_delete_on_destroy = true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
skip_provider_registration = false
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Terraform Provider Configuration for Azure
|
|
2
|
+
# Generated by SpecWeave Serverless Architecture Intelligence
|
|
3
|
+
|
|
4
|
+
terraform {
|
|
5
|
+
required_version = ">= 1.5.0"
|
|
6
|
+
|
|
7
|
+
required_providers {
|
|
8
|
+
azurerm = {
|
|
9
|
+
source = "hashicorp/azurerm"
|
|
10
|
+
version = "~> 3.0"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
{{#if enableRemoteState}}
|
|
15
|
+
backend "azurerm" {
|
|
16
|
+
resource_group_name = "{{tfStateResourceGroup}}"
|
|
17
|
+
storage_account_name = "{{tfStateStorageAccount}}"
|
|
18
|
+
container_name = "tfstate"
|
|
19
|
+
key = "{{projectName}}-{{environment}}.tfstate"
|
|
20
|
+
}
|
|
21
|
+
{{/if}}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
provider "azurerm" {
|
|
25
|
+
features {
|
|
26
|
+
key_vault {
|
|
27
|
+
purge_soft_delete_on_destroy = true
|
|
28
|
+
recover_soft_deleted_key_vaults = true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
resource_group {
|
|
32
|
+
prevent_deletion_if_contains_resources = false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Input Variables for Azure Functions + Cosmos DB
|
|
2
|
+
# Generated by SpecWeave Serverless Architecture Intelligence
|
|
3
|
+
|
|
4
|
+
variable "location" {
|
|
5
|
+
description = "Azure region for all resources"
|
|
6
|
+
type = string
|
|
7
|
+
default = "{{location}}"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
variable "resource_group_name" {
|
|
11
|
+
description = "Resource group name"
|
|
12
|
+
type = string
|
|
13
|
+
default = "{{resourceGroupName}}"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
variable "app_name" {
|
|
17
|
+
description = "Function App name"
|
|
18
|
+
type = string
|
|
19
|
+
default = "{{appName}}"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
variable "runtime" {
|
|
23
|
+
description = "Function runtime (node, python, dotnet)"
|
|
24
|
+
type = string
|
|
25
|
+
default = "{{runtime}}"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
variable "runtime_version" {
|
|
29
|
+
description = "Runtime version (20 for Node.js 20, 3.11 for Python 3.11, etc.)"
|
|
30
|
+
type = string
|
|
31
|
+
default = "{{runtimeVersion}}"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
variable "os_type" {
|
|
35
|
+
description = "OS type (Linux or Windows)"
|
|
36
|
+
type = string
|
|
37
|
+
default = "{{osType}}"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
variable "sku_name" {
|
|
41
|
+
description = "App Service Plan SKU (Y1 for Consumption, EP1/EP2/EP3 for Premium)"
|
|
42
|
+
type = string
|
|
43
|
+
default = "{{skuName}}"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
variable "environment" {
|
|
47
|
+
description = "Environment name (dev, staging, prod)"
|
|
48
|
+
type = string
|
|
49
|
+
default = "{{environment}}"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
variable "database_account_name" {
|
|
53
|
+
description = "Cosmos DB account name"
|
|
54
|
+
type = string
|
|
55
|
+
default = "{{databaseAccountName}}"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
variable "database_name" {
|
|
59
|
+
description = "Cosmos DB database name"
|
|
60
|
+
type = string
|
|
61
|
+
default = "{{databaseName}}"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
variable "container_name" {
|
|
65
|
+
description = "Cosmos DB container name"
|
|
66
|
+
type = string
|
|
67
|
+
default = "{{containerName}}"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
variable "partition_key" {
|
|
71
|
+
description = "Cosmos DB partition key"
|
|
72
|
+
type = string
|
|
73
|
+
default = "{{partitionKey}}"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
variable "throughput" {
|
|
77
|
+
description = "Cosmos DB throughput (RU/s, minimum 400)"
|
|
78
|
+
type = number
|
|
79
|
+
default = {{throughput}}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
variable "cors_origins" {
|
|
83
|
+
description = "List of allowed CORS origins for Function App"
|
|
84
|
+
type = list(string)
|
|
85
|
+
default = {{tfList corsOrigins}}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
variable "project_name" {
|
|
89
|
+
description = "Project name for resource tagging"
|
|
90
|
+
type = string
|
|
91
|
+
default = "{{projectName}}"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
variable "storage_account_tier" {
|
|
95
|
+
description = "Storage account tier (Standard or Premium)"
|
|
96
|
+
type = string
|
|
97
|
+
default = "{{storageAccountTier}}"
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
variable "storage_account_replication" {
|
|
101
|
+
description = "Storage account replication type (LRS, GRS, RAGRS, ZRS)"
|
|
102
|
+
type = string
|
|
103
|
+
default = "{{storageAccountReplication}}"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
{{#if enableMultiRegion}}
|
|
107
|
+
variable "secondary_regions" {
|
|
108
|
+
description = "List of secondary regions for multi-region deployment"
|
|
109
|
+
type = list(string)
|
|
110
|
+
default = {{tfList secondaryRegions}}
|
|
111
|
+
}
|
|
112
|
+
{{/if}}
|
|
113
|
+
|
|
114
|
+
{{#if enableVnet}}
|
|
115
|
+
variable "vnet_id" {
|
|
116
|
+
description = "Virtual Network ID for Function App integration"
|
|
117
|
+
type = string
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
variable "subnet_id" {
|
|
121
|
+
description = "Subnet ID for Function App integration"
|
|
122
|
+
type = string
|
|
123
|
+
}
|
|
124
|
+
{{/if}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectId": "my-firebase-project",
|
|
3
|
+
"region": "us-central1",
|
|
4
|
+
"appDisplayName": "My Firebase App",
|
|
5
|
+
"siteId": "my-firebase-site",
|
|
6
|
+
"functionName": "myFirebaseFunction",
|
|
7
|
+
"runtime": "nodejs20",
|
|
8
|
+
"entryPoint": "handler",
|
|
9
|
+
"memoryMb": 256,
|
|
10
|
+
"timeoutSeconds": 60,
|
|
11
|
+
"environment": "dev",
|
|
12
|
+
"databaseId": "(default)",
|
|
13
|
+
"collectionId": "my-collection",
|
|
14
|
+
"storageBucket": "my-firebase-storage",
|
|
15
|
+
"projectName": "my-project",
|
|
16
|
+
"enableAuth": false,
|
|
17
|
+
"enableStorage": false,
|
|
18
|
+
"enableAnalytics": false,
|
|
19
|
+
"enableCrashlytics": false,
|
|
20
|
+
"hostingIndexPage": "index.html",
|
|
21
|
+
"hosting404Page": "404.html",
|
|
22
|
+
"hostingHeaders": [],
|
|
23
|
+
"hostingRewrites": [
|
|
24
|
+
{
|
|
25
|
+
"source": "**",
|
|
26
|
+
"function": "myFirebaseFunction"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Firebase (Hosting + Functions + Firestore) Terraform Configuration
|
|
2
|
+
|
|
3
|
+
**Generated by SpecWeave Serverless Architecture Intelligence**
|
|
4
|
+
|
|
5
|
+
Deploys complete Firebase backend:
|
|
6
|
+
- Firebase Web App
|
|
7
|
+
- Firebase Hosting (static site)
|
|
8
|
+
- Cloud Functions for Firebase
|
|
9
|
+
- Firestore database
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
1. Install Firebase CLI: `npm install -g firebase-tools`
|
|
14
|
+
2. Authenticate: `firebase login`
|
|
15
|
+
3. Create Firebase project: `firebase projects:create {{projectId}}`
|
|
16
|
+
|
|
17
|
+
## Deployment
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
terraform init
|
|
21
|
+
terraform apply -var-file="environments/dev.tfvars"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Cost: $0/month (Free Spark Plan)
|
|
25
|
+
|
|
26
|
+
Firebase free tier includes:
|
|
27
|
+
- 10 GB hosting storage
|
|
28
|
+
- 360 MB/day hosting transfer
|
|
29
|
+
- Cloud Functions: 2M invocations/month
|
|
30
|
+
- Firestore: 1 GB storage, 50K reads/day
|
|
31
|
+
|
|
32
|
+
## Support
|
|
33
|
+
|
|
34
|
+
- Firebase Docs: https://firebase.google.com/docs
|
|
35
|
+
- SpecWeave: https://spec-weave.com
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Firebase (Hosting + Functions + Firestore) Terraform Configuration
|
|
2
|
+
# Generated by SpecWeave Serverless Architecture Intelligence
|
|
3
|
+
|
|
4
|
+
# Enable Firebase for existing GCP project
|
|
5
|
+
resource "google_firebase_project" "default" {
|
|
6
|
+
provider = google-beta
|
|
7
|
+
project = "{{projectId}}"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
# Enable required APIs
|
|
11
|
+
resource "google_project_service" "firebasehosting" {
|
|
12
|
+
project = "{{projectId}}"
|
|
13
|
+
service = "firebasehosting.googleapis.com"
|
|
14
|
+
disable_on_destroy = false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
resource "google_project_service" "firebase" {
|
|
18
|
+
project = "{{projectId}}"
|
|
19
|
+
service = "firebase.googleapis.com"
|
|
20
|
+
disable_on_destroy = false
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Firebase Web App
|
|
24
|
+
resource "google_firebase_web_app" "{{snakeCase appDisplayName}}" {
|
|
25
|
+
provider = google-beta
|
|
26
|
+
project = "{{projectId}}"
|
|
27
|
+
display_name = "{{appDisplayName}}"
|
|
28
|
+
|
|
29
|
+
depends_on = [google_firebase_project.default]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# Firebase Hosting Site
|
|
33
|
+
resource "google_firebase_hosting_site" "{{snakeCase siteId}}" {
|
|
34
|
+
provider = google-beta
|
|
35
|
+
project = "{{projectId}}"
|
|
36
|
+
site_id = "{{siteId}}"
|
|
37
|
+
|
|
38
|
+
depends_on = [google_firebase_project.default]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Firestore Database (same as GCP)
|
|
42
|
+
resource "google_firestore_database" "{{snakeCase databaseId}}" {
|
|
43
|
+
project = "{{projectId}}"
|
|
44
|
+
name = "{{databaseId}}"
|
|
45
|
+
location_id = "{{region}}"
|
|
46
|
+
type = "FIRESTORE_NATIVE"
|
|
47
|
+
|
|
48
|
+
depends_on = [google_firebase_project.default]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
# Cloud Functions for Firebase (similar to GCP Cloud Functions)
|
|
52
|
+
resource "google_cloudfunctions2_function" "{{snakeCase functionName}}" {
|
|
53
|
+
name = "{{functionName}}"
|
|
54
|
+
location = "{{region}}"
|
|
55
|
+
project = "{{projectId}}"
|
|
56
|
+
|
|
57
|
+
build_config {
|
|
58
|
+
runtime = "{{runtime}}"
|
|
59
|
+
entry_point = "{{entryPoint}}"
|
|
60
|
+
source {
|
|
61
|
+
storage_source {
|
|
62
|
+
bucket = "{{projectId}}.appspot.com"
|
|
63
|
+
object = "function-source.zip"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
service_config {
|
|
69
|
+
max_instance_count = 10
|
|
70
|
+
available_memory = "{{memoryMb}}M"
|
|
71
|
+
timeout_seconds = {{timeoutSeconds}}
|
|
72
|
+
environment_variables = {
|
|
73
|
+
FIREBASE_CONFIG = google_firebase_web_app.{{snakeCase appDisplayName}}.app_id
|
|
74
|
+
ENVIRONMENT = "{{environment}}"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
depends_on = [google_firebase_project.default]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
{{#if enableStorage}}
|
|
82
|
+
# Firebase Storage Bucket
|
|
83
|
+
resource "google_firebase_storage_bucket" "{{snakeCase storageBucket}}" {
|
|
84
|
+
provider = google-beta
|
|
85
|
+
project = "{{projectId}}"
|
|
86
|
+
bucket_id = "{{storageBucket}}"
|
|
87
|
+
|
|
88
|
+
depends_on = [google_firebase_project.default]
|
|
89
|
+
}
|
|
90
|
+
{{/if}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Firebase Outputs
|
|
2
|
+
output "web_app_id" {
|
|
3
|
+
description = "Firebase Web App ID"
|
|
4
|
+
value = google_firebase_web_app.{{snakeCase appDisplayName}}.app_id
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
output "hosting_site_url" {
|
|
8
|
+
description = "Firebase Hosting URL"
|
|
9
|
+
value = "https://${google_firebase_hosting_site.{{snakeCase siteId}}.default_url}"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
output "function_url" {
|
|
13
|
+
description = "Cloud Function URL"
|
|
14
|
+
value = google_cloudfunctions2_function.{{snakeCase functionName}}.service_config[0].uri
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.5.0"
|
|
3
|
+
required_providers {
|
|
4
|
+
google = {
|
|
5
|
+
source = "hashicorp/google"
|
|
6
|
+
version = "~> 5.0"
|
|
7
|
+
}
|
|
8
|
+
google-beta = {
|
|
9
|
+
source = "hashicorp/google-beta"
|
|
10
|
+
version = "~> 5.0"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
provider "google" {
|
|
16
|
+
project = "{{projectId}}"
|
|
17
|
+
region = "{{region}}"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
provider "google-beta" {
|
|
21
|
+
project = "{{projectId}}"
|
|
22
|
+
region = "{{region}}"
|
|
23
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Input Variables for Firebase
|
|
2
|
+
variable "project_id" {
|
|
3
|
+
description = "GCP/Firebase Project ID"
|
|
4
|
+
type = string
|
|
5
|
+
default = "{{projectId}}"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
variable "region" {
|
|
9
|
+
description = "Firebase/GCP region"
|
|
10
|
+
type = string
|
|
11
|
+
default = "{{region}}"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
variable "app_display_name" {
|
|
15
|
+
description = "Firebase Web App display name"
|
|
16
|
+
type = string
|
|
17
|
+
default = "{{appDisplayName}}"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
variable "site_id" {
|
|
21
|
+
description = "Firebase Hosting site ID"
|
|
22
|
+
type = string
|
|
23
|
+
default = "{{siteId}}"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
variable "function_name" {
|
|
27
|
+
description = "Cloud Function name"
|
|
28
|
+
type = string
|
|
29
|
+
default = "{{functionName}}"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
variable "runtime" {
|
|
33
|
+
description = "Function runtime"
|
|
34
|
+
type = string
|
|
35
|
+
default = "{{runtime}}"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
variable "environment" {
|
|
39
|
+
description = "Environment (dev/staging/prod)"
|
|
40
|
+
type = string
|
|
41
|
+
default = "{{environment}}"
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectId": "my-gcp-project",
|
|
3
|
+
"region": "us-central1",
|
|
4
|
+
"functionName": "my-cloud-function",
|
|
5
|
+
"runtime": "nodejs20",
|
|
6
|
+
"entryPoint": "handler",
|
|
7
|
+
"memoryMb": 256,
|
|
8
|
+
"timeoutSeconds": 60,
|
|
9
|
+
"minInstances": 0,
|
|
10
|
+
"maxInstances": 100,
|
|
11
|
+
"environment": "dev",
|
|
12
|
+
"databaseId": "(default)",
|
|
13
|
+
"collectionId": "my-collection",
|
|
14
|
+
"serviceAccountId": "my-function-sa",
|
|
15
|
+
"corsOrigins": ["*"],
|
|
16
|
+
"projectName": "my-project",
|
|
17
|
+
"enableSecretManager": false,
|
|
18
|
+
"enableVpc": false,
|
|
19
|
+
"enableCloudArmor": false,
|
|
20
|
+
"enableConcurrency": false,
|
|
21
|
+
"maxConcurrentRequests": 80,
|
|
22
|
+
"enableCloudLogging": true,
|
|
23
|
+
"enableCloudMonitoring": true,
|
|
24
|
+
"bucketName": "my-function-source",
|
|
25
|
+
"bucketLocation": "US"
|
|
26
|
+
}
|