Skip to content

Commit

Permalink
chore!: Pure ESM package
Browse files Browse the repository at this point in the history
  • Loading branch information
arv committed Dec 1, 2023
1 parent c1cbe69 commit c67ff68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
"homepage": "https://replicache.dev",
"repository": "github:rocicorp/replicache-react",
"type": "module",
"main": "out/index.js",
"module": "out/index.mjs",
"module": "out/index.js",
"types": "out/index.d.ts",
"exports": "./out/index.js",
"scripts": {
"format": "prettier --write 'src/*.{js,jsx,json,ts,tsx,html,css,md}' '*.{cjs,js,jsx,json,ts,tsx,html,css,md}'",
"check-format": "prettier --check 'src/*.{js,jsx,json,ts,tsx,html,css,md}' '*.{cjs,js,jsx,json,ts,tsx,html,css,md}'",
"check-types": "tsc --noEmit",
"lint": "eslint --ext .ts,.tsx,.js,.jsx src/",
"build-cjs": "tsc --module commonjs --outDir out",
"build-esm": "tsc --module ESNext --outDir out && mv out/index.js out/index.mjs",
"build": "npm run build-esm && npm run build-cjs",
"build": "tsc",
"prepack": "npm run lint && npm run test && npm run build",
"test": "web-test-runner \"src/**/*.test.{jsx,js,ts,tsx}\"",
"test:watch": "npm test -- --watch"
Expand Down Expand Up @@ -48,7 +47,6 @@
},
"files": [
"out/index.js",
"out/index.mjs",
"out/index.d.ts"
]
}
2 changes: 1 addition & 1 deletion src/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import {render} from 'react-dom';
import type {JSONValue, ReadTransaction} from 'replicache';
import {Replicache, TEST_LICENSE_KEY, WriteTransaction} from 'replicache';
import {Subscribable, useSubscribe} from './index';
import {Subscribable, useSubscribe} from './index.js';

function sleep(ms: number | undefined): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"jsx": "react",
"target": "ES2022",
"isolatedModules": true,

"outDir": "out",
"module": "Node16",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,

"declaration": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"moduleResolution": "Node16",
"allowJs": true,
"lib": ["dom", "esnext"],
"skipLibCheck": true
Expand Down

0 comments on commit c67ff68

Please sign in to comment.