pulumi/sdk/go/common/workspace
Luke Hoban 4db5fe3520 Support `pulumi new <ai-url>`
This adds support for Pulumi AI URLs as sources for `pulumi new`.   This can support both conversations and answers URLs, such as https://www.pulumi.com/ai/answers/6c060c2d-e754-47d2-af8c-0d6a761634e3.

This implementation is likely not what we ultimately want to ship.  It builds out the fake "template" from the content of the HTML page from within the Pulumi CLI.  Instead, we almost certainly want to push this logic into the Pulumi AI service itself, and only generalize the CLI slightly beyond it's current support to allow pulling a ZIP or other simpler asset in place of a Git repo.

But the end result shows what is possible:

```
$ pulumi new https://www.pulumi.com/ai/answers/6c060c2d-e754-47d2-af8c-0d6a761634e3
```

A few challenges:
* This needs to support templating in all languages, and ideally without re-creating all the login in the existing language templates
* The code is scraped to infer the package.json dependencies needed (without knowing versions) and also to guess what required config should be specified (like `aws:region`). (TypeScript only currently)
* The code itself is scraped out of the HTML in a way that may not be guarnteed to work going forward.
2023-09-24 21:29:43 -07:00
..
config.go [workspace] Minor simplification for config merge (#13817) 2023-08-30 21:49:09 +00:00
creds.go Add token info to whoami (#13206) 2023-09-23 12:46:11 +00:00
creds_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
loaders.go Remove the global caches for project files 2023-03-07 12:44:24 +00:00
paths.go Translate permission errors into ProjectNotFound when searching 2023-06-20 15:15:40 +01:00
paths_test.go Translate permission errors into ProjectNotFound when searching 2023-06-20 15:15:40 +01:00
plugins.go Allow language plugins to return plugin checksums (#13776) 2023-08-25 15:26:25 +00:00
plugins_install_nodejs_test.go ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
plugins_install_python_test.go ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
plugins_install_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
plugins_test.go ci(lint): Upgrade to latest golangci-lint (#13847) 2023-08-31 18:26:04 +00:00
project.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
project.json fix #11864: pulumi panics when Pulumi.yaml has a provider with an empty/unspecified `path` key 2023-01-18 10:33:39 -08:00
project_test.go Test project roundtrips 2023-03-07 09:42:56 +00:00
settings.go move pkg/workspace -> sdk/go/common/workspace 2020-03-18 14:35:53 -07:00
templates.go Support `pulumi new <ai-url>` 2023-09-24 21:29:43 -07:00
templates_test.go Support `pulumi new <ai-url>` 2023-09-24 21:29:43 -07:00
workspace.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00