Skip to content

Commit 38a2b8f

Browse files
chore: address barebones feedback (#5852)
1 parent fd099fd commit 38a2b8f

File tree

26 files changed

+278
-208
lines changed

26 files changed

+278
-208
lines changed

.eslintrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"error",
9090
{
9191
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
92-
"templateFile": "config/license.js"
92+
"templateFile": "config/HEADER.js"
9393
}
9494
]
9595
}
@@ -102,7 +102,7 @@
102102
"error",
103103
{
104104
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
105-
"templateFile": "../../../config/license.js"
105+
"templateFile": "config/HEADER.js"
106106
}
107107
]
108108
}
@@ -113,7 +113,7 @@
113113
"ecmaVersion": "latest",
114114
"sourceType": "module"
115115
},
116-
"plugins": ["@typescript-eslint"],
116+
"plugins": ["@typescript-eslint", "notice"],
117117
"root": true,
118118
"rules": {
119119
"no-console": [
Lines changed: 91 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,98 @@
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:
8-
contents: read
9-
pull-requests: write
7+
contents: read
8+
pull-requests: write
109

1110
jobs:
12-
test-changed-packages:
13-
strategy:
14-
matrix:
15-
browser: [firefox, chrome]
16-
name: Compare performance to latest release on ${{ matrix.browser }}
17-
18-
# The job will only run if the pull request is from the same repository.
19-
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
20-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
21-
runs-on: ubuntu-22.04
22-
steps:
23-
- name: Checkout main
24-
uses: actions/checkout@v4
25-
with:
26-
ref: main
27-
28-
- name: Checkout PR branch
29-
uses: actions/checkout@v4
30-
with:
31-
fetch-depth: 0 # Get full history
32-
33-
- name: Fetch main branch
34-
run: |
35-
git fetch origin main:main
36-
37-
- name: Setup Job and Install Dependencies
38-
uses: ./.github/actions/setup-job
39-
40-
- name: Check ChromeDriver Version
41-
if: matrix.browser == 'chrome'
42-
run: |
43-
echo "Checking ChromeDriver version..."
44-
npx chromedriver --version
45-
echo "Checking Chrome version..."
46-
google-chrome --version
47-
echo "Checking tachometer chromedriver version..."
48-
cd 1st-gen && yarn tachometer --version
49-
50-
- name: Tachometer the changed packages
51-
run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }}
52-
53-
- name: Create a dummy file to ensure at least one results file exists
54-
run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt
55-
56-
- name: Archive ${{ matrix.browser }} tachometer results
57-
id: upload-artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: tachometer-results-${{ matrix.browser }}
61-
path: |
62-
1st-gen/tach-results.${{ matrix.browser }}.*.json
63-
1st-gen/tachometer.${{ matrix.browser }}-ran.txt
64-
65-
comment-performance:
66-
name: Comment tachometer performance results
67-
needs: [test-changed-packages]
68-
69-
# The job will only run if the pull request is from the same repository.
70-
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
71-
if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }}
72-
runs-on: ubuntu-latest
73-
steps:
74-
- name: Checkout main
75-
uses: actions/checkout@v4
76-
with:
77-
ref: main
78-
79-
- name: Checkout PR branch
80-
uses: actions/checkout@v4
81-
with:
82-
fetch-depth: 2
83-
84-
- name: Setup Job and Install Dependencies
85-
uses: ./.github/actions/setup-job
86-
87-
- uses: actions/download-artifact@v4
88-
with:
89-
pattern: tachometer-results-*
90-
merge-multiple: true
91-
92-
- name: Post Tachometer Performance Comment
93-
uses: actions/github-script@v7
94-
with:
95-
script: |
96-
const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js');
97-
const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js');
98-
const body = buildTachometerComment();
99-
commentOrUpdate(github, context, '## Tachometer results', body);
11+
test-changed-packages:
12+
strategy:
13+
matrix:
14+
browser: [firefox, chrome]
15+
name: Compare performance to latest release on ${{ matrix.browser }}
16+
17+
# The job will only run if the pull request is from the same repository.
18+
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
19+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- name: Checkout main
23+
uses: actions/checkout@v4
24+
with:
25+
ref: main
26+
27+
- name: Checkout PR branch
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # Get full history
31+
32+
- name: Fetch main branch
33+
run: |
34+
git fetch origin main:main
35+
36+
- name: Setup Job and Install Dependencies
37+
uses: ./.github/actions/setup-job
38+
39+
- name: Check ChromeDriver Version
40+
if: matrix.browser == 'chrome'
41+
run: |
42+
echo "Checking ChromeDriver version..."
43+
npx chromedriver --version
44+
echo "Checking Chrome version..."
45+
google-chrome --version
46+
echo "Checking tachometer chromedriver version..."
47+
cd 1st-gen && yarn tachometer --version
48+
49+
- name: Tachometer the changed packages
50+
run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }}
51+
52+
- name: Create a dummy file to ensure at least one results file exists
53+
run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt
54+
55+
- name: Archive ${{ matrix.browser }} tachometer results
56+
id: upload-artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: tachometer-results-${{ matrix.browser }}
60+
path: |
61+
1st-gen/tach-results.${{ matrix.browser }}.*.json
62+
1st-gen/tachometer.${{ matrix.browser }}-ran.txt
63+
64+
comment-performance:
65+
name: Comment tachometer performance results
66+
needs: [test-changed-packages]
67+
68+
# The job will only run if the pull request is from the same repository.
69+
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
70+
if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }}
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout main
74+
uses: actions/checkout@v4
75+
with:
76+
ref: main
77+
78+
- name: Checkout PR branch
79+
uses: actions/checkout@v4
80+
with:
81+
fetch-depth: 2
82+
83+
- name: Setup Job and Install Dependencies
84+
uses: ./.github/actions/setup-job
85+
86+
- uses: actions/download-artifact@v4
87+
with:
88+
pattern: tachometer-results-*
89+
merge-multiple: true
90+
91+
- name: Post Tachometer Performance Comment
92+
uses: actions/github-script@v7
93+
with:
94+
script: |
95+
const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js');
96+
const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js');
97+
const body = buildTachometerComment();
98+
commentOrUpdate(github, context, '## Tachometer results', body);

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ jobs:
122122
level: error
123123
reporter: github-pr-review
124124
filter_mode: diff_context
125-
eslint_flags: '--config .eslintrc.json ${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'
125+
eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'

