@padosoft/config 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ ]0;C:\Users\PADO\.bun\bin\bun.exe[?25h$ tsdown
2
+ ℹ tsdown v0.22.3 powered by rolldown v1.1.1
3
+ ℹ config file: C:\Users\PADO\github\ts-support\packages
4
+ \config\tsdown.config.ts 
5
+ ℹ entry: src\compiler\tsdown.ts, src\types\css.ts, src\
6
+ types\expo-router.ts, src\types\i18next.ts, src\types\n
7
+ ativewind.ts, src\compiler\plugins\hono-zod.ts, src\com
8
+ piler\utils\exports.ts, src\compiler\utils\index.ts 
9
+ ℹ tsconfig: tsconfig.json
10
+ ℹ Build start
11
+ ℹ Cleaning 21 files
12
+ ℹ dist\compiler\utils\exports.mjs 0.44 kB │ gzip:
13
+ 0.27 kB
14
+ ℹ dist\compiler\tsdown.mjs 0.35 kB │ gzip:
15
+ 0.25 kB
16
+ ℹ dist\compiler\plugins\hono-zod.mjs 0.24 kB │ gzip:
17
+ 0.19 kB
18
+ ℹ dist\compiler\utils\index.mjs 0.09 kB │ gzip:
19
+ 0.08 kB
20
+ ℹ dist\types\css.mjs 0.01 kB │ gzip:
21
+ 0.03 kB
22
+ ℹ dist\types\expo-router.mjs 0.01 kB │ gzip:
23
+ 0.03 kB
24
+ ℹ dist\types\i18next.mjs 0.01 kB │ gzip:
25
+ 0.03 kB
26
+ ℹ dist\types\nativewind.mjs 0.01 kB │ gzip:
27
+ 0.03 kB
28
+ ℹ dist\types\i18next.d.mts 1.29 kB │ gzip:
29
+ 0.62 kB
30
+ ℹ dist\types\expo-router.d.mts 0.84 kB │ gzip:
31
+ 0.32 kB
32
+ ℹ dist\compiler\utils\exports.d.mts 0.25 kB │ gzip:
33
+ 0.19 kB
34
+ ℹ dist\types\css.d.mts 0.23 kB │ gzip:
35
+ 0.15 kB
36
+ ℹ dist\compiler\plugins\hono-zod.d.mts 0.20 kB │ gzip:
37
+ 0.15 kB
38
+ ℹ dist\compiler\tsdown.d.mts 0.19 kB │ gzip:
39
+ 0.15 kB
40
+ ℹ dist\compiler\utils\index.d.mts 0.09 kB │ gzip:
41
+ 0.07 kB
42
+ ℹ dist\types\nativewind.d.mts 0.01 kB │ gzip:
43
+ 0.03 kB
44
+ ℹ 16 files, total: 4.24 kB
45
+ ✔ Build complete in 83ms
46
+ .json json
47
+ .json json
48
+ .json json
49
+ .json json
50
+ .json json
package/CHANGELOG.md ADDED
@@ -0,0 +1,81 @@
1
+ # @padosoft/config
2
+
3
+ ## 1.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b017a2c`](https://github.com/padosoft/ts-support/commit/b017a2cd9669260f2dd28eec06579a902175aece) Thanks [@47PADO47](https://github.com/47PADO47)! - bump deps
8
+
9
+ ## 1.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d01b29f`](https://github.com/padosoft/ts-support/commit/d01b29fb568b4b513a89c806c7f19f056fd7797f) Thanks [@47PADO47](https://github.com/47PADO47)! - update deps
14
+
15
+ ## 1.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`ab3d36e`](https://github.com/padosoft/ts-support/commit/ab3d36e1cd5002925e63f59683fc66e7c8f8c1f7) Thanks [@47PADO47](https://github.com/47PADO47)! - update to typescript@6
20
+
21
+ - [`ab3d36e`](https://github.com/padosoft/ts-support/commit/ab3d36e1cd5002925e63f59683fc66e7c8f8c1f7) Thanks [@47PADO47](https://github.com/47PADO47)! - update tsdown
22
+
23
+ ### Patch Changes
24
+
25
+ - [`ab3d36e`](https://github.com/padosoft/ts-support/commit/ab3d36e1cd5002925e63f59683fc66e7c8f8c1f7) Thanks [@47PADO47](https://github.com/47PADO47)! - update deps
26
+
27
+ ## 1.1.7
28
+
29
+ ### Patch Changes
30
+
31
+ - [`e4f1ba8`](https://github.com/padosoft/ts-support/commit/e4f1ba8acf343670ebfd5251774af6c3c98a08ff) Thanks [@47PADO47](https://github.com/47PADO47)! - update deps
32
+
33
+ ## 1.1.6
34
+
35
+ ### Patch Changes
36
+
37
+ - [`873297d`](https://github.com/padosoft/ts-support/commit/873297d85c8088ec344d8380e88cbc069da489d6) Thanks [@47PADO47](https://github.com/47PADO47)! - fix types exports
38
+
39
+ ## 1.1.5
40
+
41
+ ### Patch Changes
42
+
43
+ - [`9dec4cc`](https://github.com/padosoft/ts-support/commit/9dec4cc15a9c3b5952da7ed399afea197eee51cf) Thanks [@47PADO47](https://github.com/47PADO47)! - update tsdown
44
+
45
+ ## 1.1.4
46
+
47
+ ### Patch Changes
48
+
49
+ - [`2acb73a`](https://github.com/padosoft/ts-support/commit/2acb73a9756df5e8b1c948c90859220af0a9e263) Thanks [@47PADO47](https://github.com/47PADO47)! - update tools config
50
+
51
+ ## 1.1.3
52
+
53
+ ### Patch Changes
54
+
55
+ - [`5a9c998`](https://github.com/padosoft/ts-support/commit/5a9c998e2bb601458bf3aed0e8e6ec5323f7dd2f) Thanks [@47PADO47](https://github.com/47PADO47)! - update exports
56
+
57
+ ## 1.1.2
58
+
59
+ ### Patch Changes
60
+
61
+ - [`40564ee`](https://github.com/padosoft/ts-support/commit/40564ee614b8b065cb07ebb862044739b2ec9ed4) Thanks [@47PADO47](https://github.com/47PADO47)! - fix defaultCustomExports location update
62
+
63
+ ## 1.1.1
64
+
65
+ ### Patch Changes
66
+
67
+ - [`2aedb22`](https://github.com/padosoft/ts-support/commit/2aedb22d494e362ef7aa2f973294cf6109da4684) Thanks [@47PADO47](https://github.com/47PADO47)! - add config package.json exports
68
+
69
+ - [`f51d05b`](https://github.com/padosoft/ts-support/commit/f51d05b30bb2335fbbddf043815238e34ea29361) Thanks [@47PADO47](https://github.com/47PADO47)! - fix package.json exports
70
+
71
+ ## 1.1.0
72
+
73
+ ### Minor Changes
74
+
75
+ - bdf8d88: Migrate compiler to tsdown
76
+
77
+ ## 1.0.1
78
+
79
+ ### Patch Changes
80
+
81
+ - ef3d6dc: Compile @padosoft/config .ts files
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @gescat/config
2
+ Collezione di configurazioni condivise nei vari progetti/pacchetti
3
+
4
+ ```
5
+ ├── config/
6
+ │ ├── expo/ //configurazioni comuni ma specifiche di expo
7
+ │ │ ├── plugin/ //configurazioni comuni per plugin per expo
8
+ │ │ ├── app.config.ts // configurazione in formato ts di base
9
+ │ │ ├── eas.json // Configurazione per compilazione in cloud di base
10
+ │ │ ├── babel.config.js
11
+ │ │ ├── metro.config.js
12
+ │ ├── lib/ //configurazioni specifiche di librerie installate comuni
13
+ │ │ ├── drizzle.config.ts //se usi la lib drizzle per ORM
14
+ │ │ ├── jest.config.ts //se usi la lib jest per i testi
15
+ │ │ ├── tailwind.config.ts //se usi la lib tailwind
16
+ │ ├── tools/ //configurazioni specifiche di tool comuni
17
+ │ │ ├── biome.json // se usi biome - config specifica e comune di tutto il progetto
18
+ ```
@@ -0,0 +1,6 @@
1
+ import { Plugin } from "rolldown";
2
+
3
+ //#region src/compiler/plugins/hono-zod.d.ts
4
+ declare const replaceZodOpenapiImportPlugin: Plugin;
5
+ //#endregion
6
+ export { replaceZodOpenapiImportPlugin as default };
@@ -0,0 +1 @@
1
+ const e={name:`replace-z-hono-openapi-import`,transform(e,t){if(!(!t.endsWith(`.ts`)&&!t.endsWith(`.tsx`)))return{code:e.replace(/import\s*\{\s*z\s*\}\s*from\s*["']hono\/openapi["'];?/g,`import { z } from "zod";`)}}};export{e as default};
@@ -0,0 +1,6 @@
1
+ import { InlineConfig, UserConfigFn } from "tsdown";
2
+
3
+ //#region src/compiler/tsdown.d.ts
4
+ declare const tsdown: (packageOptions?: InlineConfig) => UserConfigFn;
5
+ //#endregion
6
+ export { tsdown };
@@ -0,0 +1 @@
1
+ import{defaultCustomExports as e}from"./utils/exports.mjs";import{defineConfig as t}from"tsdown";const n=n=>t(t=>{let r={...t,...n};return Array.isArray(r.entry)&&r.entry.push(`!dist`),r.exports&&typeof r.exports==`boolean`&&(r.exports={customExports:e}),{dts:!0,splitting:!1,treeshake:!0,minify:!r.watch,outDir:`dist`,...r}});export{n as tsdown};
@@ -0,0 +1,6 @@
1
+ import { ExportsOptions } from "tsdown";
2
+
3
+ //#region src/compiler/utils/exports.d.ts
4
+ declare const defaultCustomExports: Extract<NonNullable<ExportsOptions["customExports"]>, (...args: never) => unknown>;
5
+ //#endregion
6
+ export { defaultCustomExports };
@@ -0,0 +1 @@
1
+ const e=e=>{let t={},n={".js":(e,t)=>({default:e,types:`${e.slice(0,-t.length)}.d.ts`}),".mjs":(e,t)=>({default:e,types:`${e.slice(0,-t.length)}.d.mts`})};for(let[r,i]of Object.entries(e)){let e=r.replace(/\\/g,`/`),a=typeof i==`string`?i.replace(/\\/g,`/`):i;if(typeof a!=`string`){t[e]=a;continue}let o=Object.entries(n).find(([e])=>a.endsWith(e));if(!o){t[e]=a;continue}let[s,c]=o;t[e]=c(a,s)}return t};export{e as defaultCustomExports};
@@ -0,0 +1,2 @@
1
+ import { defaultCustomExports } from "./exports.mjs";
2
+ export { defaultCustomExports };
@@ -0,0 +1 @@
1
+ import{defaultCustomExports as e}from"./exports.mjs";export{e as defaultCustomExports};
@@ -0,0 +1,11 @@
1
+ //#region src/types/css.d.ts
2
+ declare module "*.module.css" {
3
+ const classes: {
4
+ readonly [key: string]: string;
5
+ };
6
+ export default classes;
7
+ }
8
+ declare module "*.css" {
9
+ const content: string;
10
+ export default content;
11
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,17 @@
1
+ import { NativeStackHeaderItemButton, NativeStackHeaderItemMenu, NativeStackHeaderItemMenuAction, NativeStackNavigationOptions } from "expo-router/build/react-navigation/native-stack";
2
+ import { NativeTabs } from "expo-router/unstable-native-tabs";
3
+
4
+ //#region src/types/expo-router.d.ts
5
+ declare module "expo-router/react-navigation" {
6
+ interface NativeStackNavigationOptions extends NativeStackNavigationOptions {}
7
+ interface NativeStackHeaderItemButton extends NativeStackHeaderItemButton {}
8
+ interface NativeStackHeaderItemMenu extends NativeStackHeaderItemMenu {}
9
+ interface NativeStackHeaderItemMenuAction extends NativeStackHeaderItemMenuAction {}
10
+ }
11
+ interface NativeTabIcon extends Extract<Extract<React.ComponentProps<typeof NativeTabs.Trigger.Icon>, {
12
+ md: unknown;
13
+ }>, {
14
+ sf?: unknown;
15
+ }> {}
16
+ //#endregion
17
+ export { NativeTabIcon };
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,50 @@
1
+ //#region src/types/i18next.d.ts
2
+ interface I18nConfig {
3
+ Locale: never;
4
+ Translation: never;
5
+ }
6
+ type Locale = I18nConfig["Locale"];
7
+ type Translation = I18nConfig["Translation"];
8
+ /**
9
+ * Custom type configuration used to enable fully type-safe i18next translations.
10
+ *
11
+ * Consumers should augment the configuration interface exposed by this package
12
+ * to provide their application's `Locale` and `Translation` types.
13
+ *
14
+ * Ensure this declaration is included by the TypeScript compiler (typically via
15
+ * a `.d.ts` file in your project).
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * import type { resources } from "./i18n";
20
+ *
21
+ * declare module "@gescat/i18n/config" {
22
+ * interface I18nConfig {
23
+ * Locale: "it" | "en";
24
+ * Translation: typeof resources;
25
+ * }
26
+ * }
27
+ * ```
28
+ *
29
+ * @see https://www.i18next.com/overview/typescript
30
+ */
31
+ interface CustomI18NTypeOptions {
32
+ enableSelector: false;
33
+ defaultNS: keyof Translation;
34
+ resources: Translation;
35
+ lng: Locale | undefined;
36
+ fallbackLng: Locale | undefined;
37
+ }
38
+ /**
39
+ * Sovrascrizione interfaccia del pacchetto i18next
40
+ */
41
+ declare module "i18next" {
42
+ interface CustomTypeOptions extends CustomI18NTypeOptions {}
43
+ interface i18n {
44
+ language: Locale;
45
+ languages: Locale[];
46
+ resolvedLanguage?: Locale;
47
+ }
48
+ }
49
+ //#endregion
50
+ export { CustomI18NTypeOptions, I18nConfig };
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export{};
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@padosoft/config",
3
+ "type": "module",
4
+ "version": "1.2.2",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
9
+ "repository": {
10
+ "url": "git+https://github.com/padosoft/ts-support.git"
11
+ },
12
+ "scripts": {
13
+ "build": "tsdown",
14
+ "ts:check": "tsc --noEmit"
15
+ },
16
+ "exports": {
17
+ "./compiler/plugins/hono-zod": {
18
+ "default": "./dist/compiler/plugins/hono-zod.mjs",
19
+ "types": "./dist/compiler/plugins/hono-zod.d.mts"
20
+ },
21
+ "./compiler/tsdown": {
22
+ "default": "./dist/compiler/tsdown.mjs",
23
+ "types": "./dist/compiler/tsdown.d.mts"
24
+ },
25
+ "./compiler/utils": {
26
+ "default": "./dist/compiler/utils/index.mjs",
27
+ "types": "./dist/compiler/utils/index.d.mts"
28
+ },
29
+ "./compiler/utils/exports": {
30
+ "default": "./dist/compiler/utils/exports.mjs",
31
+ "types": "./dist/compiler/utils/exports.d.mts"
32
+ },
33
+ "./types/css": {
34
+ "default": "./dist/types/css.mjs",
35
+ "types": "./dist/types/css.d.mts"
36
+ },
37
+ "./types/expo-router": {
38
+ "default": "./dist/types/expo-router.mjs",
39
+ "types": "./dist/types/expo-router.d.mts"
40
+ },
41
+ "./types/i18next": {
42
+ "default": "./dist/types/i18next.mjs",
43
+ "types": "./dist/types/i18next.d.mts"
44
+ },
45
+ "./types/nativewind": {
46
+ "default": "./dist/types/nativewind.mjs",
47
+ "types": "./dist/types/nativewind.d.mts"
48
+ },
49
+ "./package.json": "./package.json",
50
+ "./typescript/base": "./src/typescript/base.json",
51
+ "./typescript/compiler": "./src/typescript/compiler.json",
52
+ "./typescript/expo": "./src/typescript/expo.json",
53
+ "./typescript/hono": "./src/typescript/hono.json",
54
+ "./tools/biome": "./src/tools/biome.json"
55
+ },
56
+ "dependencies": {}
57
+ }
@@ -0,0 +1,21 @@
1
+ import type { Plugin } from "rolldown";
2
+
3
+ const replaceZodOpenapiImportPlugin: Plugin = {
4
+ name: "replace-z-hono-openapi-import",
5
+
6
+ transform(code, id) {
7
+ // Only process .ts or .tsx files
8
+ if (!id.endsWith(".ts") && !id.endsWith(".tsx")) return;
9
+
10
+ const updatedCode = code.replace(
11
+ /import\s*\{\s*z\s*\}\s*from\s*["']hono\/openapi["'];?/g,
12
+ `import { z } from "zod";`,
13
+ );
14
+
15
+ return {
16
+ code: updatedCode,
17
+ };
18
+ },
19
+ };
20
+
21
+ export default replaceZodOpenapiImportPlugin;
@@ -0,0 +1,33 @@
1
+ import { defineConfig, type InlineConfig, type UserConfigFn } from "tsdown";
2
+ import { defaultCustomExports } from "./utils/exports.ts";
3
+
4
+ export const tsdown = (packageOptions?: InlineConfig): UserConfigFn => {
5
+ return defineConfig((overrideOptions) => {
6
+ const options = {
7
+ ...overrideOptions,
8
+ ...packageOptions,
9
+ };
10
+
11
+ if (Array.isArray(options.entry)) {
12
+ options.entry.push("!dist");
13
+ }
14
+
15
+ /**
16
+ * Apply default exports transformation
17
+ */
18
+ if (options.exports && typeof options.exports === "boolean") {
19
+ options.exports = {
20
+ customExports: defaultCustomExports,
21
+ };
22
+ }
23
+
24
+ return {
25
+ dts: true,
26
+ splitting: false,
27
+ treeshake: true,
28
+ minify: !options.watch,
29
+ outDir: "dist",
30
+ ...options,
31
+ };
32
+ });
33
+ };
@@ -0,0 +1,47 @@
1
+ import type { ExportsOptions } from "tsdown";
2
+
3
+ export const defaultCustomExports: Extract<
4
+ NonNullable<ExportsOptions["customExports"]>,
5
+ (...args: never) => unknown
6
+ > = (exports) => {
7
+ const fixed: typeof exports = {};
8
+
9
+ const handlers: Record<
10
+ string,
11
+ (value: string, ext: string) => { default: string; types: string }
12
+ > = {
13
+ ".js": (v, e) => ({
14
+ default: v,
15
+ types: `${v.slice(0, -e.length)}.d.ts`,
16
+ }),
17
+ ".mjs": (v, e) => ({
18
+ default: v,
19
+ types: `${v.slice(0, -e.length)}.d.mts`,
20
+ }),
21
+ };
22
+
23
+ for (const [key, value] of Object.entries(exports)) {
24
+ const normalizedKey = key.replace(/\\/g, "/");
25
+ const normalizedValue =
26
+ typeof value === "string" ? value.replace(/\\/g, "/") : value;
27
+
28
+ if (typeof normalizedValue !== "string") {
29
+ fixed[normalizedKey] = normalizedValue;
30
+ continue;
31
+ }
32
+
33
+ const handler = Object.entries(handlers).find(([ext]) =>
34
+ normalizedValue.endsWith(ext),
35
+ );
36
+
37
+ if (!handler) {
38
+ fixed[normalizedKey] = normalizedValue;
39
+ continue;
40
+ }
41
+
42
+ const [ext, fn] = handler;
43
+ fixed[normalizedKey] = fn(normalizedValue, ext);
44
+ }
45
+
46
+ return fixed;
47
+ };
@@ -0,0 +1 @@
1
+ export * from "./exports.ts";
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.4.8/schema.json",
3
+ "assist": {
4
+ "actions": {
5
+ "source": {
6
+ "organizeImports": "on",
7
+ "useSortedAttributes": "on",
8
+ "useSortedKeys": "off",
9
+ "useSortedProperties": "on"
10
+ }
11
+ }
12
+ },
13
+ "files": {
14
+ "ignoreUnknown": true,
15
+ "includes": ["**", "!**/bindings.d.ts", "!**/node_modules"]
16
+ },
17
+ "formatter": {
18
+ "enabled": true,
19
+ "indentStyle": "tab"
20
+ },
21
+ "javascript": {
22
+ "formatter": {
23
+ "quoteStyle": "double"
24
+ }
25
+ },
26
+ "linter": {
27
+ "enabled": true,
28
+ "rules": {
29
+ "complexity": {
30
+ "useLiteralKeys": "info"
31
+ },
32
+ "correctness": {
33
+ "noUnusedImports": "warn"
34
+ },
35
+ "recommended": true,
36
+ "style": {
37
+ "noInferrableTypes": "error",
38
+ "noParameterAssign": "error",
39
+ "noUnusedTemplateLiteral": "error",
40
+ "noUselessElse": "error",
41
+ "useAsConstAssertion": "error",
42
+ "useDefaultParameterLast": "error",
43
+ "useEnumInitializers": "error",
44
+ "useNumberNamespace": "error",
45
+ "useSelfClosingElements": "error",
46
+ "useSingleVarDeclarator": "error"
47
+ },
48
+ "suspicious": {
49
+ "noEmptyInterface": "warn",
50
+ "noShadowRestrictedNames": "info"
51
+ }
52
+ }
53
+ },
54
+ "root": false,
55
+ "vcs": {
56
+ "clientKind": "git",
57
+ "enabled": true,
58
+ "useIgnoreFile": true
59
+ }
60
+ }
@@ -0,0 +1,9 @@
1
+ declare module "*.module.css" {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+
6
+ declare module "*.css" {
7
+ const content: string;
8
+ export default content;
9
+ }
@@ -0,0 +1,29 @@
1
+ import type {
2
+ NativeStackHeaderItemButton as NativeStackHeaderItemButtonProps,
3
+ NativeStackHeaderItemMenuAction as NativeStackHeaderItemMenuActionProps,
4
+ NativeStackHeaderItemMenu as NativeStackHeaderItemMenuProps,
5
+ NativeStackNavigationOptions as NativeStackProps,
6
+ } from "expo-router/build/react-navigation/native-stack";
7
+ import type { NativeTabs } from "expo-router/unstable-native-tabs";
8
+
9
+ declare module "expo-router/react-navigation" {
10
+ interface NativeStackNavigationOptions extends NativeStackProps {}
11
+ interface NativeStackHeaderItemButton
12
+ extends NativeStackHeaderItemButtonProps {}
13
+ interface NativeStackHeaderItemMenu extends NativeStackHeaderItemMenuProps {}
14
+ interface NativeStackHeaderItemMenuAction
15
+ extends NativeStackHeaderItemMenuActionProps {}
16
+ }
17
+
18
+ export interface NativeTabIcon
19
+ extends Extract<
20
+ Extract<
21
+ React.ComponentProps<typeof NativeTabs.Trigger.Icon>,
22
+ {
23
+ md: unknown;
24
+ }
25
+ >,
26
+ {
27
+ sf?: unknown;
28
+ }
29
+ > {}
@@ -0,0 +1,50 @@
1
+ export interface I18nConfig {
2
+ Locale: never;
3
+ Translation: never;
4
+ }
5
+
6
+ type Locale = I18nConfig["Locale"];
7
+ type Translation = I18nConfig["Translation"];
8
+
9
+ /**
10
+ * Custom type configuration used to enable fully type-safe i18next translations.
11
+ *
12
+ * Consumers should augment the configuration interface exposed by this package
13
+ * to provide their application's `Locale` and `Translation` types.
14
+ *
15
+ * Ensure this declaration is included by the TypeScript compiler (typically via
16
+ * a `.d.ts` file in your project).
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import type { resources } from "./i18n";
21
+ *
22
+ * declare module "@gescat/i18n/config" {
23
+ * interface I18nConfig {
24
+ * Locale: "it" | "en";
25
+ * Translation: typeof resources;
26
+ * }
27
+ * }
28
+ * ```
29
+ *
30
+ * @see https://www.i18next.com/overview/typescript
31
+ */
32
+ export interface CustomI18NTypeOptions {
33
+ enableSelector: false;
34
+ defaultNS: keyof Translation;
35
+ resources: Translation;
36
+ lng: Locale | undefined;
37
+ fallbackLng: Locale | undefined;
38
+ }
39
+
40
+ /**
41
+ * Sovrascrizione interfaccia del pacchetto i18next
42
+ */
43
+ declare module "i18next" {
44
+ interface CustomTypeOptions extends CustomI18NTypeOptions {}
45
+ interface i18n {
46
+ language: Locale;
47
+ languages: Locale[];
48
+ resolvedLanguage?: Locale;
49
+ }
50
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="nativewind/types" />
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "allowUnreachableCode": false,
6
+ "allowUnusedLabels": false,
7
+ "alwaysStrict": true,
8
+ "checkJs": false,
9
+ "composite": true,
10
+ "disableReferencedProjectLoad": false,
11
+ "disableSizeLimit": true,
12
+ "disableSolutionSearching": false,
13
+ "disableSourceOfProjectReferenceRedirect": false,
14
+ "erasableSyntaxOnly": true,
15
+ "exactOptionalPropertyTypes": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "maxNodeModuleJsDepth": 10,
18
+ "target": "ESNext",
19
+ "module": "ESNext",
20
+ "lib": ["ESNext"],
21
+ "moduleResolution": "bundler",
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noImplicitAny": true,
24
+ "noImplicitOverride": true,
25
+ "noImplicitReturns": true,
26
+ "noImplicitThis": true,
27
+ "noImplicitUseStrict": false,
28
+ "noPropertyAccessFromIndexSignature": true,
29
+ "noStrictGenericChecks": false,
30
+ "noUncheckedIndexedAccess": true,
31
+ "noUnusedLocals": true,
32
+ "noUnusedParameters": true,
33
+ "resolveJsonModule": true,
34
+ "strict": true,
35
+ "strictBindCallApply": true,
36
+ "strictFunctionTypes": true,
37
+ "strictNullChecks": true,
38
+ "strictPropertyInitialization": true,
39
+ "suppressExcessPropertyErrors": false,
40
+ "suppressImplicitAnyIndexErrors": false,
41
+ "useUnknownInCatchVariables": true
42
+ },
43
+ "typeAcquisition": {
44
+ "enable": true
45
+ }
46
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base",
4
+ "compilerOptions": {
5
+ "composite": false,
6
+ "declaration": true,
7
+ "allowImportingTsExtensions": true,
8
+ "noEmit": true,
9
+ "isolatedDeclarations": true,
10
+ "allowJs": false,
11
+ "types": ["@types/node", "@types/bun"]
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": [
4
+ "@react-native/typescript-config",
5
+ "expo/tsconfig.base",
6
+ "./base.json"
7
+ ],
8
+ "compilerOptions": {
9
+ "moduleResolution": "bundler",
10
+ "types": ["nativewind/types", "@padosoft/config/types/css"],
11
+ "checkJs": true
12
+ }
13
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx",
5
+ "jsxImportSource": "hono/jsx",
6
+ "moduleResolution": "Bundler",
7
+ "skipLibCheck": true
8
+ },
9
+ "extends": "./base"
10
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./src/typescript/compiler",
4
+ "compilerOptions": {
5
+ "moduleResolution": "nodenext",
6
+ "module": "nodenext"
7
+ },
8
+ "exclude": ["dist"]
9
+ }
@@ -0,0 +1,47 @@
1
+ import { readdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import type { UserConfigFn } from "tsdown";
5
+ import { tsdown } from "./src/compiler/tsdown.ts";
6
+ import { defaultCustomExports } from "./src/compiler/utils/index.ts";
7
+
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+
10
+ const assetsDirs = ["typescript", "tools"];
11
+ const assetsExts = ["json"];
12
+
13
+ const config: UserConfigFn = tsdown({
14
+ entry: ["src/**/*.ts"],
15
+ deps: {
16
+ neverBundle: ["tsdown", "rolldown"],
17
+ },
18
+ exports: {
19
+ customExports: async (exports, context) => {
20
+ const assetExports: Record<string, string> = {
21
+ ...exports,
22
+ };
23
+
24
+ for (const dir of assetsDirs) {
25
+ const absDir = path.join(__dirname, "src", dir);
26
+ const files = await readdir(absDir);
27
+
28
+ for (const file of files) {
29
+ const ext = path.extname(file).slice(1);
30
+ console.log(path.extname(file), ext);
31
+
32
+ if (!assetsExts.includes(ext)) continue;
33
+
34
+ const base = path.basename(file, `.${ext}`);
35
+ const relPath = `./${dir}/${base}`;
36
+ const fullRelPath = `./src/${dir}/${file}`;
37
+
38
+ assetExports[relPath] = fullRelPath;
39
+ }
40
+ }
41
+
42
+ return await defaultCustomExports(assetExports, context);
43
+ },
44
+ },
45
+ });
46
+
47
+ export default config;