Skip to content

Commit

Permalink
Fixture and snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Oct 18, 2022
1 parent 72c6342 commit ffa5985
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"document":[{"markdown":"# Runme.dev\n\nThis project contains the application for [runme.dev](https://runme.dev) and\nalso acts as a guinea pig to showcase the\n[Runme Extension](https://marketplace.visualstudio.com/items?itemName=stateful.runme).\n\n## Prerequisites\n\nThis project is based on [Fresh](https://fresh.deno.dev/) and requires Deno to\nrun. To install Deno via homebrew on macOS:"},{"content":"# macOS\nbrew bundle --no-lock\n","name":"macos","language":"sh","lines":["# macOS","brew bundle --no-lock"]},{"markdown":"Or the installer which also works on Linux:"},{"content":"# macOS or Linux\ncurl -fsSL https://deno.land/x/install/install.sh | sh\n","name":"macos-2","language":"sh","lines":["# macOS or Linux","curl -fsSL https://deno.land/x/install/install.sh | sh"]},{"markdown":"Add Deno to your path:"},{"content":"export DENO_INSTALL=\"$HOME/.deno\"\nexport PATH=\"$DENO_INSTALL/bin:$PATH\"\n","name":"export-denoinstall","language":"sh","lines":["export DENO_INSTALL=\"$HOME/.deno\"","export PATH=\"$DENO_INSTALL/bin:$PATH\""]},{"markdown":"### Development\n\nStart the project:"},{"attributes":{"background":"true"},"content":"deno task start\n","name":"deno-task","language":"sh","lines":["deno task start"]},{"markdown":"Open the project in your browser:"},{"attributes":{"interactive":"false"},"content":"open http://localhost:8000/\n","name":"open-httplocalhost8000","language":"sh","lines":["open http://localhost:8000/"]},{"markdown":"This will watch the project directory and restart as necessary.\n\n### Testing\n\nWe have added some basic components tests to verify that they render correctly, run them via:"},{"content":"deno test --no-check --allow-env --allow-read\n","name":"deno-test","language":"sh","lines":["deno test --no-check --allow-env --allow-read"]},{"markdown":"### Preview Content\n\nDoublecheck what's in the CMS to be published in the blog section:"},{"attributes":{"interactive":"false"},"content":"curl \"https://api-us-west-2.graphcms.com/v2/cksds5im94b3w01xq4hfka1r4/master?query=$(deno run -A query.ts)\" --compressed 2\u003e/dev/null \\\n | jq -r '.[].posts[] | \"\\(.title) - by \\(.authors[0].name), id: \\(.id)\"'\n","name":"curl-httpsapiuswest2grap","language":"sh","lines":["curl \"https://api-us-west-2.graphcms.com/v2/cksds5im94b3w01xq4hfka1r4/master?query=$(deno run -A query.ts)\" --compressed 2\u003e/dev/null \\","| jq -r '.[].posts[] | \"\\(.title) - by \\(.authors[0].name), id: \\(.id)\"'"]},{"content":"echo \"Set up your deno environment\"\nexport DENO_PROJECT_NAME=\"safe-hedgehog-53\"\nexport DENO_ACCESS_TOKEN=\"ddp_6wpSbCUQbUoOEcBRC8DjmoxdrNipeu2OBKIj\"\n","name":"echo-set","language":"sh","lines":["echo \"Set up your deno environment\"","export DENO_PROJECT_NAME=\"safe-hedgehog-53\"","export DENO_ACCESS_TOKEN=\"ddp_6wpSbCUQbUoOEcBRC8DjmoxdrNipeu2OBKIj\""]},{"markdown":"### Deployment\n\nTo deploy this project you need to have `deployctl` installed on your system. To\ninstall, please run:"},{"content":"deno install \\\n --allow-read --allow-write \\\n --allow-env --allow-net --allow-run \\\n --no-check \\\n -r -f https://deno.land/x/deploy/deployctl.ts\n","name":"deno-install","language":"sh","lines":["deno install \\","--allow-read --allow-write \\","--allow-env --allow-net --allow-run \\","--no-check \\","-r -f https://deno.land/x/deploy/deployctl.ts"]},{"markdown":"Once installed successfully, create a\n[new access token](https://dash.deno.com/account#access-tokens) and export it\ninto your environment:"},{"content":"echo \"Set up your deno environment\"\nexport DENO_PROJECT_NAME=\"\u003cinsert-project-name\u003e\"\nexport DENO_ACCESS_TOKEN=\"\u003cinsert-token-here\u003e\"\n","name":"echo-set-2","language":"sh","lines":["echo \"Set up your deno environment\"","export DENO_PROJECT_NAME=\"\u003cinsert-project-name\u003e\"","export DENO_ACCESS_TOKEN=\"\u003cinsert-token-here\u003e\""]},{"markdown":"then you can run a preview deployment via:"},{"attributes":{"background":"true"},"content":"deployctl deploy \\\n --project=$DENO_PROJECT_NAME \\\n --exclude=node_modules \\\n --import-map=import_map.json \\\n --token=$DENO_ACCESS_TOKEN \\\n main.ts\n","name":"deployctl-deploy","language":"sh","lines":["deployctl deploy \\","--project=$DENO_PROJECT_NAME \\","--exclude=node_modules \\","--import-map=import_map.json \\","--token=$DENO_ACCESS_TOKEN \\","main.ts"]},{"markdown":"\u003cp align=\"center\"\u003e\u003csmall\u003eCopyright 2022 © \u003ca href=\"https://stateful.com/\"\u003eStateful\u003c/a\u003e (\u003ca href=\"https://discord.gg/BQm8zRCBUY\"\u003e💬 Join Discord\u003c/a\u003e) – Apache 2.0 License\u003c/small\u003e \u003c/p\u003e"}]}
106 changes: 106 additions & 0 deletions internal/renderer/testdata/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Runme.dev

