Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move document package from internal to pkg #588

Merged
merged 8 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/cmd/beta/run_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/stateful/runme/v3/internal/command"
"github.com/stateful/runme/v3/internal/config/autoconfig"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/project"
"github.com/stateful/runme/v3/pkg/document"
)

func runCmd(*commonFlags) *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
"github.com/spf13/cobra"
"go.uber.org/zap"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/internal/project"
"github.com/stateful/runme/v3/internal/runner/client"
"github.com/stateful/runme/v3/internal/tui"
"github.com/stateful/runme/v3/internal/tui/prompt"
runnerv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v1"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/identity"
)

const envStackDepth = "__RUNME_STACK_DEPTH"
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/editor"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/internal/renderer/cmark"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/editor"
"github.com/stateful/runme/v3/pkg/document/identity"
)

func fmtCmd() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

"github.com/stateful/runme/v3/internal/command"
"github.com/stateful/runme/v3/internal/config"
"github.com/stateful/runme/v3/internal/document/editor/editorservice"
"github.com/stateful/runme/v3/internal/project/projectservice"
"github.com/stateful/runme/v3/internal/runner"
runnerv2service "github.com/stateful/runme/v3/internal/runnerv2service"
Expand All @@ -24,6 +23,7 @@ import (
projectv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/project/v1"
runnerv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v1"
runnerv2alpha1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v2alpha1"
"github.com/stateful/runme/v3/pkg/document/editor/editorservice"
)

func serverCmd() *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions internal/command/command_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"go.uber.org/zap/zaptest"

"github.com/stateful/runme/v3/internal/config"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/identity"
runnerv2alpha1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v2alpha1"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/identity"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion internal/command/config_code_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path/filepath"
"strings"

"github.com/stateful/runme/v3/internal/document"
runnerv2alpha1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v2alpha1"
"github.com/stateful/runme/v3/pkg/document"
)

func NewProgramConfigFromCodeBlock(block *document.CodeBlock) (*ProgramConfig, error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/stateful/godotenv"
"go.uber.org/zap"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/identity"
)

type LoadEventType uint8
Expand Down
2 changes: 1 addition & 1 deletion internal/project/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/pkg/errors"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/pkg/document"
)

// Task is struct representing a [document.CodeBlock] within the context of a project.
Expand Down
2 changes: 1 addition & 1 deletion internal/renderer/cmark/cmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/pkg/errors"
"github.com/yuin/goldmark/ast"

"github.com/stateful/runme/v3/internal/document/constants"
"github.com/stateful/runme/v3/pkg/document/constants"
)

type NodeSourceProvider func(ast.Node) ([]byte, bool)
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/go-git/go-billy/v5/osfs"
"github.com/muesli/cancelreader"
"github.com/pkg/errors"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/project"
"github.com/stateful/runme/v3/internal/runner"
runnerv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v1"
"github.com/stateful/runme/v3/pkg/document"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/runner/client/client_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (

"github.com/muesli/cancelreader"
"github.com/pkg/errors"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/project"
"github.com/stateful/runme/v3/internal/runner"
"github.com/stateful/runme/v3/internal/system"
runnerv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v1"
"github.com/stateful/runme/v3/pkg/document"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/runner/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

"github.com/pkg/errors"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/system"
"github.com/stateful/runme/v3/pkg/document"
)

type Shell struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (
"google.golang.org/grpc/reflection"

"github.com/stateful/runme/v3/internal/command"
"github.com/stateful/runme/v3/internal/document/editor/editorservice"
"github.com/stateful/runme/v3/internal/project/projectservice"
"github.com/stateful/runme/v3/internal/runnerv2service"
runmetls "github.com/stateful/runme/v3/internal/tls"
parserv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/parser/v1"
projectv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/project/v1"
runnerv2alpha1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/runner/v2alpha1"
"github.com/stateful/runme/v3/pkg/document/editor/editorservice"
)

const (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/document/document.go → pkg/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"

"github.com/stateful/runme/v3/internal/document/constants"
"github.com/stateful/runme/v3/internal/renderer/cmark"
"github.com/stateful/runme/v3/pkg/document/constants"
)

var DefaultAttributeParser = newFailoverAttributeParser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/internal/renderer/cmark"
"github.com/stateful/runme/v3/pkg/document/identity"
)

var testIdentityResolver = identity.NewResolver(identity.DefaultLifecycleIdentity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/yuin/goldmark/ast"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/ulid"
"github.com/stateful/runme/v3/pkg/document"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/pkg/document"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/pkg/errors"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/constants"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/constants"
"github.com/stateful/runme/v3/pkg/document/identity"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/constants"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/internal/ulid"
"github.com/stateful/runme/v3/internal/version"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/constants"
"github.com/stateful/runme/v3/pkg/document/identity"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"go.uber.org/zap"

"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/editor"
"github.com/stateful/runme/v3/internal/document/identity"
parserv1 "github.com/stateful/runme/v3/pkg/api/gen/proto/go/runme/parser/v1"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/editor"
"github.com/stateful/runme/v3/pkg/document/identity"
)

type parserServiceServer struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"testing"

"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/pkg/document/identity"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/project/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/go-git/go-billy/v5/osfs"
"github.com/go-git/go-billy/v5/util"
"github.com/pkg/errors"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/identity"
)

func ReadMarkdownFile(filepath string, fs billy.Basic) ([]byte, error) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/project/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"time"

"github.com/pkg/errors"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/editor"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/internal/renderer/cmark"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/editor"
"github.com/stateful/runme/v3/pkg/document/identity"
)

type funcOutput func(string, []byte) error
Expand Down
2 changes: 1 addition & 1 deletion pkg/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/go-git/go-git/v5/plumbing/format/gitignore"
"github.com/pkg/errors"
"github.com/stateful/godotenv"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/pkg/document"
)

type CodeBlock struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/go-git/go-billy/v5/util"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/storage/filesystem"
"github.com/stateful/runme/v3/internal/document"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/pkg/document"
"github.com/stateful/runme/v3/pkg/document/identity"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
4 changes: 2 additions & 2 deletions web/main_js.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"syscall/js"

"github.com/stateful/runme/v3/internal/document/editor"
"github.com/stateful/runme/v3/internal/document/identity"
"github.com/stateful/runme/v3/pkg/document/editor"
"github.com/stateful/runme/v3/pkg/document/identity"
)

// These are variables so that they can be set during the build time.
Expand Down
Loading