From e9d485fe3b5db8c426ac03b30ed8917df0baa62d Mon Sep 17 00:00:00 2001 From: Pauline Date: Sun, 26 Nov 2023 17:13:07 -0500 Subject: feat(lint): switch to eslint config and formatting (use vscode for autoformat) --- packages/assets/scripts/generate.mjs | 79 +++++++++++++++++------------------- packages/config/.eslintrc.js | 4 -- packages/config/eslint/base.js | 79 ------------------------------------ packages/config/eslint/tailwind.js | 23 ----------- packages/config/eslint/web.js | 22 ---------- packages/config/index.js | 4 +- packages/config/package.json | 20 ++------- packages/config/vite/index.ts | 12 +++--- packages/config/vite/relAlias.ts | 33 +++++++++------ packages/ui/.eslintrc.js | 8 ---- packages/ui/package.json | 29 +++++++------ packages/ui/postcss.config.js | 2 +- packages/ui/src/keys.ts | 36 +++++++++++++--- packages/ui/src/utils.tsx | 14 +++---- packages/ui/style/tailwind.js | 46 ++++++++++++--------- 15 files changed, 147 insertions(+), 264 deletions(-) delete mode 100644 packages/config/.eslintrc.js delete mode 100644 packages/config/eslint/base.js delete mode 100644 packages/config/eslint/tailwind.js delete mode 100644 packages/config/eslint/web.js delete mode 100644 packages/ui/.eslintrc.js (limited to 'packages') diff --git a/packages/assets/scripts/generate.mjs b/packages/assets/scripts/generate.mjs index 44ba4e4..08fc2ba 100644 --- a/packages/assets/scripts/generate.mjs +++ b/packages/assets/scripts/generate.mjs @@ -1,48 +1,45 @@ import fs from 'node:fs/promises'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; -import prettier from 'prettier'; const assetFolders = ['icons', 'images', 'svgs/brands', 'svgs/ext/Extras', 'svgs/ext/Code']; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -prettier.resolveConfig(join(__dirname, '..', '..', '..', '.prettierrc.js')).then((options) => - Promise.all( - assetFolders.map(async (folder) => { - const indexFilePath = join(__dirname, '..', folder, 'index.ts'); - const assetsFolderPath = join(__dirname, '..', folder); - - if ( - await fs.access(indexFilePath).then( - () => true, - () => false - ) - ) { - await fs.unlink(indexFilePath); - } - - const fileNames = await fs.readdir(assetsFolderPath); - - const assetImports = fileNames - .filter((fileName) => fileName !== 'index.ts' && !/(^|\/)\.[^\/\.]/g.test(fileName)) - .map((fileName) => { - const variableName = fileName.split('.')[0].replace(/-/g, ''); - if (folder.startsWith('svgs')) { - return `import { ReactComponent as ${variableName} } from './${fileName}';`; - } - return `import ${variableName} from './${fileName}';`; - }) - .join('\n'); - - const assetExports = fileNames - .filter((fileName) => fileName !== 'index.ts' && !/(^|\/)\.[^\/\.]/g.test(fileName)) - .map((fileName) => `${fileName.split('.')[0].replace(/-/g, '')}`) - .join(',\n'); - - const indexFileContent = await prettier.format( - ` +await Promise.all( + assetFolders.map(async (folder) => { + const indexFilePath = join(__dirname, '..', folder, 'index.ts'); + const assetsFolderPath = join(__dirname, '..', folder); + + if ( + await fs.access(indexFilePath).then( + () => true, + () => false, + ) + ) + await fs.unlink(indexFilePath); + + const fileNames = await fs.readdir(assetsFolderPath); + + const assetImports = fileNames + .filter(fileName => fileName !== 'index.ts' && !/(^|\/)\.[^\/\.]/g.test(fileName)) + .map((fileName) => { + const variableName = fileName.split('.')[0].replace(/-/g, ''); + if (folder.startsWith('svgs')) + return `import { ReactComponent as ${variableName} } from './${fileName}';`; + + return `import ${variableName} from './${fileName}';`; + }) + .join('\n'); + + const assetExports = fileNames + .filter(fileName => fileName !== 'index.ts' && !/(^|\/)\.[^\/\.]/g.test(fileName)) + .map(fileName => `${fileName.split('.')[0].replace(/-/g, '')}`) + .join(',\n'); + + const indexFileContent + = ` /* * This file was automatically generated by a script. * To regenerate this file, run: pnpm assets gen @@ -52,11 +49,9 @@ prettier.resolveConfig(join(__dirname, '..', '..', '..', '.prettierrc.js')).then export { ${assetExports} - };`, - { ...options, parser: 'typescript' } - ); + };` + ; - await fs.writeFile(indexFilePath, indexFileContent); - }) - ) + await fs.writeFile(indexFilePath, indexFileContent); + }), ); diff --git a/packages/config/.eslintrc.js b/packages/config/.eslintrc.js deleted file mode 100644 index 93a0c63..0000000 --- a/packages/config/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - extends: [require.resolve('./eslint/base.js'), require.resolve('./eslint/tailwind.js')] -}; diff --git a/packages/config/eslint/base.js b/packages/config/eslint/base.js deleted file mode 100644 index 200f17d..0000000 --- a/packages/config/eslint/base.js +++ /dev/null @@ -1,79 +0,0 @@ -const path = require('node:path'); - -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaFeatures: { - jsx: true - }, - ecmaVersion: 12, - sourceType: 'module' - }, - extends: [ - 'eslint:recommended', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:astro/recommended', - 'plugin:astro/jsx-a11y-recommended', - 'turbo', - 'prettier' - ], - plugins: ['react', 'jsx-a11y'], - rules: { - 'react/display-name': 'off', - 'react/prop-types': 'off', - 'react/no-unescaped-entities': 'off', - 'react/react-in-jsx-scope': 'off', - 'react-hooks/rules-of-hooks': 'warn', - 'react-hooks/exhaustive-deps': 'warn', - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/ban-types': 'off', - 'no-control-regex': 'off', - 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'], - 'turbo/no-undeclared-env-vars': [ - 'error', - { - cwd: path.resolve(path.join(__dirname, '..', '..', '..')) - } - ] - }, - ignorePatterns: ['dist', '**/*.js', '**/*.json', 'node_modules'], - settings: { - react: { - version: 'detect' - } - }, - overrides: [ - { - files: ['*.astro'], - parser: 'astro-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser', - extraFileExtensions: ['.astro'] - }, - rules: { - 'astro/no-set-html-directive': 2, - 'indent': 'off' - } - }, - { - files: ['*.ts', '*.d.ts', '*.tsx', '*.js', '*.jsx', '*.mjs', '*.cjs'], - parser: '@typescript-eslint/parser', - parserOptions: { - parser: '@typescript-eslint/parser' - }, - rules: { - indent: 'off' - } - } - ] -}; diff --git a/packages/config/eslint/tailwind.js b/packages/config/eslint/tailwind.js deleted file mode 100644 index 9ac36ae..0000000 --- a/packages/config/eslint/tailwind.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('node:path'); - -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - extends: ['plugin:tailwindcss/recommended'], - rules: { - 'tailwindcss/no-custom-classname': 'off', - 'tailwindcss/classnames-order': [ - 'warn', - { - config: path.resolve( - path.join(__dirname, '../../..', 'packages/ui/tailwind.config.js') - ) - } - ] - }, - settings: { - tailwindcss: { - callees: ['classnames', 'clsx', 'ctl', 'cva', 'tw', 'twStyle'], - tags: ['tw', 'twStyle'] - } - } -}; diff --git a/packages/config/eslint/web.js b/packages/config/eslint/web.js deleted file mode 100644 index dc010b3..0000000 --- a/packages/config/eslint/web.js +++ /dev/null @@ -1,22 +0,0 @@ -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - extends: [require.resolve('./base.js'), require.resolve('./tailwind.js')], - ignorePatterns: ['public', 'vite.config.ts'], - env: { - browser: true, - node: true - }, - rules: { - 'no-restricted-syntax': [ - 'error', - { - selector: "CallExpression[callee.name='useParams']", - message: 'useParams is illegal, use useZodRouteParams!' - }, - { - selector: "CallExpression[callee.name='useSearchParams']", - message: 'useSearchParams is illegal, use useZodSearchParams!' - } - ] - } -}; diff --git a/packages/config/index.js b/packages/config/index.js index 524af3b..cf96492 100644 --- a/packages/config/index.js +++ b/packages/config/index.js @@ -1,3 +1 @@ -module.exports = { - vite: require('./vite') -}; +export { default as vite } from './vite'; diff --git a/packages/config/package.json b/packages/config/package.json index 5fdcbdc..dbdad1b 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,29 +1,17 @@ { "name": "@polyfrost/config", + "type": "module", "version": "0.0.0", "exports": { "./*": "./*", "./vite": "./vite", "./vite/relAlias": "./vite/relAlias" }, - "scripts": { - "lint": "eslint . --cache" - }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.8.0", - "@typescript-eslint/parser": "^6.8.0", - "eslint": "^8.52.0", - "eslint-config-prettier": "^9.0.0", - "eslint-config-turbo": "^1.10.16", - "eslint-plugin-astro": "^0.29.1", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-prettier": "^5.0.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-tailwindcss": "^3.13.0", - "eslint-utils": "^3.0.0", + "@vitejs/plugin-react": "^4.2.0", "regexpp": "^3.2.0", "vite-plugin-html": "^3.2.0", - "vite-plugin-svgr": "^4.1.0" + "vite-plugin-svgr": "^4.2.0", + "vite-tsconfig-paths": "^4.2.1" } } diff --git a/packages/config/vite/index.ts b/packages/config/vite/index.ts index a9306a6..f845f11 100644 --- a/packages/config/vite/index.ts +++ b/packages/config/vite/index.ts @@ -10,18 +10,18 @@ export default defineConfig({ react(), svg({ svgrOptions: { icon: true } }), createHtmlPlugin({ - minify: true - }) + minify: true, + }), ], css: { modules: { - localsConvention: 'camelCaseOnly' - } + localsConvention: 'camelCaseOnly', + }, }, root: 'src', build: { sourcemap: true, outDir: '../dist', - assetsDir: '.' - } + assetsDir: '.', + }, }); diff --git a/packages/config/vite/relAlias.ts b/packages/config/vite/relAlias.ts index 1a502b5..7bafe74 100644 --- a/packages/config/vite/relAlias.ts +++ b/packages/config/vite/relAlias.ts @@ -1,10 +1,11 @@ -import fs from 'fs/promises'; -import path from 'path'; -import { Alias } from 'vite'; +import fs from 'node:fs/promises'; +import path from 'node:path'; +import type { Alias } from 'vite'; const projectPath = path.resolve(__dirname, '../../../'); const pkgJsonCache = new Map(); +// /src/ or \src\, depending on platform const SRC_DIR_PATH = `${path.sep}src${path.sep}`; const resolver: Alias = { @@ -13,15 +14,18 @@ const resolver: Alias = { async customResolver(source, importer) { let root: null | string = null; - if (importer) importer = path.normalize(importer); + if (importer) + importer = path.normalize(importer); + // source is the path imported on typescript, which always use / as path separator const [_, sourcePath] = source.split('~/'); const relativeImporter = importer?.replace(projectPath, ''); if (relativeImporter && relativeImporter.includes(SRC_DIR_PATH)) { const [pkg] = relativeImporter.split(SRC_DIR_PATH); root = path.join(projectPath, pkg, 'src'); - } else if (importer) { + } + else if (importer) { const pathObj = path.parse(importer); let parent = pathObj.dir; @@ -30,13 +34,15 @@ const resolver: Alias = { let hasPkgJson = pkgJsonCache.get(parent); - if (hasPkgJson === undefined) + if (hasPkgJson === undefined) { try { await fs.stat(path.join(parent, 'package.json')); pkgJsonCache.set(parent, (hasPkgJson = true)); - } catch { + } + catch { pkgJsonCache.set(parent, (hasPkgJson = false)); } + } if (hasPkgJson) { root = parent; @@ -46,7 +52,8 @@ const resolver: Alias = { if (root === null) throw new Error(`Failed to resolve import path ${source} in file ${importer}`); - } else { + } + else { throw new Error(`Failed to resolve import path ${source} in file ${importer}`); } @@ -54,7 +61,8 @@ const resolver: Alias = { const folderItems = await fs.readdir(path.join(absolutePath, '..')); - const item = folderItems.find((i) => i.startsWith(sourcePath.split('/').at(-1)!))!; + // sourcePath is derived from the path imported on typescript, which always use / as path separator + const item = folderItems.find(i => i.startsWith(sourcePath.split('/').at(-1)!))!; const fullPath = absolutePath + path.extname(item); @@ -63,15 +71,16 @@ const resolver: Alias = { if (stats.isDirectory()) { const directoryItems = await fs.readdir(absolutePath + path.extname(item)); - const indexFile = directoryItems.find((i) => i.startsWith('index')); + const indexFile = directoryItems.find(i => i.startsWith('index')); if (!indexFile) throw new Error(`Failed to resolve import path ${source} in file ${importer}`); return path.join(absolutePath, indexFile); - } else { + } + else { return fullPath; } - } + }, }; export default resolver; diff --git a/packages/ui/.eslintrc.js b/packages/ui/.eslintrc.js deleted file mode 100644 index f80eaa9..0000000 --- a/packages/ui/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - extends: [require.resolve('@polyfrost/config/eslint/web.js')], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -}; diff --git a/packages/ui/package.json b/packages/ui/package.json index d843ba8..c2c95a0 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,8 +1,6 @@ { "name": "@polyfrost/ui", "version": "0.0.0", - "main": "src/index.ts", - "types": "src/index.ts", "exports": { ".": "./src/index.ts", "./src/forms": "./src/forms/index.ts", @@ -12,8 +10,9 @@ "./style/style.scss": "./style/style.scss", "./package.json": "./package.json" }, + "main": "src/index.ts", + "types": "src/index.ts", "scripts": { - "lint": "eslint src --cache", "typecheck": "tsc -b" }, "dependencies": { @@ -21,31 +20,31 @@ "@headlessui/tailwindcss": "^0.2.0", "@polyfrost/assets": "workspace:*", "@react-spring/web": "^9.7.3", - "@tailwindcss/forms": "^0.5.6", + "@tailwindcss/forms": "^0.5.7", "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.17.0", - "sonner": "^1.0.3", + "react-router-dom": "^6.20.0", + "sonner": "^1.2.3", "tailwindcss-radix": "^2.8.0", "ts-pattern": "^5.0.5", - "use-debounce": "^9.0.4", + "use-debounce": "^10.0.0", "zod": "^3.22.4" }, "devDependencies": { - "@babel/core": "^7.23.2", + "@babel/core": "^7.23.3", "@polyfrost/config": "workspace:*", - "@storybook/types": "^7.5.1", + "@storybook/types": "^7.5.3", "@tailwindcss/typography": "^0.5.10", - "@types/node": "~18.17.19", - "@types/react": "^18.2.31", - "@types/react-dom": "^18.2.14", + "@types/node": "~20.10.0", + "@types/react": "^18.2.38", + "@types/react-dom": "^18.2.17", "autoprefixer": "^10.4.16", "postcss": "^8.4.31", - "sass": "^1.69.4", - "tailwindcss": "^3.3.3", + "sass": "^1.69.5", + "tailwindcss": "^3.3.5", "tailwindcss-animate": "^1.0.7", - "typescript": "^5.2.2" + "typescript": "^5.3.2" } } diff --git a/packages/ui/postcss.config.js b/packages/ui/postcss.config.js index 708cbaf..cc95735 100644 --- a/packages/ui/postcss.config.js +++ b/packages/ui/postcss.config.js @@ -1,3 +1,3 @@ module.exports = { - plugins: [require('tailwindcss'), require('autoprefixer')] + plugins: [require('tailwindcss'), require('autoprefixer')], }; diff --git a/packages/ui/src/keys.ts b/packages/ui/src/keys.ts index 55940f9..bb8eaa4 100644 --- a/packages/ui/src/keys.ts +++ b/packages/ui/src/keys.ts @@ -1,3 +1,4 @@ +// https://www.w3.org/TR/uievents-key/#keys-modifier export enum ModifierKeys { Alt = 'Alt', Shift = 'Shift', @@ -10,14 +11,30 @@ export enum ModifierKeys { NumLock = 'NumLock', ScrollLock = 'ScrollLock', Symbol = 'Symbol', - SymbolLock = 'SymbolLock' + SymbolLock = 'SymbolLock', +} + +export enum EditingKeys { + Backspace = 'Backspace', + Delete = 'Delete', +} + +export enum UIKeys { + Escape = 'Escape', +} + +export enum NavigationKeys { + ArrowUp = 'ArrowUp', + ArrowDown = 'ArrowDown', + ArrowLeft = 'ArrowLeft', + ArrowRight = 'ArrowRight', } export type OSforKeys = 'macOS' | 'Windows' | 'Other'; export const modifierSymbols: Record< - ModifierKeys, - { macOS?: string; Windows?: string; Other: string } + ModifierKeys | EditingKeys | UIKeys | NavigationKeys, + { macOS?: string, Windows?: string, Other: string } > = { Alt: { macOS: '⌥', Other: 'Alt' }, AltGraph: { macOS: '⌥', Other: 'Alt' }, @@ -30,10 +47,17 @@ export const modifierSymbols: Record< ScrollLock: { macOS: '⤓', Other: 'ScrLk' }, Shift: { Other: 'Shift', macOS: '⇧' }, Symbol: { macOS: '⎄', Other: 'Sym' }, - SymbolLock: { macOS: '⎄', Other: 'Sym' } + SymbolLock: { macOS: '⎄', Other: 'Sym' }, + Escape: { macOS: '⎋', Other: 'Esc' }, + Delete: { macOS: '⌦', Other: 'Del' }, + Backspace: { macOS: '⌫', Other: '⟵' }, + ArrowUp: { Other: '↑' }, + ArrowDown: { Other: '↓' }, + ArrowLeft: { Other: '←' }, + ArrowRight: { Other: '→' }, }; -export const keySymbols: Record = { +export const keySymbols: Record = { ' ': { Other: '␣' }, 'Tab': { macOS: '⇥', Other: '⭾' }, 'Enter': { macOS: '↩', Other: '↵' }, @@ -52,5 +76,5 @@ export const keySymbols: Record - ([newClassNames, ..._]: TemplateStringsArray) => +function twFactory(element: any) { + return ([newClassNames, ..._]: TemplateStringsArray) => React.forwardRef(({ className, ...props }: any, ref) => React.createElement(element, { ...props, className: clsx(newClassNames, className), - ref - }) + ref, + }), ); +} type ClassnameFactory = (s: TemplateStringsArray) => T; @@ -19,10 +19,10 @@ type TailwindFactory = { React.ForwardRefExoticComponent >; } & { - (c: T): ClassnameFactory; + (c: T): ClassnameFactory }; export const tw = new Proxy((() => {}) as unknown as TailwindFactory, { get: (_, property: string) => twFactory(property), - apply: (_, __, [el]: [React.ReactElement]) => twFactory(el) + apply: (_, __, [el]: [React.ReactElement]) => twFactory(el), }); diff --git a/packages/ui/style/tailwind.js b/packages/ui/style/tailwind.js index fc05bd9..8ebf041 100644 --- a/packages/ui/style/tailwind.js +++ b/packages/ui/style/tailwind.js @@ -1,21 +1,24 @@ const defaultTheme = require('tailwindcss/defaultTheme'); /** @type {(varName: string) => string} */ -const alpha = (varName) => `hsla(var(${varName}), )`; +// eslint-disable-next-line unused-imports/no-unused-vars +const alpha = varName => `hsla(var(${varName}), )`; const contentExts = `{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue,stories.tsx}`; +// TODO: make this not CJS + /** * @param {string} app * @param {import('tailwindcss').Config} options - * @returns {import('tailwindcss').Config} + * @returns {import('tailwindcss').Config} the tailwind config */ module.exports = (app, options) => { /** @type {import('tailwindcss').Config} */ - let config = { + const config = { content: [ `../../apps/${app}/src/**/*.${contentExts}`, `../../packages/*/src/**/*.${contentExts}`, - `../../interface/**/*.${contentExts}` + `../../interface/**/*.${contentExts}`, ], darkMode: 'class', theme: { @@ -25,7 +28,7 @@ module.exports = (app, options) => { md: '868px', lg: '1024px', xl: '1280px', - ...defaultTheme.screens + ...defaultTheme.screens, }, fontSize: { 'xs': '12px', @@ -37,7 +40,7 @@ module.exports = (app, options) => { 'header-lg': '32px', 'body-sm': '15px', 'body': '16px', - 'body-lg': '17px' + 'body-lg': '17px', }, borderRadius: { none: '0', @@ -45,31 +48,31 @@ module.exports = (app, options) => { md: '5px', lg: '8px', xl: '12px', - full: '100vw' + full: '100vw', }, extend: { colors: { blue: { - 500: 'rgba(31, 101, 214, 1)' + 500: 'rgba(31, 101, 214, 1)', }, gray: { 50: 'rgba(240, 242, 244, 1)', 400: 'rgba(138, 150, 168, 1)', 700: 'rgba(65, 74, 88, 1)', - 800: 'rgba(42, 47, 55, 1)' + 800: 'rgba(42, 47, 55, 1)', }, white: { DEFAULT: 'rgba(255, 255, 255, 1)', secondary: 'rgba(238, 241, 254, 1)', - hover: 'rgba(231, 235, 252, 1)' + hover: 'rgba(231, 235, 252, 1)', }, black: { - DEFAULT: 'rgba(0, 0, 0, 1)' + DEFAULT: 'rgba(0, 0, 0, 1)', }, text: { DEFAULT: 'rgba(2, 3, 7, 1)', - primary: 'rgba(2, 3, 7, 1)' - } + primary: 'rgba(2, 3, 7, 1)', + }, }, extend: { transitionTimingFunction: { @@ -100,20 +103,23 @@ module.exports = (app, options) => { 'in-out-circ': 'cubic-bezier(0.85, 0, 0.15, 1)', 'in-back': 'cubic-bezier(0.36, 0, 0.66, -0.56)', 'out-back': 'cubic-bezier(0.34, 1.56, 0.64, 1)', - 'in-out-back': 'cubic-bezier(0.68, -0.6, 0.32, 1.6)' - } - } - } + 'in-out-back': 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', + }, + }, + }, }, plugins: [ require('@tailwindcss/forms'), require('tailwindcss-animate'), require('@headlessui/tailwindcss'), - require('tailwindcss-radix')() - ] + require('tailwindcss-radix')(), + ], + + ...options, }; - if (app === 'website') config.plugins.push(require('@tailwindcss/typography')); + if (app === 'website') + config.plugins.push(require('@tailwindcss/typography')); return config; }; -- cgit From 181547a25213bee8a20002e07344b957386c4d0f Mon Sep 17 00:00:00 2001 From: Pauline Date: Sun, 26 Nov 2023 22:55:04 -0500 Subject: feat(build): transfer everything to esm/ts --- packages/config/base.tsconfig.json | 2 +- packages/config/index.js | 1 - packages/config/index.ts | 1 + packages/config/package.json | 8 ++- packages/config/vitest.shared.ts | 8 +++ packages/ui/package.json | 12 ++-- packages/ui/postcss.config.js | 3 - packages/ui/postcss.config.ts | 8 +++ packages/ui/src/index.ts | 1 + packages/ui/style/index.js | 1 - packages/ui/style/index.ts | 1 + packages/ui/style/postcss.config.js | 1 - packages/ui/style/postcss.ts | 1 + packages/ui/style/tailwind.js | 125 ------------------------------------ packages/ui/style/tailwind.ts | 115 +++++++++++++++++++++++++++++++++ packages/ui/tailwind.config.js | 2 - packages/ui/tailwind.config.ts | 3 + packages/ui/vitest.config.ts | 3 + 18 files changed, 155 insertions(+), 141 deletions(-) delete mode 100644 packages/config/index.js create mode 100644 packages/config/index.ts create mode 100644 packages/config/vitest.shared.ts delete mode 100644 packages/ui/postcss.config.js create mode 100644 packages/ui/postcss.config.ts delete mode 100644 packages/ui/style/index.js create mode 100644 packages/ui/style/index.ts delete mode 100644 packages/ui/style/postcss.config.js create mode 100644 packages/ui/style/postcss.ts delete mode 100644 packages/ui/style/tailwind.js create mode 100644 packages/ui/style/tailwind.ts delete mode 100644 packages/ui/tailwind.config.js create mode 100644 packages/ui/tailwind.config.ts create mode 100644 packages/ui/vitest.config.ts (limited to 'packages') diff --git a/packages/config/base.tsconfig.json b/packages/config/base.tsconfig.json index 2d27ce4..17c8f2a 100644 --- a/packages/config/base.tsconfig.json +++ b/packages/config/base.tsconfig.json @@ -17,6 +17,6 @@ "resolveJsonModule": true, "module": "ESNext", "target": "ESNext", - "types": ["vite/client"] + "types": ["vite/client", "vitest/globals"] } } diff --git a/packages/config/index.js b/packages/config/index.js deleted file mode 100644 index cf96492..0000000 --- a/packages/config/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as vite } from './vite'; diff --git a/packages/config/index.ts b/packages/config/index.ts new file mode 100644 index 0000000..cf96492 --- /dev/null +++ b/packages/config/index.ts @@ -0,0 +1 @@ +export { default as vite } from './vite'; diff --git a/packages/config/package.json b/packages/config/package.json index dbdad1b..4b480ef 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -5,13 +5,17 @@ "exports": { "./*": "./*", "./vite": "./vite", - "./vite/relAlias": "./vite/relAlias" + "./vite/relAlias": "./vite/relAlias", + "./vitest": "./vitest.shared" }, + "main": "index.ts", + "types": "index.ts", "devDependencies": { "@vitejs/plugin-react": "^4.2.0", "regexpp": "^3.2.0", "vite-plugin-html": "^3.2.0", "vite-plugin-svgr": "^4.2.0", - "vite-tsconfig-paths": "^4.2.1" + "vite-tsconfig-paths": "^4.2.1", + "vitest": "^0.34.6" } } diff --git a/packages/config/vitest.shared.ts b/packages/config/vitest.shared.ts new file mode 100644 index 0000000..313a0ff --- /dev/null +++ b/packages/config/vitest.shared.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + reporters: ['dot'], + }, +}); diff --git a/packages/ui/package.json b/packages/ui/package.json index c2c95a0..54f5c8f 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -4,16 +4,17 @@ "exports": { ".": "./src/index.ts", "./src/forms": "./src/forms/index.ts", - "./postcss": "./style/postcss.config.js", - "./tailwind": "./style/tailwind.js", - "./style": "./style/index.js", + "./postcss": "./style/postcss", + "./tailwind": "./style/tailwind", + "./style": "./style", "./style/style.scss": "./style/style.scss", "./package.json": "./package.json" }, "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "typecheck": "tsc -b" + "typecheck": "tsc -b", + "test": "vitest" }, "dependencies": { "@headlessui/react": "^1.7.17", @@ -45,6 +46,7 @@ "sass": "^1.69.5", "tailwindcss": "^3.3.5", "tailwindcss-animate": "^1.0.7", - "typescript": "^5.3.2" + "typescript": "^5.3.2", + "vitest": "^0.34.6" } } diff --git a/packages/ui/postcss.config.js b/packages/ui/postcss.config.js deleted file mode 100644 index cc95735..0000000 --- a/packages/ui/postcss.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - plugins: [require('tailwindcss'), require('autoprefixer')], -}; diff --git a/packages/ui/postcss.config.ts b/packages/ui/postcss.config.ts new file mode 100644 index 0000000..2eb70ea --- /dev/null +++ b/packages/ui/postcss.config.ts @@ -0,0 +1,8 @@ +import autoprefixer from 'autoprefixer'; +import tailwindcss from 'tailwindcss'; + +const config = { + plugins: [autoprefixer(), tailwindcss()], +}; + +export default config; diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 904db93..98af4eb 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -1 +1,2 @@ export { cva, cx } from 'class-variance-authority'; +export * from './utils'; diff --git a/packages/ui/style/index.js b/packages/ui/style/index.js deleted file mode 100644 index 423b033..0000000 --- a/packages/ui/style/index.js +++ /dev/null @@ -1 +0,0 @@ -import './style.scss'; diff --git a/packages/ui/style/index.ts b/packages/ui/style/index.ts new file mode 100644 index 0000000..423b033 --- /dev/null +++ b/packages/ui/style/index.ts @@ -0,0 +1 @@ +import './style.scss'; diff --git a/packages/ui/style/postcss.config.js b/packages/ui/style/postcss.config.js deleted file mode 100644 index 0b6eba2..0000000 --- a/packages/ui/style/postcss.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../postcss.config'); diff --git a/packages/ui/style/postcss.ts b/packages/ui/style/postcss.ts new file mode 100644 index 0000000..60d0ac7 --- /dev/null +++ b/packages/ui/style/postcss.ts @@ -0,0 +1 @@ +export { default } from '../postcss.config'; diff --git a/packages/ui/style/tailwind.js b/packages/ui/style/tailwind.js deleted file mode 100644 index 8ebf041..0000000 --- a/packages/ui/style/tailwind.js +++ /dev/null @@ -1,125 +0,0 @@ -const defaultTheme = require('tailwindcss/defaultTheme'); - -/** @type {(varName: string) => string} */ -// eslint-disable-next-line unused-imports/no-unused-vars -const alpha = varName => `hsla(var(${varName}), )`; -const contentExts = `{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue,stories.tsx}`; - -// TODO: make this not CJS - -/** - * @param {string} app - * @param {import('tailwindcss').Config} options - * @returns {import('tailwindcss').Config} the tailwind config - */ -module.exports = (app, options) => { - /** @type {import('tailwindcss').Config} */ - const config = { - content: [ - `../../apps/${app}/src/**/*.${contentExts}`, - `../../packages/*/src/**/*.${contentExts}`, - `../../interface/**/*.${contentExts}`, - ], - darkMode: 'class', - theme: { - screens: { - xs: '475px', - sm: '650px', - md: '868px', - lg: '1024px', - xl: '1280px', - ...defaultTheme.screens, - }, - fontSize: { - 'xs': '12px', - 'sm': '14px', - 'md': '16px', - 'lg': '18px', - 'header-sm': '24px', - 'header': '28px', - 'header-lg': '32px', - 'body-sm': '15px', - 'body': '16px', - 'body-lg': '17px', - }, - borderRadius: { - none: '0', - sm: '3px', - md: '5px', - lg: '8px', - xl: '12px', - full: '100vw', - }, - extend: { - colors: { - blue: { - 500: 'rgba(31, 101, 214, 1)', - }, - gray: { - 50: 'rgba(240, 242, 244, 1)', - 400: 'rgba(138, 150, 168, 1)', - 700: 'rgba(65, 74, 88, 1)', - 800: 'rgba(42, 47, 55, 1)', - }, - white: { - DEFAULT: 'rgba(255, 255, 255, 1)', - secondary: 'rgba(238, 241, 254, 1)', - hover: 'rgba(231, 235, 252, 1)', - }, - black: { - DEFAULT: 'rgba(0, 0, 0, 1)', - }, - text: { - DEFAULT: 'rgba(2, 3, 7, 1)', - primary: 'rgba(2, 3, 7, 1)', - }, - }, - extend: { - transitionTimingFunction: { - 'css': 'ease', - 'css-in': 'ease-in', - 'css-out': 'ease-out', - 'css-in-out': 'ease-in-out', - 'in-sine': 'cubic-bezier(0.12, 0, 0.39, 0)', - 'out-sine': 'cubic-bezier(0.61, 1, 0.88, 1)', - 'in-out-sine': 'cubic-bezier(0.37, 0, 0.63, 1)', - 'in-quad': 'cubic-bezier(0.11, 0, 0.5, 0)', - 'out-quad': 'cubic-bezier(0.5, 1, 0.89, 1)', - 'in-out-quad': 'cubic-bezier(0.45, 0, 0.55, 1)', - 'in-cubic': 'cubic-bezier(0.32, 0, 0.67, 0)', - 'out-cubic': 'cubic-bezier(0.33, 1, 0.68, 1)', - 'in-out-cubic': 'cubic-bezier(0.65, 0, 0.35, 1)', - 'in-quart': 'cubic-bezier(0.5, 0, 0.75, 0)', - 'out-quart': 'cubic-bezier(0.25, 1, 0.5, 1)', - 'in-out-quart': 'cubic-bezier(0.76, 0, 0.24, 1)', - 'in-quint': 'cubic-bezier(0.64, 0, 0.78, 0)', - 'out-quint': 'cubic-bezier(0.22, 1, 0.36, 1)', - 'in-out-quint': 'cubic-bezier(0.83, 0, 0.17, 1)', - 'in-expo': 'cubic-bezier(0.7, 0, 0.84, 0)', - 'out-expo': 'cubic-bezier(0.16, 1, 0.3, 1)', - 'in-out-expo': 'cubic-bezier(0.87, 0, 0.13, 1)', - 'in-circ': 'cubic-bezier(0.55, 0, 1, 0.45)', - 'out-circ': 'cubic-bezier(0, 0.55, 0.45, 1)', - 'in-out-circ': 'cubic-bezier(0.85, 0, 0.15, 1)', - 'in-back': 'cubic-bezier(0.36, 0, 0.66, -0.56)', - 'out-back': 'cubic-bezier(0.34, 1.56, 0.64, 1)', - 'in-out-back': 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', - }, - }, - }, - }, - plugins: [ - require('@tailwindcss/forms'), - require('tailwindcss-animate'), - require('@headlessui/tailwindcss'), - require('tailwindcss-radix')(), - ], - - ...options, - }; - - if (app === 'website') - config.plugins.push(require('@tailwindcss/typography')); - - return config; -}; diff --git a/packages/ui/style/tailwind.ts b/packages/ui/style/tailwind.ts new file mode 100644 index 0000000..73c8fc7 --- /dev/null +++ b/packages/ui/style/tailwind.ts @@ -0,0 +1,115 @@ +import type { Config } from 'tailwindcss'; + +import forms from '@tailwindcss/forms'; +import typography from '@tailwindcss/typography'; +import headlessui from '@headlessui/tailwindcss'; +import animate from 'tailwindcss-animate'; +import radix from 'tailwindcss-radix'; + +export const alpha = (varName: string) => `hsla(var(${varName}), )`; +export const contentExts = `{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue,stories.tsx}`; + +export default async (app: string, options?: Config): Promise => { + const config: Config = { + content: [ + `../../apps/${app}/src/**/*.${contentExts}`, + `../../packages/*/src/**/*.${contentExts}`, + `../../interface/**/*.${contentExts}`, + ], + darkMode: 'class', + theme: { + screens: { + xs: '475px', + sm: '650px', + md: '868px', + lg: '1024px', + xl: '1280px', + }, + fontSize: { + 'xs': '12px', + 'sm': '14px', + 'md': '16px', + 'lg': '18px', + 'header-sm': '24px', + 'header': '28px', + 'header-lg': '32px', + 'body-sm': '15px', + 'body': '16px', + 'body-lg': '17px', + }, + borderRadius: { + none: '0', + sm: '3px', + md: '5px', + lg: '8px', + xl: '12px', + full: '100vw', + }, + extend: { + colors: { + blue: { + 500: 'rgba(31, 101, 214, 1)', + }, + gray: { + 50: 'rgba(240, 242, 244, 1)', + 400: 'rgba(138, 150, 168, 1)', + 700: 'rgba(65, 74, 88, 1)', + 800: 'rgba(42, 47, 55, 1)', + }, + white: { + DEFAULT: 'rgba(255, 255, 255, 1)', + secondary: 'rgba(238, 241, 254, 1)', + hover: 'rgba(231, 235, 252, 1)', + }, + black: { + DEFAULT: 'rgba(0, 0, 0, 1)', + }, + text: { + DEFAULT: 'rgba(2, 3, 7, 1)', + primary: 'rgba(2, 3, 7, 1)', + }, + }, + extend: { + transitionTimingFunction: { + 'css': 'ease', + 'css-in': 'ease-in', + 'css-out': 'ease-out', + 'css-in-out': 'ease-in-out', + 'in-sine': 'cubic-bezier(0.12, 0, 0.39, 0)', + 'out-sine': 'cubic-bezier(0.61, 1, 0.88, 1)', + 'in-out-sine': 'cubic-bezier(0.37, 0, 0.63, 1)', + 'in-quad': 'cubic-bezier(0.11, 0, 0.5, 0)', + 'out-quad': 'cubic-bezier(0.5, 1, 0.89, 1)', + 'in-out-quad': 'cubic-bezier(0.45, 0, 0.55, 1)', + 'in-cubic': 'cubic-bezier(0.32, 0, 0.67, 0)', + 'out-cubic': 'cubic-bezier(0.33, 1, 0.68, 1)', + 'in-out-cubic': 'cubic-bezier(0.65, 0, 0.35, 1)', + 'in-quart': 'cubic-bezier(0.5, 0, 0.75, 0)', + 'out-quart': 'cubic-bezier(0.25, 1, 0.5, 1)', + 'in-out-quart': 'cubic-bezier(0.76, 0, 0.24, 1)', + 'in-quint': 'cubic-bezier(0.64, 0, 0.78, 0)', + 'out-quint': 'cubic-bezier(0.22, 1, 0.36, 1)', + 'in-out-quint': 'cubic-bezier(0.83, 0, 0.17, 1)', + 'in-expo': 'cubic-bezier(0.7, 0, 0.84, 0)', + 'out-expo': 'cubic-bezier(0.16, 1, 0.3, 1)', + 'in-out-expo': 'cubic-bezier(0.87, 0, 0.13, 1)', + 'in-circ': 'cubic-bezier(0.55, 0, 1, 0.45)', + 'out-circ': 'cubic-bezier(0, 0.55, 0.45, 1)', + 'in-out-circ': 'cubic-bezier(0.85, 0, 0.15, 1)', + 'in-back': 'cubic-bezier(0.36, 0, 0.66, -0.56)', + 'out-back': 'cubic-bezier(0.34, 1.56, 0.64, 1)', + 'in-out-back': 'cubic-bezier(0.68, -0.6, 0.32, 1.6)', + }, + }, + }, + }, + plugins: [forms, animate, headlessui, radix], + + ...options, + }; + + if (app === 'website') + config.plugins!.push(typography); + + return config; +}; diff --git a/packages/ui/tailwind.config.js b/packages/ui/tailwind.config.js deleted file mode 100644 index 8c53793..0000000 --- a/packages/ui/tailwind.config.js +++ /dev/null @@ -1,2 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = require('./style/tailwind')('web'); diff --git a/packages/ui/tailwind.config.ts b/packages/ui/tailwind.config.ts new file mode 100644 index 0000000..0c30ba3 --- /dev/null +++ b/packages/ui/tailwind.config.ts @@ -0,0 +1,3 @@ +import tailwindConfig from './style/tailwind'; + +export default await tailwindConfig('web'); diff --git a/packages/ui/vitest.config.ts b/packages/ui/vitest.config.ts new file mode 100644 index 0000000..3160c1a --- /dev/null +++ b/packages/ui/vitest.config.ts @@ -0,0 +1,3 @@ +import vitestShared from '@polyfrost/config/vitest.shared'; + +export default vitestShared; -- cgit From 8662119a19cad0d85628919c9170373d44c733de Mon Sep 17 00:00:00 2001 From: Pauline Date: Mon, 27 Nov 2023 21:46:19 -0500 Subject: chore(ws): minor pnpm lock and ws tweaks --- packages/ui/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages') diff --git a/packages/ui/package.json b/packages/ui/package.json index 54f5c8f..ddda613 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,7 @@ { "name": "@polyfrost/ui", "version": "0.0.0", + "sideEffects": false, "exports": { ".": "./src/index.ts", "./src/forms": "./src/forms/index.ts", -- cgit From 8e85be96a154b371b4cf1fb1924155d96150f949 Mon Sep 17 00:00:00 2001 From: Pauline Date: Wed, 20 Dec 2023 01:58:22 -0500 Subject: chore(lint): bump deps and fix linting/format --- packages/config/package.json | 5 +++-- packages/ui/package.json | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'packages') diff --git a/packages/config/package.json b/packages/config/package.json index 4b480ef..30adebb 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -11,11 +11,12 @@ "main": "index.ts", "types": "index.ts", "devDependencies": { - "@vitejs/plugin-react": "^4.2.0", + "@vitejs/plugin-react": "^4.2.1", "regexpp": "^3.2.0", + "vite": "^5.0.10", "vite-plugin-html": "^3.2.0", "vite-plugin-svgr": "^4.2.0", - "vite-tsconfig-paths": "^4.2.1", + "vite-tsconfig-paths": "^4.2.2", "vitest": "^0.34.6" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index ddda613..321a5ef 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -35,19 +35,19 @@ "zod": "^3.22.4" }, "devDependencies": { - "@babel/core": "^7.23.3", + "@babel/core": "^7.23.6", "@polyfrost/config": "workspace:*", - "@storybook/types": "^7.5.3", + "@storybook/types": "^7.6.6", "@tailwindcss/typography": "^0.5.10", - "@types/node": "~20.10.0", - "@types/react": "^18.2.38", - "@types/react-dom": "^18.2.17", + "@types/node": "~20.10.5", + "@types/react": "^18.2.45", + "@types/react-dom": "^18.2.18", "autoprefixer": "^10.4.16", - "postcss": "^8.4.31", + "postcss": "^8.4.32", "sass": "^1.69.5", - "tailwindcss": "^3.3.5", + "tailwindcss": "^3.4.0", "tailwindcss-animate": "^1.0.7", - "typescript": "^5.3.2", + "typescript": "^5.3.3", "vitest": "^0.34.6" } } -- cgit From ae4afbb2af686e10feb7518cd2e5f4a4e94503bf Mon Sep 17 00:00:00 2001 From: Pauline Date: Tue, 26 Dec 2023 16:44:14 +0100 Subject: chore(deps): bump and use patched lint --- packages/config/package.json | 4 ++-- packages/ui/package.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'packages') diff --git a/packages/config/package.json b/packages/config/package.json index 30adebb..93eaa7a 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -14,9 +14,9 @@ "@vitejs/plugin-react": "^4.2.1", "regexpp": "^3.2.0", "vite": "^5.0.10", - "vite-plugin-html": "^3.2.0", + "vite-plugin-html": "^3.2.1", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.2.2", - "vitest": "^0.34.6" + "vitest": "^1.1.0" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index 321a5ef..dc17985 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -27,10 +27,10 @@ "clsx": "^2.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.20.0", - "sonner": "^1.2.3", + "react-router-dom": "^6.21.1", + "sonner": "^1.3.1", "tailwindcss-radix": "^2.8.0", - "ts-pattern": "^5.0.5", + "ts-pattern": "^5.0.6", "use-debounce": "^10.0.0", "zod": "^3.22.4" }, @@ -48,6 +48,6 @@ "tailwindcss": "^3.4.0", "tailwindcss-animate": "^1.0.7", "typescript": "^5.3.3", - "vitest": "^0.34.6" + "vitest": "^1.1.0" } } -- cgit From 75676183d008a07070db8fdd52af3fdf0bbfb8a7 Mon Sep 17 00:00:00 2001 From: Pauline Date: Mon, 8 Jan 2024 21:02:33 -0500 Subject: chore(deps): bump --- packages/config/package.json | 6 +++--- packages/ui/package.json | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'packages') diff --git a/packages/config/package.json b/packages/config/package.json index 93eaa7a..6f68aed 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -13,10 +13,10 @@ "devDependencies": { "@vitejs/plugin-react": "^4.2.1", "regexpp": "^3.2.0", - "vite": "^5.0.10", + "vite": "^5.0.11", "vite-plugin-html": "^3.2.1", "vite-plugin-svgr": "^4.2.0", - "vite-tsconfig-paths": "^4.2.2", - "vitest": "^1.1.0" + "vite-tsconfig-paths": "^4.2.3", + "vitest": "^1.1.3" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index dc17985..4a39102 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -18,13 +18,13 @@ "test": "vitest" }, "dependencies": { - "@headlessui/react": "^1.7.17", + "@headlessui/react": "^1.7.18", "@headlessui/tailwindcss": "^0.2.0", "@polyfrost/assets": "workspace:*", "@react-spring/web": "^9.7.3", "@tailwindcss/forms": "^0.5.7", "class-variance-authority": "^0.7.0", - "clsx": "^2.0.0", + "clsx": "^2.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.21.1", @@ -35,19 +35,19 @@ "zod": "^3.22.4" }, "devDependencies": { - "@babel/core": "^7.23.6", + "@babel/core": "^7.23.7", "@polyfrost/config": "workspace:*", - "@storybook/types": "^7.6.6", + "@storybook/types": "^7.6.7", "@tailwindcss/typography": "^0.5.10", - "@types/node": "~20.10.5", - "@types/react": "^18.2.45", + "@types/node": "~20.10.7", + "@types/react": "^18.2.47", "@types/react-dom": "^18.2.18", "autoprefixer": "^10.4.16", - "postcss": "^8.4.32", - "sass": "^1.69.5", - "tailwindcss": "^3.4.0", + "postcss": "^8.4.33", + "sass": "^1.69.7", + "tailwindcss": "^3.4.1", "tailwindcss-animate": "^1.0.7", "typescript": "^5.3.3", - "vitest": "^1.1.0" + "vitest": "^1.1.3" } } -- cgit From 8be3434d32d7ed9046000377f7f9e59ef2a971b3 Mon Sep 17 00:00:00 2001 From: Pauline Date: Wed, 10 Jan 2024 19:58:58 -0500 Subject: super unfinished stuff but i was getting yelled at by wybest --- packages/ui/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/ui/package.json b/packages/ui/package.json index 4a39102..3d63e4d 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -17,6 +17,10 @@ "typecheck": "tsc -b", "test": "vitest" }, + "peerDependencies": { + "tailwindcss": ">=3", + "typescript": ">=5" + }, "dependencies": { "@headlessui/react": "^1.7.18", "@headlessui/tailwindcss": "^0.2.0", @@ -39,7 +43,7 @@ "@polyfrost/config": "workspace:*", "@storybook/types": "^7.6.7", "@tailwindcss/typography": "^0.5.10", - "@types/node": "~20.10.7", + "@types/node": "~20.10.8", "@types/react": "^18.2.47", "@types/react-dom": "^18.2.18", "autoprefixer": "^10.4.16", -- cgit