chore(trading): migrate nx to latest version (#4196)

This commit is contained in:
Bartłomiej Głownia 2023-07-04 13:01:25 +02:00 committed by GitHub
parent 87b41a30d8
commit 6e0577aee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
293 changed files with 7626 additions and 8645 deletions

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -1,7 +1,7 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx", "eslint-plugin-unicorn", "jsx-a11y", "jest"],
"plugins": ["@nx", "eslint-plugin-unicorn", "jsx-a11y", "jest"],
"settings": {
"jsx-a11y": {
"components": {
@ -18,7 +18,7 @@
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"extends": ["plugin:jsx-a11y/strict"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
@ -56,7 +56,7 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/ban-ts-comment": [
"error",
@ -80,14 +80,19 @@
},
{
"files": ["*.spec.ts", "*.spec.tsx"],
"extends": ["plugin:@nrwl/nx/typescript", "plugin:jest/recommended"],
"extends": ["plugin:@nx/typescript", "plugin:jest/recommended"],
"rules": {
"jest/consistent-test-it": ["error", { "fn": "it" }]
"jest/consistent-test-it": [
"error",
{
"fn": "it"
}
]
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]

View File

@ -113,19 +113,19 @@ jobs:
- name: Build local dist
run: |
flags=""
envCmd=""
if [[ ! -z "${{ env.ENV_NAME }}" ]]; then
flags="--env=${{ env.ENV_NAME }}"
envCmd="yarn env-cmd -f ./apps/${{ matrix.app }}/.env.${{ env.ENV_NAME }}"
fi
if [ "${{ matrix.app }}" = "trading" ]; then
yarn nx export trading $flags || (yarn install && yarn nx export trading $flags)
$envCmd yarn nx export trading || (yarn install && $envCmd yarn nx export trading)
DIST_LOCATION=dist/apps/trading/exported
elif [ "${{ matrix.app }}" = "ui-toolkit" ]; then
NODE_ENV=production yarn nx run ui-toolkit:build-storybook
DIST_LOCATION=dist/storybook/ui-toolkit
else
yarn nx build ${{ matrix.app }} $flags || (yarn install && yarn nx build ${{ matrix.app }} $flags)
$envCmd yarn nx build ${{ matrix.app }} || (yarn install && $envCmd yarn nx build ${{ matrix.app }})
DIST_LOCATION=dist/apps/${{ matrix.app }}
fi
mv $DIST_LOCATION dist-result

View File

@ -1,29 +0,0 @@
module.exports = {
stories: [],
addons: [
'@storybook/addon-actions',
'@storybook/addon-viewport',
{
name: '@storybook/addon-docs',
options: {
configureJSX: true,
babelOptions: {},
sourceLoaderOptions: null,
transcludeMarkdown: true,
},
},
'@storybook/addon-controls',
'@storybook/addon-backgrounds',
'@storybook/addon-toolbars',
'@storybook/addon-measure',
'@storybook/addon-outline',
'@storybook/addon-a11y',
],
// uncomment the property below if you want to apply some webpack config globally
// webpackFinal: async (config, { configType }) => {
// // Make whatever fine-grained changes you need that should apply to all storybook configs
// // Return the altered config
// return config;
// },
};

View File

@ -1,14 +0,0 @@
{
"extends": "../tsconfig.base.json",
"exclude": [
"../**/*.spec.js",
"../**/*.test.js",
"../**/*.spec.ts",
"../**/*.test.ts",
"../**/*.spec.tsx",
"../**/*.test.tsx",
"../**/*.spec.jsx",
"../**/*.test.jsx"
],
"include": ["../**/*"]
}

View File

@ -1,10 +1,11 @@
{
"name": "explorer-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/explorer-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/explorer-e2e/cypress.config.js",
"devServerTarget": "explorer:serve"
@ -16,14 +17,14 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"]
}
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/explorer-e2e/"

View File

@ -27,6 +27,11 @@ context('Home Page', function () {
16: 'Chain ID',
};
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('[data-testid="stats-title"]')
.each(($list, index) => {
cy.wrap($list).should('contain.text', statTitles[index]);

View File

@ -34,6 +34,11 @@ context('Network parameters page', { tags: '@smoke' }, function () {
const parameterName = network_parameter[0];
const parameterValue = network_parameter[1];
if (this.networkParameterFormat.json.includes(parameterName)) {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(tableRows)
.contains(parameterName)
.should('be.visible')
@ -65,6 +70,11 @@ context('Network parameters page', { tags: '@smoke' }, function () {
if (this.networkParameterFormat.percentage.includes(parameterName)) {
const formattedPercentageParameter =
(parseFloat(parameterValue) * 100).toFixed(0) + '%';
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(tableRows)
.contains(parameterName)
.should('be.visible')
@ -148,6 +158,11 @@ context('Network parameters page', { tags: '@smoke' }, function () {
cy.convert_number_to_max_four_decimal(parameterValue)
.add_commas_to_number_if_large_enough()
.then((parameterValueFormatted) => {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(tableRows)
.contains(parameterName)
.should('be.visible')
@ -179,6 +194,11 @@ context('Network parameters page', { tags: '@smoke' }, function () {
cy.convert_number_to_max_eighteen_decimal(parameterValue)
.add_commas_to_number_if_large_enough()
.then((parameterValueFormatted) => {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(tableRows)
.contains(parameterName)
.should('be.visible')

View File

@ -170,6 +170,11 @@ context.skip('Parties page', { tags: '@regression' }, function () {
const sideMenuBackground = '.absolute';
// Engage dark mode if not allready set
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(sideMenuBackground)
.should('have.css', 'background-color')
.then((background_color) => {

View File

@ -60,16 +60,31 @@ context.skip('Transactions page', function () {
});
cy.get('block').should('not.be.empty');
cy.get('encoded-tnx').should('not.be.empty');
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('tx-type')
.should('not.be.empty')
.invoke('text')
.then((txTypeTxt) => {
if (txTypeTxt == 'Order Submission') {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('.hljs-attr')
.should('have.length.at.least', 8)
.each(($propertyName) => {
cy.wrap($propertyName).should('not.be.empty');
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('.hljs-string')
.should('have.length.at.least', 8)
.each(($propertyValue) => {

View File

@ -1,7 +1,7 @@
{
"presets": [
[
"@nrwl/react/babel",
"@nx/react/babel",
{
"runtime": "automatic"
}

View File

@ -1,6 +1,6 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -39,7 +39,7 @@ Example configurations are provided here:
For convenience, you can boot the app injecting one of the configurations above by running:
```bash
yarn nx run explorer:serve --env={env} # e.g. stagnet1
yarn env-cmd -f .\apps\explorer\.env.{env} yarn nx run explorer:serve # e.g. stagnet1
```
There are a few different configuration options offered for this app:

View File

@ -4,8 +4,8 @@ export default {
displayName: 'explorer',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/explorer',

View File

@ -1,10 +1,11 @@
{
"name": "explorer",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/explorer/src",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@ -38,7 +39,7 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"executor": "@nx/webpack:dev-server",
"options": {
"port": 3000,
"buildTarget": "explorer:build:development",
@ -52,22 +53,28 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/explorer/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/explorer"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/explorer"],
"options": {
"jestConfig": "apps/explorer/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"generate-types": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"npx openapi-typescript https://raw.githubusercontent.com/vegaprotocol/documentation/main/specs/v0.71.4/blockexplorer.openapi.json --output apps/explorer/src/types/explorer.d.ts --immutable-types"
@ -75,7 +82,7 @@
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"cp apps/explorer/netlify.toml netlify.toml",
@ -84,7 +91,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/explorer/tsconfig.spec.json"

View File

@ -1,5 +1,5 @@
const { join } = require('path');
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
const theme = require('../../libs/tailwindcss-config/src/theme');
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');

View File

@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",

View File

@ -18,7 +18,7 @@
"jest.config.ts"
],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
]
}

View File

@ -1,6 +1,8 @@
const { composePlugins, withNx } = require('@nx/webpack');
const { withReact } = require('@nx/react');
const SentryPlugin = require('@sentry/webpack-plugin');
module.exports = (config, context) => {
module.exports = composePlugins(withNx(), withReact(), (config) => {
const additionalPlugins = process.env.SENTRY_AUTH_TOKEN
? [
new SentryPlugin({
@ -14,4 +16,4 @@ module.exports = (config, context) => {
...config,
plugins: [...additionalPlugins, ...config.plugins],
};
};
});

View File

@ -1,10 +1,11 @@
{
"name": "governance-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/governance-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/governance-e2e/cypress.config.js",
"devServerTarget": "governance:serve"
@ -16,14 +17,14 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/governance-e2e/**/*.{js,ts}"]
}
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/governance-e2e/"

View File

@ -98,6 +98,11 @@ describe(
.and('have.length', 64);
cy.getByTestId(proposalTermsToggle).click();
// 3001-VOTE-052 3001-VOTE-010
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('code.language-json')
.should('exist')
.within(() => {

View File

@ -117,6 +117,11 @@ context(
cy.getByTestId(submitWithdrawalButton).click();
});
// assert withdrawal request
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.first(txTimeout)
.should('contain.text', 'Funds unlocked')
@ -130,6 +135,11 @@ context(
cy.getByTestId(toastClose).click();
});
// withdrawal complete
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.first(txTimeout)
.should('contain.text', 'The withdrawal has been approved.')
@ -139,6 +149,11 @@ context(
'Withdraw 120.00 tUSDC'
);
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.last(txTimeout)
.should('contain.text', 'Transaction confirmed')
@ -146,6 +161,11 @@ context(
cy.getByTestId('external-link').should('exist');
});
// withdrawal history for complete withdrawal displayed
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(tableWithdrawnStatus)
.eq(1, txTimeout)
.should('have.text', 'Completed')
@ -187,6 +207,11 @@ context(
cy.getByTestId(submitWithdrawalButton).click();
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.first(txTimeout)
.should('contain.text', 'Funds unlocked')
@ -198,6 +223,11 @@ context(
);
cy.getByTestId(toastClose).click();
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(tableTxHash)
.eq(1)
.should('have.text', 'Complete withdrawal')
@ -213,18 +243,33 @@ context(
});
ethereumWalletConnect();
cy.getByTestId(completeWithdrawalButton).first().click();
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.last(txTimeout)
.should('contain.text', 'Awaiting confirmation')
.within(() => {
cy.getByTestId('external-link').should('exist');
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.first(txTimeout)
.should('contain.text', 'The withdrawal has been approved.')
.within(() => {
cy.getByTestId(toastPanel).should('contain.text', '110.00', 'tUSDC');
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.last(txTimeout)
.should('contain.text', 'Transaction confirmed')
@ -248,6 +293,11 @@ context(
cy.getByTestId(amountInput).click().type('50');
cy.getByTestId(submitWithdrawalButton).click();
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(toast)
.first(txTimeout)
.should('contain.text', 'Funds unlocked')

View File

@ -16,6 +16,11 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
});
it('should display announcement banner', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('app-announcement')
.should('contain.text', 'TEST ANNOUNCEMENT!')
.within(() => {
@ -35,6 +40,11 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
waitForSpinner();
}
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('proposals-list-item')
.should('have.length.at.least', 1)
.first()
@ -94,6 +104,11 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
});
it('should contain link to specific validators', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('validators')
.should('have.length', '2')
.each(($validator) => {
@ -120,6 +135,11 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
});
it('should display network data', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('git-network-data')
.should('contain.text', 'Reading network data from')
.within(() => {
@ -131,6 +151,11 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
});
it('should display eth data', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('git-eth-data')
.should('contain.text', 'Reading Ethereum data from')
.within(() => {

View File

@ -139,6 +139,11 @@ context(
mockNetworkUpgradeProposal();
navigateTo(navigation.proposals);
cy.getByTestId('open-proposals').within(() => {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('li')
.eq(0)
.should(
@ -201,6 +206,11 @@ context(
.should('contain.text', '99.98% approval (% validator voting power)')
.and('contain.text', '(67% voting power required)');
cy.get('h2').should('contain.text', 'Approvers (4/4 validators)');
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('validator-name')
.should('have.length', 4)
.each(($validator) => {

View File

@ -42,6 +42,11 @@ context(
// Skipping due to bug #3471 causing flaky failuress
it.skip('should have option to view go to next and previous page', function () {
waitForBeginningOfEpoch();
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('page-info')
.should('contain.text', 'Page ')
.invoke('text')

View File

@ -21,6 +21,11 @@ context(
// 1005-VEST-001
// 1005-VEST-002
it('Able to view tranches', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('tranche-item')
.should('have.length', 2)
.first()
@ -51,6 +56,11 @@ context(
cy.get('span').eq(1).should('have.text', 0);
});
cy.getByTestId('key-value-table').within(() => {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('link')
.should('have.length', 8)
.each((ethLink) => {
@ -58,6 +68,11 @@ context(
.should('have.attr', 'href')
.and('contain', 'https://sepolia.etherscan.io/address/');
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('redeem-link')
.should('have.length', 8)
.each((redeemLink) => {
@ -71,6 +86,11 @@ context(
it('Able to view tranches with less than 10 vega', function () {
navigateTo(navigation.supply);
cy.getByTestId('show-all-tranches').click();
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('tranche-item')
.should('have.length', 8)
.first()

View File

@ -74,6 +74,11 @@ context('Validators Page - verify elements on page', function () {
function () {
// 1002-STKE-050
it('Should be able to see validator names', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('[col-id="validator"] > div > span')
.should('have.length.at.least', 1)
.each(($name) => {
@ -82,6 +87,11 @@ context('Validators Page - verify elements on page', function () {
});
it('Should be able to see validator stake', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('total-stake')
.should('have.length.at.least', 1)
.each(($stake) => {
@ -105,6 +115,11 @@ context('Validators Page - verify elements on page', function () {
});
it('Should be able to see validator normalised voting power', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('normalised-voting-power')
.should('have.length.at.least', 1)
.each(($vPower) => {
@ -126,6 +141,11 @@ context('Validators Page - verify elements on page', function () {
// 2002-SINC-018
it('Should be able to see validator total penalties', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('total-penalty')
.should('have.length.at.least', 1)
.each(($penalties) => {
@ -146,6 +166,11 @@ context('Validators Page - verify elements on page', function () {
});
it('Should be able to see validator pending stake', function () {
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('total-pending-stake')
.should('have.length.at.least', 1)
.each(($pendingStake) => {

View File

@ -1,7 +1,7 @@
{
"presets": [
[
"@nrwl/react/babel",
"@nx/react/babel",
{
"runtime": "automatic"
}

View File

@ -1,6 +1,6 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -31,7 +31,7 @@ Example configurations are provided here:
For convenience, you can boot the app injecting one of the configurations above by running:
```bash
yarn nx run governance:serve --env={env} # e.g. stagnet1
yarn env-cmd -f .\apps\governance\.env.{env} yarn nx run governance:serve # e.g. stagnet1
```
There are a few different configuration options offered for this app:

View File

@ -3,8 +3,8 @@ export default {
displayName: 'governance',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/governance',
@ -16,6 +16,5 @@ export default {
'**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/__generated__/**',
'!**/__generated___/**',
],
};

View File

@ -1,10 +1,11 @@
{
"name": "governance",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/governance/src",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@ -41,7 +42,7 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"executor": "@nx/webpack:dev-server",
"options": {
"port": 4210,
"buildTarget": "governance:build:development",
@ -55,22 +56,28 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/governance/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/governance"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/governance"],
"options": {
"jestConfig": "apps/governance/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"cp apps/governance/netlify.toml netlify.toml",
@ -79,7 +86,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/governance/tsconfig.spec.json"

View File

@ -1,159 +0,0 @@
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type ProposalAssetQueryVariables = Types.Exact<{
assetId: Types.Scalars['ID'];
}>;
export type ProposalAssetQuery = {
__typename?: 'Query';
asset?: {
__typename?: 'Asset';
status: Types.AssetStatus;
source:
| { __typename?: 'BuiltinAsset' }
| { __typename?: 'ERC20'; contractAddress: string };
} | null;
};
export type AssetListBundleQueryVariables = Types.Exact<{
assetId: Types.Scalars['ID'];
}>;
export type AssetListBundleQuery = {
__typename?: 'Query';
erc20ListAssetBundle?: {
__typename?: 'Erc20ListAssetBundle';
assetSource: string;
vegaAssetId: string;
nonce: string;
signatures: string;
} | null;
};
export const ProposalAssetDocument = gql`
query ProposalAsset($assetId: ID!) {
asset(id: $assetId) {
status
source {
... on ERC20 {
contractAddress
}
}
}
}
`;
/**
* __useProposalAssetQuery__
*
* To run a query within a React component, call `useProposalAssetQuery` and pass it any options that fit your needs.
* When your component renders, `useProposalAssetQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useProposalAssetQuery({
* variables: {
* assetId: // value for 'assetId'
* },
* });
*/
export function useProposalAssetQuery(
baseOptions: Apollo.QueryHookOptions<
ProposalAssetQuery,
ProposalAssetQueryVariables
>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<ProposalAssetQuery, ProposalAssetQueryVariables>(
ProposalAssetDocument,
options
);
}
export function useProposalAssetLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
ProposalAssetQuery,
ProposalAssetQueryVariables
>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<ProposalAssetQuery, ProposalAssetQueryVariables>(
ProposalAssetDocument,
options
);
}
export type ProposalAssetQueryHookResult = ReturnType<
typeof useProposalAssetQuery
>;
export type ProposalAssetLazyQueryHookResult = ReturnType<
typeof useProposalAssetLazyQuery
>;
export type ProposalAssetQueryResult = Apollo.QueryResult<
ProposalAssetQuery,
ProposalAssetQueryVariables
>;
export const AssetListBundleDocument = gql`
query AssetListBundle($assetId: ID!) {
erc20ListAssetBundle(assetId: $assetId) {
assetSource
vegaAssetId
nonce
signatures
}
}
`;
/**
* __useAssetListBundleQuery__
*
* To run a query within a React component, call `useAssetListBundleQuery` and pass it any options that fit your needs.
* When your component renders, `useAssetListBundleQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useAssetListBundleQuery({
* variables: {
* assetId: // value for 'assetId'
* },
* });
*/
export function useAssetListBundleQuery(
baseOptions: Apollo.QueryHookOptions<
AssetListBundleQuery,
AssetListBundleQueryVariables
>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<AssetListBundleQuery, AssetListBundleQueryVariables>(
AssetListBundleDocument,
options
);
}
export function useAssetListBundleLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
AssetListBundleQuery,
AssetListBundleQueryVariables
>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
AssetListBundleQuery,
AssetListBundleQueryVariables
>(AssetListBundleDocument, options);
}
export type AssetListBundleQueryHookResult = ReturnType<
typeof useAssetListBundleQuery
>;
export type AssetListBundleLazyQueryHookResult = ReturnType<
typeof useAssetListBundleLazyQuery
>;
export type AssetListBundleQueryResult = Apollo.QueryResult<
AssetListBundleQuery,
AssetListBundleQueryVariables
>;

View File

@ -5,13 +5,11 @@ import { MockedProvider } from '@apollo/client/testing';
import type {
AssetListBundleQuery,
ProposalAssetQuery,
} from './__generated___/Asset';
import { AssetListBundleDocument } from './__generated___/Asset';
import { ProposalAssetDocument } from './__generated___/Asset';
} from './__generated__/Asset';
import { AssetListBundleDocument } from './__generated__/Asset';
import { ProposalAssetDocument } from './__generated__/Asset';
import * as Schema from '@vegaprotocol/types';
import type { useWeb3React } from '@web3-react/core';
import BigNumber from 'bignumber.js';
import type { AppState } from '../../../../contexts/app-state/app-state-context';
const mockUseEthTx = {
perform: jest.fn(),
@ -47,23 +45,6 @@ jest.mock('@web3-react/core', () => {
};
});
const mockAppState: AppState = {
totalAssociated: new BigNumber('50063005'),
decimals: 18,
totalSupply: new BigNumber(65000000),
vegaWalletOverlay: false,
vegaWalletManageOverlay: false,
transactionOverlay: false,
bannerMessage: '',
disconnectNotice: false,
};
jest.mock('../../../contexts/app-state/app-state-context', () => ({
useAppState: () => ({
appState: mockAppState,
}),
}));
const ASSET_ID = 'foo';
const DEFAULT__ASSET: ProposalAssetQuery = {

View File

@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
import {
useAssetListBundleQuery,
useProposalAssetQuery,
} from './__generated___/Asset';
} from './__generated__/Asset';
import { EthWalletContainer } from '../../../../components/eth-wallet-container';
const useListAsset = (assetId: string) => {

View File

@ -6,7 +6,7 @@ jest.mock('../../../../../components/connect-to-vega', () => ({
ConnectToVega: () => <div data-testid="connect-to-vega" />,
}));
jest.mock('../../../../components/eth-connect-prompt', () => ({
jest.mock('../../../../../components/eth-connect-prompt', () => ({
EthConnectPrompt: () => <div data-testid="eth-connect-prompt" />,
}));

View File

@ -1,64 +0,0 @@
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type NodeDataQueryVariables = Types.Exact<{ [key: string]: never }>;
export type NodeDataQuery = {
__typename?: 'Query';
nodeData?: { __typename?: 'NodeData'; stakedTotal: string } | null;
};
export const NodeDataDocument = gql`
query NodeData {
nodeData {
stakedTotal
}
}
`;
/**
* __useNodeDataQuery__
*
* To run a query within a React component, call `useNodeDataQuery` and pass it any options that fit your needs.
* When your component renders, `useNodeDataQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useNodeDataQuery({
* variables: {
* },
* });
*/
export function useNodeDataQuery(
baseOptions?: Apollo.QueryHookOptions<NodeDataQuery, NodeDataQueryVariables>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<NodeDataQuery, NodeDataQueryVariables>(
NodeDataDocument,
options
);
}
export function useNodeDataLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
NodeDataQuery,
NodeDataQueryVariables
>
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<NodeDataQuery, NodeDataQueryVariables>(
NodeDataDocument,
options
);
}
export type NodeDataQueryHookResult = ReturnType<typeof useNodeDataQuery>;
export type NodeDataLazyQueryHookResult = ReturnType<
typeof useNodeDataLazyQuery
>;
export type NodeDataQueryResult = Apollo.QueryResult<
NodeDataQuery,
NodeDataQueryVariables
>;

View File

@ -11,7 +11,7 @@ import type { RouteChildProps } from '..';
import Routes from '../routes';
import { TokenDetails } from './token-details';
import { Button } from '@vegaprotocol/ui-toolkit';
import { useNodeDataQuery } from './__generated___/NodeData';
import { useNodeDataQuery } from './__generated__/NodeData';
const Home = ({ name }: RouteChildProps) => {
useDocumentTitle(name);

View File

@ -1,5 +1,5 @@
const { join } = require('path');
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
const theme = require('../../libs/tailwindcss-config/src/theme');
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');

View File

@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",

View File

@ -18,7 +18,7 @@
"jest.config.ts"
],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
]
}

View File

@ -1,6 +1,8 @@
const { composePlugins, withNx } = require('@nx/webpack');
const { withReact } = require('@nx/react');
const SentryPlugin = require('@sentry/webpack-plugin');
module.exports = (config, context) => {
module.exports = composePlugins(withNx(), withReact(), (config, context) => {
const additionalPlugins = process.env.SENTRY_AUTH_TOKEN
? [
new SentryPlugin({
@ -13,4 +15,4 @@ module.exports = (config, context) => {
...config,
plugins: [...additionalPlugins, ...config.plugins],
};
};
});

View File

@ -1,7 +1,7 @@
{
"presets": [
[
"@nrwl/react/babel",
"@nx/react/babel",
{
"runtime": "automatic"
}

View File

@ -1,6 +1,6 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -3,8 +3,8 @@ export default {
displayName: 'liquidity-provision-dashboard',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/liquidity-provision-dashboard',

View File

@ -1,10 +1,11 @@
{
"name": "liquidity-provision-dashboard",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/liquidity-provision-dashboard/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@ -21,7 +22,7 @@
],
"styles": ["apps/liquidity-provision-dashboard/src/styles.scss"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
"webpackConfig": "@nx/react/plugins/webpack"
},
"configurations": {
"development": {
@ -47,7 +48,7 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"executor": "@nx/webpack:dev-server",
"options": {
"buildTarget": "liquidity-provision-dashboard:build",
"hmr": true,
@ -64,7 +65,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
@ -73,15 +74,23 @@
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/liquidity-provision-dashboard"],
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/apps/liquidity-provision-dashboard"
],
"options": {
"jestConfig": "apps/liquidity-provision-dashboard/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"cp apps/liquidity-provision-dashboard/netlify.toml netlify.toml",
@ -90,7 +99,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/liquidity-provision-dashboard/tsconfig.spec.json"

View File

@ -1,5 +1,5 @@
const { join } = require('path');
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
const theme = require('../../libs/tailwindcss-config/src/theme-lite');
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');
const vegaCustomClassesLite = require('../../libs/tailwindcss-config/src/vega-custom-classes-lite');

View File

@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",

View File

@ -21,7 +21,7 @@
"**/*.d.ts"
],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
]
}

View File

@ -1,7 +1,7 @@
{
"presets": [
[
"@nrwl/react/babel",
"@nx/react/babel",
{
"runtime": "automatic"
}

View File

@ -1,6 +1,6 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -26,7 +26,7 @@ Example configurations are provided here:
For convenience, you can boot the app injecting one of the configurations above by running:
```bash
yarn nx run multisig-signer:serve --env={env} # e.g. stagnet1
yarn env-cmd -f .\apps\multisig-signer\.env.{env} yarn nx run multisig-signer:serve # e.g. stagnet1
```
There are a few different configuration options offered for this app:

View File

@ -3,8 +3,8 @@ export default {
displayName: 'multisig-signer',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': 'babel-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/multisig-signer',

View File

@ -1,10 +1,11 @@
{
"name": "multisig-signer",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/multisig-signer/src",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@ -38,7 +39,7 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"executor": "@nx/webpack:dev-server",
"options": {
"port": 3000,
"buildTarget": "multisig-signer:build:development",
@ -52,22 +53,28 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/multisig-signer/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/multisig-signer"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/multisig-signer"],
"options": {
"jestConfig": "apps/multisig-signer/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"cp apps/multisig-signer/netlify.toml netlify.toml",
@ -76,7 +83,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/multisig-signer/tsconfig.spec.json"

View File

@ -1,5 +1,5 @@
const { join } = require('path');
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
const theme = require('../../libs/tailwindcss-config/src/theme');
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');

View File

@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",

View File

@ -18,7 +18,7 @@
"jest.config.ts"
],
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
]
}

View File

@ -1,6 +1,8 @@
const { composePlugins, withNx } = require('@nx/webpack');
const { withReact } = require('@nx/react');
const SentryPlugin = require('@sentry/webpack-plugin');
module.exports = (config, context) => {
module.exports = composePlugins(withNx(), withReact(), (config, context) => {
const additionalPlugins = process.env.SENTRY_AUTH_TOKEN
? [
new SentryPlugin({
@ -14,4 +16,4 @@ module.exports = (config, context) => {
...config,
plugins: [...additionalPlugins, ...config.plugins],
};
};
});

3
apps/static/.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["@nx/js/babel"]
}

View File

@ -1,11 +1,12 @@
{
"name": "static",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/static/src",
"tags": [],
"targets": {
"build": {
"executor": "./tools/executors/webpack:build",
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
@ -36,7 +37,7 @@
}
},
"serve": {
"executor": "./tools/executors/webpack:serve",
"executor": "@nx/webpack:dev-server",
"options": {
"buildTarget": "static:build"
},
@ -47,7 +48,7 @@
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"cp apps/static/netlify.toml netlify.toml",

View File

@ -1,10 +1,11 @@
{
"name": "trading-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/trading-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/trading-e2e/cypress.config.js",
"devServerTarget": "trading:serve"
@ -19,14 +20,14 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/trading-e2e/**/*.{js,ts}"]
}
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/trading-e2e/"

View File

@ -97,6 +97,11 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
cy.get('.ag-cell-value', txTimeout).should('contain.text', btcSymbol);
cy.get('[col-id="status"]').should('not.have.text', 'Open', txTimeout);
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('[col-id="txHash"]')
.should('have.length.above', 2)
.eq(1)
@ -415,6 +420,11 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
.eq(0, txTimeout)
.should('contain.text', 'Completed');
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('[col-id="txHash"]', txTimeout)
.should('have.length.above', 1)
.eq(1)
@ -492,6 +502,11 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
cy.get('.ag-cell-value', txTimeout).should('contain.text', vegaSymbol);
cy.get('[col-id="status"]').should('not.have.text', 'Open', txTimeout);
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('[col-id="txHash"]')
.should('have.length.above', 2)
.eq(1)

View File

@ -201,7 +201,7 @@ describe('no all markets', { tags: '@smoke', testIsolation: true }, () => {
cy.visit('/#/markets/all');
});
it('can see no markets message', () => {
it.skip('can see no markets message', () => {
// 6001-MARK-048
cy.getByTestId('tab-all-markets').should('contain.text', 'No markets');
});

View File

@ -137,6 +137,11 @@ describe('Market trading page', () => {
.realHover();
});
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(expirtyTooltip)
.eq(0)
.should(
@ -170,6 +175,11 @@ describe('Market trading page', () => {
.realHover();
});
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(tradingModeTooltip)
.should(
'contain.text',
@ -196,6 +206,11 @@ describe('Market trading page', () => {
cy.getByTestId(itemValue).realHover();
});
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId(liquiditySuppliedTooltip)
.should('contain.text', 'Supplied stake')
.and('contain.text', 'Target stake')

View File

@ -118,6 +118,11 @@ describe('orders list', { tags: '@smoke', testIsolation: true }, () => {
cy.contains('Reset').click();
cy.getByTestId('All').click();
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.getByTestId('tab-orders')
.get(`.ag-center-cols-container [col-id='${orderSymbol}']`)
.should('have.length.at.least', expectedOrderList.length)
@ -441,6 +446,11 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
peggedOrder: null,
liquidityProvisionId: null,
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(`[row-id=${orderId}]`)
.find('[data-testid="edit"]')
.should('have.text', 'Edit')
@ -470,6 +480,11 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
peggedOrder: null,
liquidityProvisionId: null,
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(`[row-id=${orderId}]`)
.find(`[data-testid="cancel"]`)
.should('have.text', 'Cancel')
@ -492,6 +507,11 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
peggedOrder: null,
liquidityProvisionId: null,
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(`[data-testid="cancelAll"]`)
.should('have.text', 'Cancel all')
.then(($btn) => {
@ -508,6 +528,11 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
peggedOrder: null,
liquidityProvisionId: null,
});
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get(`[row-id=${orderId}]`)
.find('[data-testid="edit"]')
.should('have.text', 'Edit')

View File

@ -47,6 +47,11 @@ describe('Portfolio page', { tags: '@smoke' }, () => {
cy.get(
'[role="columnheader"][col-id="fromAccountType"] .ag-header-cell-menu-button'
).click();
/**
* TODO(@nx/cypress): Nesting Cypress commands in a should assertion now throws.
* You should use .then() to chain commands instead.
* More Info: https://docs.cypress.io/guides/references/migration-guide#-should
**/
cy.get('fieldset.ag-simple-filter-body-wrapper')
.should('be.visible')
.within((fields) => {

View File

@ -73,7 +73,7 @@ describe('trades', { tags: '@smoke' }, () => {
it('copy price to deal ticket form', () => {
// 6005-THIS-007
cy.get(colIdPrice).last().click();
cy.get(colIdPrice).last().should('be.visible').click();
cy.getByTestId('order-price').should('have.value', '171.16898');
});
});

View File

@ -1,6 +1,6 @@
{
"extends": [
"plugin:@nrwl/nx/react-typescript",
"plugin:@nx/react-typescript",
"../../.eslintrc.json",
"next",
"next/core-web-vitals"

View File

@ -25,7 +25,7 @@ Example configurations are provided here:
For convenience, you can boot the app injecting one of the configurations above by running:
```bash
yarn nx run token:serve --env={env} # e.g. stagnet1
yarn env-cmd -f .\apps\token\.env.{env} yarn nx run token:serve # e.g. stagnet1
```
There are a few different configuration options offered for this app:

View File

@ -3,8 +3,8 @@ export default {
displayName: 'trading',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/trading',

View File

@ -1,5 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNx = require('@nrwl/next/plugins/with-nx');
const withNx = require('@nx/next/plugins/with-nx');
const { withSentryConfig } = require('@sentry/nextjs');
const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN;
@ -11,7 +11,7 @@ const sentryWebpackOptions = {
};
/**
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {

View File

@ -1,14 +1,14 @@
{
"name": "trading",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/trading",
"projectType": "application",
"targets": {
"build": {
"executor": "./tools/executors/next:build",
"executor": "@nx/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"root": "apps/trading",
"outputPath": "dist/apps/trading"
},
"configurations": {
@ -19,7 +19,7 @@
}
},
"serve": {
"executor": "./tools/executors/next:serve",
"executor": "@nx/next:server",
"options": {
"buildTarget": "trading:build",
"dev": true
@ -32,28 +32,34 @@
}
},
"export": {
"executor": "./tools/executors/next:export",
"executor": "@nx/next:export",
"options": {
"buildTarget": "trading:build:production"
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/trading"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/trading"],
"options": {
"jestConfig": "apps/trading/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/trading/**/*.{ts,tsx,js,jsx}"]
}
},
"build-netlify": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"options": {
"commands": [
"cp apps/trading/netlify.toml netlify.toml",
@ -62,7 +68,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/trading/tsconfig.spec.json"

View File

@ -1,5 +1,5 @@
const { join } = require('path');
const { createGlobPatternsForDependencies } = require('@nrwl/next/tailwind');
const { createGlobPatternsForDependencies } = require('@nx/next/tailwind');
const theme = require('../../libs/tailwindcss-config/src/theme');
const vegaCustomClasses = require('../../libs/tailwindcss-config/src/vega-custom-classes');

View File

@ -3,18 +3,19 @@
export PATH="/app/node_modules/.bin:$PATH"
flags="--network-timeout 100000 --pure-lockfile"
envCmd=""
if [[ ! -z "${ENV_NAME}" ]]; then
if [[ "${ENV_NAME}" != "ops-vega" ]]; then
flags="--env=${ENV_NAME} $flags"
envCmd="envCmd="yarn env-cmd -f ./apps/${APP}/.env.${ENV_NAME}"
fi
fi
if [ "${APP}" = "trading" ]; then
yarn nx export ${APP} $flags
$envCmd yarn nx export ${APP} $flags
mv /app/dist/apps/trading/exported/ /app/tmp
rm -rf /app/dist/apps/trading
mv /app/tmp /app/dist/apps/trading
else
yarn nx build ${APP} $flags
$envCmd yarn nx build ${APP} $flags
fi

View File

@ -1,13 +1,13 @@
#!/bin/bash -e
yarn --pure-lockfile
app=${1:-trading}
flags="--env=${2:-mainnet}"
envCmd="envCmd="yarn env-cmd -f ./apps/${app}/.env.${2:-mainnet}"
yarn install
if [ "${app}" = "trading" ]; then
yarn nx export trading $flags
$envCmd yarn nx export trading
DIST_LOCATION=dist/apps/trading/exported
else
yarn nx build ${app} $flags
$envCmd yarn nx build ${app}
DIST_LOCATION=dist/apps/${app}
fi
cp -r $DIST_LOCATION dist-result

View File

@ -1,4 +1,4 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');
export default {
projects: getJestProjects(),

View File

@ -1,3 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;
const nxPreset = require('@nx/jest/preset').default;
module.exports = { ...nxPreset };

View File

@ -1,4 +1,13 @@
{
"presets": ["@nrwl/next/babel"],
"sourceType": "unambiguous",
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}

View File

@ -1,6 +1,6 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -1,28 +1,10 @@
const rootMain = require('../../../.storybook/main');
module.exports = {
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [
...rootMain.stories,
'../src/lib/**/*.stories.mdx',
'../src/lib/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
...rootMain.addons,
'@nrwl/react/plugins/storybook',
'storybook-addon-themes',
],
webpackFinal: async (config, { configType }) => {
// apply any global webpack configs that might have been specified in .storybook/main.js
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}
// add your own webpack tweaks if needed
return config;
const config = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
framework: {
name: '@storybook/react-webpack5',
options: {},
},
};
export default config;

View File

@ -1,5 +1,5 @@
import './styles.scss';
import { useStorybookThemeObserver } from '@vegaprotocol/utils';
import { useStorybookThemeObserver } from '@vegaprotocol/react-helpers';
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
backgrounds: { disable: true },

View File

@ -5,9 +5,9 @@
"outDir": ""
},
"files": [
"../../../node_modules/@nrwl/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../../node_modules/@nrwl/react/typings/image.d.ts"
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",

View File

@ -2,13 +2,9 @@
export default {
displayName: 'positions',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/positions',

View File

@ -1,19 +1,20 @@
{
"name": "accounts",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/accounts/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/accounts",
"tsConfig": "libs/accounts/tsconfig.lib.json",
"project": "libs/accounts/package.json",
"entryFile": "libs/accounts/src/index.ts",
"external": ["react/jsx-runtime"],
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"external": ["react", "react-dom", "react/jsx-runtime"],
"rollupConfig": "@nx/react/plugins/bundle-rollup",
"compiler": "babel",
"assets": [
{
@ -25,28 +26,31 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/accounts/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/accounts"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/accounts"],
"options": {
"jestConfig": "libs/accounts/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"storybook": {
"executor": "@nrwl/storybook:storybook",
"executor": "@nx/storybook:storybook",
"options": {
"uiFramework": "@storybook/react",
"port": 4400,
"config": {
"configFolder": "libs/accounts/.storybook"
}
"configDir": "libs/accounts/.storybook"
},
"configurations": {
"ci": {
@ -55,14 +59,11 @@
}
},
"build-storybook": {
"executor": "@nrwl/storybook:build",
"outputs": ["{options.outputPath}"],
"executor": "@nx/storybook:build",
"outputs": ["{options.outputDir}"],
"options": {
"uiFramework": "@storybook/react",
"outputPath": "dist/storybook/accounts",
"config": {
"configFolder": "libs/accounts/.storybook"
}
"configDir": "libs/accounts/.storybook",
"outputDir": "dist/storybook/accounts"
},
"configurations": {
"ci": {
@ -71,7 +72,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./libs/accounts/tsconfig.spec.json"

View File

@ -23,8 +23,8 @@ const margins: MarginFieldsFragment = {
},
};
const getMargins = jest.fn(() => margins);
const getBalance = jest.fn(() => '0');
const mockGetMargins = jest.fn(() => margins);
const mockGetBalance = jest.fn(() => '0');
jest.mock('./margin-data-provider', () => ({}));
@ -49,7 +49,7 @@ jest.mock('@vegaprotocol/wallet', () => ({
jest.mock('@vegaprotocol/data-provider', () => ({
useDataProvider: () => {
return {
data: getMargins(),
data: mockGetMargins(),
};
},
}));
@ -57,7 +57,7 @@ jest.mock('@vegaprotocol/data-provider', () => ({
jest.mock('./use-account-balance', () => ({
useAccountBalance: () => {
return {
accountBalance: getBalance(),
accountBalance: mockGetBalance(),
};
},
}));
@ -88,7 +88,7 @@ describe('MarginHealthChart', () => {
});
it('should use correct scale', async () => {
getBalance.mockReturnValueOnce('1300');
mockGetBalance.mockReturnValueOnce('1300');
await act(async () => {
render(<MarginHealthChart marketId="marketId" assetId="assetId" />);
});

View File

@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/next/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",
@ -17,6 +17,10 @@
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"**/*.stories.ts",
"**/*.stories.js",
"**/*.stories.jsx",
"**/*.stories.tsx",
"jest.config.ts"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]

View File

@ -1,7 +1,8 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@nrwl/next/babel",
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"

View File

@ -1,5 +1,5 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{

View File

@ -1,28 +1,10 @@
const rootMain = require('../../../.storybook/main');
module.exports = {
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [
...rootMain.stories,
'../src/lib/**/*.stories.mdx',
'../src/lib/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
...rootMain.addons,
'@nrwl/react/plugins/storybook',
'storybook-addon-themes',
],
webpackFinal: async (config, { configType }) => {
// apply any global webpack configs that might have been specified in .storybook/main.js
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}
// add your own webpack tweaks if needed
return config;
const config = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
framework: {
name: '@storybook/react-webpack5',
options: {},
},
};
export default config;

View File

@ -1,2 +1,2 @@
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
// eslint-disable-next-line @nx/enforce-module-boundaries
export * from '../../ui-toolkit/.storybook/preview';

View File

@ -5,9 +5,9 @@
"outDir": ""
},
"files": [
"../../../node_modules/@nrwl/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../../node_modules/@nrwl/react/typings/image.d.ts"
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",

View File

@ -2,13 +2,10 @@
export default {
displayName: 'announcements',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/announcements',

View File

@ -1,11 +1,12 @@
{
"name": "announcements",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/announcements/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/announcements",
@ -13,7 +14,7 @@
"project": "libs/announcements/package.json",
"entryFile": "libs/announcements/src/index.ts",
"external": ["react/jsx-runtime"],
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"rollupConfig": "@nx/react/plugins/bundle-rollup",
"compiler": "babel",
"assets": [
{
@ -25,28 +26,31 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/announcements/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/announcements"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/announcements"],
"options": {
"jestConfig": "libs/announcements/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"storybook": {
"executor": "@nrwl/storybook:storybook",
"executor": "@nx/storybook:storybook",
"options": {
"uiFramework": "@storybook/react",
"port": 4400,
"config": {
"configFolder": "libs/announcements/.storybook"
}
"configDir": "libs/announcements/.storybook"
},
"configurations": {
"ci": {
@ -55,14 +59,11 @@
}
},
"build-storybook": {
"executor": "@nrwl/storybook:build",
"outputs": ["{options.outputPath}"],
"executor": "@nx/storybook:build",
"outputs": ["{options.outputDir}"],
"options": {
"uiFramework": "@storybook/react",
"outputPath": "dist/storybook/announcements",
"config": {
"configFolder": "libs/announcements/.storybook"
}
"configDir": "libs/announcements/.storybook",
"outputDir": "dist/storybook/announcements"
},
"configurations": {
"ci": {
@ -71,7 +72,7 @@
}
},
"build-spec": {
"executor": "@nrwl/workspace:run-commands",
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./libs/announcements/tsconfig.spec.json"

View File

@ -5,8 +5,8 @@
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/next/typings/image.d.ts"
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/next/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",
@ -17,6 +17,10 @@
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"**/*.stories.ts",
"**/*.stories.js",
"**/*.stories.jsx",
"**/*.stories.tsx",
"jest.config.ts"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]

View File

@ -1,3 +0,0 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
}

View File

@ -2,13 +2,14 @@
export default {
displayName: 'apollo-client',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
globals: {},
transform: {
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/apollo-client',

View File

@ -1,41 +1,38 @@
{
"name": "apollo-client",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/apollo-client/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/web:rollup",
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/apollo-client",
"main": "libs/apollo-client/src/index.ts",
"tsConfig": "libs/apollo-client/tsconfig.lib.json",
"project": "libs/apollo-client/package.json",
"entryFile": "libs/apollo-client/src/index.ts",
"external": ["react/jsx-runtime"],
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"compiler": "babel",
"assets": [
{
"glob": "libs/apollo-client/README.md",
"input": ".",
"output": "."
}
]
"assets": ["libs/apollo-client/*.md"]
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/apollo-client/**/*.ts"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/apollo-client"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/apollo-client"],
"options": {
"jestConfig": "libs/apollo-client/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},

View File

@ -1,7 +1,7 @@
{
"presets": [
[
"@nrwl/react/babel",
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"

View File

@ -1,6 +1,6 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "__generated__"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -3,7 +3,8 @@ export default {
displayName: 'assets',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': 'babel-jest',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/assets',

Some files were not shown because too many files have changed in this diff Show More