WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ce934b4

Browse files
authored
ci: add internal-debug release mode (#14820)
This PR adds support for publishing internal-debug pre-releases, designed to make debugging Payload packages easier during development. ## Usage When manually triggering the publish-prerelease workflow, check the "Enable debug mode" checkbox to publish an internal-debug release. ## Why? Debug builds skip bundling, React Compiler transformations, and minification. This makes it easier to: - Inspect Payload source code directly in node_modules - Set breakpoints and step through unminified code - Make local modifications for testing/debugging purposes
1 parent e818a01 commit ce934b4

File tree

47 files changed

+117
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+117
-14
lines changed

.github/workflows/publish-prerelease.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
# Run nightly at 10pm EST
66
- cron: '0 3 * * *'
77
workflow_dispatch:
8+
inputs:
9+
debug_build:
10+
description: 'Enable debug build (uses internal-debug tag and pnpm build:debug)'
11+
required: false
12+
default: false
13+
type: boolean
814

915
env:
1016
DO_NOT_TRACK: 1 # Disable Turbopack telemetry
@@ -26,18 +32,23 @@ jobs:
2632
env:
2733
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2834

29-
- name: Determine release type
35+
- name: Determine release type and debug flag
3036
id: determine_release_type
31-
# Use 'canary' for main branch, 'internal' for others
37+
# Use 'internal-debug' if debug mode, 'canary' for main branch, 'internal' for others
3238
run: |
33-
if [[ ${{ github.ref_name }} == "main" ]]; then
39+
if [[ "${{ inputs.debug_build }}" == "true" ]]; then
40+
echo "release_type=internal-debug" >> $GITHUB_OUTPUT
41+
echo "debug_flag=--debug" >> $GITHUB_OUTPUT
42+
elif [[ ${{ github.ref_name }} == "main" ]]; then
3443
echo "release_type=canary" >> $GITHUB_OUTPUT
44+
echo "debug_flag=" >> $GITHUB_OUTPUT
3545
else
3646
echo "release_type=internal" >> $GITHUB_OUTPUT
47+
echo "debug_flag=" >> $GITHUB_OUTPUT
3748
fi
3849
3950
- name: Release
40-
run: pnpm publish-prerelease --tag ${{ steps.determine_release_type.outputs.release_type }}
51+
run: pnpm publish-prerelease --tag ${{ steps.determine_release_type.outputs.release_type }} ${{ steps.determine_release_type.outputs.debug_flag }}
4152
env:
4253
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4354
NPM_CONFIG_PROVENANCE: true

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"build:db-postgres": "turbo build --filter \"@payloadcms/db-postgres\"",
2525
"build:db-sqlite": "turbo build --filter \"@payloadcms/db-sqlite\"",
2626
"build:db-vercel-postgres": "turbo build --filter \"@payloadcms/db-vercel-postgres\"",
27+
"build:debug": "turbo build:debug --filter \"!blank\" --filter \"!website\" --filter \"!ecommerce\"",
2728
"build:drizzle": "turbo build --filter \"@payloadcms/drizzle\"",
2829
"build:email-nodemailer": "turbo build --filter \"@payloadcms/email-nodemailer\"",
2930
"build:email-resend": "turbo build --filter \"@payloadcms/email-resend\"",

packages/admin-bar/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
],
3333
"scripts": {
3434
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
35+
"build:debug": "pnpm build",
3536
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
3637
"build:types": "tsc --emitDeclarationOnly --outDir dist",
3738
"clean": "rimraf -g {dist,*.tsbuildinfo}",

packages/create-payload-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
],
5050
"scripts": {
5151
"build": "pnpm pack-template-files && pnpm typecheck && pnpm build:swc",
52+
"build:debug": "pnpm build",
5253
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
5354
"clean": "rimraf -g {dist,*.tsbuildinfo}",
5455
"lint": "eslint .",

packages/db-d1-sqlite/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
],
6464
"scripts": {
6565
"build": "pnpm build:swc && pnpm build:types",
66+
"build:debug": "pnpm build",
6667
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
6768
"build:types": "tsc --emitDeclarationOnly --outDir dist",
6869
"clean": "rimraf -g {dist,*.tsbuildinfo}",

packages/db-mongodb/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
],
4545
"scripts": {
4646
"build": "pnpm build:types && pnpm build:swc",
47+
"build:debug": "pnpm build",
4748
"build:swc": "swc ./src -d ./dist --config-file .swcrc-build --strip-leading-paths",
4849
"build:types": "tsc --emitDeclarationOnly --outDir dist",
4950
"clean": "rimraf -g {dist,*.tsbuildinfo}",

packages/db-postgres/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
],
6565
"scripts": {
6666
"build": "rimraf .dist && rimraf tsconfig.tsbuildinfo && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm renamePredefinedMigrations",
67+
"build:debug": "pnpm build",
6768
"build:esbuild": "echo skipping esbuild",
6869
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
6970
"build:types": "tsc --emitDeclarationOnly --outDir dist",

packages/db-sqlite/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
],
6565
"scripts": {
6666
"build": "pnpm build:swc && pnpm build:types",
67+
"build:debug": "pnpm build",
6768
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
6869
"build:types": "tsc --emitDeclarationOnly --outDir dist",
6970
"clean": "rimraf -g {dist,*.tsbuildinfo}",

packages/db-vercel-postgres/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
],
6565
"scripts": {
6666
"build": "rimraf .dist && rimraf tsconfig.tsbuildinfo && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm renamePredefinedMigrations",
67+
"build:debug": "pnpm build",
6768
"build:esbuild": "echo skipping esbuild",
6869
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
6970
"build:types": "tsc --emitDeclarationOnly --outDir dist",

packages/drizzle/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
],
5050
"scripts": {
5151
"build": "pnpm build:swc && pnpm build:types",
52+
"build:debug": "pnpm build",
5253
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
5354
"build:types": "tsc --emitDeclarationOnly --outDir dist",
5455
"clean": "rimraf -g {dist,*.tsbuildinfo}",

0 commit comments

Comments
 (0)