1st-gen/packages/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
"error",
195195
{
196196
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
197-
"templateFile": "config/license.js"
197+
"templateFile": "config/HEADER.js"
198198
}
199199
],
200200
"sort-imports": [

1st-gen/scripts/css-tools.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ const wrapCSSResult = (content) => {
5858
`;
5959
};
6060

61-
const licensePath = path.resolve(__dirname, '..', 'config', 'license.js');
61+
const headerPath = path.resolve(__dirname, '..', 'config', 'HEADER.js');
6262
let header = '';
63-
if (fs.existsSync(licensePath)) {
64-
header = fs.readFileSync(licensePath, 'utf8');
63+
if (fs.existsSync(headerPath)) {
64+
header = fs.readFileSync(headerPath, 'utf8');
6565
header = header.replace('<%= YEAR %>', new Date().getFullYear());
6666
}
6767

1st-gen/scripts/test-changes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { browser = 'chrome' } = yargs(hideBin(process.argv)).argv;
2727
*/
2828
export const getChangedPackages = () => {
2929
let changedPackages = [];
30-
const changesetDir = '.changeset';
30+
const changesetDir = '../.changeset';
3131

3232
try {
3333
// Check if .changeset directory exists

1st-gen/test/benchmark/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ $ node test/benchmark/cli -n 20
178178
for (const packageName of packages) {
179179
const runCommands: string[] = [];
180180
const config: Partial<ConfigFile> = {
181-
root: '../..',
181+
root: '../../..',
182182
$schema:
183183
'https://raw.githubusercontent.com/Polymer/tachometer/master/config.schema.json',
184184
timeout: parseFloat(opts.timeout) || 0,

1st-gen/test/tsconfig-node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": ".",
55
"rootDir": ".",
66
"types": ["node"],
7-
"typeRoots": ["../node_modules/@types"]
7+
"typeRoots": ["../../node_modules/@types"]
88
},
99
"include": ["benchmark/cli.ts"],
1010
"exclude": []

1st-gen/tools/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"error",
188188
{
189189
"mustMatch": "Copyright [0-9]{0,4} Adobe. All rights reserved.",
190-
"templateFile": "config/license.js"
190+
"templateFile": "config/HEADER.js"
191191
}
192192
],
193193
"sort-imports": [

2nd-gen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"clean": "yarn workspaces foreach --from '{@spectrum-web-components/core,@adobe/swc}' --recursive run clean",
2121
"dev:analyze": "yarn workspace @adobe/swc analyze:watch",
2222
"dev:core": "yarn workspace @spectrum-web-components/core dev",
23-
"lint": "eslint . --ext .ts,.js,.json",
23+
"lint": "cd .. && eslint 2nd-gen --ext .ts,.js,.json",
2424
"start": "run-p dev:core dev:analyze storybook",
2525
"storybook": "yarn workspace @adobe/swc storybook",
2626
"storybook:build": "yarn workspace @adobe/swc storybook:build",

0 commit comments

Comments
 (0)