Repository navigation
build(account,ingest-types): compile to dist for publish #17840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bd86739
7ad2414
93273f1
5fa9127
a195220
6e339f7
c0eb4c1
6082d36
5da2078
a1ef967
65756db
4c7e091
ae9273f
a22ca6d
e9455bd
5087971
5be024d
98691b6
eb70654
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| name: 'CI: Account Pack Check' | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches-ignore: [wip/*, draft/*, temp/*] | ||
| paths: | ||
| - 'packages/account/**' | ||
| - 'packages/ingest-types/**' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| verify-pack-contents: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| package: [account, ingest-types] | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup frontend | ||
| uses: ./.github/actions/setup-frontend | ||
|
|
||
| - name: Typecheck | ||
| run: pnpm -C packages/${{ matrix.package }} typecheck | ||
|
|
||
| - name: Build package | ||
| run: pnpm -C packages/${{ matrix.package }} build | ||
|
|
||
| - name: Verify packed tarball only contains compiled dist output | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| UNEXPECTED=$( | ||
| pnpm -C packages/${{ matrix.package }} pack --dry-run --json | | ||
| jq -r ' | ||
| .files[].path | ||
| | select( | ||
| . != "package.json" | ||
| and . != "LICENSE" | ||
| and . != "README.md" | ||
| and (startswith("dist/") | not) | ||
| ) | ||
| ' | ||
| ) | ||
| if [ -n "$UNEXPECTED" ]; then | ||
| echo "::error title=Unexpected files in tarball::Packed tarball contains files outside dist:" >&2 | ||
| echo "$UNEXPECTED" >&2 | ||
| exit 1 | ||
| fi | ||
| echo 'Packed tarball contains only expected files.' | ||
|
|
||
| - name: Verify published manifest resolves to dist and pins real versions | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| PACK_DIR="$RUNNER_TEMP/${{ matrix.package }}-pack" | ||
| rm -rf "$PACK_DIR" | ||
| mkdir -p "$PACK_DIR" | ||
| pnpm -C packages/${{ matrix.package }} pack --pack-destination "$PACK_DIR" | ||
| TARBALL=$(find "$PACK_DIR" -maxdepth 1 -name '*.tgz' | head -n 1) | ||
| if [ -z "$TARBALL" ]; then | ||
| echo "::error title=Pack failed::No tarball produced in $PACK_DIR" >&2 | ||
| exit 1 | ||
| fi | ||
| MANIFEST=$(tar -xzOf "$TARBALL" package/package.json) | ||
| NON_DIST_EXPORTS=$( | ||
| printf '%s' "$MANIFEST" | | ||
| jq -r ' | ||
| [ | ||
| .exports | ||
| | .. | ||
| | strings | ||
| | select(. != "./package.json" and (startswith("./dist/") | not)) | ||
| ] | ||
| | join(", ") | ||
| ' | ||
| ) | ||
| if [ -n "$NON_DIST_EXPORTS" ]; then | ||
| echo "::error title=Exports escape dist::Published exports must resolve to compiled dist output, got: $NON_DIST_EXPORTS" >&2 | ||
| exit 1 | ||
| fi | ||
| PACKED_FILES=$(tar -tzf "$TARBALL" | sed -n 's#^package/##p') | ||
| MISSING_TARGETS='' | ||
| while IFS= read -r TARGET; do | ||
| [ -n "$TARGET" ] || continue | ||
| PATTERN=${TARGET#./} | ||
| FOUND='' | ||
| while IFS= read -r PACKED; do | ||
| # Unquoted: pattern exports like ./dist/* must glob-match. | ||
| case "$PACKED" in | ||
| $PATTERN) | ||
| FOUND=yes | ||
| break | ||
| ;; | ||
| esac | ||
| done <<< "$PACKED_FILES" | ||
| if [ -z "$FOUND" ]; then | ||
| MISSING_TARGETS="${MISSING_TARGETS}${TARGET}"$'\n' | ||
| fi | ||
| done <<< "$(printf '%s' "$MANIFEST" | jq -r '[.exports | .. | strings] | unique[]')" | ||
| if [ -n "$MISSING_TARGETS" ]; then | ||
| echo "::error title=Exports missing from tarball::Published exports point at files the tarball does not contain:" >&2 | ||
| printf '%s' "$MISSING_TARGETS" >&2 | ||
| echo "Packed files:" >&2 | ||
| printf '%s\n' "$PACKED_FILES" >&2 | ||
| exit 1 | ||
| fi | ||
| UNRESOLVED=$( | ||
| printf '%s' "$MANIFEST" | | ||
| jq -r ' | ||
| (.dependencies // {}) + (.peerDependencies // {}) | ||
| | to_entries[] | ||
| | select(.value | test("^(catalog:|workspace:)")) | ||
| | "\(.key)@\(.value)" | ||
| ' | ||
| ) | ||
| if [ -n "$UNRESOLVED" ]; then | ||
| echo "::error title=Unresolved workspace specifiers::Published manifest must not contain catalog:/workspace: ranges:" >&2 | ||
| echo "$UNRESOLVED" >&2 | ||
| exit 1 | ||
| fi | ||
| echo 'Published manifest resolves to dist with real dependency ranges.' | ||
|
|
||
| smoke-consumer: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup frontend | ||
| uses: ./.github/actions/setup-frontend | ||
|
|
||
| - name: Install the packed tarballs into a clean consumer and import every entry | ||
| run: pnpm --filter @comfyorg/account smoke:pack |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 Comfy Org | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,7 @@ | |
| "keywords": [], | ||
| "license": "MIT", | ||
| "files": [ | ||
| "src", | ||
| "!src/**/*.test.ts", | ||
| "!src/**/__fixtures__" | ||
| "dist" | ||
| ], | ||
| "type": "module", | ||
| "exports": { | ||
|
|
@@ -39,9 +37,111 @@ | |
| "./package.json": "./package.json" | ||
| }, | ||
| "publishConfig": { | ||
| "exports": { | ||
| "./boundedOperation": { | ||
| "types": "./dist/core/boundedOperation.d.ts", | ||
| "import": "./dist/core/boundedOperation.js" | ||
| }, | ||
| "./lazyIdentity": { | ||
| "types": "./dist/core/lazyIdentity.d.ts", | ||
| "import": "./dist/core/lazyIdentity.js" | ||
| }, | ||
| "./session": { | ||
| "types": "./dist/core/session.d.ts", | ||
| "import": "./dist/core/session.js" | ||
| }, | ||
| "./billing": { | ||
| "types": "./dist/core/billing/index.d.ts", | ||
| "import": "./dist/core/billing/index.js" | ||
| }, | ||
| "./firebase": { | ||
| "types": "./dist/firebase/index.d.ts", | ||
| "import": "./dist/firebase/index.js" | ||
| }, | ||
| "./web": { | ||
| "types": "./dist/web/crossTabRefresh.d.ts", | ||
| "import": "./dist/web/crossTabRefresh.js" | ||
| }, | ||
| "./vue/PasswordRules": { | ||
| "types": "./dist/vue/PasswordRules.vue.d.ts", | ||
| "import": "./dist/vue/PasswordRules.vue" | ||
| }, | ||
| "./vue/SocialAuthButtons": { | ||
| "types": "./dist/vue/SocialAuthButtons.vue.d.ts", | ||
| "import": "./dist/vue/SocialAuthButtons.vue" | ||
| }, | ||
| "./vue/TurnstileWidget": { | ||
| "types": "./dist/vue/TurnstileWidget.vue.d.ts", | ||
| "import": "./dist/vue/TurnstileWidget.vue" | ||
| }, | ||
| "./vue/regionGate": { | ||
| "types": "./dist/vue/regionGate.d.ts", | ||
| "import": "./dist/vue/regionGate.js" | ||
| }, | ||
| "./vue/turnstileGate": { | ||
| "types": "./dist/vue/turnstileGate.d.ts", | ||
| "import": "./dist/vue/turnstileGate.js" | ||
| }, | ||
| "./vue/lifecycleScope": { | ||
| "types": "./dist/vue/lifecycleScope.d.ts", | ||
| "import": "./dist/vue/lifecycleScope.js" | ||
| }, | ||
| "./vue/useGenerationGuard": { | ||
| "types": "./dist/vue/useGenerationGuard.d.ts", | ||
| "import": "./dist/vue/useGenerationGuard.js" | ||
| }, | ||
| "./testing": { | ||
| "types": "./dist/testing.d.ts", | ||
| "import": "./dist/testing.js" | ||
| }, | ||
| "./customerRecovery": { | ||
| "types": "./dist/core/customerRecovery.d.ts", | ||
| "import": "./dist/core/customerRecovery.js" | ||
| }, | ||
| "./signInSchemas": { | ||
| "types": "./dist/signInSchemas.d.ts", | ||
| "import": "./dist/signInSchemas.js" | ||
| }, | ||
| "./turnstile": { | ||
| "types": "./dist/turnstile.d.ts", | ||
| "import": "./dist/turnstile.js" | ||
| }, | ||
| "./turnstileScript": { | ||
| "types": "./dist/turnstileScript.d.ts", | ||
| "import": "./dist/turnstileScript.js" | ||
| }, | ||
| "./firebaseAuthError": { | ||
| "types": "./dist/firebaseAuthError.d.ts", | ||
| "import": "./dist/firebaseAuthError.js" | ||
| }, | ||
| "./provisioning": { | ||
| "types": "./dist/provisioning.d.ts", | ||
| "import": "./dist/provisioning.js" | ||
| }, | ||
| "./redirect": { | ||
| "types": "./dist/redirect.d.ts", | ||
| "import": "./dist/redirect.js" | ||
| }, | ||
| "./region": { | ||
| "types": "./dist/region.d.ts", | ||
| "import": "./dist/region.js" | ||
| }, | ||
| "./telemetry": { | ||
| "types": "./dist/telemetry.d.ts", | ||
| "import": "./dist/telemetry.js" | ||
| }, | ||
| "./webviewDetection": { | ||
| "types": "./dist/webviewDetection.d.ts", | ||
| "import": "./dist/webviewDetection.js" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "access": "public" | ||
| }, | ||
| "scripts": { | ||
| "build": "pnpm run clean && vue-tsc -p tsconfig.build.json && tsx scripts/copyVueSources.ts", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "clean": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"", | ||
| "prepack": "pnpm run build", | ||
| "lint": "oxlint src --type-aware && eslint src", | ||
| "smoke:pack": "tsx scripts/smokePack.ts", | ||
| "test": "vitest run", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /** | ||
| * The Vue SFCs ship as source for the consumer's bundler: vue-tsc emits their | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete: the SFCs are not part of the published core. They ship from |
||
| * declarations, this copies the `.vue` files next to them and drops the | ||
| * script-only `.vue.js` vue-tsc also writes. | ||
| */ | ||
| import { copyFileSync, readdirSync, rmSync } from 'node:fs' | ||
| import { join } from 'node:path' | ||
| import { fileURLToPath } from 'node:url' | ||
|
|
||
| const packageDir = fileURLToPath(new URL('..', import.meta.url)) | ||
| const sourceDir = join(packageDir, 'src', 'vue') | ||
| const distDir = join(packageDir, 'dist', 'vue') | ||
|
|
||
| for (const name of readdirSync(sourceDir)) { | ||
| if (!name.endsWith('.vue')) continue | ||
| rmSync(join(distDir, `${name}.js`), { force: true }) | ||
| copyFileSync(join(sourceDir, name), join(distDir, name)) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seven
./vue/*published entries are the Vue layer the plan keeps out of the core artifact. Remove them frompublishConfig.exports; keep thesrc-pointing devexportsso the monorepo is unchanged until #17854 moves the files to@comfyorg/account-ui(./auth/*).