Skip to content

Commit

Permalink
type.d
Browse files Browse the repository at this point in the history
  • Loading branch information
KamyarTaher committed Oct 2, 2024
1 parent aebd563 commit d72725d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 26 deletions.
10 changes: 4 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
src
tests
.gitignore
.npmignore
tsconfig.json
rollup.config.js
# Exclude unnecessary files
src/
node_modules/
test/
26 changes: 24 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zust",
"version": "0.2.1",
"version": "0.2.2",
"description": "A powerful state manager based on Zustand",
"type": "module",
"main": "dist/index.cjs.js",
Expand All @@ -12,7 +12,6 @@
"LICENSE"
],
"scripts": {
"dev": "rollup -c -w",
"build": "rollup -c",
"test": "jest",
"prepublishOnly": "npm run build"
Expand All @@ -30,6 +29,7 @@
"devDependencies": {
"@jest/globals": "^29.7.0",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "16.0.1",
Expand Down
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// rollup.config.js
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import json from "@rollup/plugin-json"; // Import the plugin

export default {
input: "src/index.ts",
Expand All @@ -20,11 +22,9 @@ export default {
external: ["react", "react-dom", "zustand"],
plugins: [
peerDepsExternal(),
typescript({
tsconfig: "tsconfig.build.json",
useTsconfigDeclarationDir: true,
}),
resolve(),
commonjs(),
typescript({ useTsconfigDeclarationDir: true }),
json(), // Add the plugin to the plugins array
],
};
2 changes: 0 additions & 2 deletions tests/integration.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// test/integration.test.ts
import { render, act } from "@testing-library/react";
import "@testing-library/jest-dom";

import { createStore } from "../src/index";

describe("Zust Integration", () => {
Expand Down Expand Up @@ -31,7 +30,6 @@ describe("Zust Integration", () => {

test("state updates trigger re-renders", () => {
const { useSelectors, setDeep } = createStore({ counter: 0 });

let renderCount = 0;
function TestComponent() {
const { counter } = useSelectors("counter");
Expand Down
21 changes: 11 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
"module": "ESNext",
"lib": ["ES2020", "DOM"],
"moduleResolution": "node",
"rootDir": ".",
"rootDir": "src",
"declaration": true,
"declarationDir": "dist/types",
"emitDeclarationOnly": false,
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"jsx": "react-jsx",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"types": ["jest", "node"],
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": false,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*", "tests/**/*"],
"exclude": ["node_modules", "dist"]
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
}

0 comments on commit d72725d

Please sign in to comment.