Skip to content

Commit

Permalink
chore(deps): update npm (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Jan 7, 2025
1 parent 2241363 commit 15062e3
Show file tree
Hide file tree
Showing 5 changed files with 1,223 additions and 523 deletions.
2 changes: 1 addition & 1 deletion ui/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
clearMocks: true,
// env settings
setupFiles: ['<rootDir>/jest.polyfills.ts'],
testEnvironment: 'jsdom',
testEnvironment: 'jest-fixed-jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
modulePathIgnorePatterns: ['<rootDir>/src/main/resources'],
restoreMocks: true,
Expand Down
34 changes: 1 addition & 33 deletions ui/jest.polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,7 @@
* you don't want to deal with this.
*/

const { performance } = require('node:perf_hooks');
const { TextDecoder, TextEncoder } = require('node:util');
const { TransformStream } = require('node:stream/web');
const { BroadcastChannel } = require('node:worker_threads');
const { clearImmediate } = require('node:timers');

Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
TransformStream: { value: TransformStream },
BroadcastChannel: { value: BroadcastChannel },
clearImmediate: { value: clearImmediate },
performance: { value: performance },
});

const { Blob } = require('node:buffer');
const { fetch, Headers, FormData, Request, Response } = require('undici');

Object.defineProperties(globalThis, {
fetch: { value: fetch, writable: true },
Blob: { value: Blob },
Headers: { value: Headers },
FormData: { value: FormData },
BroadcastChannel: { value: BroadcastChannel },
Request: { value: Request, configurable: true },
Response: { value: Response, configurable: true },
});

Object.defineProperty(URL, 'createObjectURL', {
// needed for package import EnterpriseViewOnlyPreset from '@splunk/dashboard-presets/EnterpriseViewOnlyPreset'
writable: true,
value: jest.fn(),
});
// the most of the polyfills are applied with jest-fixed-jsdom package

HTMLCanvasElement.prototype.getContext = jest.fn();

Expand Down
63 changes: 32 additions & 31 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
"test-storybook:update-snapshots": "yarn run test-storybook -u"
},
"dependencies": {
"@splunk/dashboard-action-buttons": "^27.5.0",
"@splunk/dashboard-context": "^27.5.0",
"@splunk/dashboard-core": "^27.5.0",
"@splunk/dashboard-presets": "^27.5.0",
"@splunk/dashboard-state": "^27.5.0",
"@splunk/dashboard-types": "^27.5.0",
"@splunk/react-icons": "^4.8.0",
"@splunk/dashboard-action-buttons": "^27.5.1",
"@splunk/dashboard-context": "^27.5.1",
"@splunk/dashboard-core": "^27.5.1",
"@splunk/dashboard-presets": "^27.5.1",
"@splunk/dashboard-state": "^27.5.1",
"@splunk/dashboard-types": "^27.5.1",
"@splunk/react-icons": "^4.9.0",
"@splunk/react-page": "^7.1.0",
"@splunk/react-toast-notifications": "^0.11.3",
"@splunk/react-ui": "^4.39.0",
"@splunk/react-ui": "^4.40.0",
"@splunk/search-job": "^3.1.0",
"@splunk/splunk-utils": "^3.1.0",
"@splunk/themes": "^0.22.0",
"@splunk/ui-utils": "^1.7.1",
"@splunk/visualization-context": "^26.4.1",
"@storybook/test": "^8.4.2",
"@storybook/test": "^8.4.7",
"immutability-helper": "^3.1.1",
"license-webpack-plugin": "^4.0.2",
"lodash": "^4.17.21",
Expand All @@ -46,29 +46,29 @@
"react-is": "^16.13.1",
"react-router-dom": "6.27.0",
"styled-components": "^5.3.11",
"uuid": "^11.0.2",
"zod": "^3.23.8"
"uuid": "^11.0.4",
"zod": "^3.24.1"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@babel/preset-react": "^7.26.3",
"@kickstartds/core": "^4.1.0",
"@kickstartds/storybook-addon-jsonschema": "^4.0.0",
"@splunk/babel-preset": "^4.0.0",
"@splunk/eslint-config": "^4.0.0",
"@splunk/webpack-configs": "^7.0.2",
"@storybook/addon-a11y": "^8.4.2",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-links": "^8.4.2",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-webpack5": "^8.4.2",
"@storybook/test-runner": "^0.19.1",
"@storybook/addon-a11y": "^8.4.7",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-webpack5": "^8.4.7",
"@storybook/test-runner": "^0.21.0",
"@testing-library/dom": "^8.20.1",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^12.1.5",
Expand All @@ -88,33 +88,34 @@
"eslint": "^8.57.1",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.2.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-jest": "^28.10.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-storybook": "^0.11.0",
"eslint-plugin-storybook": "^0.11.2",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fixed-jsdom": "^0.0.9",
"jest-image-snapshot": "^6.4.0",
"js-yaml": "^4.1.0",
"msw": "2.6.2",
"msw": "2.7.0",
"msw-storybook-addon": "^2.0.4",
"prettier": "^2.8.8",
"querystring-es3": "^0.2.1",
"storybook": "^8.4.2",
"storybook": "^8.4.7",
"style-loader": "^4.0.0",
"stylelint": "^14.16.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"undici": "^5.28.4",
"url": "^0.11.4",
"webpack": "^5.96.1",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-dev-server": "^5.2.0",
"webpack-merge": "^6.0.1"
},
"resolutions": {
Expand All @@ -124,7 +125,7 @@
"d3-color": "^3.1.0",
"d3-interpolate": "^3.0.1",
"glob-parent": "^5.1.2",
"postcss": "^8.4.47",
"postcss": "^8.4.49",
"semver": "^7.6.3",
"strip-ansi": "^6.0.1",
"string-width": "^4.2.3"
Expand Down
28 changes: 21 additions & 7 deletions ui/src/public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.6.2'
const INTEGRITY_CHECKSUM = '07a8241b182f8a246a7cd39894799a9e'
const PACKAGE_VERSION = '2.7.0'
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()

Expand Down Expand Up @@ -192,12 +192,26 @@ async function getResponse(event, client, requestId) {
const requestClone = request.clone()

function passthrough() {
const headers = Object.fromEntries(requestClone.headers.entries())
// Cast the request headers to a new Headers instance
// so the headers can be manipulated with.
const headers = new Headers(requestClone.headers)

// Remove the "accept" header value that marked this request as passthrough.
// This prevents request alteration and also keeps it compliant with the
// user-defined CORS policies.
const acceptHeader = headers.get('accept')
if (acceptHeader) {
const values = acceptHeader.split(',').map((value) => value.trim())
const filteredValues = values.filter(
(value) => value !== 'msw/passthrough',
)

// Remove internal MSW request header so the passthrough request
// complies with any potential CORS preflight checks on the server.
// Some servers forbid unknown request headers.
delete headers['x-msw-intention']
if (filteredValues.length > 0) {
headers.set('accept', filteredValues.join(', '))
} else {
headers.delete('accept')
}
}

return fetch(requestClone, { headers })
}
Expand Down
Loading

0 comments on commit 15062e3

Please sign in to comment.