Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Gartland committed Nov 16, 2023
2 parents 3dcb8d1 + bc00525 commit 57587b9
Show file tree
Hide file tree
Showing 35 changed files with 468 additions and 334 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ This mode can be reproduced on your local machine by setting `CI=true`.
| DOCKER | true |
| MODE | prod |

### Extension Development

Extensions require the executable to exist on your `$PATH`.

Execute `eval "$(just configure)"` to configure the executable on your current `$PATH`.

## Release

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ If you want to build the development version the easiest (after switching branch
1. Build and start the vite web server, to support error reporting and hot-reloading: `just web/dev` in one terminal. Keep the terminal window open.
- This will launch the `vite` web server on `http://127.0.0.1:9000`
2. Within a new terminal window, build the development version of the CLI: `just build-dev`. Keep this terminal open, so that you can rebuild as needed.
3. Within a new terminal window, launch the development version of the CLI for the current platform (with these parameters): `./connect-client publish-ui <PROJECT_PATH> --listen=127.0.0.1:9001 --open-browser-at="http://127.0.0.1:9000" --skip-browser-session-auth`
- *Where** `<PROJECT_PATH>` above is replaced with a location of a sample project. For example, with a python project at `~/dev/connect-content/bundles/python-flaskapi`, your complete command line would become: `./connect-client publish-ui ~/dev/connect-content/bundles/python-flaskapi --listen=127.0.0.1:9001 --open-browser-at="http://127.0.0.1:9000" --skip-browser-session-auth`.
3. Within a new terminal window, launch the development version of the CLI for the current platform (with these parameters): `./connect-client publish-ui <PROJECT_PATH> --listen=127.0.0.1:9001 --open-browser-at="http://127.0.0.1:9000"`
- *Where** `<PROJECT_PATH>` above is replaced with a location of a sample project. For example, with a python project at `~/dev/connect-content/bundles/python-flaskapi`, your complete command line would become: `./connect-client publish-ui ~/dev/connect-content/bundles/python-flaskapi --listen=127.0.0.1:9001 --open-browser-at="http://127.0.0.1:9000"`.
- This launches the CLI and configures it to listen on port `9001`, while launching a browser to the address which is being served by the `vite` web server.

You now should have a Web UX loaded within the browser, which is loading from the `vite` dev server, but has its APIs serviced from the CLI backend.
Expand Down
1 change: 0 additions & 1 deletion cmd/connect-client/commands/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ func (cmd *PublishUICmd) Run(args *cli_types.CommonArgs, ctx *cli_types.CLIConte
"/",
cmd.UIArgs,
&cmd.PublishArgs,
ctx.LocalToken,
ctx.Fs,
ctx.Accounts,
log,
Expand Down
10 changes: 1 addition & 9 deletions cmd/connect-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/rstudio/connect-client/internal/events"
"github.com/rstudio/connect-client/internal/logging"
"github.com/rstudio/connect-client/internal/project"
"github.com/rstudio/connect-client/internal/services"
"github.com/spf13/afero"
)

Expand All @@ -37,11 +36,7 @@ func logVersion(log logging.Logger) {
func makeContext(log logging.Logger) (*cli_types.CLIContext, error) {
fs := afero.NewOsFs()
accountList := accounts.NewAccountList(fs, log)
token, err := services.NewLocalToken()
if err != nil {
return nil, err
}
ctx := cli_types.NewCLIContext(accountList, token, fs, log)
ctx := cli_types.NewCLIContext(accountList, fs, log)
return ctx, nil
}

Expand Down Expand Up @@ -75,9 +70,6 @@ func main() {
if cli.Debug {
ctx.Logger = events.NewLogger(true)
}
if cli.Token != nil {
ctx.LocalToken = *cli.Token
}
cmd, ok := args.Selected().Target.Interface().(commands.StatefulCommand)
if ok {
// For these commands, we need to load saved deployment state
Expand Down
1 change: 0 additions & 1 deletion cmd/connect-client/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ func (s *MainSuite) TestMakeContext() {
ctx, err := makeContext(log)
s.Nil(err)
s.NotNil(ctx.Accounts)
s.NotEqual(ctx.LocalToken, "")
s.Equal(log, ctx.Logger)
}
8 changes: 0 additions & 8 deletions extensions/positron/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ clean:
rm -rf node_modules

configure:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
alias publisher=$(basename `just ../../executable-path`)
readonly publisher


# Install dependencies
install:
Expand Down
Loading

0 comments on commit 57587b9

Please sign in to comment.