v0.1.8 — corrige l'import côté Server Component (Next App Router)
- ToastProvider/useToast déplacés dans @napps/design-system/toast ("use client")
- index principal de nouveau importable depuis un Server Component
- test de non-régression test/run-next-smoke.sh (next build)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@napps/design-system",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.8",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@napps/design-system",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.8",
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.0",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@napps/design-system",
|
||||
"version": "0.1.7",
|
||||
"version": "0.1.8",
|
||||
"private": false,
|
||||
"description": "Identité visuelle et bibliothèque de composants nApps — direction A4 (Précision / Vibrance)",
|
||||
"type": "module",
|
||||
@@ -14,7 +14,12 @@
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"./tokens.css": "./dist/index.css"
|
||||
"./tokens.css": "./dist/index.css",
|
||||
"./toast": {
|
||||
"types": "./dist/toast.d.ts",
|
||||
"import": "./dist/toast.js",
|
||||
"require": "./dist/toast.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
@@ -23,8 +28,8 @@
|
||||
"**/*.css"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "tsup",
|
||||
"build": "tsup",
|
||||
"prepare": "npm run build",
|
||||
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup",
|
||||
"dev": "tsup --watch",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -59,6 +59,3 @@ export type { ColorPickerProps } from './components/ColorPicker';
|
||||
|
||||
export { Toast } from './components/Toast';
|
||||
export type { ToastProps, ToastTone } from './components/Toast';
|
||||
|
||||
export { ToastProvider, useToast } from './components/ToastProvider';
|
||||
export type { ToastProviderProps, ToastOptions, ToastApi } from './components/ToastProvider';
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Point d'entrée séparé « @napps/design-system/toast » : construit avec la directive "use client"
|
||||
// (voir tsup.config.ts), car ToastProvider appelle createContext au niveau du module.
|
||||
export { ToastProvider, useToast } from './components/ToastProvider';
|
||||
export type { ToastProviderProps, ToastOptions, ToastApi } from './components/ToastProvider';
|
||||
@@ -1,12 +1,19 @@
|
||||
import { defineConfig } from 'tsup';
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
format: ['esm', 'cjs'],
|
||||
const common = {
|
||||
format: ['esm', 'cjs'] as ('esm' | 'cjs')[],
|
||||
dts: true,
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
// dist/ est vidé par le script `build` (deux configs en parallèle se marcheraient dessus).
|
||||
clean: false,
|
||||
external: ['react', 'react-dom'],
|
||||
injectStyle: false,
|
||||
});
|
||||
};
|
||||
|
||||
export default defineConfig([
|
||||
// Index principal : composants importables depuis un Server Component (aucune directive client).
|
||||
{ ...common, entry: { index: 'src/index.ts' } },
|
||||
// Point d'entrée « /toast » : ToastProvider/useToast créent un contexte React → "use client".
|
||||
{ ...common, entry: { toast: 'src/toast.ts' }, banner: { js: '"use client";' } },
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user