diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cfe134..de38960 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,3 +30,5 @@ jobs: run: pnpm run type-check - name: Build run: pnpm run build + - name: Release + run: pnpx pkg-pr-new publish --bin --commentWithSha --pnpm --packageManager=pnpm './packages/create-vue-lib' diff --git a/packages/create-vue-lib/src/index.ts b/packages/create-vue-lib/src/index.ts index 6e7d587..0d99d48 100644 --- a/packages/create-vue-lib/src/index.ts +++ b/packages/create-vue-lib/src/index.ts @@ -85,6 +85,7 @@ type Config = { includeEsLintStylistic: boolean includeVitest: boolean includeGithubCi: boolean + includePkgPrNew: boolean includeAtAliases: boolean includeTestVariable: boolean includeTailwind: boolean @@ -275,6 +276,7 @@ async function init() { const includeGithubPages = includeDocs && await togglePrompt('Include GitHub Pages config for documentation?') const includePlayground = await togglePrompt('Include playground application for development?', true) const includeGithubCi = await togglePrompt('Include GitHub CI configuration?', !!githubPath) + const includePkgPrNew = includeGithubCi && await togglePrompt('Include pkg.pr.new in CI configuration?', false) const includeExamples = await togglePromptIf(extended, 'Include example code?', true, 'Yes', 'No, just configs') const includeAtAliases = await togglePromptIf(extended, 'Configure @ as an alias for src?') const includeTestVariable = await togglePromptIf(extended, 'Configure global __TEST__ variable?') @@ -342,6 +344,7 @@ async function init() { includeEsLintStylistic, includeVitest, includeGithubCi, + includePkgPrNew, includeAtAliases, includeTestVariable, includeTailwind, diff --git a/packages/create-vue-lib/src/template/ci/config/.github/workflows/ci.yml.ejs b/packages/create-vue-lib/src/template/ci/config/.github/workflows/ci.yml.ejs index b5e7528..7843e35 100644 --- a/packages/create-vue-lib/src/template/ci/config/.github/workflows/ci.yml.ejs +++ b/packages/create-vue-lib/src/template/ci/config/.github/workflows/ci.yml.ejs @@ -38,3 +38,7 @@ jobs: - name: Test run: pnpm run test:unit <%_ } _%> +<%_ if (config.includePkgPrNew) { _%> + - name: Release + run: pnpx pkg-pr-new publish --commentWithSha --pnpm --packageManager=pnpm,npm,yarn './<%- config.packagesDir %><%- config.mainPackageDirName %>' +<%_ } _%> diff --git a/packages/docs/src/questions.md b/packages/docs/src/questions.md index 5f3dcb7..1b6e92e 100644 --- a/packages/docs/src/questions.md +++ b/packages/docs/src/questions.md @@ -53,6 +53,7 @@ Include GitHub Pages config for documentation? … No / Yes Include playground application for development? … No / Yes Include GitHub CI configuration? … No / Yes + Include pkg.pr.new in CI configuration? … No / Yes Include example code? … No, just configs / Yes Configure @ as an alias for src? … No / Yes Configure global __TEST__ variable? … No / Yes @@ -226,6 +227,16 @@ This option will include a GitHub Actions configuration for a CI workflow. It wi If a [GitHub path](#github-path) has been provided, the job will be configured so that it only runs for that specific fork. +## Include pkg.pr.new in CI configuration?{#include-pkg-pr-new} + +:::info NOTE +You'll only see this question if you chose to include GitHub CI configuration. +::: + +[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. + +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. + ## Include example code?{#include-examples} :::info NOTE