Skip to content

Commit

Permalink
Update dependencies. (#1228)
Browse files Browse the repository at this point in the history
* Update dependencies.

* Update ESLint.

* Add copyright.

* Remove bundlesize.

* Update vitest.

* Fix lintint error.
  • Loading branch information
dompuiu authored Jan 23, 2025
1 parent d1582d1 commit 00a2b23
Show file tree
Hide file tree
Showing 29 changed files with 1,700 additions and 2,909 deletions.
4,472 changes: 1,630 additions & 2,842 deletions package-lock.json

Large diffs are not rendered by default.

69 changes: 33 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,62 +64,56 @@
},
"author": "Adobe Inc.",
"license": "Apache-2.0",
"bundlesize": [
{
"path": "./dist/alloy.min.js"
}
],
"dependencies": {
"@adobe/aep-rules-engine": "^2.0.2",
"@adobe/aep-rules-engine": "^2.0.3",
"@adobe/reactor-cookie": "^1.1.0",
"@adobe/reactor-load-script": "^1.1.1",
"@adobe/reactor-object-assign": "^2.0.0",
"@adobe/reactor-query-string": "^2.0.0",
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/eslint-parser": "^7.26.5",
"@babel/plugin-transform-template-literals": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@inquirer/prompts": "^7.0.1",
"@inquirer/prompts": "^7.2.3",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-terser": "^0.4.4",
"commander": "^12.1.0",
"commander": "^13.1.0",
"css.escape": "^1.5.1",
"js-cookie": "3.0.5",
"parse-uri": "^1.0.9",
"rollup": "^4.24.4",
"rollup": "^4.31.0",
"rollup-plugin-license": "^3.5.3",
"uuid": "^11.0.2"
"uuid": "^11.0.5"
},
"devDependencies": {
"@adobe/alloy": "^2.25.0-beta.0",
"@babel/cli": "^7.25.9",
"@babel/cli": "^7.26.4",
"@babel/plugin-transform-runtime": "^7.25.9",
"@eslint/js": "^9.14.0",
"@octokit/rest": "^21.0.2",
"@vitest/browser": "^2.1.8",
"@vitest/coverage-v8": "^2.1.8",
"bundlesize": "^0.18.2",
"chalk": "^5.3.0",
"concurrently": "^9.1.0",
"@eslint/js": "^9.18.0",
"@octokit/rest": "^21.1.0",
"@vitest/browser": "^3.0.3",
"@vitest/coverage-v8": "^3.0.3",
"chalk": "^5.4.1",
"concurrently": "^9.1.2",
"date-fns": "^4.1.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"dotenv": "^16.4.7",
"eslint": "^9.18.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ban": "^1.6.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-ban": "^2.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-testcafe": "^0.2.1",
"glob": "^11.0.0",
"globals": "^15.12.0",
"glob": "^11.0.1",
"globals": "^15.14.0",
"handlebars": "^4.7.8",
"happy-dom": "^15.11.1",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"happy-dom": "^16.7.2",
"husky": "^9.1.7",
"lint-staged": "^15.4.1",
"playwright": "^1.49.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"read-cache": "^1.0.0",
"recursive-readdir": "^2.2.3",
"request": "^2.88.2",
Expand All @@ -128,14 +122,17 @@
"rollup-plugin-istanbul": "^5.0.0",
"semver": "^7.6.3",
"staged-git-files": "^1.3.0",
"start-server-and-test": "^2.0.8",
"testcafe": "^3.7.0",
"start-server-and-test": "^2.0.10",
"testcafe": "^3.7.1",
"testcafe-reporter-junit": "^3.0.2",
"url-exists-nodejs": "^0.2.4",
"url-parse": "^1.5.10",
"vitest": "^2.1.4"
"vitest": "^3.0.3"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.24.4"
"@rollup/rollup-linux-x64-gnu": "^4.31.0"
},
"overrides": {
"eslint": "^9.18.0"
}
}
2 changes: 1 addition & 1 deletion scripts/helpers/publishToNpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const publishToNpm = async ({ exec, execSync, logger, npmTag, version }) => {
publishVersionJson = execSync(
`npm view @adobe/alloy@${version} version --json`,
).toString();
} catch (e) {
} catch {
// the error is already printed to stdErr
}
if (publishVersionJson !== "") {
Expand Down
4 changes: 2 additions & 2 deletions scripts/specs/exec.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("exec", () => {
try {
await exec("bad exit", "exit 42", { outputStream });
fail();
} catch (e) {
} catch {
const result = getResult();
expect(result).toMatch(/exited with code 42/);
}
Expand All @@ -50,7 +50,7 @@ describe("exec", () => {
try {
await exec("bad exit", "exit 42", { outputStream });
fail();
} catch (e) {
} catch {
const result = getResult();
expect(result).toMatch(/bad exit/);
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/testConvert.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ for (let fileIndex = start; fileIndex < f.length; fileIndex += 1) {
),
),
);
} catch (e) {
// sss
} catch {
// Catch all errors.
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Personalization/createComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export default ({
onResponse,
});
} else if (personalizationDetails.shouldUseCachedData()) {
// eslint-disable-next-line consistent-return
decisionsMetaPromises.push(
viewChangeHandler({
personalizationDetails,
Expand Down
1 change: 0 additions & 1 deletion src/components/Personalization/createInteractionStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default () => {
notification,
interactId,
) => {
// eslint-disable-next-line no-param-reassign
interactId = parseInt(interactId, 10);

if (!clickMetaStorage[interactId]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const isRulesetItem = (item) => {
Object.prototype.hasOwnProperty.call(content, "version") &&
Object.prototype.hasOwnProperty.call(content, "rules")
);
} catch (error) {
} catch {
return false;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/RulesEngine/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const createRestoreStorage = (storage, storageKey) => {

try {
return JSON.parse(stored);
} catch (e) {
} catch {
return defaultValue;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/core/buildAndValidateConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default ({
);
setDebugEnabled(config.debugEnabled, { fromConfig: true });
queuedLogger.flush();
// eslint-disable-next-line no-underscore-dangle

const extraParams = buildAllOnInstanceConfiguredExtraParams(
config,
logger,
Expand Down
2 changes: 1 addition & 1 deletion src/core/edgeNetwork/injectExtractEdgeInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default ({ logger }) =>
if (!Number.isNaN(regionId)) {
return { regionId };
}
} catch (e) {
} catch {
// No need to do anything. The log statement below will log an error
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/network/injectSendNetworkRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default ({

try {
parsedBody = JSON.parse(response.body);
} catch (e) {
} catch {
// Non-JSON. Something went wrong.
}

Expand Down
6 changes: 3 additions & 3 deletions src/utils/injectStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getStorageByType = (context, storageType, namespace) => {
getItem(name) {
try {
return context[storageType].getItem(namespace + name);
} catch (e) {
} catch {
return null;
}
},
Expand All @@ -39,7 +39,7 @@ const getStorageByType = (context, storageType, namespace) => {
try {
context[storageType].setItem(namespace + name, value);
return true;
} catch (e) {
} catch {
return false;
}
},
Expand All @@ -54,7 +54,7 @@ const getStorageByType = (context, storageType, namespace) => {
}
});
return true;
} catch (e) {
} catch {
return false;
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/isValidRegExp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ governing permissions and limitations under the License.
export default (value) => {
try {
return RegExp(value) !== null;
} catch (e) {
} catch {
return false;
}
};
1 change: 0 additions & 1 deletion src/utils/parseUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const parseDomainBasic = (host) => {

const parseUrl = (url, parseDomain = parseDomainBasic) => {
if (!isString(url)) {
// eslint-disable-next-line no-param-reassign
url = "";
}
const parsed = parseUri(url) || {};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/updateErrorMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ governing permissions and limitations under the License.
export default ({ error, message }) => {
try {
error.message = message;
} catch (e) {
} catch {
// We'll set a new message when we can, but some errors, like DOMException,
// have a read-only message property, which limits our options.
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validation/createAnyOfValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default (validators, message) =>
try {
newValue = validator.call(this, value, path);
return true;
} catch (e) {
} catch {
return false;
}
});
Expand Down
11 changes: 10 additions & 1 deletion test/functional/helpers/assertions/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/* eslint-disable import/prefer-default-export */
/*
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.
*/
// Please keep in alphabetical order.
export { default as responseStatus } from "./responseStatus.js";
2 changes: 1 addition & 1 deletion test/functional/helpers/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
.reduce((a, b) => {
try {
a[b[0]] = JSON.parse(b[1]);
} catch (e) {
} catch {
a[b[0]] = b[1];
}
return a;
Expand Down
2 changes: 1 addition & 1 deletion test/functional/helpers/createFixture/clientScripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getProdNpmLibraryCode = () => readCache.sync(prodNpmLibraryPath, "utf8");

export const injectInlineScript = ClientFunction((code) => {
const scriptElement = document.createElement("script");
// eslint-disable-next-line no-undef

scriptElement.innerHTML = code;
document.getElementsByTagName("head")[0].appendChild(scriptElement);
});
Expand Down
1 change: 0 additions & 1 deletion test/functional/specs/Data Collector/C81181.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ test("Test C81181: Verify that onBeforeLinkClickSend augments a request", async
clickCollectionEnabled,
clickCollectionEventGroupingDisabled,
{
// eslint-disable-next-line consistent-return
onBeforeLinkClickSend: (options) => {
const { xdm, data, clickedElement } = options;

Expand Down
2 changes: 1 addition & 1 deletion test/functional/specs/Personalization/C17409728.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-underscore-dangle */
/*
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -419,6 +418,7 @@ test("Test C17409728: Includes rendered propositions as display notifications in
);
const hasPlatformDisplayNotifications = sendEventRequestBody.events.some(
({ xdm }) =>
// eslint-disable-next-line no-underscore-dangle
xdm._experience?.decisioning?.propositionEventType?.display === 1,
);
await t
Expand Down
2 changes: 1 addition & 1 deletion test/functional/specs/Personalization/C205528.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test("Test C205528: A redirect offer should redirect the page to the URL in the
await alloy.sendEvent({
renderDecisions: true,
});
} catch (e) {
} catch {
// an exception will be thrown because a redirect will be executed within the Alloy Client Function
} finally {
await t.expect(redirectLogger.count(() => true)).eql(1);
Expand Down
1 change: 0 additions & 1 deletion test/integration/customBuildSize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
/*
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("ActivityCollector::attachClickActivityCollector", () => {
lifecycle = {
onClick: vi.fn().mockReturnValue(Promise.resolve()),
};
// eslint-disable-next-line no-unused-vars

vi.spyOn(document, "addEventListener").mockImplementation(
(name, handler) => {
clickHandler = handler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe("injectSendBeaconRequest", () => {
sendBeacon,
sendFetchRequest,
});
// eslint-disable-next-line consistent-return

return sendBeaconRequest("https://example.com/endpoint", body).then(
(result) => {
expect(sendFetchRequest).not.toHaveBeenCalled();
Expand Down
1 change: 0 additions & 1 deletion test/unit/specs/utils/isInteger.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe("isInteger", () => {
[123, -123].forEach((value) => expect(isInteger(value)).toBe(true));
});

// eslint-disable-next-line no-restricted-globals
it("returns false if the value is not an integer", () => {
[null, undefined, NaN, "abc", "123", 123.45, -123.45].forEach((value) =>
expect(isInteger(value)).toBe(false),
Expand Down
1 change: 0 additions & 1 deletion test/unit/specs/utils/isNumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe("isNumber", () => {
);
});

// eslint-disable-next-line no-restricted-globals
it("returns false if the value is not a number", () => {
[null, undefined, NaN, "abc", "123"].forEach((value) =>
expect(isNumber(value)).toBe(false),
Expand Down
6 changes: 5 additions & 1 deletion vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export default defineProject({
isolate: false,
browser: {
provider: "playwright",
name: "chromium",
instances: [
{
browser: "chromium",
},
],
enabled: true,
headless: true,
},
Expand Down

0 comments on commit 00a2b23

Please sign in to comment.