Dashboard › craft › Distillation
5508ad36-b8ae-46bb-9dfd-c4185384c000["lore_tm_v1_u8NGxXJZ-4xiGYrVE4Qn-FJN7MmApIFlSzHIgQCF5G8","lore_tm_v1_yEigYpVblIy3A46k0UoWVvkga71hoQDHVOvL1DR0XKU","lore_tm_v1_1y7Sxi-depUBc4udjSo4cOFPtu2Pqf_a0yhBJzNvZOM"]
Date: Sep 3, 2026
expandWorkspaceTargets, including craft/src/commands/publish.ts where targetConfigList = await expandWorkspaceTargets(config.targets || []) follows the comment “Expand any npm workspace targets into individual package targets”; craft/src/commands/targets.ts where definedTargets = await expandWorkspaceTargets(definedTargets) follows “Expand workspace targets (e.g., npm workspaces)”; and craft/src/commands/__tests__/targets.test.ts tests for no-workspace listing, expanded workspace targets, and empty target results.publish-workspace-acceptance/src/modules/__tests__/publish-workflow.js imports resolvePublishLocation from ../publish-location.js, reads .github/workflows/publish.yml, extracts the YAML Set targets shell script using a regex bounded by - name: Set targets and - uses: docker://getsentry/craft:latest, and executes it through spawnSync("bash", ["-e", "-c", getSetTargetsScript()]).runSetTargets({ path, repo, version, workspace = "" }) test helper provides CRAFT_PUBLISH_PATH, CRAFT_PUBLISH_REPO, CRAFT_PUBLISH_TARGETS_JSON: '["github"]', CRAFT_PUBLISH_VERSION, CRAFT_PUBLISH_WORKSPACE, GITHUB_OUTPUT, and GITHUB_WORKSPACE; it expects exit status 0, reads state_file= from GitHub output, and returns the state-file path and contents. Temporary directories named publish-workflow-test- are removed in afterEach.publish-workflow.js test “uses the CI-approved revision for checkout, location resolution, and publishing” asserts this ordering in publish.yml: Resolve CI-approved release revision → Inform start → Check out target repo → Resolve publish location → Set targets → Publish using Craft. It requires checkout ref ref: ${{ steps.release-revision.outputs.revision }}, getsentry/craft:latest workspace list, conditional if [[ "$requires_workspace_discovery" == "true", and rejects getsentry/craft:2.31.0.CRAFT_PUBLISH_PATH: ${{ fromJSON(steps.location.outputs.result).path }}, CRAFT_PUBLISH_WORKSPACE: ${{ fromJSON(steps.location.outputs.result).workspace || '' }}, and publishing command craft publish ${{ fromJSON(steps.inputs.outputs.result).version }} --rev ${{ steps.release-revision.outputs.revision }}.publish-workflow.js validates Craft’s legacy root state filename: for path: ".", repo: "sentry", and version "21.3.1", the state file must match .craft-state/craft/publish-state-getsentry-sentry-c232c383e26f-21.3.1.json and parse to { published: { github: true } }.publish-workflow.js validates monorepo workspace state naming: resolvePublishLocation({ path: "./cli", workspaceNames: ["cli"] }), followed by runSetTargets with repo: "toolkit" and version "1.2.3", must produce a state file matching .craft-state/craft/publish-state-getsentry-toolkit-c232c383e26f-workspace-Y2xp-1.2.3.json and state { published: { github: true } }.craft/src/config.ts defines expandWorkspaceTargets at line 576 and notes that getTargetByName is imported lazily there to avoid an issue not shown in the search output.craft/src/utils/workspaces.ts defines WorkspacePackage, WorkspaceDiscoveryResult, and PnpmWorkspaceConfig; supports npm/yarn workspace discovery from package.json’s workspaces field and pnpm discovery from pnpm-workspace.yaml. extractWorkspacesGlobs() accepts either a string array or { packages?: string[] }; discoverWorkspaces() tries pnpm first, then npm/yarn, and otherwise returns type none.craft/src/utils/workspaces.ts resolves workspace globs through resolveWorkspaceGlobs(), logs failed parsing of pnpm-workspace.yaml, and exports filterWorkspacePackages(). Tests are in craft/src/utils/__tests__/workspaces.test.ts, with fixtures in craft/src/utils/__fixtures__/workspaces; shown test groups cover npm discovery, pnpm discovery, no-workspace (none) results, and workspace package filtering.craft/src/targets/npm.ts imports discoverWorkspaces, filterWorkspacePackages, and WorkspacePackage; its npm target configuration includes workspaces?: boolean, includeWorkspaces?: string, and excludeWorkspaces?: string. Workspace target expansion returns the configuration unchanged when config.workspaces is not enabled, warns when enabled but no workspace packages are found, and filters discovered packages using regexes derived from includeWorkspaces and excludeWorkspaces.craft/src/targets/npm.ts supports workspace version bumps: it identifies a workspace when discovery returns a non-none type with at least one package, then invokes npm 7+ workspace support with --workspaces and logs Running: ${bin} ${workspaceArgs.join(' ')} (for workspaces).craft/src/targets/crates.ts, which defines isWorkspaceDependency, filters packages with no workspace dependencies, and implements publishWorkspace(directory: string); its publishing flow invokes await this.publishWorkspace(directory).