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

pr preview template #645

Merged
merged 4 commits into from
Aug 21, 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 .github/workflows/npm-previews.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
env:
CI: true
name: mdsvex
- run: pnpx pkg-pr-new publish './packages/*'
- run: pnpx pkg-pr-new publish './packages/*' --template './packages/template/'
47 changes: 47 additions & 0 deletions packages/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Default Template

This is a template that leverages the experimental templates feature in the `pkg.pr.new` tool.

## Overview

Templates are particularly useful for creating live, interactive examples of your packages, which can be very beneficial for both development and documentation purposes.

As a user, you can check the package.json file and see the new generated packages! You can just copy those and put them in your package.json or install them with your favorite package manager.

```sh
npm i https://pkg.pr.new/pngwn/MDsveX/mdsvex@e9631f1
```

```sh
npm i https://pkg.pr.new/pngwn/MDsveX/pfm-parse@e9631f1
```

```sh
npm i https://pkg.pr.new/pngwn/MDsveX/svast@e9631f1
```

```sh
npm i https://pkg.pr.new/pngwn/MDsveX/svast-stringify@e9631f1
```

```sh
npm i https://pkg.pr.new/pngwn/MDsveX/svast-utils@e9631f1
```

```sh
npm i https://pkg.pr.new/pngwn/MDsveX/svelte-parse@e9631f1
```

## Usage

To use this feature as a maintainer, you can run the following command:

```sh
npx pkg-pr-new publish './packages/A' --template './examples/*'
```

## Benefits

- Interactive Demos: Automatically create live demos that users can interact with directly in their browser.
- Enhanced Testing: Quickly spin up environments to test your package in different scenarios.
- Improved Sharing: Easily share working examples of your package with collaborators or users without needing them to set up their environment.
3 changes: 3 additions & 0 deletions packages/template/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { compile } from 'mdsvex';

compile('# hello').then(console.log);
14 changes: 14 additions & 0 deletions packages/template/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "mdsvex-test",
"version": "1.0.0",
"description": "generated by pkg.pr.new",
"main": "index.js",
"dependencies": {
"mdsvex": "workspace:*"
},
"keywords": [],
"author": "pkg.pr.new",
"license": "ISC",
"private": "true",
"type": "module"
}
194 changes: 194 additions & 0 deletions packages/template/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.