Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOYAG-11116 moving components into sharable packages #411

Open
wants to merge 6 commits into
base: lmp-main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This project is setup as a monorepo, and contains the following:

- Publisher app (under `apps/publisher`)
- Viewer/subscriber app (under `apps/viewer`)
- Tests (under `apps/e2e-test/*` )
- Tests (under `apps/e2e-test/*`)
- Shared components/hooks (under `libs/*`)
- Storybook stories (under `.apps/stories/*`)

Expand Down
4 changes: 2 additions & 2 deletions apps/viewer/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import useNotification from '@millicast-react/use-notification';
import usePageClosePrompt from '@millicast-react/use-page-close-prompt';
import useViewer from '@millicast-react/use-viewer';

import ViewerVideoTiles from './components/viewer-video-tiles';
import { NoStream } from './components/no-stream';
import ViewerVideoTiles from '@millicast-react/viewer-video-tiles';
import NoStream from '@millicast-react/no-stream';

import './styles/app.css';

Expand Down
1 change: 0 additions & 1 deletion apps/viewer/src/components/no-stream/index.ts

This file was deleted.

18 changes: 18 additions & 0 deletions libs/no-stream/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.js"],
"rules": {}
},
{
"files": ["*.ts", "*.js"],
"rules": {}
},
{
"files": ["*.ts", "*.js"],
"rules": {}
}
]
}
15 changes: 15 additions & 0 deletions libs/no-stream/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */
export default {
displayName: 'no-stream',
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/no-stream',
};
24 changes: 24 additions & 0 deletions libs/no-stream/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "no-stream",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/no-stream/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/no-stream/**/*.{ts,js}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/no-stream/jest.config.ts",
"passWithNoTests": true
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Heading, Text, VStack } from '@chakra-ui/react';
import * as React from 'react';

export const NoStream = () => {
const NoStream = () => {
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

curiosity: why did remove the named export?

Copy link
Author

Choose a reason for hiding this comment

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

I was following the style of some of the components in the libs folder that instead did the default export at the bottom. I wasn't sure if there was a particular reason, but I was trying to match the style.

<VStack>
<Heading as="h2" fontSize="24px" fontWeight="600" test-id="pageHeader">
Expand All @@ -11,3 +11,5 @@ export const NoStream = () => {
</VStack>
);
};

export default NoStream;
1 change: 1 addition & 0 deletions libs/no-stream/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
28 changes: 28 additions & 0 deletions libs/no-stream/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"target": "ESNext",
"useDefineForClassFields": true,
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
9 changes: 9 additions & 0 deletions libs/no-stream/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
"include": ["**/*.ts"]
}
20 changes: 20 additions & 0 deletions libs/no-stream/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"**/*.test.ts",
"**/*.spec.ts",
"**/*.test.tsx",
"**/*.spec.tsx",
"**/*.test.js",
"**/*.spec.js",
"**/*.test.jsx",
"**/*.spec.jsx",
"**/*.d.ts"
]
}
18 changes: 18 additions & 0 deletions libs/settings-popover/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.js"],
"rules": {}
},
{
"files": ["*.ts", "*.js"],
"rules": {}
},
{
"files": ["*.ts", "*.js"],
"rules": {}
}
]
}
15 changes: 15 additions & 0 deletions libs/settings-popover/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */
export default {
displayName: 'settings-popover',
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/settings-popover',
};
24 changes: 24 additions & 0 deletions libs/settings-popover/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "settings-popover",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/settings-popover/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/settings-popover/**/*.{ts,js}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/settings-popover/jest.config.ts",
"passWithNoTests": true
}
}
}
}
1 change: 1 addition & 0 deletions libs/settings-popover/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
28 changes: 28 additions & 0 deletions libs/settings-popover/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"target": "ESNext",
"useDefineForClassFields": true,
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
9 changes: 9 additions & 0 deletions libs/settings-popover/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
"include": ["**/*.ts", "src/index.tsx"]
}
20 changes: 20 additions & 0 deletions libs/settings-popover/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"**/*.test.ts",
"**/*.spec.ts",
"**/*.test.tsx",
"**/*.spec.tsx",
"**/*.test.js",
"**/*.spec.js",
"**/*.test.jsx",
"**/*.spec.jsx",
"**/*.d.ts"
]
}
18 changes: 18 additions & 0 deletions libs/use-playback-control/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.js"],
"rules": {}
},
{
"files": ["*.ts", "*.js"],
"rules": {}
},
{
"files": ["*.ts", "*.js"],
"rules": {}
}
]
}
15 changes: 15 additions & 0 deletions libs/use-playback-control/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */
export default {
displayName: 'use-playback-control',
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/use-playback-control',
};
24 changes: 24 additions & 0 deletions libs/use-playback-control/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "use-playback-control",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/use-playback-control/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/use-playback-control/**/*.{ts,js}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/use-playback-control/jest.config.ts",
"passWithNoTests": true
}
}
}
}
Loading
Loading