dnscontrol/documentation/advanced-features
Tom Limoncelli 7ab7d147fb
CHORE: Move non-provider code out of /providers (#3916)
# Issue

Fixes https://github.com/StackExchange/dnscontrol/issues/3912

# Resolution

```
#!/bin/sh

# Reset

git fetch origin main
git reset --hard origin/main
git checkout main
git branch -D tlim_moveproviders
git checkout -b tlim_moveproviders
find . -name \*.bak -delete

# Move the *.go files out of providers/

mkdir -p pkg/providers
git mv providers/*.go pkg/providers

# move the _all file out of providers/

git mv providers/_all pkg/providers/_all

# Update the imports (in go.* and the affected files)

sed -i.bak -e 's@"github.com/StackExchange/dnscontrol/v4/providers"@"github.com/StackExchange/dnscontrol/v4/pkg/providers"@g' go.* $(fgrep -lr --include '*.go' '"github.com/StackExchange/dnscontrol/v4/providers"' *)
sed -i.bak -e 's@"../../providers"@"../../pkg/providers"@g' pkg/normalize/capabilities_test.go
sed -i.bak -e 's@"github.com/StackExchange/dnscontrol/v4/providers/_all"@"github.com/StackExchange/dnscontrol/v4/pkg/providers/_all"@g' go.* $(fgrep -lr --include '*.go' '"github.com/StackExchange/dnscontrol/v4/providers/_all"' *)

# Fix the docs

sed -i.bak -e 's@StackExchange/dnscontrol/blob/main/providers/_all/all.go@StackExchange/dnscontrol/blob/main/pkg/providers/_all/all.go@g' documentation/advanced-features/writing-providers.md
sed -i.bak -e 's@StackExchange/dnscontrol/providers@StackExchange/dnscontrol/pkg/providers@g' documentation/advanced-features/writing-providers.md
sed -i.bak -e 's@StackExchange/dnscontrol/v4/providers@StackExchange/dnscontrol/v4/pkg/providers@g' documentation/advanced-features/writing-providers.md
sed -i.bak -e 's@dnscontrol/providers/providers.go@dnscontrol/pkg/providers/providers.go@g' documentation/advanced-features/writing-providers.md
sed -i.bak -e 's@providers/_all/all.go@pkg/providers/_all/all.go@g' documentation/advanced-features/writing-providers.md
#sed -i.bak -e 's@@@g' documentation/advanced-features/writing-providers.md
#sed -i.bak -e 's@@@g' documentation/advanced-features/writing-providers.md

find . -name \*.bak -delete

go fmt ./...

git status

echo git commit -a -m'CHORE: Move Non-provider files in providers to pkg/providers'



```
2025-12-15 12:53:52 -05:00
..
adding-new-rtypes-v2.md REFACTOR: BIND/GANDI_V5 add "RP" record type, rewrite CLOUDFLAREAPI CF_* and more (#3886) 2025-12-04 16:42:20 -05:00
adding-new-rtypes.md DOCS/rtypes: consistently use pushd (#3719) 2025-08-11 11:06:38 -04:00
alias.md
bug-triage.md DOCS: How to add a requested provider (#3636) 2025-06-23 15:48:00 -04:00
byo-secrets.md DOCS: Fix many minor typos (#3752) 2025-09-02 11:00:25 -04:00
ci-cd-gitlab.md
cli-variables.md
code-tricks.md NEW FEATURE: DKIM_BUILDER() adds a DKIM record builder (#3627) 2025-07-18 10:38:50 -04:00
concurrency-verified.md DNSIMPLE: DOCS: handle multiple provider instances (#3678) 2025-07-22 12:51:21 -04:00
debugging-with-dlv.md REFACTOR: BIND/GANDI_V5 add "RP" record type, rewrite CLOUDFLAREAPI CF_* and more (#3886) 2025-12-04 16:42:20 -05:00
dual-host.md
integration-tests.md
json-reports.md feat(report): --report output now includes detailed list of changes (#3835) 2025-11-13 13:16:32 -05:00
nameservers.md DOCS: replace all NewRegistrar('ThirdParty') (#3889) 2025-12-05 15:33:03 -05:00
notifications.md FEATURE: Set --notify via creds.json so that preview or push can always notify (#3910) 2025-12-10 12:50:31 -05:00
opinions.md
ordering.md DOCS: Add internals for ordering (#3811) 2025-11-03 11:33:21 -05:00
styleguide-code.md DOCS: Fix many minor typos (#3752) 2025-09-02 11:00:25 -04:00
styleguide-doc.md
test-a-branch.md
testing-txt-records.md
unittests.md
writing-providers.md CHORE: Move non-provider code out of /providers (#3916) 2025-12-15 12:53:52 -05:00