Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocxl committed Jan 1, 2024
1 parent 2b21a0f commit 46e272c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/dev/bin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node
require('dotenv').config()
require('dotenv')?.config()
require('./dist/cli.default.js')
3 changes: 2 additions & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { setup } from './setup'
export * from './use-format'
export * from './use-locale'
export * from './set-locale'
export * from './use-ts'

export { setupClient } from './setup'
2 changes: 1 addition & 1 deletion packages/react/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type SetupOptions = Pick<Setup, 'format' | 'loader' | 'persist'> & {

export const setup$ = observable<Setup>()

export const setup = ({ defaultLocale, ...options }: SetupOptions) => {
export const setupClient = ({ defaultLocale, ...options }: SetupOptions) => {
if (options.persist) {
configureObservablePersistence({
pluginLocal: ObservablePersistLocalStorage
Expand Down
Empty file added playground/vite/.env
Empty file.
2 changes: 1 addition & 1 deletion playground/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"preview": "vite preview"
},
"dependencies": {
"@terai/react": "workspace:*"
"@terai/vite": "workspace:*"
},
"devDependencies": {
"@terai/dev": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion playground/vite/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTs, setLocale } from '@terai/react'
import { useTs, setLocale } from '@terai/vite'

export default function App() {
const { ts } = useTs()
Expand Down
2 changes: 1 addition & 1 deletion playground/vite/src/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTs } from '@terai/react'
import { useTs } from '@terai/vite'
import { Suspense } from 'react'

export function Button() {
Expand Down
4 changes: 2 additions & 2 deletions playground/vite/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { Suspense } from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import { setup } from '@terai/react'
import { setupClient } from '@terai/vite'

setup({
setupClient({
defaultLocale: 'en',
persist: true,
loader: (locale: string, id: string) =>
Expand Down
4 changes: 2 additions & 2 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 46e272c

Please sign in to comment.