Skip to content

Commit

Permalink
refactor: yarn, e2e and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Nov 12, 2024
1 parent c2d4b78 commit e269a6b
Show file tree
Hide file tree
Showing 19 changed files with 28,355 additions and 19,579 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const Config = require('@vechain/repo-config');

module.exports = Config.EslintLibrary;
module.exports = {
...Config.EslintLibrary,
rules: {
...Config.EslintLibrary.rules,
'import/no-extraneous-dependencies': 'error',
},
};
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

Binary file added .yarn/install-state.gz
Binary file not shown.
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
"lint-staged": "^15.0.2",
"prettier": "^2.5.1",
"punycode": "^1.4.1",
"ts-node": "^10.9.2",
"turbo": "latest",
"typescript": "5.3.3"
},
"packageManager": "yarn@1.22.19"
"packageManager": "yarn@4.5.1"
}
4 changes: 4 additions & 0 deletions packages/dapp-kit-react/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ module.exports = {
'*.test.ts',
'test/**',
],
rules: {
...Config.EslintReact.rules,
'import/no-extraneous-dependencies': 'error',
},
};
5 changes: 2 additions & 3 deletions packages/dapp-kit-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@vechain/dapp-kit-react",
"version": "1.0.11",
"private": false,
"homepage": "https://github.com/vechain/vechain-dapp-kit",
"repository": "github:vechain/vechain-dapp-kit",
"license": "MIT",
Expand Down Expand Up @@ -29,6 +28,7 @@
"@vechain/dapp-kit-ui": "*",
"@vechain/sdk-core": "1.0.0-rc.1",
"@vechain/sdk-network": "1.0.0-rc.1",
"react": "^18.2.0",
"valtio": "1.11.2"
},
"devDependencies": {
Expand All @@ -37,10 +37,9 @@
"@types/react-dom": "^18.2.13",
"@vechain/repo-config": "https://github.com/vechain/repo-config#v0.0.1",
"eslint": "^8.15.0",
"react": "^18.2.0",
"tsup": "*",
"typescript": "*",
"vite": "^4.5.2",
"vite": "^4.5.5",
"vitest": "^0.34.6"
}
}
8 changes: 7 additions & 1 deletion packages/dapp-kit-ui/.eslintrc.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const Config = require('@vechain/repo-config');

module.exports = Config.EslintLibrary;
module.exports = {
...Config.EslintReact,
rules: {
...Config.EslintReact.rules,
'import/no-extraneous-dependencies': 'error',
},
};
3 changes: 1 addition & 2 deletions packages/dapp-kit-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@vechain/dapp-kit-ui",
"version": "1.0.11",
"private": false,
"description": "Vanilla JS DAppKit",
"keywords": [
"web-components",
Expand Down Expand Up @@ -59,7 +58,7 @@
"tsup": "^7.2.0",
"typechain": "^8.3.2",
"typescript": "~5.2.0",
"vite": "^4.5.2",
"vite": "^4.5.5",
"vitest": "^0.34.6"
}
}
8 changes: 7 additions & 1 deletion packages/dapp-kit/.eslintrc.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const Config = require('@vechain/repo-config');

module.exports = Config.EslintLibrary;
module.exports = {
...Config.EslintLibrary,
rules: {
...Config.EslintLibrary.rules,
'import/no-extraneous-dependencies': 'error',
},
};
5 changes: 1 addition & 4 deletions packages/dapp-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@vechain/dapp-kit",
"version": "1.0.11",
"private": false,
"homepage": "https://github.com/vechain/vechain-dapp-kit",
"repository": "github:vechain/vechain-dapp-kit",
"license": "MIT",
Expand Down Expand Up @@ -33,8 +32,6 @@
"valtio": "1.11.2"
},
"devDependencies": {
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@vechain/repo-config": "https://github.com/vechain/repo-config#v0.0.1",
"@vitest/coverage-v8": "^0.34.6",
"@walletconnect/types": "2.10.2",
Expand All @@ -43,7 +40,7 @@
"lokijs": "^1.5.12",
"tsup": "*",
"typescript": "*",
"vite": "^4.5.2",
"vite": "^4.5.5",
"vitest": "^0.34.6"
}
}
2 changes: 1 addition & 1 deletion packages/dapp-kit/src/classes/vechain-signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class VeChainSignerDAppKit extends VeChainAbstractSigner {
this.walletManager = walletManager;
}

get address() {
get address(): string | null {
return this.walletManager.state.address;
}

Expand Down
1 change: 1 addition & 0 deletions tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@types/chromedriver": "^81.0.1",
"@types/cucumber": "^7.0.0",
"@types/jest": "^29.5.12",
"@types/node": "^16.11.11",
"@types/selenium-webdriver": "^4.1.13",
"@vechain/repo-config": "https://github.com/vechain/repo-config",
"async-mutex": "^0.2.6",
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/src/config/hooks/ExtensionHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ BeforeAll(async function () {
'..',
'veworld-dist.zip',
);
await asyncExec(`unzip ${zipPath} -d ${distPath}`);
await asyncExec(`unzip -o ${zipPath}`);
});
2 changes: 1 addition & 1 deletion tests/e2e/src/extension/flows/ApproveFlows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const approveAndSign = async (password?: string) => {
const sign = async (password?: string) => {
const pw = password || TestDefaults.PASSWORD;
//Click the "Sign Cert" button
await extension.driver.waitAndClick(Locators.byId('signCertificateButton'));
await extension.driver.waitAndClick(Locators.byId('signApproveButton'));
await PasswordFlows.submitPassword(pw);
};

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/src/extension/flows/DashboardFlows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Locators from '../selenium/Locators';
import NavigationUtils from '../utils/NavigationUtils';

const isActive = async () => {
const locator = Locators.byId('yourBalanceTitle');
const locator = Locators.byDataTestId('accountFiatBalance');
return ScreenUtils.isActive([locator], ROUTES.DASHBOARD);
};

Expand Down Expand Up @@ -78,7 +78,7 @@ const checkTokenBalance = async (token: string) => {

const countTransactionsByToken = async (token: string) => {
await extension.driver.sleep(1000);
await extension.driver.waitAndClick(Locators.byId('token-' + token));
await extension.driver.waitAndClick(Locators.byId(`token-${token}`));
await extension.driver.sleep(2000);
const transactionsCount = await extension.driver.findElements(
Locators.byDataTestId('ft-activity'),
Expand Down
Binary file modified tests/e2e/veworld-dist.zip
Binary file not shown.
Loading

0 comments on commit e269a6b

Please sign in to comment.