Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"error",
{
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
"templateFile": "config/license.js"
"templateFile": "config/HEADER.js"
}
]
}
Expand All @@ -102,7 +102,7 @@
"error",
{
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
"templateFile": "../../../config/license.js"
"templateFile": "config/HEADER.js"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this is passing in CI, but locally, I'm still getting a lint error:

Image

If I change this to:

Suggested change
"templateFile": "config/HEADER.js"
"templateFile": "../config/HEADER.js"

I can get it to run and it finds lint errors:

Image

Should we address these?

@rubencarvalho rubencarvalho Nov 4, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed this for now and pushed a commit with the --fixed files.
The more comprehensive linting fix will happen in: #5847
LMK if you still find something quirky!

}
]
}
Expand All @@ -113,7 +113,7 @@
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "notice"],
"root": true,
"rules": {
"no-console": [
Expand Down
183 changes: 91 additions & 92 deletions .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,98 @@
name: Browser Performance Tests

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch: # Only run manually, not on pull requests

permissions:
contents: read
pull-requests: write
contents: read
pull-requests: write

jobs:
test-changed-packages:
strategy:
matrix:
browser: [firefox, chrome]
name: Compare performance to latest release on ${{ matrix.browser }}

# The job will only run if the pull request is from the same repository.
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main

- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history

- name: Fetch main branch
run: |
git fetch origin main:main

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job

- name: Check ChromeDriver Version
if: matrix.browser == 'chrome'
run: |
echo "Checking ChromeDriver version..."
npx chromedriver --version
echo "Checking Chrome version..."
google-chrome --version
echo "Checking tachometer chromedriver version..."
cd 1st-gen && yarn tachometer --version

- name: Tachometer the changed packages
run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }}

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

- name: Archive ${{ matrix.browser }} tachometer results
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: tachometer-results-${{ matrix.browser }}
path: |
1st-gen/tach-results.${{ matrix.browser }}.*.json
1st-gen/tachometer.${{ matrix.browser }}-ran.txt

comment-performance:
name: Comment tachometer performance results
needs: [test-changed-packages]

# The job will only run if the pull request is from the same repository.
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main

- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job

- uses: actions/download-artifact@v4
with:
pattern: tachometer-results-*
merge-multiple: true

- name: Post Tachometer Performance Comment
uses: actions/github-script@v7
with:
script: |
const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js');
const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js');
const body = buildTachometerComment();
commentOrUpdate(github, context, '## Tachometer results', body);
test-changed-packages:
strategy:
matrix:
browser: [firefox, chrome]
name: Compare performance to latest release on ${{ matrix.browser }}

# The job will only run if the pull request is from the same repository.
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main

- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history

- name: Fetch main branch
run: |
git fetch origin main:main

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job

- name: Check ChromeDriver Version
if: matrix.browser == 'chrome'
run: |
echo "Checking ChromeDriver version..."
npx chromedriver --version
echo "Checking Chrome version..."
google-chrome --version
echo "Checking tachometer chromedriver version..."
cd 1st-gen && yarn tachometer --version

- name: Tachometer the changed packages
run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }}

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

- name: Archive ${{ matrix.browser }} tachometer results
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: tachometer-results-${{ matrix.browser }}
path: |
1st-gen/tach-results.${{ matrix.browser }}.*.json
1st-gen/tachometer.${{ matrix.browser }}-ran.txt

comment-performance:
name: Comment tachometer performance results
needs: [test-changed-packages]

# The job will only run if the pull request is from the same repository.
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main

- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job

- uses: actions/download-artifact@v4
with:
pattern: tachometer-results-*
merge-multiple: true

