Skip to content

Commit

Permalink
feat(reactor-browser): removed peerDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gpuente committed Jan 10, 2025
1 parent 2853de2 commit 05915f4
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 51 deletions.
33 changes: 17 additions & 16 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": {
"@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": {
"@powerhousedao/config": "^1.5.0",
"@powerhousedao/design-system": "^1.19.0",
"@powerhousedao/scalars": "^1.16.0",
"document-drive": "^1.13.2",
"document-model": "^2.15.0",
"document-model-libs": "^1.125.2",
"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": "ESNext",
"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"],
}
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"test/**/*.ts",
"*.ts",
"package.json"
]
}
"include": ["./"]
}
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", "cjs"],
treeshake: true,
bundle: true,
platform: "node",
target: "node20",
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;
}
38 changes: 19 additions & 19 deletions pnpm-lock.yaml

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

0 comments on commit 05915f4

Please sign in to comment.