Skip to content

Commit

Permalink
build: Bookmarking progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Anton committed May 16, 2024
1 parent 7159456 commit 14b0ec6
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 320 deletions.
13 changes: 3 additions & 10 deletions apps/web/config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { useBabelRc, override, addWebpackAlias } = require('customize-cra');
const { useBabelRc, override } = require('customize-cra');
const { DefinePlugin } = require('webpack');
const { version } = require('./package.json');
const path = require('path');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

function overrideConfig(config, env) {
Expand All @@ -24,11 +23,5 @@ function overrideConfig(config, env) {
};
}

module.exports = override(
// eslint-disable-next-line react-hooks/rules-of-hooks
useBabelRc(),
overrideConfig,
addWebpackAlias({
['#ui-lib']: path.resolve(__dirname, 'src/styled-system'),
})
);
// eslint-disable-next-line react-hooks/rules-of-hooks
module.exports = override(useBabelRc(), overrideConfig);
4 changes: 1 addition & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "@novu/web",
"version": "0.24.2",
"private": true,
"imports": {
"#ui-lib/*": "./src/styled-system/*"
},
"scripts": {
"start": "pnpm panda --watch & cross-env NODE_OPTIONS=--max_old_space_size=8192 PORT=4200 react-app-rewired start",
"prebuild": "rimraf build",
Expand Down Expand Up @@ -174,6 +171,7 @@
"react-app-rewired": "^2.2.1",
"react-error-overlay": "6.0.11",
"react-scripts": "^5.0.1",
"sinon": "9.2.4",
"storybook": "^7.4.2",
"typescript": "4.9.5",
"webpack": "5.78.0",
Expand Down
11 changes: 8 additions & 3 deletions apps/web/panda.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig } from '@pandacss/dev';
import { novuPandaPreset } from '@novu/novui';

const STYLED_SYSTEM_PATH_BASE = './node_modules/@novu/novui/';

