Skip to content
Open
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
1,158 changes: 510 additions & 648 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,27 @@
"@babel/plugin-syntax-typescript": "^7.16.0",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@cloudscape-design/documenter": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.48.0",
"@typescript-eslint/eslint-plugin": "^8.57.2",
"@typescript-eslint/parser": "^8.57.2",
"css-selector-tokenizer": "^0.8.0",
"css.escape": "^1.5.1",
"glob": "^10.5.0",
"glob": "^13.0.6",
"lodash": "^4.17.23",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@eslint/js is required here but it was not declared as a (dev) dependency:

const eslint = require('@eslint/js');

"@testing-library/react": "^16.2.0",
"@tony.ganchev/eslint-plugin-header": "^3.3.1",
"@tsconfig/node18": "^18.2.2",
"@types/babel__core": "^7.1.16",
"@types/glob": "^9.0.0",
"@types/jest": "^28.1.3",
"@types/lodash": "^4.17.15",
"@types/node": "^18.0.0",
"@types/node": "^20.0.0",
"@types/react-dom": "^18.3.5",
"@vitest/coverage-istanbul": "^3.0.7",
"eslint": "^9.39.1",
"eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-unicorn": "^62.0.0",
Expand All @@ -50,7 +51,7 @@
"lint-staged": "^15.2.9",
"prettier": "^3.4.2",
"typescript": "^4.9.5",
"typescript-eslint": "^8.48.0",
"typescript-eslint": "^8.57.2",
"vitest": "^3.0.7"
},
"overrides": {
Expand Down
7 changes: 3 additions & 4 deletions src/converter/extract-test-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,11 @@ export function extractTestSelectorsUtil({ srcPath = 'src', libPath = 'lib/compo
}

function resolveSelectorsPath(importPath: string) {
let selectorsFile = importPath;
// Path to selectors file from 'lib folder'.
selectorsFile = path.resolve(path.relative(libTestUtilsPath, importPath));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The new version of eslint did not like this let-based logic, so refactored it

const relativeSelectorsFile = path.resolve(path.relative(libTestUtilsPath, importPath));
// Absolute path to selectors file.
selectorsFile = path.resolve(path.join(libPath, selectorsFile));
return selectorsFile;
const absoluteSelectorsFile = path.resolve(path.join(libPath, relativeSelectorsFile));
return absoluteSelectorsFile;
}

function getComponentNameFromFilePath(filePath: string) {
Expand Down
3 changes: 1 addition & 2 deletions src/converter/test/__snapshots__/converter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default class DummyWrapper extends ComponentWrapper {
exports[`strip-dom 1`] = `
"// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/* eslint-env browser */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These eslint-env comments were already deprecated in eslint 9 and start throwing errors in eslint 10. They have been in the repo since the beginning and I don't think they were doing anything at this point. Dry run just in case: 7767732568

https://eslint.org/docs/latest/use/configure/migration-guide#eslint-env-configuration-comments


import { ComponentWrapper, ElementWrapper, usesDom } from '../../../../../lib/core/dom';
export default class DummyWrapper extends ComponentWrapper {
Expand All @@ -48,7 +47,7 @@ export default class DummyWrapper extends ComponentWrapper {
exports[`strip-external-imports 1`] = `
"// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/* eslint-env browser */

import { ComponentWrapper } from "@cloudscape-design/test-utils-core/selectors";
import { KeyCode } from "@cloudscape-design/test-utils-core/utils";
export default class DummyWrapper extends ComponentWrapper {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/* eslint-env browser */

import { ComponentWrapper, usesDom } from '@cloudscape-design/test-utils-core/dom';
import { KeyCode } from '@cloudscape-design/test-utils-core/utils';
import { act } from '@cloudscape-design/test-utils-core/utils-dom';
Expand Down
1 change: 0 additions & 1 deletion src/converter/test/inputs/converter/strip-dom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/* eslint-env browser */

import { ComponentWrapper, ElementWrapper, usesDom } from '../../../../../lib/core/dom';

Expand Down
2 changes: 1 addition & 1 deletion src/core/dom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*eslint-env browser*/

import { IElementWrapper } from './interfaces';
import { KeyCode, isScopedSelector, substituteScope, appendSelector, getComponentRootSelector } from './utils';
import { act } from './utils-dom';
Expand Down
2 changes: 1 addition & 1 deletion src/core/test/dom.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*eslint-env browser*/

import { describe, beforeEach, afterEach, it, expect, test, vi } from 'vitest';
import { ElementWrapper, ComponentWrapper, createWrapper } from '../dom';
import { KeyCode } from '../utils';
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*eslint-env browser*/

import * as Tokenizer from 'css-selector-tokenizer';
import 'css.escape';

Expand Down
Loading