Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(reactor-browser): removed peerDependencies #802

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions packages/reactor-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,46 @@
"files": [
"dist"
],
"types": "dist/src/index.d.ts",
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js"
}
},
"scripts": {
"check-types": "tsc",
"lint": "eslint .",
"lint:nx": "eslint . --fix --quiet",
"lint:fix": "eslint --fix",
"postlint": "npm run check-types",
"build": "NODE_ENV=production vite build",
"build:watch": "vite build --watch",
"build": "tsup",
"build:watch": "tsup --watch",
"test": "vitest run --passWithNoTests",
"clean": "rimraf dist",
"clean:node_modules": "rimraf node_modules"
},
"keywords": [],
"author": "",
"devDependencies": {
"@powerhousedao/config": "workspace:*",
"@powerhousedao/design-system": "workspace:*",
"@powerhousedao/scalars": "workspace:*",
"document-drive": "workspace:*",
"document-model": "workspace:*",
"document-model-libs": "workspace:*",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"dependencies": {
"@powerhousedao/config": "workspace:*",
"@powerhousedao/design-system": "workspace:*",
"@powerhousedao/scalars": "workspace:*",
"document-drive": "workspace:*",
"document-model": "workspace:*",
"document-model-libs": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"dependencies": {
"did-key-creator": "^1.2.0",
"jotai": "^2.10.3"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function debounceOperations(
(op) => op.scope === operation.scope && op.index === operation.index,
);
if (index > -1) {
const oldOperation = operations[index];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const oldOperation = operations[index]!;
if (
!(
oldOperation.type === operation.type &&
Expand Down
4 changes: 3 additions & 1 deletion packages/reactor-browser/src/hooks/useDocumentDispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export function useDocumentDispatch<State, A extends Action, LocalState>(
const newState = documentReducer(_state, action);
const scope = action.scope ?? "global";
const operations = newState.operations[scope];
const operation = operations[operations.length - 1];

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const operation = operations[operations.length - 1]!;

if (operation.error) {
const error = new Error(operation.error);
Expand Down
36 changes: 22 additions & 14 deletions packages/reactor-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{
"extends": "../../tsconfig.options.json",
"compilerOptions": {
"esModuleInterop": true,
"skipLibCheck": true,
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"outDir": "dist",
"sourceMap": true,
"declaration": true,
"moduleResolution": "Bundler",
"target": "ES2022",
"module": "ESNext",
"noEmit": true,
"lib": ["ES2022", "DOM"],
"emitDeclarationOnly": true,
"types": ["node", "./types.d.ts"],
"jsx": "react-jsx",
"outDir": "./dist",
"types": ["vitest/globals"],
"resolveJsonModule": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"paths": {
"document-drive": ["../document-drive/src/index.ts"],
}
},
gpuente marked this conversation as resolved.
Show resolved Hide resolved
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"test/**/*.ts",
"*.ts",
"package.json"
]
}
"include": ["src/**/*.ts", "src/**/*.tsx"],
}
17 changes: 17 additions & 0 deletions packages/reactor-browser/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/**/*.ts"],
splitting: true,
sourcemap: false,
clean: true,
format: "esm",
treeshake: true,
bundle: true,
platform: "node",
target: "node20",
gpuente marked this conversation as resolved.
Show resolved Hide resolved
noExternal: ["document-drive"],
shims: true,
cjsInterop: true,
dts: true,
});
5 changes: 5 additions & 0 deletions packages/reactor-browser/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module "*.graphql" {
const value: string;

export default value;
}
84 changes: 0 additions & 84 deletions packages/reactor-browser/vite.config.ts

This file was deleted.

26 changes: 13 additions & 13 deletions pnpm-lock.yaml

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

Loading