-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add flyte-api plugin package (#490)
Signed-off-by: Nastya <[email protected]>
- Loading branch information
Showing
15 changed files
with
165 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a flyte-API package for flyteconsole plugin system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
const sharedConfig = require('../../../script/test/jest.base.js'); | ||
|
||
module.exports = { | ||
...sharedConfig, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@flyteconsole/flyte-api", | ||
"version": "0.0.1-rc.1", | ||
"description": "FlyteConsole plugin to allow access FlyteAPI", | ||
"main": "./dist/index.js", | ||
"module": "./lib/esm/index.js", | ||
"types": "./lib/esm/index.d.ts", | ||
"license": "Apache-2.0", | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
}, | ||
"scripts": { | ||
"build": "yarn build:esm && yarn build:cjs", | ||
"build:esm": "tsc --module esnext --outDir lib/esm --project ./tsconfig.build.json", | ||
"build:cjs": "tsc --project ./tsconfig.build.json", | ||
"test": "NODE_ENV=test jest" | ||
}, | ||
"dependencies": { | ||
"@material-ui/core": "^4.0.0", | ||
"@material-ui/icons": "^4.0.0", | ||
"classnames": "^2.3.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^16.9.34", | ||
"@types/react-dom": "^16.9.7", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react'; | ||
import { AppBar, Toolbar, IconButton, makeStyles, Theme } from '@material-ui/core'; | ||
import MenuIcon from '@material-ui/icons/Menu'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
spacer: { | ||
flexGrow: 1, | ||
}, | ||
menuButton: { | ||
marginRight: theme.spacing(2), | ||
}, | ||
})); | ||
|
||
export interface SampleComponentProps { | ||
useCustomContent?: boolean; // rename to show that it is a backNavigation | ||
className?: string; | ||
} | ||
|
||
/** Contains all content in the top navbar of the application. */ | ||
export const SampleComponent = (props: SampleComponentProps) => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<AppBar | ||
color="secondary" | ||
elevation={0} | ||
id="navbar" | ||
position="fixed" | ||
className={props.className as string} | ||
> | ||
<Toolbar> | ||
<div className={styles.spacer} /> | ||
{' Sample Text '} | ||
<div className={styles.spacer} /> | ||
<IconButton edge="start" className={styles.menuButton} color="inherit" aria-label="menu"> | ||
<MenuIcon /> | ||
</IconButton> | ||
</Toolbar> | ||
</AppBar> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
|
||
import { SampleComponent } from '.'; | ||
|
||
export default { | ||
title: 'Flyte-API/Sample', | ||
component: SampleComponent, | ||
} as ComponentMeta<typeof SampleComponent>; | ||
|
||
const useStyles = makeStyles((_theme: Theme) => ({ | ||
updatedOne: { | ||
backgroundColor: 'lightblue', | ||
color: 'black', | ||
}, | ||
updatedTwo: { | ||
backgroundColor: 'black', | ||
color: 'yellow', | ||
}, | ||
})); | ||
|
||
const Template: ComponentStory<typeof SampleComponent> = () => <SampleComponent />; | ||
export const Primary = Template.bind({}); | ||
|
||
export const Secondary: ComponentStory<typeof SampleComponent> = () => { | ||
const styles = useStyles(); | ||
return <SampleComponent className={styles.updatedOne} />; | ||
}; | ||
|
||
export const Tertiary: ComponentStory<typeof SampleComponent> = () => { | ||
const styles = useStyles(); | ||
return <SampleComponent className={styles.updatedTwo} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { SampleComponent } from './index'; | ||
|
||
describe('add function', () => { | ||
it('SampleComponent is rendered contains correct text', () => { | ||
render(<SampleComponent />); | ||
const text = screen.getByText('Sample Text'); | ||
expect(text).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { SampleComponent } from './Sample'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": [ | ||
// files excluded from the build, we can not put it inro default tsconfig | ||
// as it will screw VSCode IntelliSence | ||
"**/test", | ||
"**/mocks", | ||
"**/__mocks__", | ||
"**/__stories__", | ||
"**/*.spec.*", | ||
"**/*.test.*", | ||
"**/*.mock.*", | ||
"**/*.stories.*" | ||
], | ||
"references": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist" | ||
}, | ||
"references": [], | ||
"include": ["src/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters