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

Fix/export types #21

Merged
merged 3 commits into from
Dec 28, 2021
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
run: yarn build

- name: Publish lib to NPM
run: npm publish --access public
run: |
cd lib
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@euk-labs/componentz",
"version": "0.1.1",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"main": "./index.js",
"module": "./esm/index.js",
"types": "./index.d.ts",
"files": [
"lib"
],
Expand Down Expand Up @@ -65,8 +65,6 @@
"eslint": "^8.5.0",
"eslint-plugin-react": "^7.28.0",
"husky": "^7.0.4",
"inversify": "^6.0.1",
"inversify-react": "^1.0.1",
"jest": "^27.4.5",
"mobx": "^6.3.10",
"mobx-react-lite": "^3.2.2",
Expand Down
7 changes: 6 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ rimraf(distFolder, (err) => {
entryPoints: [...inputs],
format: 'cjs',
outbase: sourceFolder,
outdir: distFolder + '/cjs',
outdir: distFolder,
jsx: 'transform',
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
Expand All @@ -67,4 +67,9 @@ rimraf(distFolder, (err) => {
inject: ['./scripts/react-shim.js'],
});
console.timeEnd('Generating CJS output...');

fs.copyFileSync(
path.join('./package.json'),
path.join(distFolder, 'package.json')
);
});
3 changes: 2 additions & 1 deletion src/components/AppBar/AppBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
RenderResult,
screen,
} from '@testing-library/react';
import { AppBar, globalContainer } from '../../index';
import AppBar from './index';
import globalContainer from '../../containers/global.inversify';
import { Container } from 'inversify';
import { Provider } from 'inversify-react';
import { Dashboard } from '@mui/icons-material';
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/DrawerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Collapse from '@mui/material/Collapse';
import List from '@mui/material/List';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import { useUIStore } from '../../index';
import useUIStore from '../../hooks/useUIStore';
import { Fragment, useState } from 'react';
import { Page } from './types';
import { observer } from 'mobx-react-lite';
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import IconButton from '@mui/material/IconButton';
import { useTheme } from '@mui/material/styles';
import MuiToolbar from '@mui/material/Toolbar';
import { observer } from 'mobx-react-lite';
import { useUIStore } from '../../index';
import useUIStore from '../../hooks/useUIStore';

function Toolbar() {
const theme = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Box from '@mui/material/Box';
import Divider from '@mui/material/Divider';
import List from '@mui/material/List';
import { useUIStore } from '../../index';
import useUIStore from '../../hooks/useUIStore';
import { observer } from 'mobx-react-lite';
import { ReactNode } from 'react';
import DrawerItem from './DrawerItem';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MuiBreadcrumbs, { BreadcrumbsProps } from '@mui/material/Breadcrumbs';
import Link from '@mui/material/Link';
import Typography from '@mui/material/Typography';
import { useUIStore } from '../../index';
import useUIStore from '../../hooks/useUIStore';
import { observer } from 'mobx-react-lite';
import { MouseEventHandler } from 'react';
import { BreadcrumbPath } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MuiDialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import { useUIStore } from '../../index';
import useUIStore from '../../hooks/useUIStore';
import { observer } from 'mobx-react-lite';
import { DialogProps } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Snackbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Snackbar as MuiSnackbar,
SnackbarProps,
} from '@mui/material';
import { useUIStore } from '../../index';
import useUIStore from '../../hooks/useUIStore';
import { observer } from 'mobx-react-lite';

interface ButtonProps extends MuiButtonProps {
Expand Down
4 changes: 2 additions & 2 deletions src/stores/internal/BreadcrumbStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeAutoObservable } from 'mobx';
import * as R from 'ramda';
import { last } from 'ramda';
import { BreadcrumbPath } from '../../components/Breadcrumbs/types';
import { BreadcrumbStoreType } from '../types';

Expand All @@ -16,7 +16,7 @@ class BreadcrumbStore implements BreadcrumbStoreType {
}

get finalPath() {
return R.last(this.paths)?.label ?? '';
return last(this.paths)?.label ?? '';
}

get linkedPaths() {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

// Build Options
"declaration": true,
"declarationDir": "./lib/types"
"declarationDir": "./lib"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "dist"]
Expand Down