Skip to content

Commit

Permalink
resolve modules
Browse files Browse the repository at this point in the history
  • Loading branch information
KamyarTaher committed Jul 27, 2024
1 parent eab1287 commit 8014fd7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 36 deletions.
Binary file modified bun.lockb
Binary file not shown.
23 changes: 19 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "zust",
"version": "0.1.4",
"description": "A powerful state manager based on Zustand",
"main": "dist/index.js", // CommonJS entry
"module": "dist/index.esm.js", // ES Module entry
"types": "dist/index.d.ts", // TypeScript declaration
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
Expand All @@ -13,11 +13,26 @@
"import": "./dist/index.esm.js",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./core": {
"import": "./dist/core/index.esm.js",
"require": "./dist/core/index.js",
"types": "./dist/core/index.d.ts"
},
"./middleware": {
"import": "./dist/middleware/index.esm.js",
"require": "./dist/middleware/index.js",
"types": "./dist/middleware/index.d.ts"
},
"./plugins": {
"import": "./dist/plugins/index.esm.js",
"require": "./dist/plugins/index.js",
"types": "./dist/plugins/index.d.ts"
}
},
"scripts": {
"build:types": "tsc --emitDeclarationOnly",
"build:js": "bun build ./src/index.ts --outdir ./dist",
"build:js": "bun build ./src/index.ts --outfile=./dist/index.js && bun build ./src/index.ts --outfile=./dist/index.esm.js --format=esm && bun build ./src/core/index.ts --outfile=./dist/core/index.js && bun build ./src/core/index.ts --outfile=./dist/core/index.esm.js --format=esm && bun build ./src/middleware/index.ts --outfile=./dist/middleware/index.js && bun build ./src/middleware/index.ts --outfile=./dist/middleware/index.esm.js --format=esm && bun build ./src/plugins/index.ts --outfile=./dist/plugins/index.js && bun build ./src/plugins/index.ts --outfile=./dist/plugins/index.esm.js --format=esm",
"build": "bun run build:types && bun run build:js",
"test": "bun test",
"prepublishOnly": "bun run build"
Expand Down
27 changes: 0 additions & 27 deletions rollup.config.js

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { createStore } from "./core/createStore";
export { createStore } from "./core";
export { createPersistConfig } from "./core/persistConfig";
export type { Store, StoreOptions, Plugin, Middleware } from "./types";
9 changes: 5 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
"jsx": "react-jsx",
"allowJs": true,

"emitDeclarationOnly": true,

// Bundler mode
"moduleResolution": "node", // Changez "bundler" en "node"
"allowImportingTsExtensions": false, // Changez true en false
"verbatimModuleSyntax": false, // Changez true en false
"emitDeclarationOnly": false, // Changez true en false
// Best practices
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
Expand All @@ -33,8 +34,8 @@
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["src/**/*.ts", "src/types/**/*.d.ts"],
"exclude": ["node_modules", "tests", "dist"]
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "dist", "tests"],
}


0 comments on commit 8014fd7

Please sign in to comment.