Skip to content

Commit

Permalink
template
Browse files Browse the repository at this point in the history
  • Loading branch information
pngwn committed Aug 19, 2024
1 parent 175c256 commit 59a5a60
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 1 deletion.
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/'
50 changes: 50 additions & 0 deletions packages/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

# 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.

0 comments on commit 59a5a60

Please sign in to comment.