Skip to content

Commit

Permalink
fix(esm): cjs to esm as default (toss#125)
Browse files Browse the repository at this point in the history
* fix(esm): cjs to esm as default

* Create fuzzy-lizards-build.md
  • Loading branch information
manudeli authored Sep 3, 2023
1 parent 4cbb29b commit 12c9cb7
Show file tree
Hide file tree
Showing 25 changed files with 88 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .changeset/fuzzy-lizards-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@suspensive/react-query": patch
"@suspensive/react": patch
---

fix(esm): cjs to esm as default
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
command: ['pnpm lint', 'pnpm test', 'pnpm test:tsd', 'pnpm type:check']
command: ['pnpm lint', 'pnpm lint:pub', 'pnpm test', 'pnpm test:tsd', 'pnpm type:check']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
Expand All @@ -29,6 +29,6 @@ jobs:
cache-dependency-path: 'pnpm-lock.yaml'
node-version-file: '.nvmrc'
- run: pnpm install --frozen-lockfile
- run: pnpm build --filter=@suspensive/react --filter=@suspensive/react-query
- run: pnpm build
- name: Run commands
run: ${{ matrix.command }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"license": "MIT",
"packageManager": "pnpm@8.5.1",
"type": "module",
"workspaces": [
"configs/*",
"packages/*",
Expand All @@ -31,6 +32,7 @@
"graph": "mkdir graph && turbo run build --graph=graph/index.html",
"lint": "turbo run lint",
"lint:pack": "packlint sort -R",
"lint:pub": "turbo run lint:pub",
"postinstall": "husky install",
"prepack": "turbo run prepack",
"test": "turbo run test",
Expand All @@ -52,6 +54,7 @@
"lint-staged": "^13.2.2",
"packlint": "^0.2.4",
"prettier": "^2.8.8",
"publint": "^0.2.2",
"turbo": "latest",
"typescript": "^5.1.6"
}
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/react-query/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...require('@suspensive/jest'),
rootDir: __dirname,
}
6 changes: 0 additions & 6 deletions packages/react-query/jest.config.js

This file was deleted.

16 changes: 11 additions & 5 deletions packages/react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@
},
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"files": [
"dist",
Expand All @@ -34,6 +39,7 @@
"scripts": {
"build": "tsup",
"lint": "eslint \"**/*.ts*\"",
"lint:pub": "publint --strict",
"prepack": "pnpm build && pnpm test:tsd",
"test": "jest",
"test:tsd": "tsd -t ./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export { useSuspenseQuery } from './useSuspenseQuery'
export { useSuspenseQueries } from './useSuspenseQueries'
export type {
BaseUseSuspenseQueryResult,
UseSuspenseQueryOptions,
UseSuspenseQueryResultOnLoading,
UseSuspenseQueryResultOnSuccess,
} from './useSuspenseQuery'
export { useSuspenseQueries } from './useSuspenseQueries'
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'
export type {
BaseUseSuspenseInfiniteQueryResult,
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/react/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...require('@suspensive/jest'),
rootDir: __dirname,
}
6 changes: 0 additions & 6 deletions packages/react/jest.config.js

This file was deleted.

16 changes: 11 additions & 5 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@
},
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"files": [
"dist",
Expand All @@ -34,6 +39,7 @@
"scripts": {
"build": "tsup",
"lint": "eslint \"**/*.ts*\"",
"lint:pub": "publint --strict",
"prepack": "pnpm build",
"test": "jest",
"test:watchAll": "jest --watchAll",
Expand Down
43 changes: 43 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"lint": {
"outputs": []
},
"lint:pub": {
"outputs": []
},
"test": {
"outputs": []
},
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 12c9cb7

Please sign in to comment.