export default defineConfig({
// use CSS reset
preflight: true,
Expand All @@ -15,7 +17,8 @@ export default defineConfig({
*/
include: [
'./src/**/*.{js,jsx,ts,tsx}',
// '../../libs/design-system/src/**/*.{js,jsx,ts,tsx}'
`${STYLED_SYSTEM_PATH_BASE}/dist/**/*.{js,jsx}`,
// '../../libs/novui/src/**/*.{js,jsx,ts,tsx}',
],

// Files to exclude
Expand All @@ -38,8 +41,10 @@ export default defineConfig({
extend: {},
},

// The output directory for your css system
outdir: 'src/styled-system',
outExtension: 'js',

// TODO: have to confirm this with the panda maintainer
outdir: `${STYLED_SYSTEM_PATH_BASE}/styled-system`,

importMap: '@novu/novui',

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import App from './App';
import { initializeApp } from './initializeApp';
import reportWebVitals from './reportWebVitals';

import '#ui-lib/styles.css';
import '@novu/novui/styles.css';

initializeApp();

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/pages/invites/components/MembersTable.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MembersTable } from './MembersTable';
import { TestWrapper } from '../../../testing';
import { MemberRoleEnum, MemberStatusEnum } from '@novu/shared';
import { SinonSpy } from 'cypress/types/sinon';
import { SinonSpy } from 'sinon';

describe('MembersTable Component', function () {
let onChangeMemberRole: SinonSpy;
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/pages/templates/TemplatesListNoData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { IBlueprintTemplate } from '../../api/types';
import { TemplateCreationSourceEnum } from './shared';
import { useHoverOverItem } from '../../hooks';
import { EchoProjectCardTile } from './components/EchoProjectWaitList';
import { Test } from '@novu/novui';
import { css } from '@novu/novui/css';

const NoDataHolder = styled.div`
display: flex;
Expand Down Expand Up @@ -73,7 +75,10 @@ export const TemplatesListNoData = ({

return (
<NoDataHolder data-test-id="no-workflow-templates-placeholder">
<NoDataSubHeading>Start from a blank workflow or use a template</NoDataSubHeading>
<NoDataSubHeading className={css({ color: 'legacy.success !important' })}>
Start from a blank workflow or use a template
</NoDataSubHeading>
<Test />
<CardsContainer>
<CardTile
disabled={readonly}
Expand Down
7 changes: 2 additions & 5 deletions apps/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "Node16",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"noImplicitAny": false,
"types": ["cypress"],
"paths": {
"#ui-lib/*": ["./src/styled-system/*"]
}
"types": ["cypress"]
},
"include": ["src", "cypress/global.d.ts", "styled-system"],
"exclude": ["node_modules"]
Expand Down
8 changes: 3 additions & 5 deletions libs/novui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = {
extends: [
'../../.eslintrc.js',
// 'plugin:@pandacss/recommended'
],
extends: ['../../.eslintrc.js', 'plugin:@pandacss/recommended'],
plugins: ['@pandacss', 'react-hooks'],
rules: {
'func-names': 'off',
Expand Down Expand Up @@ -33,7 +30,8 @@ module.exports = {
format: ['PascalCase', 'camelCase', 'UPPER_CASE'],
},
],
'@pandacss/file-not-included': 'off',
// disabled because it suggests putting everything into a single config file
'@pandacss/no-config-function-in-source': 'off',
},
ignorePatterns: ['styled-system/*', 'prettier.config.ts', 'panda.config.ts'],
parserOptions: {
Expand Down
58 changes: 30 additions & 28 deletions libs/novui/package.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
{
"name": "@novu/novui",
"version": "0.0.1",
"description": "",
"repository": "https://github.com/novuhq/novu",
"description": "Novu's Design System & Component Library",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"files": ["dist", "styled-system"],
"exports": {
".": {
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": "./dist/index.js"
"import": "./dist/index.js"
},
"./css": {
"types": "./styled-system/css/index.d.ts",
"require": "./styled-system/css/index.mjs",
"import": "./styled-system/css/index.mjs"
"require": "./styled-system/css/index.js",
"import": "./styled-system/css/index.js"
},
"./tokens": {
"types": "./styled-system/tokens/index.d.ts",
"require": "./styled-system/tokens/index.mjs",
"import": "./styled-system/tokens/index.mjs"
"require": "./styled-system/tokens/index.js",
"import": "./styled-system/tokens/index.js"
},
"./types": {
"types": "./styled-system/types/index.d.ts",
"require": "./styled-system/types/index.mjs",
"import": "./styled-system/types/index.mjs"
"require": "./styled-system/types/index.js",
"import": "./styled-system/types/index.js"
},
"./patterns": {
"types": "./styled-system/patterns/index.d.ts",
"require": "./styled-system/patterns/index.mjs",
"import": "./styled-system/patterns/index.mjs"
"require": "./styled-system/patterns/index.js",
"import": "./styled-system/patterns/index.js"
},
"./recipes": {
"types": "./styled-system/recipes/index.d.ts",
"require": "./styled-system/recipes/index.mjs",
"import": "./styled-system/recipes/index.mjs"
"require": "./styled-system/recipes/index.js",
"import": "./styled-system/recipes/index.js"
},
"./jsx": {
"types": "./styled-system/jsx/index.d.ts",
"require": "./styled-system/jsx/index.mjs",
"import": "./styled-system/jsx/index.mjs"
"require": "./styled-system/jsx/index.js",
"import": "./styled-system/jsx/index.js"
},
"./styles.css": "./styled-system/styles.css"
},
"scripts": {
"prepare": "pnpm panda codegen",
"build": "tsup",
"build:dev": "tsup --no-dts",
"dev": "pnpm build:dev --watch",
"prebuild": "rimraf dist styled-system",
"lint": "eslint --ext .ts,.tsx src",
"build": "cross-env node_modules/.bin/tsc",
"build:watch": "pnpm panda && cross-env node_modules/.bin/tsc -w --preserveWatchOutput",
"studio": "pnpm panda studio"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"react": "^18.3.0",
"react-dom": "^18.3.0"
},
"devDependencies": {
"@pandabox/prettier-plugin": "^0.1.2",
"@pandacss/dev": "^0.38.0",
"@pandacss/eslint-plugin": "^0.1.2",
"@pandacss/studio": "^0.38.0",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@types/node": "^18.11.12",
"@types/react": "^17.0.1",
"@types/react-dom": "^17.0.1",
"eslint-plugin-react-hooks": "^4.6.2",
"tsup": "^8.0.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^3.0.2",
"typescript": "^4.9.5"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
}
}
8 changes: 1 addition & 7 deletions libs/novui/panda.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineConfig({
preflight: true,

/** Only allow defined values */
// strictTokens: true,
strictTokens: true,

// Where to look for your css declarations
include: ['./src/**/*.{js,jsx,ts,tsx}', './.storybook/**/*.{js,jsx,ts,tsx}'],
Expand All @@ -30,12 +30,6 @@ export default defineConfig({
extend: {},
},

// importMap: {
// css: '#ui-lib/css',
// recipes: '#ui-lib/recipes',
// patterns: '#ui-lib/patterns',
// jsx: '#ui-lib/jsx',
// },
importMap: 'styled-system',

// extension of generated files
Expand Down
16 changes: 9 additions & 7 deletions libs/novui/src/components/Test.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { css } from 'styled-system/css';
import { css } from '../../styled-system/css';
import { FC } from 'react';

/**
* An example component using Panda.
* TODO remove this in a future iteration.
*/
export const Test: FC = () => {
return (
<div
<p
className={css({
bg: 'surface.page',
w: '11/12',
h: '[69px]',
bg: 'legacy.warning',
textAlign: 'center',
textStyle: 'title.section',
textStyle: 'title.page',
})}
>
Testing everything now
</div>
</p>
);
};
46 changes: 13 additions & 33 deletions libs/novui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
{
"include": ["src", "styled-system"],
"extends": "../../tsconfig.json",
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"target": "ES2020",
"outDir": "dist",
"forceConsistentCasingInFileNames": true,
"target": "es6",
"module": "ESNext",
"esModuleInterop": true,
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"strict": true,
"typeRoots": ["node_modules/@types"],
"jsx": "react-jsx",
"lib": ["ESNext", "dom", "dom.iterable"],
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"removeComments": false,

/**
* Required due to extending base tsconfig, and receiving error:
* "error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated
* and will stop functioning in TypeScript 5.5"
*/
"ignoreDeprecations": "5.0",

"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
//
"allowSyntheticDefaultImports": true,
"allowJs": true,
//
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"styled-system/*": ["./styled-system/*"]
}
}
"baseUrl": "."
},
"exclude": ["src/**/*.test.*", "src/**/*.stories.*", "node_modules", "**/node_modules/*"]
}
9 changes: 0 additions & 9 deletions libs/novui/tsup.config.ts

This file was deleted.

Loading

0 comments on commit 14b0ec6

Please sign in to comment.