This project contains the application for [runme.dev](https://runme.dev) and
also acts as a guinea pig to showcase the
[Runme Extension](https://marketplace.visualstudio.com/items?itemName=stateful.runme).

## Prerequisites

This project is based on [Fresh](https://fresh.deno.dev/) and requires Deno to
run. To install Deno via homebrew on macOS:

```sh
# macOS
brew bundle --no-lock
```

Or the installer which also works on Linux:

```sh
# macOS or Linux
curl -fsSL https://deno.land/x/install/install.sh | sh
```

Add Deno to your path:

```sh
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
```

### Development

Start the project:

```sh { background=true }
deno task start
```

Open the project in your browser:

```sh { interactive=false }
open http://localhost:8000/
```

This will watch the project directory and restart as necessary.

### Testing

We have added some basic components tests to verify that they render correctly, run them via:

```sh
deno test --no-check --allow-env --allow-read
```

### Preview Content

Doublecheck what's in the CMS to be published in the blog section:

```sh { interactive=false }
curl "https://api-us-west-2.graphcms.com/v2/cksds5im94b3w01xq4hfka1r4/master?query=$(deno run -A query.ts)" --compressed 2>/dev/null \
| jq -r '.[].posts[] | "\(.title) - by \(.authors[0].name), id: \(.id)"'
```

```sh
echo "Set up your deno environment"
export DENO_PROJECT_NAME="safe-hedgehog-53"
export DENO_ACCESS_TOKEN="ddp_6wpSbCUQbUoOEcBRC8DjmoxdrNipeu2OBKIj"
```

### Deployment

To deploy this project you need to have `deployctl` installed on your system. To
install, please run:

```sh
deno install \
--allow-read --allow-write \
--allow-env --allow-net --allow-run \
--no-check \
-r -f https://deno.land/x/deploy/deployctl.ts
```

Once installed successfully, create a
[new access token](https://dash.deno.com/account#access-tokens) and export it
into your environment:

```sh
echo "Set up your deno environment"
export DENO_PROJECT_NAME="<insert-project-name>"
export DENO_ACCESS_TOKEN="<insert-token-here>"
```

then you can run a preview deployment via:

```sh { background=true }
deployctl deploy \
--project=$DENO_PROJECT_NAME \
--exclude=node_modules \
--import-map=import_map.json \
--token=$DENO_ACCESS_TOKEN \
main.ts
```

---

<p align="center"><small>Copyright 2022 © <a href="https://stateful.com/">Stateful</a> (<a href="https://discord.gg/BQm8zRCBUY">💬 Join Discord</a>) – Apache 2.0 License</small> </p>

0 comments on commit ffa5985

Please sign in to comment.