Skip to content

Commit

Permalink
Fix form imports and exports
Browse files Browse the repository at this point in the history
  • Loading branch information
f-elix committed May 24, 2024
1 parent 7e4e8a2 commit 95296b0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
7 changes: 7 additions & 0 deletions packages/components/pagination/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @288-toolkit/pagination

## 3.2.3

### Patch Changes

- Updated dependencies
- @288-toolkit/forms@4.3.3

## 3.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/components/pagination/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@288-toolkit/pagination",
"version": "3.2.2",
"version": "3.2.3",
"author": "DeuxHuitHuit",
"license": "MIT",
"type": "module",
Expand Down
6 changes: 6 additions & 0 deletions packages/forms/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @288-toolkit/forms

## 4.3.3

### Patch Changes

- Fix form imports and exports

## 4.3.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/dist/validateNewsletter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* };
* ```
*/
import { createTranslate, createTranslationsLoader } from '@288-toolkit/i18n/translations/server';
import { createServerTranslate } from '@288-toolkit/i18n/server';
import { fail } from '@sveltejs/kit';
import { z } from 'zod';
import { zodErrorToObject } from './lib/zodErrorToObject.js';
Expand All @@ -27,7 +27,7 @@ import { validateHoneypot } from './validateHoneypot.js';
export const validateNewsletter = (language, callback) => {
return async (event) => {
await validateHoneypot(event);
const t = await createTranslate(newsletterForm, language);
const t = await createServerTranslate(newsletterForm, language);
const emailError = t('emailError');
const newsletterSchema = z.object({
email: z
Expand Down
5 changes: 3 additions & 2 deletions packages/forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@288-toolkit/forms",
"version": "4.3.2",
"version": "4.3.3",
"author": "DeuxHuitHuit",
"license": "MIT",
"type": "module",
Expand All @@ -26,7 +26,8 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"default": "./dist/index.js",
"svelte": "./dist/index.js"
},
"./translations": {
"types": "./dist/translations/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/validateNewsletter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* ```
*/

import { createTranslate, createTranslationsLoader } from '@288-toolkit/i18n/translations/server';
import { createServerTranslate } from '@288-toolkit/i18n/server';
import { fail, type Action } from '@sveltejs/kit';
import { z } from 'zod';
import { zodErrorToObject } from './lib/zodErrorToObject.js';
Expand All @@ -35,7 +35,7 @@ export const validateNewsletter: (language: string, callback?: Callback) => Acti
return async (event) => {
await validateHoneypot(event);

const t = await createTranslate(newsletterForm, language);
const t = await createServerTranslate(newsletterForm, language);

const emailError = t('emailError');

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { defineConfig, type Plugin } from 'vite';

export default defineConfig(() => {
return {
Expand Down

0 comments on commit 95296b0

Please sign in to comment.