Skip to content

Commit

Permalink
chore: update packaging for better exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Apr 4, 2023
1 parent 6a3567b commit 9ca589b
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 61 deletions.
3 changes: 2 additions & 1 deletion packages/examples/pages/workspaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import React, { useState } from 'react';
import { useNile } from '@theniledev/react';
import { LoginInfo, User } from '@theniledev/js';
import { useForm } from 'react-hook-form';
import { ComponentList } from 'components/ComponentList';
import { useQuery } from '@tanstack/react-query';

import { ComponentList } from '../components/ComponentList';

function DeveloperLoginForm(props: { setShowForm: (show: boolean) => void }) {
const nile = useNile();
const { setShowForm } = props;
Expand Down
22 changes: 2 additions & 20 deletions packages/examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
{
"compilerOptions": {
"target": "es5",
"baseUrl": "./",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": { "@theniledev/react": ["../react"] }
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"extends": "../../tsconfig",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
2 changes: 1 addition & 1 deletion packages/react/src/GoogleLoginButton/GoogleLoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { useNile } from '../context';

import GoogleSSOButton from './Button';
import GoogleSSOButton from './GoogleSSOButton';

type LogInGoogleProps = {
org?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/GoogleLoginButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from './GoogleLoginButton';
export { default as Button } from './Button';
export { default as GoogleSSOButton } from './GoogleSSOButton';
2 changes: 2 additions & 0 deletions packages/react/src/components/Metrics/MetricsBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
TimeScale,
} from 'chart.js';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import('chartjs-adapter-date-fns');

import FilterBarChart from './Filter/FilterBarChart';
Expand Down

This file was deleted.

8 changes: 1 addition & 7 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export { useVerifyToken } from './lib/hooks/useVerifyToken';

export { useInstances } from './lib/hooks/useInstances';

export { AttributeType, Attribute } from './lib/SimpleForm/types';

export {
MetricsLineChart,
useFilter,
Expand All @@ -20,11 +18,7 @@ export {
IntervalSelect,
MetricsContext,
} from './components/Metrics';
export {
AggregateMetricsRequest,
AggregationType,
UpdateInterval,
} from './components/Metrics/types';

export { default as OrganizationForm } from './components/OrganizationForm';

export { default as GoogleLoginButton } from './GoogleLoginButton';
Expand Down
32 changes: 2 additions & 30 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src", "types", "../stories/**/*.stories.tsx"],
"extends": "../../tsconfig",
"compilerOptions": {
"module": "esnext",
"lib": ["dom", "esnext"],
"baseUrl": "./src",
"importHelpers": true,
// output .d.ts declaration files for consumers
"declaration": true,
// output .js.map sourcemap files for consumers
"sourceMap": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
"rootDir": "./src",
// stricter type-checking for stronger correctness. Recommended by TS
"strict": true,
// linter checks for common issues
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
"noUnusedLocals": true,
"noUnusedParameters": true,
// use Node's module resolution algorithm, instead of the legacy TS one
"moduleResolution": "node",
// transpile JSX to React.createElement
"jsx": "react",
// interop between ESM and CJS modules. Recommended by TS
"esModuleInterop": true,
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
"skipLibCheck": true,
// error out if import and file system have a casing mismatch. Recommended by TS
"forceConsistentCasingInFileNames": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true
"jsx": "react"
}
}
28 changes: 28 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": "./",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "es5",
"paths": {
"@theniledev/react": ["./packages/react/src"],
"@theniledev/react/*": ["./packages/react/src/*"],
"@theniledev/js": ["./lib/nile/src"],
"@theniledev/js/*": ["./lib/nile/src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts"],
"exclude": ["node_modules"],
"types": ["node", "react", "react-is/next"]
}

0 comments on commit 9ca589b

Please sign in to comment.