Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Apr 5, 2024
2 parents f3fcc24 + 4402b71 commit a68e8d5
Show file tree
Hide file tree
Showing 28 changed files with 165 additions and 156 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.2.1-alpha.0](https://github.com/niledatabase/nile-js/compare/v2.2.0...v2.2.1-alpha.0) (2024-04-05)

### Bug Fixes

- **react:** relagate theming to storybook alone ([5318b19](https://github.com/niledatabase/nile-js/commit/5318b197e3b766afc05801a4334469afd69d227f))
- **server:** export for cjs, better logging for config ([11fc06e](https://github.com/niledatabase/nile-js/commit/11fc06ec1f33e5a12bf2e8d4db0f9115dc8ca2da))

# [2.2.0](https://github.com/niledatabase/nile-js/compare/v2.2.0-alpha.3...v2.2.0) (2024-04-04)

**Note:** Version bump only for package @niledatabase/packages
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packages/browser",
"packages/server"
],
"version": "2.2.0",
"version": "2.2.1-alpha.0",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
4 changes: 4 additions & 0 deletions packages/browser/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.2.1-alpha.0](https://github.com/niledatabsae/nile-js/compare/v2.2.0...v2.2.1-alpha.0) (2024-04-05)

**Note:** Version bump only for package @niledatabase/browser

# [2.2.0](https://github.com/niledatabsae/nile-js/compare/v2.2.0-alpha.3...v2.2.0) (2024-04-04)

**Note:** Version bump only for package @niledatabase/browser
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@niledatabase/browser",
"version": "2.2.0",
"version": "2.2.1-alpha.0",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/browser.esm.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/edge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.2.1-alpha.0](https://github.com/niledatabase/nile-js/compare/v2.2.0...v2.2.1-alpha.0) (2024-04-05)

**Note:** Version bump only for package @niledatabase/edge

# [2.2.0](https://github.com/niledatabase/nile-js/compare/v2.2.0-alpha.3...v2.2.0) (2024-04-04)

**Note:** Version bump only for package @niledatabase/edge
Expand Down
2 changes: 1 addition & 1 deletion packages/edge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@niledatabase/edge",
"version": "2.2.0",
"version": "2.2.1-alpha.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/edge.esm.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,12 @@ mergedTheme.unstable_sxConfig = {
...muiSxConfig,
...joySxConfig,
};
export default mergedTheme;

export default {
theme: mergedTheme,
slotProps: {
provider: {
defaultMode: 'dark',
},
},
};
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.2.1-alpha.0](https://github.com/niledatabase/nile-js/compare/v2.2.0...v2.2.1-alpha.0) (2024-04-05)

### Bug Fixes

- **react:** relagate theming to storybook alone ([5318b19](https://github.com/niledatabase/nile-js/commit/5318b197e3b766afc05801a4334469afd69d227f))

# [2.2.0](https://github.com/niledatabase/nile-js/compare/v2.2.0-alpha.3...v2.2.0) (2024-04-04)

**Note:** Version bump only for package @niledatabase/react
Expand Down
11 changes: 4 additions & 7 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@niledatabase/react",
"version": "2.2.0",
"version": "2.2.1-alpha.0",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/react.esm.js",
Expand Down Expand Up @@ -65,6 +65,7 @@
"@storybook/blocks": "^8.0.0",
"@storybook/react": "^8.0.0",
"@storybook/react-webpack5": "^8.0.0",
"@storybook/test": "^8.0.0",
"@storybook/theming": "^8.0.4",
"@svgr/rollup": "^8.1.0",
"@svgr/webpack": "^8.1.0",
Expand All @@ -76,6 +77,7 @@
"@typescript-eslint/parser": "^6.12.0",
"babel-jest": "29.7.0",
"babel-loader": "^9.1.3",
"dts-cli": "^2.0.3",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-react-app": "^7.0.1",
Expand All @@ -98,16 +100,11 @@
"@mui/icons-material": "^5.14.18",
"@mui/joy": "5.0.0-beta.15",
"@mui/material": "5.14.18",
"@mui/utils": "^5.15.14",
"@mui/x-data-grid": "^7.0.0",
"@mui/x-date-pickers": "^7.0.0",
"@niledatabase/browser": "^2.2.0",
"@storybook/test": "^8.0.0",
"@niledatabase/browser": "^2.2.1-alpha.0",
"@tanstack/react-query": "^4.36.1",
"dts-cli": "^2.0.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"react-is": "^18.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Stack from '@mui/joy/Stack';
import Input from '@mui/joy/Input';

import { NileProvider } from '../context';
import theme from '../../.storybook/themeConfig';

import GoogleLoginButton from './GoogleLoginButton';

Expand All @@ -17,7 +18,7 @@ export default meta;

export function Basic() {
return (
<NileProvider>
<NileProvider {...theme}>
<div style={{ maxWidth: '20rem', margin: '0 auto' }}>
<GoogleLoginButton />
</div>
Expand All @@ -28,7 +29,7 @@ export function Basic() {
export function BasicWithTenantNameProvider() {
const [newTenant, setNewTenant] = React.useState<string | undefined>();
return (
<NileProvider>
<NileProvider {...theme}>
<div style={{ maxWidth: '20rem', margin: '0 auto' }}>
<Stack gap={2}>
<Stack>
Expand Down Expand Up @@ -57,7 +58,7 @@ export function AlphaVersionWithOutProvider() {

export function AlphaVersionWithProvider() {
return (
<NileProvider>
<NileProvider {...theme}>
<div style={{ maxWidth: '20rem', margin: '0 auto' }}>
<GoogleLoginButton />
</div>
Expand Down
9 changes: 7 additions & 2 deletions packages/react/src/LoginForm/UserLoginForm.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Meta } from '@storybook/react';
import Stack from '@mui/joy/Stack';

import theme from '../../.storybook/themeConfig';
import LoginForm from '../../src/LoginForm';
import { NileProvider } from '../../src/context';

Expand All @@ -14,8 +15,12 @@ export default meta;

export function Basic() {
return (
<NileProvider>
<Stack sx={{ maxWidth: '20rem', margin: '0 auto' }} spacing={2}>
<NileProvider {...theme}>
<Stack
sx={{ maxWidth: '20rem', margin: '0 auto' }}
spacing={2}
data-joy-color-scheme="dark"
>
<LoginForm onSuccess={() => alert('success!')} />
</Stack>
</NileProvider>
Expand Down
20 changes: 16 additions & 4 deletions packages/react/src/SSO/SSO.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import Typography from '@mui/joy/Typography';
import { Meta } from '@storybook/react';

import { NileProvider } from '../context';
import theme from '../../.storybook/themeConfig';

import BaseSSOForm, { Okta } from '.';

Expand All @@ -14,9 +16,16 @@ export default meta;

export function BasicSSO() {
return (
<NileProvider>
<div style={{ maxWidth: '20rem', margin: '0 auto' }}>
<NileProvider {...theme}>
<div
style={{ maxWidth: '20rem', margin: '0 auto' }}
data-joy-color-scheme="dark"
>
<Typography>Some kind of cool explaination</Typography>
<BaseSSOForm
configurationGuide={
<Typography>Some kind of cool explaination</Typography>
}
providerName="placeholder"
onSuccess={() => alert('success!')}
/>
Expand All @@ -26,8 +35,11 @@ export function BasicSSO() {
}
export function OktaSSO() {
return (
<NileProvider>
<div style={{ maxWidth: '20rem', margin: '0 auto' }}>
<NileProvider {...theme}>
<div
style={{ maxWidth: '20rem', margin: '0 auto' }}
data-joy-color-scheme="dark"
>
<Okta
onSuccess={() => {
alert('success!');
Expand Down
8 changes: 6 additions & 2 deletions packages/react/src/SignUpForm/NewUserSignUp.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Meta } from '@storybook/react';

import { NileProvider } from '../context';
import theme from '../../.storybook/themeConfig';

import SignUpForm from '.';

Expand All @@ -14,8 +15,11 @@ export default meta;

export function Basic() {
return (
<NileProvider>
<div style={{ maxWidth: '20rem', margin: '0 auto' }}>
<NileProvider {...theme}>
<div
style={{ maxWidth: '20rem', margin: '0 auto' }}
data-joy-color-scheme="dark"
>
<SignUpForm onSuccess={() => alert('success!')} />
</div>
</NileProvider>
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/UserTenantList/UserList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Meta } from '@storybook/react';

import { NileProvider } from '../context';
import theme from '../../.storybook/themeConfig';

import UserList from '.';

Expand All @@ -22,7 +23,7 @@ const users = [
];
export function Basic() {
return (
<NileProvider tenantId="tenantId">
<NileProvider {...theme} tenantId="tenantId" data-joy-color-scheme="dark">
<UserList data={users} />
</NileProvider>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const NileProvider = (props: NileProviderProps) => {
const {
children,
theme,
slotProps,
tenantId,
QueryProvider = BaseQueryProvider,
basePath = 'https://api.thenile.dev',
Expand All @@ -55,7 +56,7 @@ export const NileProvider = (props: NileProviderProps) => {

return (
<QueryProvider>
<ThemeProvider theme={theme}>
<ThemeProvider slotProps={slotProps?.provider} theme={theme}>
<Provider value={values}>{children}</Provider>
</ThemeProvider>
</QueryProvider>
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/context/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import CssBaseline from '@mui/material/CssBaseline';
import { Theme } from '@mui/joy/styles';
import { CssVarsProvider as JoyCssVarsProvider } from '@mui/joy/styles';

import defaultTheme from './config';

export default function Themer({
theme,
children,
slotProps,
}: {
theme?: Theme;
children: JSX.Element;
slotProps?: Record<string, string>;
}) {
return (
<JoyCssVarsProvider theme={theme ?? defaultTheme} defaultMode="dark">
<JoyCssVarsProvider {...slotProps} theme={theme}>
<CssBaseline enableColorScheme />
{children}
</JoyCssVarsProvider>
Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/context/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export type NileContext = NileReactConfig & {
export type NileProviderProps = NileReactConfig & {
children: JSX.Element | JSX.Element[];
theme?: Theme;
slotProps?: {
provider?: Record<string, string>;
};
QueryProvider?: (props: { children: JSX.Element }) => JSX.Element;
api?: Browser;
};
3 changes: 0 additions & 3 deletions packages/react/src/lib/SimpleForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ export default function SimpleForm(props: {
endDecorator={
field.value ? options[0].label : options[1].label
}
sx={{
'--Switch-thumbSize': '28px',
}}
/>
);
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig",
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src/**/*", "test", "src/**/*.stories.tsx"],
"include": ["src/**/*", "test", "src/**/*.stories.tsx", ".storybook/config.ts"],
"compilerOptions": {
"jsx": "react",
"lib": ["dom", "esnext"],
Expand Down
6 changes: 6 additions & 0 deletions packages/server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.2.1-alpha.0](https://github.com/niledatabase/nile-js/compare/v2.2.0...v2.2.1-alpha.0) (2024-04-05)

### Bug Fixes

- **server:** export for cjs, better logging for config ([11fc06e](https://github.com/niledatabase/nile-js/commit/11fc06ec1f33e5a12bf2e8d4db0f9115dc8ca2da))

# [2.2.0](https://github.com/niledatabase/nile-js/compare/v2.2.0-alpha.3...v2.2.0) (2024-04-04)

**Note:** Version bump only for package @niledatabase/server
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@niledatabase/server",
"version": "2.2.0",
"version": "2.2.1-alpha.0",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/server.esm.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/server/src/db/NileInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { evictPool } from '../utils/Event';
import { AfterCreate } from '../types';
import Logger from '../utils/Logger';

import { createProxyForPool } from './PoolProxy';

class NileDatabase {
pool: Pool;
tenantId?: undefined | null | string;
Expand All @@ -29,7 +31,7 @@ class NileDatabase {
this.config = config;
info(this.config);

this.pool = new Pool(remaining);
this.pool = createProxyForPool(new Pool(remaining), this.config);

if (typeof afterCreate === 'function') {
warn(
Expand Down
Loading

0 comments on commit a68e8d5

Please sign in to comment.