diff --git a/packages/authentication/tsup.config.ts b/packages/authentication/tsup.config.ts index 195b515..c1543e3 100644 --- a/packages/authentication/tsup.config.ts +++ b/packages/authentication/tsup.config.ts @@ -4,11 +4,11 @@ import { defineConfig } from 'tsup' export default defineConfig({ name: '@baseapp-frontend/authentication', entry: ['index.ts'], - format: ['esm', 'cjs'], - treeshake: true, - splitting: true, dts: false, + format: ['cjs', 'esm'], clean: true, - minify: true, + bundle: false, + splitting: false, + sourcemap: true, external: ['react', 'react-dom'], }) diff --git a/packages/utils/client.ts b/packages/utils/client.ts deleted file mode 100644 index af50469..0000000 --- a/packages/utils/client.ts +++ /dev/null @@ -1,18 +0,0 @@ -'use client' - -export { default as withController } from './functions/form/withController' -export type * from './functions/form/withController/types' - -export { default as useDebounce } from './hooks/useDebounce' - -export { default as useDjangoOrderBy } from './hooks/useDjangoOrderBy' - -export { default as useEventSubscription } from './hooks/useEventSubscription' - -export { default as useNotification } from './hooks/useNotification' - -export { NotificationProvider } from './hooks/useNotification' - -export { default as useSSR } from './hooks/useSSR' - -export { default as useBoolean } from './hooks/useBoolean' diff --git a/packages/utils/index.ts b/packages/utils/index.ts deleted file mode 100644 index b68c5eb..0000000 --- a/packages/utils/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -export * from './constants/fetch' -export * from './constants/cookie' -export * from './constants/date' -export * from './constants/django' -export * from './constants/events' -export * from './constants/languages' -export * from './constants/regex' -export * from './constants/token' -export * from './constants/zod' - -export * from './functions/api' -export * from './functions/axios' -export * from './functions/cookie' -export * from './functions/date' -export * from './functions/events' -export * from './functions/fetch' -export * from './functions/file' -export * from './functions/form' -export * from './functions/string' -export * from './functions/token' - -export type * from './types/cookie' -export type * from './types/date' -export type * from './types/django' -export type * from './types/form' -export type * from './types/server' -export type * from './types/jwt' -export type * from './types/typescript' diff --git a/packages/utils/package.json b/packages/utils/package.json index 9973b3e..cb52776 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -3,19 +3,13 @@ "description": "Util functions, constants and types.", "version": "2.5.6", "sideEffects": false, - "main": "./dist/index.ts", - "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", "scripts": { - "build": "tsc --build", - "dev": "tsc --watch", + "build": "tsup", + "dev": "parcel watch", "test": "jest --config ./jest.config.ts", "lint": "eslint . --ext .tsx --ext .ts && tsc --noEmit", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist" - }, - "exports": { - ".": "./dist/index.ts", - "./client": "./dist/client.ts" + "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", + "prepare": "pnpm build" }, "dependencies": { "axios": "^1.7.2", @@ -75,5 +69,16 @@ "publishConfig": { "access": "public" }, - "readme": "https://github.com/silverlogic/baseapp-frontend/blob/master/packages/utils/README.md" + "readme": "https://github.com/silverlogic/baseapp-frontend/blob/master/packages/utils/README.md", + "exports": { + "./constants/cookie": "./dist/cookie.js", + "./constants/date": "./dist/date.js", + "./constants/django": "./dist/django.js", + "./constants/events": "./dist/events.js", + "./constants/fetch": "./dist/fetch.js", + "./constants/languages": "./dist/languages.js", + "./constants/regex": "./dist/regex.js", + "./constants/token": "./dist/token.js", + "./constants/zod": "./dist/zod.js" + } } diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index e9176b2..95f6398 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -1,15 +1,41 @@ { - "extends": "@baseapp-frontend/tsconfig/lib.json", + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": false, + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "declaration": true, + "composite": false, + "sourceMap": true, + "declarationMap": true, + "module": "preserve", + "noEmit": true, + "lib": ["es2022", "dom", "dom.iterable"], + "jsx": "react-jsx", + "outDir": "dist", + "types": ["node", "jest"], + "baseUrl": ".", + "paths": { + "react": ["./node_modules/@types/react"], + "react-dom": ["./node_modules/@types/react-dom"] + } + }, "include": [ "**/*.ts", "**/*.tsx", "**/*.d.ts", ".eslintrc.js", - "*.js", - "*.jsx", - "index.d.ts", - "index.ts", - "client.ts" + "*.ts", + "*.tsx", + "*.d.ts", + "jest.config.ts" ], "exclude": ["node_modules"] } diff --git a/packages/utils/tsup.config.ts b/packages/utils/tsup.config.ts index b993ead..3a3ce6b 100644 --- a/packages/utils/tsup.config.ts +++ b/packages/utils/tsup.config.ts @@ -3,12 +3,22 @@ import { defineConfig } from 'tsup' export default defineConfig({ name: '@baseapp-frontend/utils', - entry: ['index.ts', 'client.ts'], - format: ['esm', 'cjs'], - treeshake: true, - splitting: true, + entry: { + cookie: 'constants/cookie.ts', + date: 'constants/date.ts', + django: 'constants/django.ts', + events: 'constants/events.ts', + fetch: 'constants/fetch.ts', + languages: 'constants/languages.ts', + regex: 'constants/regex.ts', + token: 'constants/token.ts', + zod: 'constants/zod.ts', + }, dts: true, + format: ['cjs', 'esm'], clean: true, - minify: true, + bundle: false, + splitting: false, + sourcemap: true, external: ['react', 'react-dom'], })