Skip to content

Commit 84deab2

Browse files
committed
Add initial implementation of Webflow resources including Redirect, RobotsTxt, and Site
- Created pulumi-plugin.json for the Webflow SDK. - Added type hints and input classes for Redirect, RobotsTxt, and Site resources. - Implemented methods for managing HTTP redirects, robots.txt configuration, and site management. - Included detailed docstrings for all parameters and properties for better clarity and usage.
1 parent 9d66b58 commit 84deab2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2983
-816
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ensure::
5555

5656
$(SCHEMA_FILE): provider
5757
$(PULUMI) package get-schema $(WORKING_DIR)/bin/${PROVIDER} | \
58-
jq 'del(.version)' > $(SCHEMA_FILE)
58+
jq 'del(.version) | (.language.go.importBasePath="github.com/jdetmar/pulumi-webflow/sdk/go/webflow")' > $(SCHEMA_FILE)
5959

6060
# Codegen generates the schema file and *generates* all sdks. This is a local process and
6161
# does not require the ability to build all SDKs.
@@ -87,9 +87,11 @@ sdk/dotnet: $(SCHEMA_FILE)
8787
sdk/go: ${SCHEMA_FILE}
8888
rm -rf $@
8989
$(PULUMI) package gen-sdk --language go ${SCHEMA_FILE} --version "${VERSION_GENERIC}"
90-
cp go.mod ${PACKDIR}/go/pulumi-${PACK}/go.mod
91-
cd ${PACKDIR}/go/pulumi-${PACK} && \
92-
go mod edit -module=github.com/pulumi/pulumi-${PACK}/${PACKDIR}/go/pulumi-${PACK} && \
90+
GO_PKG_DIR=${PACKDIR}/go/webflow; \
91+
mkdir -p $$GO_PKG_DIR; \
92+
cp go.mod $$GO_PKG_DIR/go.mod; \
93+
cd $$GO_PKG_DIR && \
94+
go mod edit -module=github.com/jdetmar/pulumi-webflow/sdk/go/webflow && \
9395
go mod tidy
9496

9597
.PHONY: provider
@@ -129,6 +131,8 @@ python_sdk: sdk/python
129131

130132
java_sdk:: PACKAGE_VERSION := $(VERSION_GENERIC)
131133
java_sdk:: sdk/java
134+
# Generated settings.gradle references a non-existent 'lib' module; drop it for a single-module build.
135+
sed -i '' '/^include("lib")/d' sdk/java/settings.gradle
132136
cd sdk/java/ && \
133137
gradle --console=plain build
134138

provider/cmd/pulumi-resource-webflow/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "webflow",
33
"displayName": "Webflow",
4-
"description": "Pulumi provider for managing Webflow site configurations",
4+
"description": "Pulumi provider for managing Webflow sites, redirects, and robots.txt.",
55
"homepage": "https://github.com/jdetmar/pulumi-webflow",
66
"namespace": "webflow",
77
"language": {

provider/provider.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Package provider implements a simple random resource and component.
15+
// Package provider wires up the Webflow Pulumi provider and exposes the Provider constructor.
1616
package provider
1717

1818
import (
@@ -29,25 +29,30 @@ var Version string
2929
// Name controls how this provider is referenced in package names and elsewhere.
3030
const Name string = "webflow"
3131

32-
// Provider creates a new instance of the Webflow provider.
32+
// Provider creates a new instance of the Webflow provider with all supported resources.
3333
func Provider() p.Provider {
34-
p, err := infer.NewProviderBuilder().
34+
// Propagate build version into HTTP client user-agent strings.
35+
if Version != "" {
36+
SetProviderVersion(Version)
37+
}
38+
39+
prov, err := infer.NewProviderBuilder().
3540
WithDisplayName("Webflow").
36-
WithDescription("Pulumi provider for managing Webflow site configurations").
41+
WithDescription("Pulumi provider for managing Webflow sites, redirects, and robots.txt.").
3742
WithHomepage("https://github.com/jdetmar/pulumi-webflow").
38-
WithNamespace("webflow").
39-
WithGoImportPath("github.com/jdetmar/pulumi-webflow/sdk/go/webflow").
43+
WithNamespace(Name).
44+
WithConfig(infer.Config(&Config{})).
4045
WithResources(
41-
infer.Resource(&RobotsTxt{}),
42-
infer.Resource(&Redirect{}),
4346
infer.Resource(&SiteResource{}),
47+
infer.Resource(&Redirect{}),
48+
infer.Resource(&RobotsTxt{}),
4449
).
45-
WithConfig(infer.Config(&Config{})).
4650
WithModuleMap(map[tokens.ModuleName]tokens.ModuleName{
4751
"provider": "index",
48-
}).Build()
52+
}).
53+
Build()
4954
if err != nil {
5055
panic(fmt.Errorf("unable to build provider: %w", err))
5156
}
52-
return p
57+
return prov
5358
}

sdk/dotnet/Config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Pulumi provider for managing Webflow site configurations
1+
Pulumi provider for managing Webflow sites, redirects, and robots.txt.

sdk/dotnet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Pulumi provider for managing Webflow site configurations
1+
Pulumi provider for managing Webflow sites, redirects, and robots.txt.

sdk/dotnet/Webflow.Webflow.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
55
<Authors>Pulumi Corp.</Authors>
66
<Company>Pulumi Corp.</Company>
7-
<Description>Pulumi provider for managing Webflow site configurations</Description>
7+
<Description>Pulumi provider for managing Webflow sites, redirects, and robots.txt.</Description>
88
<PackageLicenseExpression></PackageLicenseExpression>
99
<PackageProjectUrl>https://github.com/jdetmar/pulumi-webflow</PackageProjectUrl>
1010
<RepositoryUrl></RepositoryUrl>

sdk/go/webflow/doc.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/go/webflow/go.mod

Lines changed: 97 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)