#128 Add positions library
This commit is contained in:
parent
c5788fa1cf
commit
30c990bb3e
6
libs/positions/.babelrc
Normal file
6
libs/positions/.babelrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
"@nrwl/next/babel"
|
||||||
|
],
|
||||||
|
"plugins": []
|
||||||
|
}
|
18
libs/positions/.eslintrc.json
Normal file
18
libs/positions/.eslintrc.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
|
"ignorePatterns": ["!**/*"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.js", "*.jsx"],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
7
libs/positions/README.md
Normal file
7
libs/positions/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# positions
|
||||||
|
|
||||||
|
This library was generated with [Nx](https://nx.dev).
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `nx test positions` to execute the unit tests via [Jest](https://jestjs.io).
|
14
libs/positions/jest.config.js
Normal file
14
libs/positions/jest.config.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
displayName: 'positions',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
globals: {
|
||||||
|
'ts-jest': {
|
||||||
|
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
transform: {
|
||||||
|
'^.+\\.[tj]sx?$': 'ts-jest',
|
||||||
|
},
|
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
|
coverageDirectory: '../../coverage/libs/positions',
|
||||||
|
};
|
4
libs/positions/package.json
Normal file
4
libs/positions/package.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "@vegaprotocol/positions",
|
||||||
|
"version": "0.0.1"
|
||||||
|
}
|
43
libs/positions/project.json
Normal file
43
libs/positions/project.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"root": "libs/positions",
|
||||||
|
"sourceRoot": "libs/positions/src",
|
||||||
|
"projectType": "library",
|
||||||
|
"tags": [],
|
||||||
|
"targets": {
|
||||||
|
"build": {
|
||||||
|
"executor": "@nrwl/web:rollup",
|
||||||
|
"outputs": ["{options.outputPath}"],
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/libs/positions",
|
||||||
|
"tsConfig": "libs/positions/tsconfig.lib.json",
|
||||||
|
"project": "libs/positions/package.json",
|
||||||
|
"entryFile": "libs/positions/src/index.ts",
|
||||||
|
"external": ["react/jsx-runtime"],
|
||||||
|
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
|
||||||
|
"compiler": "babel",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "libs/positions/README.md",
|
||||||
|
"input": ".",
|
||||||
|
"output": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nrwl/linter:eslint",
|
||||||
|
"outputs": ["{options.outputFile}"],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": ["libs/positions/**/*.{ts,tsx,js,jsx}"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"executor": "@nrwl/jest:jest",
|
||||||
|
"outputs": ["coverage/libs/positions"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "libs/positions/jest.config.js",
|
||||||
|
"passWithNoTests": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
libs/positions/src/index.ts
Normal file
1
libs/positions/src/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './lib/positions';
|
0
libs/positions/src/lib/positions.module.scss
Normal file
0
libs/positions/src/lib/positions.module.scss
Normal file
10
libs/positions/src/lib/positions.spec.tsx
Normal file
10
libs/positions/src/lib/positions.spec.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { render } from '@testing-library/react';
|
||||||
|
|
||||||
|
import Positions from './positions';
|
||||||
|
|
||||||
|
describe('Positions', () => {
|
||||||
|
it('should render successfully', () => {
|
||||||
|
const { baseElement } = render(<Positions />);
|
||||||
|
expect(baseElement).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
14
libs/positions/src/lib/positions.tsx
Normal file
14
libs/positions/src/lib/positions.tsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import './positions.module.scss';
|
||||||
|
|
||||||
|
/* eslint-disable-next-line */
|
||||||
|
export interface PositionsProps {}
|
||||||
|
|
||||||
|
export function Positions(props: PositionsProps) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h1>Welcome to Positions!</h1>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Positions;
|
25
libs/positions/tsconfig.json
Normal file
25
libs/positions/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"allowJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.lib.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
22
libs/positions/tsconfig.lib.json
Normal file
22
libs/positions/tsconfig.lib.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
||||||
|
"../../node_modules/@nrwl/next/typings/image.d.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.test.ts",
|
||||||
|
"**/*.spec.tsx",
|
||||||
|
"**/*.test.tsx",
|
||||||
|
"**/*.spec.js",
|
||||||
|
"**/*.test.js",
|
||||||
|
"**/*.spec.jsx",
|
||||||
|
"**/*.test.jsx"
|
||||||
|
],
|
||||||
|
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
|
||||||
|
}
|
19
libs/positions/tsconfig.spec.json
Normal file
19
libs/positions/tsconfig.spec.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"module": "commonjs",
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.test.ts",
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/*.test.tsx",
|
||||||
|
"**/*.spec.tsx",
|
||||||
|
"**/*.test.js",
|
||||||
|
"**/*.spec.js",
|
||||||
|
"**/*.test.jsx",
|
||||||
|
"**/*.spec.jsx",
|
||||||
|
"**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
@ -20,6 +20,7 @@
|
|||||||
"@vegaprotocol/market-list": ["libs/market-list/src/index.ts"],
|
"@vegaprotocol/market-list": ["libs/market-list/src/index.ts"],
|
||||||
"@vegaprotocol/network-stats": ["libs/network-stats/src/index.ts"],
|
"@vegaprotocol/network-stats": ["libs/network-stats/src/index.ts"],
|
||||||
"@vegaprotocol/order-list": ["libs/order-list/src/index.ts"],
|
"@vegaprotocol/order-list": ["libs/order-list/src/index.ts"],
|
||||||
|
"@vegaprotocol/positions": ["libs/positions/src/index.ts"],
|
||||||
"@vegaprotocol/react-helpers": ["libs/react-helpers/src/index.ts"],
|
"@vegaprotocol/react-helpers": ["libs/react-helpers/src/index.ts"],
|
||||||
"@vegaprotocol/tailwindcss-config": [
|
"@vegaprotocol/tailwindcss-config": [
|
||||||
"libs/tailwindcss-config/src/index.js"
|
"libs/tailwindcss-config/src/index.js"
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"market-list": "libs/market-list",
|
"market-list": "libs/market-list",
|
||||||
"network-stats": "libs/network-stats",
|
"network-stats": "libs/network-stats",
|
||||||
"order-list": "libs/order-list",
|
"order-list": "libs/order-list",
|
||||||
|
"positions": "libs/positions",
|
||||||
"react-helpers": "libs/react-helpers",
|
"react-helpers": "libs/react-helpers",
|
||||||
"stats": "apps/stats",
|
"stats": "apps/stats",
|
||||||
"stats-e2e": "apps/stats-e2e",
|
"stats-e2e": "apps/stats-e2e",
|
||||||
|
Loading…
Reference in New Issue
Block a user