- name: Post Tachometer Performance Comment
uses: actions/github-script@v7
with:
script: |
const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js');
const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js');
const body = buildTachometerComment();
commentOrUpdate(github, context, '## Tachometer results', body);
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ jobs:
level: error
reporter: github-pr-review
filter_mode: diff_context
eslint_flags: '--config .eslintrc.json ${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'
eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'
2 changes: 1 addition & 1 deletion 1st-gen/packages/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"error",
{
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
"templateFile": "config/license.js"
"templateFile": "config/HEADER.js"
}
],
"sort-imports": [
Expand Down
6 changes: 3 additions & 3 deletions 1st-gen/scripts/css-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ const wrapCSSResult = (content) => {
`;
};

const licensePath = path.resolve(__dirname, '..', 'config', 'license.js');
const headerPath = path.resolve(__dirname, '..', 'config', 'HEADER.js');
let header = '';
if (fs.existsSync(licensePath)) {
header = fs.readFileSync(licensePath, 'utf8');
if (fs.existsSync(headerPath)) {
header = fs.readFileSync(headerPath, 'utf8');
header = header.replace('<%= YEAR %>', new Date().getFullYear());
}

Expand Down
2 changes: 1 addition & 1 deletion 1st-gen/scripts/test-changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const { browser = 'chrome' } = yargs(hideBin(process.argv)).argv;
*/
export const getChangedPackages = () => {
let changedPackages = [];
const changesetDir = '.changeset';
const changesetDir = '../.changeset';

try {
// Check if .changeset directory exists
Expand Down
2 changes: 1 addition & 1 deletion 1st-gen/test/benchmark/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ $ node test/benchmark/cli -n 20
for (const packageName of packages) {
const runCommands: string[] = [];
const config: Partial<ConfigFile> = {
root: '../..',
root: '../../..',
$schema:
'https://raw.githubusercontent.com/Polymer/tachometer/master/config.schema.json',
timeout: parseFloat(opts.timeout) || 0,
Expand Down
2 changes: 1 addition & 1 deletion 1st-gen/test/tsconfig-node.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": ".",
"rootDir": ".",
"types": ["node"],
"typeRoots": ["../node_modules/@types"]
"typeRoots": ["../../node_modules/@types"]
},
"include": ["benchmark/cli.ts"],
"exclude": []
Expand Down
2 changes: 1 addition & 1 deletion 1st-gen/tools/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"error",
{
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
"templateFile": "config/license.js"
"templateFile": "config/HEADER.js"
}
],
"sort-imports": [
Expand Down
2 changes: 1 addition & 1 deletion 2nd-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"clean": "yarn workspaces foreach --from '{@spectrum-web-components/core,@adobe/swc}' --recursive run clean",
"dev:analyze": "yarn workspace @adobe/swc analyze:watch",
"dev:core": "yarn workspace @spectrum-web-components/core dev",
"lint": "eslint . --ext .ts,.js,.json",
"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",
Expand Down
12 changes: 6 additions & 6 deletions 2nd-gen/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
"author": "Adobe",
"homepage": "https://opensource.adobe.com/spectrum-web-components/",
"repository": {
"directory": "2nd-gen/packages/core",
"type": "git",
"url": "https://github.com/adobe/spectrum-web-components.git",
"directory": "2nd-gen/packages/core"
"url": "https://github.com/adobe/spectrum-web-components.git"
},
"bugs": {
"url": "https://github.com/adobe/spectrum-web-components/issues"
},
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -38,6 +36,8 @@
"import": "./dist/shared/base/*.js"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"files": [
"dist/"
],
Expand All @@ -47,6 +47,7 @@
"dev": "vite build --watch",
"prepublishOnly": "yarn build"
},
"types": "./dist/index.d.ts",
"dependencies": {
"lit": "^2.5.0 || ^3.1.3"
},
Expand All @@ -71,6 +72,5 @@
],
"publishConfig": {
"access": "public"
},
"module": "./dist/index.js"
}
}
11 changes: 11 additions & 0 deletions 2nd-gen/packages/core/shared/base/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
/**
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// Generated by genversion.
export const version = '1.9.0';
18 changes: 9 additions & 9 deletions 2nd-gen/packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./",
"allowImportingTsExtensions": false,
"composite": true,
"noEmit": false,
"allowImportingTsExtensions": false,
"outDir": "./dist",
"paths": {
"@spectrum-web-components/core/shared/*": ["./shared/*"],
"@spectrum-web-components/core/*": ["./*"]
}
"@spectrum-web-components/core/*": ["./*"],
"@spectrum-web-components/core/shared/*": ["./shared/*"]
},
"rootDir": "./"
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.stories.ts"]
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.stories.ts"],
"extends": "../../tsconfig.json",
"include": ["**/*.ts"]
}
Loading
Loading