Skip to content

Commit 0da4c14

Browse files
Add pkg-pr-new support (#18)
* Enable `pkg-pr-new` * `packages/*` won't work due to `docs` * Add `pkg-pr-new` support
1 parent 69a0cc8 commit 0da4c14

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ jobs:
3030
run: pnpm run type-check
3131
- name: Build
3232
run: pnpm run build
33+
- name: Release
34+
run: pnpx pkg-pr-new publish --bin --commentWithSha --pnpm --packageManager=pnpm './packages/create-vue-lib'

packages/create-vue-lib/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ type Config = {
8585
includeEsLintStylistic: boolean
8686
includeVitest: boolean
8787
includeGithubCi: boolean
88+
includePkgPrNew: boolean
8889
includeAtAliases: boolean
8990
includeTestVariable: boolean
9091
includeTailwind: boolean
@@ -275,6 +276,7 @@ async function init() {
275276
const includeGithubPages = includeDocs && await togglePrompt('Include GitHub Pages config for documentation?')
276277
const includePlayground = await togglePrompt('Include playground application for development?', true)
277278
const includeGithubCi = await togglePrompt('Include GitHub CI configuration?', !!githubPath)
279+
const includePkgPrNew = includeGithubCi && await togglePrompt('Include pkg.pr.new in CI configuration?', false)
278280
const includeExamples = await togglePromptIf(extended, 'Include example code?', true, 'Yes', 'No, just configs')
279281
const includeAtAliases = await togglePromptIf(extended, 'Configure @ as an alias for src?')
280282
const includeTestVariable = await togglePromptIf(extended, 'Configure global __TEST__ variable?')
@@ -342,6 +344,7 @@ async function init() {
342344
includeEsLintStylistic,
343345
includeVitest,
344346
includeGithubCi,
347+
includePkgPrNew,
345348
includeAtAliases,
346349
includeTestVariable,
347350
includeTailwind,

packages/create-vue-lib/src/template/ci/config/.github/workflows/ci.yml.ejs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ jobs:
3838
- name: Test
3939
run: pnpm run test:unit
4040
<%_ } _%>
41+
<%_ if (config.includePkgPrNew) { _%>
42+
- name: Release
43+
run: pnpx pkg-pr-new publish --commentWithSha --pnpm --packageManager=pnpm,npm,yarn './<%- config.packagesDir %><%- config.mainPackageDirName %>'
44+
<%_ } _%>

packages/docs/src/questions.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<span class="check">✔</span> <a href="#include-github-pages">Include GitHub Pages config for documentation? … No / Yes</a>
5454
<span class="check">✔</span> <a href="#include-playground">Include playground application for development? … No / Yes</a>
5555
<span class="check">✔</span> <a href="#include-github-ci">Include GitHub CI configuration? … No / Yes</a>
56+
<span class="check">✔</span> <a href="#include-pkg-pr-new">Include pkg.pr.new in CI configuration? … No / Yes</a>
5657
<span class="check">✔</span> <a href="#include-examples">Include example code? … No, just configs / Yes</a>
5758
<span class="check">✔</span> <a href="#configure-src-alias">Configure @ as an alias for src? … No / Yes</a>
5859
<span class="check">✔</span> <a href="#configure-test-variable">Configure global __TEST__ variable? … No / Yes</a></pre>
@@ -226,6 +227,16 @@ This option will include a GitHub Actions configuration for a CI workflow. It wi
226227

227228
If a [GitHub path](#github-path) has been provided, the job will be configured so that it only runs for that specific fork.
228229

230+
## Include pkg.pr.new in CI configuration?{#include-pkg-pr-new}
231+
232+
:::info NOTE
233+
You'll only see this question if you chose to include GitHub CI configuration.
234+
:::
235+
236+
[pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) allows for continuous releases. Every PR and every commit to `main` will be published as a package on pkg.pr.new, which is similar to the npm registry but with each 'release' tied to a specific commit rather than a version number. This allows changes to be installed and tested before they're merged or released to npm.
237+
238+
You'll also need to install the [pkg.pr.new GitHub App](https://github.com/apps/pkg-pr-new) and enable it on your GitHub repository.
239+
229240
## Include example code?{#include-examples}
230241

231242
:::info NOTE

0 commit comments

Comments
 (0)