Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
56e4ee5
refactor: refactored release strategy
blunteshwar Jan 21, 2026
15293fb
chore: update publish workflows for 1st-gen and 2nd-gen
blunteshwar Jan 21, 2026
27a002e
chore: change default NPM dist-tag to 'snapshot-test' in publish work…
blunteshwar Jan 21, 2026
c9b45f3
chore: refine changeset backup logic in publish workflows for 1st-gen…
blunteshwar Jan 21, 2026
ea9c6ef
chore: minor fix
blunteshwar Jan 21, 2026
40bc802
chore: enable publishing in workflows and add changeset for @adobe/sp…
blunteshwar Jan 21, 2026
54c19ef
chore: remove private flag from swc package.json
blunteshwar Jan 21, 2026
7098a52
chore: migrated to trusted release for gen1
blunteshwar Jan 27, 2026
fb6021b
chore: update Node.js version to 20.17.0
blunteshwar Jan 27, 2026
091fc77
chore: update publish workflows for 1st-gen and 2nd-gen
blunteshwar Jan 27, 2026
f42a472
Merge branch 'main' into SWC-1405
blunteshwar Jan 27, 2026
f1ad6a7
chore: add push trigger for SWC-1405 branch in publish workflows
blunteshwar Jan 27, 2026
2f925a6
chore: update CODEOWNERS to specify file protections and maintainers …
blunteshwar Jan 27, 2026
cc8cee9
chore: replace 2nd-gen publish workflow with a unified publish workflow
blunteshwar Jan 29, 2026
ecc9239
chore: remove deprecated publish workflow for packages
blunteshwar Jan 29, 2026
800e373
chore: simplify CODEOWNERS by removing specific protections for workf…
blunteshwar Jan 29, 2026
96a07ff
chore: added "1st-gen/projects/*" to root package.json
blunteshwar Jan 29, 2026
e76d760
chore: add repository information to package.json in cem-plugin-react…
blunteshwar Jan 29, 2026
8958701
chore: update Node.js setup to use version from .nvmrc and refine pac…
blunteshwar Jan 29, 2026
b8cf8ff
chore: add "types" field to package.json for postcss-token
blunteshwar Jan 29, 2026
c983f5d
chore: brought upto main
blunteshwar Jan 29, 2026
1f5af05
Merge branch 'main' into SWC-1405
blunteshwar Jan 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"!@spectrum-web-components/2nd-gen"
]
],
"linked": [["@adobe/swc", "@spectrum-web-components/core"]],
"linked": [["@adobe/spectrum-wc", "@spectrum-web-components/core"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/tired-comics-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@adobe/spectrum-wc': patch
---

Testing
177 changes: 177 additions & 0 deletions .github/workflows/publish-1st-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Publish 1st-gen

on:
workflow_dispatch:
inputs:
tag:
description: 'NPM dist-tag (e.g., latest, beta, snapshot)'
required: false
default: 'snapshot-test'
push:
branches:
- SWC-1405
# paths:
# - '1st-gen/**'
# - '.changeset/**'

jobs:
publish:
runs-on: ubuntu-latest
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup job and install dependencies
uses: ./.github/actions/setup-job

- name: Set Git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions-bot"

- name: Extract tag from commit message or use default
id: extract-tag
run: |
# Get tag from workflow_dispatch input (if manually triggered)
WORKFLOW_TAG="${{ github.event.inputs.tag }}"

# If not manually triggered, try to extract from commit message
if [ -z "$WORKFLOW_TAG" ]; then
COMMIT_MSG="${{ github.event.head_commit.message }}"
# Look for [tag:xxx] pattern in commit message
if echo "$COMMIT_MSG" | grep -qE '\[tag:([a-zA-Z0-9-]+)\]'; then
WORKFLOW_TAG=$(echo "$COMMIT_MSG" | grep -oE '\[tag:([a-zA-Z0-9-]+)\]' | sed 's/\[tag://;s/\]//')
else
# Default to snapshot-test if no tag specified
WORKFLOW_TAG="snapshot-test"
fi
fi

echo "tag=$WORKFLOW_TAG" >> $GITHUB_OUTPUT
echo "Using npm tag: $WORKFLOW_TAG"

- name: Filter changesets for 1st-gen
id: check-changesets
run: |
# Create backup directory
mkdir -p .changeset-backup

# Count total changesets
TOTAL=$(ls -1 .changeset/*.md 2>/dev/null | grep -v README | wc -l | tr -d ' ')

# Move 2nd-gen related changesets to backup
MOVED=0
for file in .changeset/*.md; do
if [ -f "$file" ] && [ "$(basename "$file")" != "README.md" ]; then
# Only back up changesets that mention 2nd-gen packages (@adobe/spectrum-wc)
# @spectrum-web-components/core is part of 1st-gen, so don't back it up
if grep -q "@adobe/spectrum-wc\|2nd-gen" "$file"; then
mv "$file" .changeset-backup/
echo "Backed up: $(basename "$file")"
MOVED=$((MOVED + 1))
fi
fi
done

REMAINING=$((TOTAL - MOVED))
echo "Total changesets: $TOTAL"
echo "Backed up 2nd-gen: $MOVED"
echo "Remaining for 1st-gen: $REMAINING"

if [ "$REMAINING" -eq 0 ]; then
echo "has_changesets=false" >> $GITHUB_OUTPUT
else
echo "has_changesets=true" >> $GITHUB_OUTPUT
fi

- name: Build packages
if: steps.check-changesets.outputs.has_changesets == 'true'
run: yarn build:1st-gen

- name: Generate custom elements manifests
if: steps.check-changesets.outputs.has_changesets == 'true'
run: yarn workspace @spectrum-web-components/1st-gen custom-element-json

- name: Confirm build artifacts
if: steps.check-changesets.outputs.has_changesets == 'true'
run: yarn workspace @spectrum-web-components/1st-gen build:confirm

- name: Version packages
if: steps.check-changesets.outputs.has_changesets == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.extract-tag.outputs.tag }}"
if [ "$TAG" == "latest" ]; then
yarn workspace @spectrum-web-components/1st-gen changelog:global
yarn changeset version
else
yarn changeset version --snapshot $TAG
fi

- name: Refresh lockfile and rebuild
if: steps.check-changesets.outputs.has_changesets == 'true'
run: |
yarn install --refresh-lockfile
yarn build:1st-gen

- name: Configure NPM authentication
if: steps.check-changesets.outputs.has_changesets == 'true'
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish to npm
if: steps.check-changesets.outputs.has_changesets == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
TAG="${{ steps.extract-tag.outputs.tag }}"
if [ "$TAG" == "latest" ]; then
yarn changeset publish --no-git-tag
else
yarn changeset publish --no-git-tag --tag $TAG
fi

- name: Build React wrappers
if: steps.check-changesets.outputs.has_changesets == 'true'
run: yarn workspace @spectrum-web-components/1st-gen build:react

- name: Publish React wrappers
if: steps.check-changesets.outputs.has_changesets == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
TAG="${{ steps.extract-tag.outputs.tag }}"
if [ "$TAG" == "latest" ]; then
PUBLISH_CMD="npm publish --access public"
else
PUBLISH_CMD="npm publish --tag $TAG --access public"
fi
cd 1st-gen/react
for dir in */; do
(cd "$dir" && $PUBLISH_CMD) || exit 1
done

- name: Restore backed up changesets
if: always()
run: |
if [ -d ".changeset-backup" ]; then
mv .changeset-backup/*.md .changeset/ 2>/dev/null || true
rmdir .changeset-backup 2>/dev/null || true
echo "Restored backed up changesets"
fi

- name: Commit and push changes
if: steps.check-changesets.outputs.has_changesets == 'true' && steps.extract-tag.outputs.tag == 'latest'
run: |
git add .
git commit -m "chore: release 1st-gen packages #publish" || echo "No changes to commit"
git push

- name: Create git tag
if: steps.check-changesets.outputs.has_changesets == 'true' && steps.extract-tag.outputs.tag == 'latest'
run: node ./1st-gen/scripts/create-git-tag.js
151 changes: 151 additions & 0 deletions .github/workflows/publish-2nd-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Publish 2nd-gen

on:
workflow_dispatch:
inputs:
tag:
description: 'NPM dist-tag (e.g., latest, beta, snapshot)'
required: false
default: 'snapshot-test'
push:
branches:
- SWC-1405
paths:
- '2nd-gen/**'
- '.changeset/**'

jobs:
publish:
# Temporarily disabled - change to 'true' to re-enable
if: true
runs-on: ubuntu-latest
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup job and install dependencies
uses: ./.github/actions/setup-job

- name: Set Git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions-bot"

- name: Extract tag from commit message or use default
id: extract-tag
run: |
# Get tag from workflow_dispatch input (if manually triggered)
WORKFLOW_TAG="${{ github.event.inputs.tag }}"

# If not manually triggered, try to extract from commit message
if [ -z "$WORKFLOW_TAG" ]; then
COMMIT_MSG="${{ github.event.head_commit.message }}"
# Look for [tag:xxx] pattern in commit message
if echo "$COMMIT_MSG" | grep -qE '\[tag:([a-zA-Z0-9-]+)\]'; then
WORKFLOW_TAG=$(echo "$COMMIT_MSG" | grep -oE '\[tag:([a-zA-Z0-9-]+)\]' | sed 's/\[tag://;s/\]//')
else
# Default to snapshot-test if no tag specified
WORKFLOW_TAG="snapshot-test"
fi
fi

echo "tag=$WORKFLOW_TAG" >> $GITHUB_OUTPUT
echo "Using npm tag: $WORKFLOW_TAG"

- name: Filter changesets for 2nd-gen
id: check-changesets
run: |
# Create backup directory
mkdir -p .changeset-backup

# Count total changesets
TOTAL=$(ls -1 .changeset/*.md 2>/dev/null | grep -v README | wc -l | tr -d ' ')

# Move 1st-gen only changesets to backup
MOVED=0
for file in .changeset/*.md; do
if [ -f "$file" ] && [ "$(basename "$file")" != "README.md" ]; then
# Back up changesets that mention 1st-gen packages (including core)
# Only keep changesets that mention @adobe/spectrum-wc for 2nd-gen
if grep -q "@spectrum-web-components/" "$file" && ! grep -q "@adobe/spectrum-wc" "$file"; then
mv "$file" .changeset-backup/
echo "Backed up: $(basename "$file")"
MOVED=$((MOVED + 1))
fi
fi
done

REMAINING=$((TOTAL - MOVED))
echo "Total changesets: $TOTAL"
echo "Backed up 1st-gen: $MOVED"
echo "Remaining for 2nd-gen: $REMAINING"

if [ "$REMAINING" -eq 0 ]; then
echo "has_changesets=false" >> $GITHUB_OUTPUT
else
echo "has_changesets=true" >> $GITHUB_OUTPUT
fi

- name: Build packages
if: steps.check-changesets.outputs.has_changesets == 'true'
run: yarn build:2nd-gen

- name: Version packages
if: steps.check-changesets.outputs.has_changesets == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.extract-tag.outputs.tag }}"
if [ "$TAG" == "latest" ]; then
yarn changeset version
else
yarn changeset version --snapshot $TAG
fi

- name: Update 2nd-gen version file
if: steps.check-changesets.outputs.has_changesets == 'true'
run: |
yarn genversion --source ./1st-gen/tools/base/package.json --semi --es6 --force ./2nd-gen/packages/core/shared/base/version.ts

- name: Refresh lockfile and rebuild
if: steps.check-changesets.outputs.has_changesets == 'true'
run: |
yarn install --refresh-lockfile
yarn build:2nd-gen

- name: Configure NPM authentication for Adobe namespace
if: steps.check-changesets.outputs.has_changesets == 'true'
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.ADOBE_BOT_NPM_TOKEN }}" > ~/.npmrc

- name: Publish to npm
if: steps.check-changesets.outputs.has_changesets == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
run: |
TAG="${{ steps.extract-tag.outputs.tag }}"
if [ "$TAG" == "latest" ]; then
yarn changeset publish --no-git-tag
else
yarn changeset publish --no-git-tag --tag $TAG
fi

- name: Restore backed up changesets
if: always()
run: |
if [ -d ".changeset-backup" ]; then
mv .changeset-backup/*.md .changeset/ 2>/dev/null || true
rmdir .changeset-backup 2>/dev/null || true
echo "Restored backed up changesets"
fi

- name: Commit and push changes
if: steps.check-changesets.outputs.has_changesets == 'true' && steps.extract-tag.outputs.tag == 'latest'
run: |
git add .
git commit -m "chore: release 2nd-gen packages #publish" || echo "No changes to commit"
git push
4 changes: 3 additions & 1 deletion 1st-gen/storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export default {
'@spectrum-web-components/core': resolve(
'../2nd-gen/packages/core/dist'
),
'@adobe/swc': resolve('../2nd-gen/packages/swc/dist'),
'@adobe/spectrum-wc': resolve(
'../2nd-gen/packages/swc/dist'
),
},
},
});
Expand Down
4 changes: 2 additions & 2 deletions 2nd-gen/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
[
"^lit",
"^@lit",
"^(?!@adobe/swc|@spectrum-web-components)@?\\w"
"^(?!@adobe/spectrum-wc|@spectrum-web-components)@?\\w"
],
["^@adobe/swc", "^@spectrum-web-components"],
["^@adobe/spectrum-wc", "^@spectrum-web-components"],
["^\\u0000"],
["^\\."],
["^.+\\.(css|scss|sass|less|styl)$"]
Expand Down
2 changes: 1 addition & 1 deletion 2nd-gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This workspace contains the second generation of Spectrum Web Components, built
## Packages

- **[@spectrum-web-components/core](./packages/core)** - Abstract base classes providing shared functionality
- **[@adobe/swc](./packages/swc)** - Concrete component implementations with styling
- **[@adobe/spectrum-wc](./packages/swc)** - Concrete component implementations with styling

## Getting Started

Expand Down
12 changes: 6 additions & 6 deletions 2nd-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
},
"type": "module",
"scripts": {
"build": "yarn workspaces foreach --from '{@spectrum-web-components/core,@adobe/swc}' --recursive run build",
"clean": "yarn workspaces foreach --from '{@spectrum-web-components/core,@adobe/swc}' --recursive run clean",
"dev:analyze": "yarn workspace @adobe/swc analyze:watch",
"build": "yarn workspaces foreach --from '{@spectrum-web-components/core,@adobe/spectrum-wc}' --recursive run build",
"clean": "yarn workspaces foreach --from '{@spectrum-web-components/core,@adobe/spectrum-wc}' --recursive run clean",
"dev:analyze": "yarn workspace @adobe/spectrum-wc analyze:watch",
"dev:core": "yarn workspace @spectrum-web-components/core dev",
"lint": "cd .. && eslint 2nd-gen --ext .ts,.js,.json",
"start": "run-p dev:core dev:analyze storybook",
"storybook": "yarn workspace @adobe/swc storybook",
"storybook:build": "yarn workspace @adobe/swc storybook:build",
"test": "yarn workspace @adobe/swc test",
"storybook": "yarn workspace @adobe/spectrum-wc storybook",
"storybook:build": "yarn workspace @adobe/spectrum-wc storybook:build",
"test": "yarn workspace @adobe/spectrum-wc test",
"test:a11y": "playwright test --config=../playwright.a11y.config.ts",
"test:a11y:1st": "playwright test --config=../playwright.a11y.config.ts --project=1st-gen",
"test:a11y:2nd": "playwright test --config=../playwright.a11y.config.ts --project=2nd-gen",
Expand Down
Loading
Loading