Skip to content

Commit 1ad19f7

Browse files
feat: introduce dual-generation monorepo architecture (#5785)
* chore: move repository contents under 1st-gen/ * build: configure root workspace and tooling - Add root package.json with workspace delegating scripts - Configure Yarn 4 with monorepo workspaces - Set up lint-staged, commitlint, and patch-package - Update .gitignore for dual-workspace structure - Configure root-level linting and formatting rules * feat: scaffold 2nd-gen workspace with components and tooling - Create 2nd-gen workspace with separate package.json - Add @spectrum-web-components/core package with shared base classes - Implement 2nd-gen components: asset, alert-banner, divider, progress-circle, status-light, report-abuse-button - Add @adobe/swc aggregator package - Configure Vite-based Storybook for Spectrum 2 - Set up Vitest and Playwright testing infrastructure - Add TypeScript path mappings for cross-generation imports * ci: update automation for dual-workspace structure - Update CircleCI config for 1st-gen and 2nd-gen paths - Modify GitHub workflows for monorepo structure - Update changeset configuration for dual-workspace - Add Cursor rules for contributor documentation * docs: add barebones architecture documentation - Add comprehensive contributor documentation - Document 1st-gen vs 2nd-gen split and migration paths - Include component migration step-by-step guides - Add project planning and workstream documentation - Document release processes and testing strategies * chore(tooling): adapt publishing workflow for new monorepo structure (#5851) * chore: update and streamline publishing workflow for new monorepo structure Refactors the publishing and release management workflow to support the dual-generation monorepo architecture: - Update Changesets configuration to recognize both 1st-gen and 2nd-gen workspaces, enabling independent versioning strategies - Refactor release scripts to delegate to generation-specific publishing workflows rather than operating on a flat package structure - Update CI/CD publishing jobs to build, test, and publish both generations with appropriate dependency handling for the shared Core library - Preserve existing 1st-gen package publishing behavior to avoid disruption to current consumers This workflow enables continuous delivery of improvements to 1st-gen customers while supporting independent 2nd-gen package releases.
1 parent bc0dad7 commit 1ad19f7

File tree

2,191 files changed

+27731
-7839
lines changed

Some content is hidden

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

2,191 files changed

+27731
-7839
lines changed

.changeset/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ find the full documentation for it [in our repository](https://github.com/change
88

99
Changesets are a way to manage versions and changelogs for monorepos. Each changeset:
1010

11-
- Describes changes made in one or more packages
12-
- Indicates the type of change (major, minor, patch)
13-
- Contains a brief markdown summary of the changes
11+
- Describes changes made in one or more packages
12+
- Indicates the type of change (major, minor, patch)
13+
- Contains a brief markdown summary of the changes
1414

1515
## How to Add a Changeset
1616

@@ -29,18 +29,25 @@ Changesets are a way to manage versions and changelogs for monorepos. Each chang
2929

3030
The command will create a new markdown file in the `.changeset` directory with your changes.
3131

32+
## Important: @spectrum-web-components/core and component updates
33+
34+
When making changes to `@spectrum-web-components/core`, you **must** also include the corresponding `@spectrum-web-components` component in the same changeset to ensure the changes appear in the component's changelog. This is because `@spectrum-web-components/core` changes are internal and don't automatically propagate to the component changelogs.
35+
36+
**Best practice**: Create a single changeset that includes both packages when updating core functionality that affects a specific component.
37+
3238
## Example Changeset
3339

3440
A typical changeset file looks like this:
3541

3642
```markdown
3743
---
44+
'@spectrum-web-components/core': patch
3845
'@spectrum-web-components/button': minor
3946
'@spectrum-web-components/theme': patch
4047
---
4148
42-
- **Added**: Added new variant `tertiary` to `<sp-button>` component [#9999](https://github.com/adobe/spectrum-web-components/pull/9999)
43-
- **Fixed**: Fixed `<sp-theme>` theme compatibility issues [#10000](https://github.com/adobe/spectrum-web-components/pull/10000)
49+
- **Added**: Added new variant `tertiary` to `<sp-button>` component [#9999](https://github.com/adobe/spectrum-web-components/pull/9999)
50+
- **Fixed**: Fixed `<sp-theme>` theme compatibility issues [#10000](https://github.com/adobe/spectrum-web-components/pull/10000)
4451
```
4552
4653
For our guidelines on writing changesets, see [our writing changesets guide](https://opensource.adobe.com/spectrum-web-components/guides/writing-changesets/).
@@ -61,6 +68,6 @@ We have a quick list of common questions to get you started engaging with this p
6168
6269
## Additional Resources
6370
64-
- [Changesets Documentation](https://github.com/changesets/changesets)
65-
- [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
66-
- [Detailed Release Process](https://github.com/changesets/changesets/blob/main/docs/detailed-explanation.md)
71+
- [Changesets Documentation](https://github.com/changesets/changesets)
72+
- [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
73+
- [Detailed Release Process](https://github.com/changesets/changesets/blob/main/docs/detailed-explanation.md)

.changeset/config.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@
77
}
88
],
99
"commit": false,
10-
"fixed": [["@spectrum-web-components/*"]],
11-
"linked": [],
10+
"fixed": [
11+
[
12+
"@spectrum-web-components/*",
13+
"!@spectrum-web-components/core",
14+
"!@spectrum-web-components/1st-gen",
15+
"!@spectrum-web-components/2nd-gen"
16+
]
17+
],
18+
"linked": [["@adobe/swc", "@spectrum-web-components/core"]],
1219
"access": "public",
1320
"baseBranch": "main",
1421
"updateInternalDependencies": "patch",
15-
"ignore": [],
22+
"ignore": [
23+
"@spectrum-web-components/1st-gen",
24+
"@spectrum-web-components/2nd-gen"
25+
],
1626
"snapshot": {
1727
"useCalculatedVersion": true,
1828
"prereleaseTemplate": "{tag}.{datetime}"

.circleci/config.yml

Lines changed: 69 additions & 51 deletions
Large diffs are not rendered by default.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
description: Useful for updating auto-generated navigation and validating links in the contributor docs
3+
alwaysApply: false
4+
---
5+
6+
# Contributor docs navigation and link validation
7+
8+
## When to apply this rule
9+
10+
Recognize and apply this rule when the user requests any of the following:
11+
- Update contributor docs navigation
12+
- Update nav / TOC / breadcrumbs in contributor docs
13+
- Regenerate contributor docs
14+
- Validate/verify links in contributor docs
15+
- Fix broken links in contributor docs
16+
- Any mention of "CONTRIBUTOR-DOCS" or "contributor docs" with "update", "nav", "links", or "verify"
17+
18+
## Instructions location
19+
20+
**Primary path:** `CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs/01_ai-agent-instructions.md`
21+
22+
## What to do
23+
24+
1. **Verify the instructions file exists** at the path above
25+
- If the file exists, read it and follow the instructions for "Role 1: Operator"
26+
- If the file does NOT exist, see "Self-correction procedure" below
27+
28+
2. **Follow the AI agent instructions** to:
29+
- Run the nav update script (which automatically validates links)
30+
- Handle any broken links that are reported
31+
- Report results to the user
32+
33+
## Self-correction procedure
34+
35+
If the instructions file is not found at the expected path:
36+
37+
1. Search for the file using: `glob_file_search` with pattern `**/ai-agent-instructions.md`
38+
2. Filter results to find the one in `CONTRIBUTOR-DOCS/` folder
39+
3. Read the found file to confirm it contains the nav update instructions
40+
4. **Update this rule file** with the new path by modifying the "Primary path" line above
41+
5. Inform the user that you've updated the rule with the new location
42+
6. Continue with the nav update process
43+
44+
## Quick reference
45+
46+
The nav update process typically involves:
47+
- Running a Node.js script in the authoring-contributor-docs folder
48+
- The script automatically updates breadcrumbs, TOC, and validates all links
49+
- If broken links are found, fix straightforward issues automatically
50+
- Only consult the user for ambiguous cases
51+
52+
Execution time is typically 20-200ms for the entire CONTRIBUTOR-DOCS tree.

.eslintrc.json

100755100644
Lines changed: 29 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
"extends": [
88
"eslint:recommended",
99
"plugin:@typescript-eslint/recommended",
10-
"plugin:prettier/recommended",
11-
"plugin:lit-a11y/recommended",
12-
"plugin:require-extensions/recommended"
10+
"plugin:prettier/recommended"
11+
],
12+
"ignorePatterns": [
13+
"CONTRIBUTOR-DOCS/**/*",
14+
"1st-gen/packages/icons/src/icons-*.svg.ts"
1315
],
1416
"overrides": [
1517
{
1618
"extends": ["plugin:jsonc/recommended-with-jsonc"],
1719
"files": ["*.json"],
1820
"parser": "jsonc-eslint-parser",
1921
"rules": {
20-
"jsonc/sort-keys": ["warn"],
21-
"notice/notice": "off"
22+
"jsonc/sort-keys": ["warn"]
2223
}
2324
},
2425
{
@@ -74,97 +75,56 @@
7475
"cpu",
7576
"publishConfig"
7677
],
77-
"pathPattern": "^$" // Top-level properties
78+
"pathPattern": "^$"
7879
},
7980
{
80-
/*
81-
* This rule excludes export conditions from alphabetical sorting.
82-
* Since node.js processes export conditions in order and chooses the
83-
* first match, they need to be ordered logically, not alphabetically.
84-
*/
8581
"order": { "type": "asc" },
86-
"pathPattern": "^(?!exports\\[).*" // All properties except export conditions
82+
"pathPattern": "^(?!exports\\[).*"
8783
}
8884
]
8985
}
9086
},
9187
{
92-
"files": ["scripts/*"],
88+
"extends": ["./1st-gen/.eslintrc.json"],
89+
"files": ["1st-gen/**/*"],
9390
"rules": {
94-
"no-console": ["off"]
91+
"notice/notice": [
92+
"error",
93+
{
94+
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
95+
"templateFile": "config/HEADER.js"
96+
}
97+
]
9598
}
9699
},
97100
{
98-
"files": ["react/**/*.ts"],
101+
"extends": ["./2nd-gen/.eslintrc.json"],
102+
"files": ["2nd-gen/**/*"],
99103
"rules": {
100-
"@typescript-eslint/no-explicit-any": "off"
104+
"notice/notice": [
105+
"error",
106+
{
107+
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
108+
"templateFile": "config/HEADER.js"
109+
}
110+
]
101111
}
102112
}
103113
],
104114
"parser": "@typescript-eslint/parser",
105115
"parserOptions": {
106-
"ecmaVersion": 2020,
116+
"ecmaVersion": "latest",
107117
"sourceType": "module"
108118
},
109-
"plugins": [
110-
"@typescript-eslint",
111-
"notice",
112-
"@spectrum-web-components",
113-
"import",
114-
"require-extensions"
115-
],
119+
"plugins": ["@typescript-eslint", "notice"],
116120
"root": true,
117121
"rules": {
118-
"@spectrum-web-components/prevent-argument-names": [
119-
"error",
120-
["e", "ev", "evt", "err"]
121-
],
122-
"curly": ["error", "all"],
123-
"import/extensions": [
124-
"error",
125-
"ignorePackages",
126-
{
127-
"ts": "never"
128-
}
129-
],
130-
"import/prefer-default-export": "off",
131-
"lit-a11y/click-events-have-key-events": [
132-
"error",
133-
{
134-
"allowList": [
135-
"sp-button",
136-
"sp-action-button",
137-
"sp-checkbox",
138-
"sp-radio",
139-
"sp-switch",
140-
"sp-menu-item",
141-
"sp-clear-button",
142-
"sp-underlay"
143-
]
144-
}
145-
],
146122
"no-console": [
147123
"error",
148124
{
149125
"allow": ["warn", "error"]
150126
}
151127
],
152-
"no-debugger": 2,
153-
"notice/notice": [
154-
"error",
155-
{
156-
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
157-
"templateFile": "config/license.js"
158-
}
159-
],
160-
"sort-imports": [
161-
"error",
162-
{
163-
"allowSeparatedGroups": false,
164-
"ignoreCase": true,
165-
"ignoreDeclarationSort": true,
166-
"ignoreMemberSort": false
167-
}
168-
]
128+
"no-debugger": 2
169129
}
170130
}

.github/workflows/browser-tests.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Browser Performance Tests
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
4+
workflow_dispatch: # Only run manually, not on pull requests
65

76
permissions:
87
contents: read
@@ -45,22 +44,22 @@ jobs:
4544
echo "Checking Chrome version..."
4645
google-chrome --version
4746
echo "Checking tachometer chromedriver version..."
48-
yarn tachometer --version
47+
cd 1st-gen && yarn tachometer --version
4948
5049
- name: Tachometer the changed packages
51-
run: yarn test:changed --browser=${{ matrix.browser }}
50+
run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }}
5251

5352
- name: Create a dummy file to ensure at least one results file exists
54-
run: touch tachometer.${{ matrix.browser }}-ran.txt
53+
run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt
5554

5655
- name: Archive ${{ matrix.browser }} tachometer results
5756
id: upload-artifact
5857
uses: actions/upload-artifact@v4
5958
with:
6059
name: tachometer-results-${{ matrix.browser }}
6160
path: |
62-
tach-results.${{ matrix.browser }}.*.json
63-
tachometer.${{ matrix.browser }}-ran.txt
61+
1st-gen/tach-results.${{ matrix.browser }}.*.json
62+
1st-gen/tachometer.${{ matrix.browser }}-ran.txt
6463
6564
comment-performance:
6665
name: Comment tachometer performance results

.github/workflows/coveralls.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
name: Coveralls Code Coverage
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
1010

1111
jobs:
12-
code-coverage-report:
13-
name: Generate and upload coverage report
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout PR branch
17-
uses: actions/checkout@v4
12+
code-coverage-report:
13+
name: Generate and upload coverage report
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout PR branch
17+
uses: actions/checkout@v4
1818

19-
- name: Setup Job and Install Dependencies
20-
uses: ./.github/actions/setup-job
19+
- name: Setup Job and Install Dependencies
20+
uses: ./.github/actions/setup-job
2121

22-
- name: Install Playwright
23-
run: yarn playwright install --with-deps
22+
- name: Install Playwright
23+
run: cd 1st-gen && yarn playwright install --with-deps
2424

25-
- name: Run unit tests with coverage
26-
run: yarn test:ci --config web-test-runner.config.ci-chromium.js --group unit --coverage
27-
continue-on-error: true
25+
- name: Run unit tests with coverage
26+
run: cd 1st-gen && yarn test:ci --config web-test-runner.config.ci-chromium.js --group coveralls-ci --coverage
27+
continue-on-error: true
2828

29-
- name: Upload coverage to Coveralls
30-
uses: coverallsapp/github-action@v2
31-
with:
32-
allow-empty: true
29+
- name: Upload coverage to Coveralls
30+
uses: coverallsapp/github-action@v2
31+
with:
32+
allow-empty: true

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
run: yarn install --immutable
104104

105105
- name: Lint styles
106-
if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }}
106+
# if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }}
107107
uses: reviewdog/[email protected]
108108
with:
109109
fail_level: error
@@ -116,7 +116,7 @@ jobs:
116116

117117
- name: ESLint
118118
uses: reviewdog/[email protected]
119-
if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }}
119+
# if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }}
120120
with:
121121
fail_level: error
122122
level: error

0 commit comments

Comments
 (0)