Skip to content

Commit

Permalink
chore: check size of artifacts (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joozty authored Nov 7, 2024
1 parent 9526093 commit c205f18
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
uses: actions/[email protected]
- name: Setup
uses: ./.github/actions/setup
- name: Size check
run: npm run size-limit
- run: npm run version:check
- name: Lint code
run: npm run lint
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
- run: npm run version:check
- name: Size check
run: npm run size-limit
- name: Lint code
run: npm run lint
- name: Lint docs
Expand Down
42 changes: 42 additions & 0 deletions .size-limit.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
*
* Copyright 2024 Splunk Inc.
*
* Licensed 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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
module.exports = [
{
name: 'artifacts/otel-api-globals.js',
limit: '3 kB',
path: './packages/web/dist/artifacts/otel-api-globals.js',
},

{
name: 'artifacts/splunk-otel-web.js',
limit: '40 kB',
path: './packages/web/dist/artifacts/splunk-otel-web.js',
},

{
name: 'artifacts/splunk-otel-web.js',
limit: '72 kB',
path: './packages/web/dist/artifacts/splunk-otel-web-legacy.js',
},

{
name: 'artifacts/splunk-otel-web-session-recorder.js',
limit: '22 kB',
path: './packages/session-recorder/dist/artifacts/splunk-otel-web-session-recorder.js',
},
]
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export default [
'packages/web/performance-tests/**/*.{js,mjs,cjs}',
'packages/web/integration-tests/**/*.{js,mjs,cjs}',
'**/*.conf.js',
'.size-limit.cjs',
'.prettierrc.cjs',
],
languageOptions: {
Expand Down
163 changes: 158 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@
"postversion": "node ./scripts/version-update.mjs",
"version:bump": "npm version --workspaces --include-workspace-root",
"version:check": "node ./scripts/version-check.mjs",
"tag:check": "node ./scripts/tag-check.js"
"tag:check": "node ./scripts/tag-check.js",
"size-limit": "size-limit"
},
"devDependencies": {
"@aws-sdk/client-cloudfront": "^3.171.0",
"@aws-sdk/client-s3": "^3.171.0",
"@eslint/js": "^9.13.0",
"@octokit/graphql": "^7.0.1",
"@octokit/request": "^8.1.1",
"@size-limit/file": "^11.1.6",
"@stylistic/eslint-plugin-js": "^2.10.1",
"@stylistic/eslint-plugin-ts": "^2.10.1",
"@typescript-eslint/eslint-plugin": "^8.13.0",
Expand All @@ -59,6 +61,7 @@
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.11.0",
"prettier": "^3.3.3",
"size-limit": "^11.1.6",
"typescript": "^5.1.6",
"typescript-eslint": "^8.12.2"
}
Expand Down

0 comments on commit c205f18

Please sign in to comment.