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

[DPCP-65] Oneiros: Morpheus: Add Oneiros to Morpheus #15

Merged
merged 10 commits into from
Aug 14, 2024
59 changes: 57 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.1",
"description": "DreamPip's Design System Component Library.",
"type": "module",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.es.js",
"types": "dist/index.d.ts",
"repository": "https://github.com/dreampipcom/oneiros",
"files": [
Expand All @@ -15,8 +15,8 @@
"lint:icons": "eslint . --ext .ts,.tsx --ignore-path .gitignore --fix",
"format": "prettier --write --parser typescript '**/*.{ts,tsx}' --ignore-path .ignoreicons",
"lint": "eslint . --ext .ts,.tsx --ignore-path .ignoreicons --fix",
"build": "tsc -p tsconfig.json && cp ./tailwind.config.ts ./public/ && tsc -p tsconfig-dist.json && vite build",
"build:watch": "tsc -p tsconfig.json && cp ./tailwind.config.ts ./public/ && tsc -p tsconfig-dist.json && vite build --watch",
"build": "tsc -p tsconfig-cjs.json && cp ./tailwind.config.ts ./public/ && tsc -p tsconfig-dist.json && vite build --mode cjs && tsc -p tsconfig.json && vite build --emptyOutDir=false --mode es",
"build:watch": "tsc -p tsconfig.json && cp ./tailwind.config.ts ./public/ && tsc -p tsconfig-dist.json && vite build --watch --mode es",
"test": "vitest run",
"test-watch": "vitest",
"test:ui": "vitest --ui",
Expand Down Expand Up @@ -81,12 +81,12 @@
"jsdom": "24.0.0",
"lodash": "4.17.21",
"mapbox-gl": "^3.5.2",
"moment": "^2.30.1",
"postcss": "8.4.38",
"prettier": "3.2.5",
"react-map-gl": "^7.1.7",
"storybook": "^8.1.11",
"vite": "5.2.9",
"vite-plugin-commonjs": "^0.10.1",
"vite-plugin-dts": "3.8.3",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "4.3.2",
Expand All @@ -95,6 +95,7 @@
"peerDependencies": {
"clsx": "2.1.0",
"lazysizes": "^5.3.2",
"moment": "^2.30.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "3.4.4",
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions src/atoms/12_DateRange/DateRange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@
md:[&_.base-Popper-root]:!top-a5
md:[&_.base-Popper-root]:!mt-0

[&_.MuiPickersToolbarText-root.Mui-selected]:text-soft-light
[&_.MuiPickersToolbarText-root.Mui-selected]:text-primary-light
dark:[&_.MuiPickersToolbarText-root.Mui-selected]:text-soft-light

dark:!text-body-dark
[&_.MuiDateRangePickerDay-day.Mui-selected]:bg-soft-light
hover:[&_.MuiDateRangePickerDay-day.Mui-selected]:bg-soft-light
focus:[&_.MuiDateRangePickerDay-day.Mui-selected]:bg-soft-light
[&_.MuiDateRangePickerDay-day.Mui-selected]:bg-primary-light
hover:[&_.MuiDateRangePickerDay-day.Mui-selected]:bg-primary-light
focus:[&_.MuiDateRangePickerDay-day.Mui-selected]:bg-primary-light

[&_.MuiButton-colorPrimary]:!text-secondary-light

[&_.MuiDateRangePickerDay-rangeIntervalDayHighlight]:!bg-soft-bg
hover:[&_.MuiDateRangePickerDay-day]:!bg-soft-light
[&_.MuiDateRangePickerDay-rangeIntervalDayHighlight]:!bg-secondary-light
hover:[&_.MuiDateRangePickerDay-day]:!bg-primary-light
`]: true,
},
];
Expand Down Expand Up @@ -118,7 +118,7 @@
textRef.current = (e?: any, opts?: any) => ({ e, opts });
handleClear();
};
}, []);

Check warning on line 121 in src/atoms/12_DateRange/DateRange.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::build

React Hook useEffect has a missing dependency: 'handleClear'. Either include it or remove the dependency array

Check warning on line 121 in src/atoms/12_DateRange/DateRange.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::lint

React Hook useEffect has a missing dependency: 'handleClear'. Either include it or remove the dependency array

const handleChange = (e: any) => {
valueRef.current = value;
Expand Down
23 changes: 23 additions & 0 deletions tsconfig-cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "ES5",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable"],
"module": "commonjs",
"skipLibCheck": true,
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"noEmit": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"noUnusedLocals": false,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"declaration": true,
"outDir": "dist/cjs"
},
"include": ["src"],
"exclude": [
"src/**/__docs__","src/**/__test__",
]
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"declaration": true,
"outDir": "dist/esm"
},
"include": ["src"],
"exclude": [
Expand Down
115 changes: 85 additions & 30 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,92 @@
/// <reference types='vitest' />
import commonjs from 'vite-plugin-commonjs';
import eslint from 'vite-plugin-eslint';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import { peerDependencies } from './package.json';

export default defineConfig((env) => ({
build: {
lib: {
entry: './src/index.ts',
name: 'vite-react-ts-button',
fileName: (format) => `index.${format}.js`,
formats: ['cjs', 'es'],
},
rollupOptions: {
external: [...Object.keys(peerDependencies), 'react/jsx-runtime'],
},
sourcemap: true,
emptyOutDir: true,
},
plugins: [
dts({
insertTypesEntry: true,
}),
react({ fastRefresh: false }),
env.mode !== 'test' &&
eslint({
exclude: ['/virtual:/**', 'node_modules/**', '/sb-preview/**'],
}),
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './setupTests.ts',
},
}));
export default defineConfig((env) => {
return env.mode != 'cjs'
? {
// es-module
build: {
outDir: './dist/esm',
lib: {
entry: './src/index.ts',
name: 'oneiros-esm',
fileName: (format) => `index.es.js`,
formats: ['es'],
},
rollupOptions: {
external: [
...Object.keys(peerDependencies),
'react/jsx-runtime',
'moment',
],
},
sourcemap: true,
emptyOutDir: false,
},
plugins: [
dts({
insertTypesEntry: true,
tsconfigPath: './tsconfig.json',
}),
react({ fastRefresh: false }),
env.mode !== 'test' &&
eslint({
exclude: ['/virtual:/**', 'node_modules/**', '/sb-preview/**'],
}),
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './setupTests.ts',
},
}
: {
build: {
// cjs
outDir: './dist/cjs',
lib: {
entry: './src/index.ts',
name: 'oneiros-cjs',
fileName: (format) => `index.cjs`,
formats: ['cjs'],
},
rollupOptions: {
external: [
...Object.keys(peerDependencies),
'react/jsx-runtime',
'moment',
],
onwarn(warning, defaultHandler) {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
return;
}
defaultHandler(warning);
},
},
sourcemap: true,
emptyOutDir: false,
},
plugins: [
dts({
insertTypesEntry: true,
tsconfigPath: './tsconfig-cjs.json',
}),
commonjs(),
// react({ fastRefresh: false }),
env.mode !== 'test' &&
eslint({
exclude: ['/virtual:/**', 'node_modules/**', '/sb-preview/**'],
}),
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './setupTests.ts',
},
};
});
Loading