Skip to content
Source
Sign inSign up
TanStack/showcase
A read-only demo of every feature
Every page of this repository is open, and nothing can change. Take a guided tour of what TanStack Source does.

ci: publish a package preview of each pull request #12

MergedAlemTuzlakmerged 1 commit intomain fromci/package-previewsmerged by AlemTuzlak

Showing 4 changed files with 26 additions and 1 deletion (loading 1).

x
0 of 4 viewed, 4 left
15 additions and 0 deletions.source/workflows/preview.tsAdded
View file
@@ -0,0 +1,15 @@
+import { defineWorkflow, packagePreview, pullRequest, setup } from '@tanstack-source/ci'
+​
+// Each pull request into main gets a preview of the package: one install line on the pull request page.
+// The package is the root of the repository, so the npm folder is '.'.
+export default defineWorkflow('preview', { on: [pullRequest({ branches: ['main'] })] }).job('package', {
+ permissions: { packages: 'preview' },
+ egress: ['registry.npmjs.org'],
+ steps: [
+ setup.node(),
+ setup.pnpm(),
+ { name: 'Install dependencies', run: 'pnpm install --frozen-lockfile' },
+ { name: 'Build', run: 'pnpm build' },
+ packagePreview({ npm: ['.'] }),
+ ],
+})
1 addition and 0 deletions.gitignoreModified
View file
@@ -1 +1,2 @@
node_modules/
+dist/
10 additions and 1 deletionpackage.jsonModified
View file
@@ -4,10 +4,19 @@
"description": "A small task list library. The public demo repository of TanStack Source.",
"type": "module",
"license": "MIT",
+ "main": "./dist/index.js",
+ "types": "./dist/index.d.ts",
"exports": {