Skip to content

Commit

Permalink
revert them
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored and dmaskasky committed Jan 21, 2025
1 parent 36668c7 commit 50c4d12
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 15 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"build:babel:preset": "rollup -c --config-babel_preset",
"build:vanilla": "rollup -c --config-vanilla",
"build:vanilla:utils": "rollup -c --config-vanilla_utils",
"build:vanilla:internals": "rollup -c --config-vanilla_internals",
"build:react": "rollup -c --config-react --client-only",
"build:react:utils": "rollup -c --config-react_utils --client-only",
"postbuild": "pnpm patch-d-ts && pnpm copy && pnpm patch-ts3.8 && pnpm patch-old-ts && pnpm patch-esm-ts && pnpm patch-readme",
Expand Down
1 change: 0 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function createUMDConfig(input, output, env, clientOnly) {
'jotai/react': 'jotaiReact',
'jotai/vanilla/utils': 'jotaiVanillaUtils',
'jotai/react/utils': 'jotaiReactUtils',
'jotai/vanilla/internals': 'jotaiVanillaInternals',
},
},
external,
Expand Down
15 changes: 14 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
export * from './vanilla.ts'
export { atom, createStore, getDefaultStore } from './vanilla.ts'

export type {
Atom,
WritableAtom,
PrimitiveAtom,
Getter,
Setter,
ExtractAtomValue,
ExtractAtomArgs,
ExtractAtomResult,
SetStateAction,
} from './vanilla.ts'

export * from './react.ts'
10 changes: 9 additions & 1 deletion src/vanilla.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
export { atom } from './vanilla/atom.ts'
export type { Atom, WritableAtom, PrimitiveAtom } from './vanilla/atom.ts'

export { createStore, getDefaultStore } from './vanilla/store.ts'
export {
createStore,
getDefaultStore,

// Internal functions (subject to change without notice)
// In case you rely on them, be sure to pin the version
INTERNAL_getSecretStoreMethods,
INTERNAL_buildStore,
} from './vanilla/store.ts'

export type {
Getter,
Expand Down
3 changes: 0 additions & 3 deletions src/vanilla/internals.ts

This file was deleted.

7 changes: 4 additions & 3 deletions tests/vanilla/derive.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { describe, expect, it, vi } from 'vitest'
import { atom, createStore } from 'jotai/vanilla'
import type { Atom, Getter } from 'jotai/vanilla'
import {
atom,
INTERNAL_buildStore as buildStore,
createStore,
INTERNAL_getSecretStoreMethods as getSecretStoreMethods,
} from 'jotai/vanilla/internals'
} from 'jotai/vanilla'
import type { Atom, Getter } from 'jotai/vanilla'

type EnsureAtomState = ReturnType<typeof getSecretStoreMethods>[0]

Expand Down
7 changes: 5 additions & 2 deletions tests/vanilla/effect.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { expect, it, vi } from 'vitest'
import type { Atom, Getter, Setter, WritableAtom } from 'jotai/vanilla'
import { atom, createStore } from 'jotai/vanilla'
import { INTERNAL_getSecretStoreMethods as getSecretStoreMethods } from 'jotai/vanilla/internals'
import {
atom,
createStore,
INTERNAL_getSecretStoreMethods as getSecretStoreMethods,
} from 'jotai/vanilla'

type Store = ReturnType<typeof createStore>
type AtomState = ReturnType<ReturnType<typeof getSecretStoreMethods>[0]>
Expand Down
7 changes: 4 additions & 3 deletions tests/vanilla/store.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { waitFor } from '@testing-library/react'
import { assert, describe, expect, it, vi } from 'vitest'
import { atom, createStore } from 'jotai/vanilla'
import type { Atom, Getter, PrimitiveAtom } from 'jotai/vanilla'
import {
atom,
INTERNAL_buildStore as buildStore,
createStore,
INTERNAL_getSecretStoreMethods as getSecretStoreMethods,
} from 'jotai/vanilla/internals'
} from 'jotai/vanilla'
import type { Atom, Getter, PrimitiveAtom } from 'jotai/vanilla'

it('should not fire on subscribe', async () => {
const store = createStore()
Expand Down

0 comments on commit 50c4d12

Please sign in to comment.