From 65411a4e6cbd0763ee711fd1b4b98c7414b39dab Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Tue, 16 Sep 2025 15:07:09 -0400 Subject: [PATCH] remove unlinked references and update tfjson --- .../unreleased/FEATURES-20250811-174112.yaml | 2 +- .../unreleased/FEATURES-20250811-174141.yaml | 2 +- .../unreleased/FEATURES-20250811-174155.yaml | 2 +- ...k_provider_success_generic_templates.txtar | 31 +++++++------- ...amework_provider_success_legacy_docs.txtar | 37 ++++++++-------- ...ork_provider_success_named_templates.txtar | 33 +++++++-------- ...mework_provider_success_no_templates.txtar | 29 +++++++------ ...mework_provider_success_static_files.txtar | 37 ++++++++-------- .../time_provider_success_docs_website.txtar | 42 +++++++++---------- ...der_success_docs_website_with_prefix.txtar | 42 +++++++++---------- ...time_provider_success_legacy_website.txtar | 42 +++++++++---------- ...r_success_legacy_website_with_prefix.txtar | 42 +++++++++---------- ...amework_provider_error_file_mismatch.txtar | 9 ++-- ...amework_provider_success_legacy_docs.txtar | 11 +++-- ...ework_provider_success_registry_docs.txtar | 11 +++-- go.mod | 2 +- go.sum | 4 +- internal/provider/action_template_test.go | 3 +- internal/provider/testdata/schema.json | 3 +- .../testdata/test-action-dir/action.tf | 2 +- internal/schemamd/render.go | 3 -- internal/schemamd/render_test.go | 6 +-- ...test_unlinked_action.md => test_action.md} | 0 ...on.schema.json => test_action.schema.json} | 1 - 24 files changed, 191 insertions(+), 205 deletions(-) rename internal/schemamd/testdata/actions/{test_unlinked_action.md => test_action.md} (100%) rename internal/schemamd/testdata/actions/{test_unlinked_action.schema.json => test_action.schema.json} (97%) diff --git a/.changes/unreleased/FEATURES-20250811-174112.yaml b/.changes/unreleased/FEATURES-20250811-174112.yaml index bed6a32e..494c77b6 100644 --- a/.changes/unreleased/FEATURES-20250811-174112.yaml +++ b/.changes/unreleased/FEATURES-20250811-174112.yaml @@ -1,5 +1,5 @@ kind: FEATURES -body: 'generate: Add support for unlinked actions' +body: 'generate: Add support for actions' time: 2025-08-11T17:41:12.858383-04:00 custom: Issue: "505" diff --git a/.changes/unreleased/FEATURES-20250811-174141.yaml b/.changes/unreleased/FEATURES-20250811-174141.yaml index 3013f108..32e9b2a0 100644 --- a/.changes/unreleased/FEATURES-20250811-174141.yaml +++ b/.changes/unreleased/FEATURES-20250811-174141.yaml @@ -1,5 +1,5 @@ kind: FEATURES -body: 'migrate: Add support for unlinked actions' +body: 'migrate: Add support for actions' time: 2025-08-11T17:41:41.553344-04:00 custom: Issue: "505" diff --git a/.changes/unreleased/FEATURES-20250811-174155.yaml b/.changes/unreleased/FEATURES-20250811-174155.yaml index 91386609..67ad8771 100644 --- a/.changes/unreleased/FEATURES-20250811-174155.yaml +++ b/.changes/unreleased/FEATURES-20250811-174155.yaml @@ -1,5 +1,5 @@ kind: FEATURES -body: 'validate: Add support for unlinked actions' +body: 'validate: Add support for actions' time: 2025-08-11T17:41:55.966547-04:00 custom: Issue: "505" diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar index e4474efc..3db43b54 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_generic_templates.txtar @@ -11,7 +11,7 @@ cmpenv docs/data-sources/example.md expected-datasource.md cmpenv docs/resources/example.md expected-resource.md cmpenv docs/functions/example.md expected-function.md cmpenv docs/ephemeral-resources/example.md expected-ephemeral-resource.md -cmpenv docs/actions/unlinked_example.md expected-unlinked-action.md +cmpenv docs/actions/example.md expected-action.md -- expected-output.txt -- @@ -29,26 +29,26 @@ function "example" fallback template exists, creating template generating missing ephemeral resource content ephemeral resource "scaffolding_example" fallback template exists, creating template generating missing action content -action "scaffolding_unlinked_example" fallback template exists, creating template +action "scaffolding_example" fallback template exists, creating template generating missing provider content provider "terraform-provider-scaffolding" template exists, skipping rendering static website cleaning rendered website dir rendering templated website to static markdown -rendering "actions/unlinked_example.md.tmpl" +rendering "actions/example.md.tmpl" rendering "data-sources/example.md.tmpl" rendering "ephemeral-resources/example.md.tmpl" rendering "functions/example.md.tmpl" rendering "index.md.tmpl" rendering "resources/example.md.tmpl" --- expected-unlinked-action.md -- +-- expected-action.md -- # Data Fields -Name: scaffolding_unlinked_example +Name: scaffolding_example Type: Action -Description: Example unlinked action +Description: Example action HasExample: true -ExampleFile: $WORK/examples/actions/scaffolding_unlinked_example/action.tf +ExampleFile: $WORK/examples/actions/scaffolding_example/action.tf ProviderName: terraform-provider-scaffolding ProviderShortName: scaffolding RenderedProviderName: terraform-provider-scaffolding @@ -70,7 +70,7 @@ SchemaMarkdown: lower: action plainmarkdown: Action prefixlines: Prefix: Action -split: [scaffolding unlinked example] +split: [scaffolding example] title: Action trimspace: Action upper: ACTION @@ -80,13 +80,13 @@ upper: ACTION printf tffile: ## Example Usage -{{tffile "$WORK/examples/actions/scaffolding_unlinked_example/action.tf"}} +{{tffile "$WORK/examples/actions/scaffolding_example/action.tf"}} tffile: ## Example Usage ```terraform -action "scaffolding_unlinked_example" "example" { +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -665,8 +665,8 @@ The document generation tool looks for files in the following locations by defau * **provider/provider.tf** example file for the provider index page * **data-sources/`full data source name`/data-source.tf** example file for the named data source page * **resources/`full resource name`/resource.tf** example file for the named data source page --- examples/actions/scaffolding_unlinked_example/action.tf -- -action "scaffolding_unlinked_example" "example" { +-- examples/actions/scaffolding_example/action.tf -- +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -723,7 +723,7 @@ resource "scaffolding_example" "example" { } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -740,10 +740,9 @@ resource "scaffolding_example" "example" { "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar index d54dd003..16b488a7 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_legacy_docs.txtar @@ -27,10 +27,10 @@ cmp templates/ephemeral-resources/example.markdown docs/ephemeral-resources/exam cmp templates/ephemeral-resources/example.html.markdown docs/ephemeral-resources/example.html.markdown cmp templates/ephemeral-resources/example.html.md docs/ephemeral-resources/example.html.md -cmp templates/actions/unlinked_example.md docs/actions/unlinked_example.md -cmp templates/actions/unlinked_example.markdown docs/actions/unlinked_example.markdown -cmp templates/actions/unlinked_example.html.markdown docs/actions/unlinked_example.html.markdown -cmp templates/actions/unlinked_example.html.md docs/actions/unlinked_example.html.md +cmp templates/actions/example.md docs/actions/example.md +cmp templates/actions/example.markdown docs/actions/example.markdown +cmp templates/actions/example.html.markdown docs/actions/example.html.markdown +cmp templates/actions/example.html.md docs/actions/example.html.md cmp templates/index.md docs/index.md cmp templates/index.markdown docs/index.markdown @@ -51,16 +51,16 @@ function "example" static file exists, skipping generating missing ephemeral resource content ephemeral resource "scaffolding_example" static file exists, skipping generating missing action content -action "scaffolding_unlinked_example" static file exists, skipping +action "scaffolding_example" static file exists, skipping generating missing provider content provider "terraform-provider-scaffolding" static file exists, skipping rendering static website cleaning rendered website dir rendering templated website to static markdown -copying non-template file: "actions/unlinked_example.html.markdown" -copying non-template file: "actions/unlinked_example.html.md" -copying non-template file: "actions/unlinked_example.markdown" -copying non-template file: "actions/unlinked_example.md" +copying non-template file: "actions/example.html.markdown" +copying non-template file: "actions/example.html.md" +copying non-template file: "actions/example.markdown" +copying non-template file: "actions/example.md" copying non-template file: "d/example.html.markdown" copying non-template file: "d/example.html.md" copying non-template file: "d/example.markdown" @@ -81,22 +81,22 @@ copying non-template file: "r/example.html.markdown" copying non-template file: "r/example.html.md" copying non-template file: "r/example.markdown" copying non-template file: "r/example.md" --- templates/actions/unlinked_example.md -- +-- templates/actions/example.md -- # Data Fields Name: {{.Name}} Type: {{.Type}} --- templates/actions/unlinked_example.markdown -- +-- templates/actions/example.markdown -- # Data Fields Name: {{.Name}} Type: {{.Type}} --- templates/actions/unlinked_example.html.markdown -- +-- templates/actions/example.html.markdown -- # Data Fields Name: {{.Name}} Type: {{.Type}} --- templates/actions/unlinked_example.html.md -- +-- templates/actions/example.html.md -- # Data Fields Name: {{.Name}} @@ -211,8 +211,8 @@ The document generation tool looks for files in the following locations by defau * **provider/provider.tf** example file for the provider index page * **data-sources/`full data source name`/data-source.tf** example file for the named data source page * **resources/`full resource name`/resource.tf** example file for the named data source page --- examples/actions/scaffolding_unlinked_example/action.tf -- -action "scaffolding_unlinked_example" "example" { +-- examples/actions/scaffolding_example/action.tf -- +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -265,7 +265,7 @@ terraform import scaffolding_example.example "id-123" } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -282,10 +282,9 @@ terraform import scaffolding_example.example "id-123" "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar index 434223c0..aeb62e65 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_named_templates.txtar @@ -11,7 +11,7 @@ cmpenv docs/data-sources/example.md expected-datasource.md cmpenv docs/resources/example.md expected-resource.md cmpenv docs/functions/example.md expected-function.md cmpenv docs/ephemeral-resources/example.md expected-ephemeral-resource.md -cmpenv docs/actions/unlinked_example.md expected-unlinked-action.md +cmpenv docs/actions/example.md expected-action.md -- expected-output.txt -- rendering website for provider "terraform-provider-scaffolding" (as "Scaffolding") @@ -28,26 +28,26 @@ function "example" template exists, skipping generating missing ephemeral resource content ephemeral resource "scaffolding_example" template exists, skipping generating missing action content -action "scaffolding_unlinked_example" template exists, skipping +action "scaffolding_example" template exists, skipping generating missing provider content provider "terraform-provider-scaffolding" template exists, skipping rendering static website cleaning rendered website dir rendering templated website to static markdown -rendering "actions/unlinked_example.md.tmpl" +rendering "actions/example.md.tmpl" rendering "data-sources/example.md.tmpl" rendering "ephemeral-resources/example.md.tmpl" rendering "functions/example.md.tmpl" rendering "index.md.tmpl" rendering "resources/example.md.tmpl" --- expected-unlinked-action.md -- +-- expected-action.md -- # Data Fields -Name: scaffolding_unlinked_example +Name: scaffolding_example Type: Action -Description: Example unlinked action +Description: Example action HasExample: true -ExampleFile: $WORK/examples/actions/scaffolding_unlinked_example/action.tf +ExampleFile: $WORK/examples/actions/scaffolding_example/action.tf ProviderName: terraform-provider-scaffolding ProviderShortName: Scaffolding RenderedProviderName: Scaffolding @@ -69,7 +69,7 @@ SchemaMarkdown: lower: action plainmarkdown: Action prefixlines: Prefix: Action -split: [scaffolding unlinked example] +split: [scaffolding example] title: Action trimspace: Action upper: ACTION @@ -79,13 +79,13 @@ upper: ACTION printf tffile: ## Example Usage -{{tffile "$WORK/examples/actions/scaffolding_unlinked_example/action.tf"}} +{{tffile "$WORK/examples/actions/scaffolding_example/action.tf"}} tffile: ## Example Usage ```terraform -action "scaffolding_unlinked_example" "example" { +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -378,7 +378,7 @@ resource "scaffolding_example" "example" { configurable_attribute = "some-value" } ``` --- templates/actions/unlinked_example.md.tmpl -- +-- templates/actions/example.md.tmpl -- # Data Fields Name: {{.Name}} @@ -681,8 +681,8 @@ The document generation tool looks for files in the following locations by defau * **provider/provider.tf** example file for the provider index page * **data-sources/`full data source name`/data-source.tf** example file for the named data source page * **resources/`full resource name`/resource.tf** example file for the named data source page --- examples/actions/scaffolding_unlinked_example/action.tf -- -action "scaffolding_unlinked_example" "example" { +-- examples/actions/scaffolding_example/action.tf -- +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -752,7 +752,7 @@ terraform import scaffolding_example.example "id-123" } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -769,10 +769,9 @@ terraform import scaffolding_example.example "id-123" "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar index 9231266c..0cd495cb 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_no_templates.txtar @@ -11,7 +11,7 @@ cmp docs/resources/example.md expected-resource.md cmp docs/functions/example.md expected-function.md cmp docs/functions/no-variadic.md expected-no-variadic-function.md cmp docs/ephemeral-resources/example.md expected-ephemeral-resource.md -cmp docs/actions/unlinked_example.md expected-unlinked-action.md +cmp docs/actions/example.md expected-action.md -- expected-output.txt -- rendering website for provider "terraform-provider-scaffolding" (as "Scaffolding") @@ -28,36 +28,36 @@ generating new template for function "no-variadic" generating missing ephemeral resource content generating new template for "scaffolding_example" generating missing action content -generating new template for "scaffolding_unlinked_example" +generating new template for "scaffolding_example" generating missing provider content generating new template for "terraform-provider-scaffolding" rendering static website cleaning rendered website dir rendering templated website to static markdown -rendering "actions/unlinked_example.md.tmpl" +rendering "actions/example.md.tmpl" rendering "data-sources/example.md.tmpl" rendering "ephemeral-resources/example.md.tmpl" rendering "functions/example.md.tmpl" rendering "functions/no-variadic.md.tmpl" rendering "index.md.tmpl" rendering "resources/example.md.tmpl" --- expected-unlinked-action.md -- +-- expected-action.md -- --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "scaffolding_unlinked_example Action - Scaffolding" +page_title: "scaffolding_example Action - Scaffolding" subcategory: "" description: |- - Example unlinked action + Example action --- -# scaffolding_unlinked_example (Action) +# scaffolding_example (Action) -Example unlinked action +Example action ## Example Usage ```terraform -action "scaffolding_unlinked_example" "example" { +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -317,8 +317,8 @@ The document generation tool looks for files in the following locations by defau * **provider/provider.tf** example file for the provider index page * **data-sources/`full data source name`/data-source.tf** example file for the named data source page * **resources/`full resource name`/resource.tf** example file for the named data source page --- examples/actions/scaffolding_unlinked_example/action.tf -- -action "scaffolding_unlinked_example" "example" { +-- examples/actions/scaffolding_example/action.tf -- +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -391,7 +391,7 @@ resource "scaffolding_example" "example" { } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -408,10 +408,9 @@ resource "scaffolding_example" "example" { "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar index 39ac300c..26795fbd 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/generate/framework_provider_success_static_files.txtar @@ -27,10 +27,10 @@ cmp templates/ephemeral-resources/example.markdown docs/ephemeral-resources/exam cmp templates/ephemeral-resources/example.html.markdown docs/ephemeral-resources/example.html.markdown cmp templates/ephemeral-resources/example.html.md docs/ephemeral-resources/example.html.md -cmp templates/actions/unlinked_example.md docs/actions/unlinked_example.md -cmp templates/actions/unlinked_example.markdown docs/actions/unlinked_example.markdown -cmp templates/actions/unlinked_example.html.markdown docs/actions/unlinked_example.html.markdown -cmp templates/actions/unlinked_example.html.md docs/actions/unlinked_example.html.md +cmp templates/actions/example.md docs/actions/example.md +cmp templates/actions/example.markdown docs/actions/example.markdown +cmp templates/actions/example.html.markdown docs/actions/example.html.markdown +cmp templates/actions/example.html.md docs/actions/example.html.md cmp templates/index.md docs/index.md cmp templates/index.markdown docs/index.markdown @@ -51,16 +51,16 @@ function "example" static file exists, skipping generating missing ephemeral resource content ephemeral resource "scaffolding_example" static file exists, skipping generating missing action content -action "scaffolding_unlinked_example" static file exists, skipping +action "scaffolding_example" static file exists, skipping generating missing provider content provider "terraform-provider-scaffolding" static file exists, skipping rendering static website cleaning rendered website dir rendering templated website to static markdown -copying non-template file: "actions/unlinked_example.html.markdown" -copying non-template file: "actions/unlinked_example.html.md" -copying non-template file: "actions/unlinked_example.markdown" -copying non-template file: "actions/unlinked_example.md" +copying non-template file: "actions/example.html.markdown" +copying non-template file: "actions/example.html.md" +copying non-template file: "actions/example.markdown" +copying non-template file: "actions/example.md" copying non-template file: "data-sources/example.html.markdown" copying non-template file: "data-sources/example.html.md" copying non-template file: "data-sources/example.markdown" @@ -81,22 +81,22 @@ copying non-template file: "resources/example.html.markdown" copying non-template file: "resources/example.html.md" copying non-template file: "resources/example.markdown" copying non-template file: "resources/example.md" --- templates/actions/unlinked_example.md -- +-- templates/actions/example.md -- # Data Fields Name: {{.Name}} Type: {{.Type}} --- templates/actions/unlinked_example.markdown -- +-- templates/actions/example.markdown -- # Data Fields Name: {{.Name}} Type: {{.Type}} --- templates/actions/unlinked_example.html.markdown -- +-- templates/actions/example.html.markdown -- # Data Fields Name: {{.Name}} Type: {{.Type}} --- templates/actions/unlinked_example.html.md -- +-- templates/actions/example.html.md -- # Data Fields Name: {{.Name}} @@ -211,8 +211,8 @@ The document generation tool looks for files in the following locations by defau * **provider/provider.tf** example file for the provider index page * **data-sources/`full data source name`/data-source.tf** example file for the named data source page * **resources/`full resource name`/resource.tf** example file for the named data source page --- examples/actions/scaffolding_unlinked_example/action.tf -- -action "scaffolding_unlinked_example" "example" { +-- examples/actions/scaffolding_example/action.tf -- +action "scaffolding_example" "example" { config { required_attr = "some-value" } @@ -265,7 +265,7 @@ terraform import scaffolding_example.example "id-123" } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -282,10 +282,9 @@ terraform import scaffolding_example.example "id-123" "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar index 414cbfac..e2cf2639 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website.txtar @@ -16,7 +16,7 @@ cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md. cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -cmpenv templates/actions/unlinked_example.md.tmpl exp-templates/actions/unlinked_example.md.tmpl +cmpenv templates/actions/example.md.tmpl exp-templates/actions/example.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -45,18 +45,18 @@ cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/e cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -cmpenv examples/actions/unlinked_example/example_1.tf exp-examples/actions/unlinked_example/example_1.tf -cmpenv examples/actions/unlinked_example/example_2.tf exp-examples/actions/unlinked_example/example_2.tf +cmpenv examples/actions/example/example_1.tf exp-examples/actions/example/example_1.tf +cmpenv examples/actions/example/example_2.tf exp-examples/actions/example/example_2.tf -- expected-output.txt -- migrating website from "$WORK/docs" to "$WORK/templates" migrating actions directory: actions -migrating file "unlinked_example.html.markdown" -extracting YAML frontmatter to "$WORK/templates/actions/unlinked_example.md.tmpl" -extracting code examples from "unlinked_example.html.markdown" -creating example file "$WORK/examples/actions/unlinked_example/example_1.tf" -creating example file "$WORK/examples/actions/unlinked_example/example_2.tf" -finished creating template "$WORK/templates/actions/unlinked_example.md.tmpl" +migrating file "example.html.markdown" +extracting YAML frontmatter to "$WORK/templates/actions/example.md.tmpl" +extracting code examples from "example.html.markdown" +creating example file "$WORK/examples/actions/example/example_1.tf" +creating example file "$WORK/examples/actions/example/example_2.tf" +finished creating template "$WORK/templates/actions/example.md.tmpl" migrating ephemeral resources directory: ephemeral-resources migrating file "ephemeral_static.html.markdown" extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" @@ -539,10 +539,10 @@ $ terraform import time_static.example 2020-02-12T06:36:13Z ``` The `triggers` argument cannot be imported. --- docs/actions/unlinked_example.html.markdown -- +-- docs/actions/example.html.markdown -- --- layout: "time" -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -550,7 +550,7 @@ description: |- Just a fake example. ```hcl -action "scaffolding_unlinked_example" "example1" { +action "scaffolding_example" "example1" { config { required_attr = "value-1" } @@ -558,7 +558,7 @@ action "scaffolding_unlinked_example" "example1" { ``` ```hcl -action "scaffolding_unlinked_example" "example2" { +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -789,14 +789,14 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z --- exp-examples/actions/unlinked_example/example_1.tf -- -action "scaffolding_unlinked_example" "example1" { +-- exp-examples/actions/example/example_1.tf -- +action "scaffolding_example" "example1" { config { required_attr = "value-1" } } --- exp-examples/actions/unlinked_example/example_2.tf -- -action "scaffolding_unlinked_example" "example2" { +-- exp-examples/actions/example/example_2.tf -- +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -1184,9 +1184,9 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} The `triggers` argument cannot be imported. --- exp-templates/actions/unlinked_example.md.tmpl -- +-- exp-templates/actions/example.md.tmpl -- --- -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -1197,6 +1197,6 @@ For example, the {{ .SchemaMarkdown }} template can be used to replace manual sc Just a fake example. -{{tffile "examples/actions/unlinked_example/example_1.tf"}} +{{tffile "examples/actions/example/example_1.tf"}} -{{tffile "examples/actions/unlinked_example/example_2.tf"}} \ No newline at end of file +{{tffile "examples/actions/example/example_2.tf"}} \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar index 6a217c2d..c50ac192 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_docs_website_with_prefix.txtar @@ -16,7 +16,7 @@ cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md. cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -cmpenv templates/actions/unlinked_example.md.tmpl exp-templates/actions/unlinked_example.md.tmpl +cmpenv templates/actions/example.md.tmpl exp-templates/actions/example.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -45,18 +45,18 @@ cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/e cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -cmpenv examples/actions/unlinked_example/example_1.tf exp-examples/actions/unlinked_example/example_1.tf -cmpenv examples/actions/unlinked_example/example_2.tf exp-examples/actions/unlinked_example/example_2.tf +cmpenv examples/actions/example/example_1.tf exp-examples/actions/example/example_1.tf +cmpenv examples/actions/example/example_2.tf exp-examples/actions/example/example_2.tf -- expected-output.txt -- migrating website from "$WORK/docs" to "$WORK/templates" migrating actions directory: actions -migrating file "time_unlinked_example.html.markdown" -extracting YAML frontmatter to "$WORK/templates/actions/unlinked_example.md.tmpl" -extracting code examples from "time_unlinked_example.html.markdown" -creating example file "$WORK/examples/actions/unlinked_example/example_1.tf" -creating example file "$WORK/examples/actions/unlinked_example/example_2.tf" -finished creating template "$WORK/templates/actions/unlinked_example.md.tmpl" +migrating file "time_example.html.markdown" +extracting YAML frontmatter to "$WORK/templates/actions/example.md.tmpl" +extracting code examples from "time_example.html.markdown" +creating example file "$WORK/examples/actions/example/example_1.tf" +creating example file "$WORK/examples/actions/example/example_2.tf" +finished creating template "$WORK/templates/actions/example.md.tmpl" migrating ephemeral resources directory: ephemeral-resources migrating file "time_ephemeral_static.html.markdown" extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" @@ -539,10 +539,10 @@ $ terraform import time_static.example 2020-02-12T06:36:13Z ``` The `triggers` argument cannot be imported. --- docs/actions/time_unlinked_example.html.markdown -- +-- docs/actions/time_example.html.markdown -- --- layout: "time" -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -550,7 +550,7 @@ description: |- Just a fake example. ```hcl -action "scaffolding_unlinked_example" "example1" { +action "scaffolding_example" "example1" { config { required_attr = "value-1" } @@ -558,7 +558,7 @@ action "scaffolding_unlinked_example" "example1" { ``` ```hcl -action "scaffolding_unlinked_example" "example2" { +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -789,14 +789,14 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z --- exp-examples/actions/unlinked_example/example_1.tf -- -action "scaffolding_unlinked_example" "example1" { +-- exp-examples/actions/example/example_1.tf -- +action "scaffolding_example" "example1" { config { required_attr = "value-1" } } --- exp-examples/actions/unlinked_example/example_2.tf -- -action "scaffolding_unlinked_example" "example2" { +-- exp-examples/actions/example/example_2.tf -- +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -1184,9 +1184,9 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} The `triggers` argument cannot be imported. --- exp-templates/actions/unlinked_example.md.tmpl -- +-- exp-templates/actions/example.md.tmpl -- --- -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -1197,6 +1197,6 @@ For example, the {{ .SchemaMarkdown }} template can be used to replace manual sc Just a fake example. -{{tffile "examples/actions/unlinked_example/example_1.tf"}} +{{tffile "examples/actions/example/example_1.tf"}} -{{tffile "examples/actions/unlinked_example/example_2.tf"}} \ No newline at end of file +{{tffile "examples/actions/example/example_2.tf"}} \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar index af00bf04..088501c5 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website.txtar @@ -16,7 +16,7 @@ cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md. cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -cmpenv templates/actions/unlinked_example.md.tmpl exp-templates/actions/unlinked_example.md.tmpl +cmpenv templates/actions/example.md.tmpl exp-templates/actions/example.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -45,8 +45,8 @@ cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/e cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -cmpenv examples/actions/unlinked_example/example_1.tf exp-examples/actions/unlinked_example/example_1.tf -cmpenv examples/actions/unlinked_example/example_2.tf exp-examples/actions/unlinked_example/example_2.tf +cmpenv examples/actions/example/example_1.tf exp-examples/actions/example/example_1.tf +cmpenv examples/actions/example/example_2.tf exp-examples/actions/example/example_2.tf # Verify legacy website directory is removed ! exists website/ @@ -54,12 +54,12 @@ cmpenv examples/actions/unlinked_example/example_2.tf exp-examples/actions/unlin -- expected-output.txt -- migrating website from "$WORK/website/docs" to "$WORK/templates" migrating actions directory: actions -migrating file "unlinked_example.html.markdown" -extracting YAML frontmatter to "$WORK/templates/actions/unlinked_example.md.tmpl" -extracting code examples from "unlinked_example.html.markdown" -creating example file "$WORK/examples/actions/unlinked_example/example_1.tf" -creating example file "$WORK/examples/actions/unlinked_example/example_2.tf" -finished creating template "$WORK/templates/actions/unlinked_example.md.tmpl" +migrating file "example.html.markdown" +extracting YAML frontmatter to "$WORK/templates/actions/example.md.tmpl" +extracting code examples from "example.html.markdown" +creating example file "$WORK/examples/actions/example/example_1.tf" +creating example file "$WORK/examples/actions/example/example_2.tf" +finished creating template "$WORK/templates/actions/example.md.tmpl" migrating ephemeral resources directory: ephemeral-resources migrating file "ephemeral_static.html.markdown" extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" @@ -542,10 +542,10 @@ $ terraform import time_static.example 2020-02-12T06:36:13Z ``` The `triggers` argument cannot be imported. --- website/docs/actions/unlinked_example.html.markdown -- +-- website/docs/actions/example.html.markdown -- --- layout: "time" -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -553,7 +553,7 @@ description: |- Just a fake example. ```hcl -action "scaffolding_unlinked_example" "example1" { +action "scaffolding_example" "example1" { config { required_attr = "value-1" } @@ -561,7 +561,7 @@ action "scaffolding_unlinked_example" "example1" { ``` ```hcl -action "scaffolding_unlinked_example" "example2" { +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -792,14 +792,14 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z --- exp-examples/actions/unlinked_example/example_1.tf -- -action "scaffolding_unlinked_example" "example1" { +-- exp-examples/actions/example/example_1.tf -- +action "scaffolding_example" "example1" { config { required_attr = "value-1" } } --- exp-examples/actions/unlinked_example/example_2.tf -- -action "scaffolding_unlinked_example" "example2" { +-- exp-examples/actions/example/example_2.tf -- +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -1187,9 +1187,9 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} The `triggers` argument cannot be imported. --- exp-templates/actions/unlinked_example.md.tmpl -- +-- exp-templates/actions/example.md.tmpl -- --- -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -1200,6 +1200,6 @@ For example, the {{ .SchemaMarkdown }} template can be used to replace manual sc Just a fake example. -{{tffile "examples/actions/unlinked_example/example_1.tf"}} +{{tffile "examples/actions/example/example_1.tf"}} -{{tffile "examples/actions/unlinked_example/example_2.tf"}} \ No newline at end of file +{{tffile "examples/actions/example/example_2.tf"}} \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar index fe30ab37..0e071534 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/migrate/time_provider_success_legacy_website_with_prefix.txtar @@ -16,7 +16,7 @@ cmpenv templates/resources/rotating.md.tmpl exp-templates/resources/rotating.md. cmpenv templates/resources/sleep.md.tmpl exp-templates/resources/sleep.md.tmpl cmpenv templates/resources/static.md.tmpl exp-templates/resources/static.md.tmpl cmpenv templates/ephemeral-resources/ephemeral_static.md.tmpl exp-templates/ephemeral-resources/ephemeral_static.md.tmpl -cmpenv templates/actions/unlinked_example.md.tmpl exp-templates/actions/unlinked_example.md.tmpl +cmpenv templates/actions/example.md.tmpl exp-templates/actions/example.md.tmpl # Check generated example files cmpenv examples/example_1.tf examples/example_1.tf @@ -45,8 +45,8 @@ cmpenv examples/ephemeral-resources/ephemeral_static/example_1.tf exp-examples/e cmpenv examples/ephemeral-resources/ephemeral_static/example_2.tf exp-examples/ephemeral-resources/ephemeral_static/example_2.tf cmpenv examples/ephemeral-resources/ephemeral_static/import_1.sh exp-examples/ephemeral-resources/ephemeral_static/import_1.sh -cmpenv examples/actions/unlinked_example/example_1.tf exp-examples/actions/unlinked_example/example_1.tf -cmpenv examples/actions/unlinked_example/example_2.tf exp-examples/actions/unlinked_example/example_2.tf +cmpenv examples/actions/example/example_1.tf exp-examples/actions/example/example_1.tf +cmpenv examples/actions/example/example_2.tf exp-examples/actions/example/example_2.tf # Verify legacy website directory is removed ! exists website/ @@ -54,12 +54,12 @@ cmpenv examples/actions/unlinked_example/example_2.tf exp-examples/actions/unlin -- expected-output.txt -- migrating website from "$WORK/website/docs" to "$WORK/templates" migrating actions directory: actions -migrating file "time_unlinked_example.html.markdown" -extracting YAML frontmatter to "$WORK/templates/actions/unlinked_example.md.tmpl" -extracting code examples from "time_unlinked_example.html.markdown" -creating example file "$WORK/examples/actions/unlinked_example/example_1.tf" -creating example file "$WORK/examples/actions/unlinked_example/example_2.tf" -finished creating template "$WORK/templates/actions/unlinked_example.md.tmpl" +migrating file "time_example.html.markdown" +extracting YAML frontmatter to "$WORK/templates/actions/example.md.tmpl" +extracting code examples from "time_example.html.markdown" +creating example file "$WORK/examples/actions/example/example_1.tf" +creating example file "$WORK/examples/actions/example/example_2.tf" +finished creating template "$WORK/templates/actions/example.md.tmpl" migrating ephemeral resources directory: ephemeral-resources migrating file "time_ephemeral_static.html.markdown" extracting YAML frontmatter to "$WORK/templates/ephemeral-resources/ephemeral_static.md.tmpl" @@ -542,10 +542,10 @@ $ terraform import time_static.example 2020-02-12T06:36:13Z ``` The `triggers` argument cannot be imported. --- website/docs/actions/time_unlinked_example.html.markdown -- +-- website/docs/actions/time_example.html.markdown -- --- layout: "time" -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -553,7 +553,7 @@ description: |- Just a fake example. ```hcl -action "scaffolding_unlinked_example" "example1" { +action "scaffolding_example" "example1" { config { required_attr = "value-1" } @@ -561,7 +561,7 @@ action "scaffolding_unlinked_example" "example1" { ``` ```hcl -action "scaffolding_unlinked_example" "example2" { +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -792,14 +792,14 @@ resource "aws_instance" "server" { } -- exp-examples/resources/static/import_1.sh -- $ terraform import time_static.example 2020-02-12T06:36:13Z --- exp-examples/actions/unlinked_example/example_1.tf -- -action "scaffolding_unlinked_example" "example1" { +-- exp-examples/actions/example/example_1.tf -- +action "scaffolding_example" "example1" { config { required_attr = "value-1" } } --- exp-examples/actions/unlinked_example/example_2.tf -- -action "scaffolding_unlinked_example" "example2" { +-- exp-examples/actions/example/example_2.tf -- +action "scaffolding_example" "example2" { config { required_attr = "value-2" } @@ -1187,9 +1187,9 @@ This resource can be imported using the UTC RFC3339 value, e.g. {{codefile "shell" "examples/ephemeral-resources/ephemeral_static/import_1.sh"}} The `triggers` argument cannot be imported. --- exp-templates/actions/unlinked_example.md.tmpl -- +-- exp-templates/actions/example.md.tmpl -- --- -page_title: "Time: time_unlinked_example" +page_title: "Time: time_example" description: |- Just a fake example. --- @@ -1200,6 +1200,6 @@ For example, the {{ .SchemaMarkdown }} template can be used to replace manual sc Just a fake example. -{{tffile "examples/actions/unlinked_example/example_1.tf"}} +{{tffile "examples/actions/example/example_1.tf"}} -{{tffile "examples/actions/unlinked_example/example_2.tf"}} \ No newline at end of file +{{tffile "examples/actions/example/example_2.tf"}} \ No newline at end of file diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar index 64e4859e..6405567a 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_error_file_mismatch.txtar @@ -14,7 +14,7 @@ stderr 'missing documentation file for function: example' stderr 'matching ephemeral resource for documentation file \(example2.md\) not found, file is extraneous or incorrectly named' stderr 'missing documentation file for ephemeral resource: scaffolding_example' stderr 'matching action for documentation file \(example2.md\) not found, file is extraneous or incorrectly named' -stderr 'missing documentation file for action: scaffolding_unlinked_example' +stderr 'missing documentation file for action: scaffolding_example' -- docs/actions/example2.md -- --- @@ -92,7 +92,7 @@ Type: {{.Type}} } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -109,10 +109,9 @@ Type: {{.Type}} "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar index ba4e2fd4..ff6a2132 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_legacy_docs.txtar @@ -12,7 +12,7 @@ getting provider schema running mixed directories check detected legacy website directory, running checks running invalid directories check on website/docs/actions -running file checks on website/docs/actions/unlinked_example.html.md +running file checks on website/docs/actions/example.html.md running invalid directories check on website/docs/d running file checks on website/docs/d/example.html.md running invalid directories check on website/docs/ephemeral-resources @@ -38,7 +38,7 @@ description: |- Example contents. --- website/docs/actions/unlinked_example.html.md -- +-- website/docs/actions/example.html.md -- --- subcategory: "Example" layout: "example" @@ -130,7 +130,7 @@ Type: {{.Type}} } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -147,10 +147,9 @@ Type: {{.Type}} "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar index 20ad2cfa..a470194d 100644 --- a/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar +++ b/cmd/tfplugindocs/testdata/scripts/schema-json/validate/framework_provider_success_registry_docs.txtar @@ -12,7 +12,7 @@ getting provider schema running mixed directories check detected static docs directory, running checks running invalid directories check on docs/actions -running file checks on docs/actions/unlinked_example.md +running file checks on docs/actions/example.md running invalid directories check on docs/data-sources running file checks on docs/data-sources/example.md running invalid directories check on docs/ephemeral-resources @@ -37,7 +37,7 @@ description: |- Example contents. --- docs/actions/unlinked_example.md -- +-- docs/actions/example.md -- --- subcategory: "Example" page_title: "Example: example_thing" @@ -123,7 +123,7 @@ Type: {{.Type}} } }, "action_schemas": { - "scaffolding_unlinked_example": { + "scaffolding_example": { "version": 0, "block": { "attributes": { @@ -140,10 +140,9 @@ Type: {{.Type}} "optional": true } }, - "description": "Example unlinked action", + "description": "Example action", "description_kind": "plain" - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/go.mod b/go.mod index 1a446eee..56862dde 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hc-install v0.9.2 github.com/hashicorp/terraform-exec v0.23.1 - github.com/hashicorp/terraform-json v0.26.1-0.20250908200803-41f8aafc40af + github.com/hashicorp/terraform-json v0.27.0 github.com/mattn/go-colorable v0.1.14 github.com/rogpeppe/go-internal v1.14.1 github.com/yuin/goldmark v1.7.7 diff --git a/go.sum b/go.sum index 8e9bcd5f..d9f69bb6 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/hashicorp/hc-install v0.9.2 h1:v80EtNX4fCVHqzL9Lg/2xkp62bbvQMnvPQ0G+O github.com/hashicorp/hc-install v0.9.2/go.mod h1:XUqBQNnuT4RsxoxiM9ZaUk0NX8hi2h+Lb6/c0OZnC/I= github.com/hashicorp/terraform-exec v0.23.1 h1:diK5NSSDXDKqHEOIQefBMu9ny+FhzwlwV0xgUTB7VTo= github.com/hashicorp/terraform-exec v0.23.1/go.mod h1:e4ZEg9BJDRaSalGm2z8vvrPONt0XWG0/tXpmzYTf+dM= -github.com/hashicorp/terraform-json v0.26.1-0.20250908200803-41f8aafc40af h1:TXYkA1zjKTAJrpuY4NqdBsdpa1Msii6LGhax3Ywf1MQ= -github.com/hashicorp/terraform-json v0.26.1-0.20250908200803-41f8aafc40af/go.mod h1:GzPLJ1PLdUG5xL6xn1OXWIjteQRT2CNT9o/6A9mi9hE= +github.com/hashicorp/terraform-json v0.27.0 h1:REIlFzMMkIyTbhq69NC30bYiUYLv7iVhwM8ObnLo0p8= +github.com/hashicorp/terraform-json v0.27.0/go.mod h1:GzPLJ1PLdUG5xL6xn1OXWIjteQRT2CNT9o/6A9mi9hE= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= diff --git a/internal/provider/action_template_test.go b/internal/provider/action_template_test.go index 066856e0..14ad2e5d 100644 --- a/internal/provider/action_template_test.go +++ b/internal/provider/action_template_test.go @@ -22,7 +22,7 @@ tffile: {{ tffile .ExampleFile }} expectedString := ` Printf tffile: {{tffile "action.tf"}} tffile: terraform -action "scaffolding_unlinked_example" "example1" { +action "scaffolding_example" "example1" { config { required_attr = "value-1" } @@ -33,7 +33,6 @@ action "scaffolding_unlinked_example" "example1" { tpl := actionTemplate(template) schema := tfjson.ActionSchema{ - Unlinked: &tfjson.UnlinkedSchemaType{}, Block: &tfjson.SchemaBlock{ Attributes: map[string]*tfjson.SchemaAttribute{ "required_attr": { diff --git a/internal/provider/testdata/schema.json b/internal/provider/testdata/schema.json index df76d068..2f1e26c0 100644 --- a/internal/provider/testdata/schema.json +++ b/internal/provider/testdata/schema.json @@ -26,8 +26,7 @@ "optional": true } } - }, - "unlinked": {} + } } }, "resource_schemas": { diff --git a/internal/provider/testdata/test-action-dir/action.tf b/internal/provider/testdata/test-action-dir/action.tf index b4d434dc..bc8ea4a2 100644 --- a/internal/provider/testdata/test-action-dir/action.tf +++ b/internal/provider/testdata/test-action-dir/action.tf @@ -1,4 +1,4 @@ -action "scaffolding_unlinked_example" "example1" { +action "scaffolding_example" "example1" { config { required_attr = "value-1" } diff --git a/internal/schemamd/render.go b/internal/schemamd/render.go index 71daa901..8a72e636 100644 --- a/internal/schemamd/render.go +++ b/internal/schemamd/render.go @@ -38,9 +38,6 @@ func Render(schema *tfjson.Schema, w io.Writer) error { // RenderAction is a variant of Render for action schemas. Action schemas share the same config block as // resource schemas, with the addition of other schema data based on the type of action it is. -// -// Currently, the only action type is unlinked, which has no additional information to document, but future -// actions may have useful information to generate documentation for (example: linked resources). func RenderAction(schema *tfjson.ActionSchema, w io.Writer) error { _, err := io.WriteString(w, "## Schema\n\n") if err != nil { diff --git a/internal/schemamd/render_test.go b/internal/schemamd/render_test.go index 05165a1c..4c8f4374 100644 --- a/internal/schemamd/render_test.go +++ b/internal/schemamd/render_test.go @@ -161,9 +161,9 @@ func TestRenderAction(t *testing.T) { expectedFile string }{ { - "test_unlinked_action", - "testdata/actions/test_unlinked_action.schema.json", - "testdata/actions/test_unlinked_action.md", + "test_action", + "testdata/actions/test_action.schema.json", + "testdata/actions/test_action.md", }, } { t.Run(c.name, func(t *testing.T) { diff --git a/internal/schemamd/testdata/actions/test_unlinked_action.md b/internal/schemamd/testdata/actions/test_action.md similarity index 100% rename from internal/schemamd/testdata/actions/test_unlinked_action.md rename to internal/schemamd/testdata/actions/test_action.md diff --git a/internal/schemamd/testdata/actions/test_unlinked_action.schema.json b/internal/schemamd/testdata/actions/test_action.schema.json similarity index 97% rename from internal/schemamd/testdata/actions/test_unlinked_action.schema.json rename to internal/schemamd/testdata/actions/test_action.schema.json index 5b5fde97..a25b764f 100644 --- a/internal/schemamd/testdata/actions/test_unlinked_action.schema.json +++ b/internal/schemamd/testdata/actions/test_action.schema.json @@ -1,6 +1,5 @@ { "block": { - "unlinked": {}, "attributes": { "required_attr": { "description_kind": "plain",