@padosoft/config 1.2.2 → 1.3.1
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.
- package/README.md +77 -18
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +2 -0
- package/dist/compiler/tsdown.mjs +1 -1
- package/dist/compiler/utils/exports.d.mts +1 -5
- package/dist/compiler/utils/exports.mjs +1 -1
- package/dist/compiler/utils/index.d.mts +1 -1
- package/dist/compiler/utils/index.mjs +1 -1
- package/dist/exports-Cp7dWSTV.mjs +1 -0
- package/dist/exports-FMOinUbl.d.mts +6 -0
- package/package.json +76 -57
- package/src/cli/index.ts +99 -0
- package/src/compiler/plugins/hono-zod.ts +21 -21
- package/src/compiler/tsdown.ts +33 -33
- package/src/compiler/utils/exports.ts +47 -47
- package/src/compiler/utils/index.ts +1 -1
- package/src/editor/vscode/settings.json +41 -0
- package/src/editor/zed/settings.json +81 -0
- package/src/tools/biome.json +2 -2
- package/src/types/css.ts +9 -9
- package/src/types/expo-router.ts +29 -29
- package/src/types/i18next.ts +50 -50
- package/src/types/nativewind.ts +1 -1
- package/.turbo/turbo-build.log +0 -50
- package/CHANGELOG.md +0 -81
- package/tsconfig.json +0 -9
- package/tsdown.config.ts +0 -47
package/README.md
CHANGED
|
@@ -1,18 +1,77 @@
|
|
|
1
|
-
# @
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
# @padosoft/config
|
|
2
|
+
|
|
3
|
+
Shared TypeScript, Biome, and tsdown configurations for padosoft packages and apps.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -D @padosoft/config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Contents
|
|
12
|
+
|
|
13
|
+
### TypeScript configs
|
|
14
|
+
|
|
15
|
+
Extend any of these base configs in your `tsconfig.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{ "extends": "@padosoft/config/typescript/base" }
|
|
19
|
+
{ "extends": "@padosoft/config/typescript/compiler" }
|
|
20
|
+
{ "extends": "@padosoft/config/typescript/expo" }
|
|
21
|
+
{ "extends": "@padosoft/config/typescript/hono" }
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Biome config
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{ "extends": ["@padosoft/config/tools/biome"] }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### tsdown config factory
|
|
31
|
+
|
|
32
|
+
Use the `tsdown` helper to get a consistent bundler setup across packages:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// tsdown.config.ts
|
|
36
|
+
import { tsdown } from "@padosoft/config/compiler/tsdown";
|
|
37
|
+
|
|
38
|
+
export default tsdown({
|
|
39
|
+
entry: ["src/index.ts"],
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The factory sets `dts: true`, `splitting: false`, `treeshake: true`, minification outside watch mode, and `outDir: "dist"` by default.
|
|
44
|
+
|
|
45
|
+
### Compiler plugins
|
|
46
|
+
|
|
47
|
+
#### `hono-zod`
|
|
48
|
+
|
|
49
|
+
A tsdown plugin that handles the hono/zod integration for type generation:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { tsdown } from "@padosoft/config/compiler/tsdown";
|
|
53
|
+
import { honoZodPlugin } from "@padosoft/config/compiler/plugins/hono-zod";
|
|
54
|
+
|
|
55
|
+
export default tsdown({
|
|
56
|
+
plugins: [honoZodPlugin()],
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### TypeScript type declarations
|
|
61
|
+
|
|
62
|
+
Import ambient declarations for CSS modules, NativeWind, Expo Router, and i18next:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// In your tsconfig.json types array or a .d.ts file:
|
|
66
|
+
import "@padosoft/config/types/css";
|
|
67
|
+
import "@padosoft/config/types/nativewind";
|
|
68
|
+
import "@padosoft/config/types/expo-router";
|
|
69
|
+
import "@padosoft/config/types/i18next";
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Export utilities
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { defaultCustomExports } from "@padosoft/config/compiler/utils/exports";
|
|
76
|
+
import { /* helpers */ } from "@padosoft/config/compiler/utils";
|
|
77
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{existsSync as e}from"node:fs";import{copyFile as t,mkdir as n,writeFile as r}from"node:fs/promises";import{dirname as i,join as a}from"node:path";import{fileURLToPath as o}from"node:url";import{parseArgs as s}from"node:util";const c=i(o(import.meta.url)),{values:l,positionals:u}=s({args:process.argv.slice(2),options:{force:{type:`boolean`,short:`f`,default:!1},preset:{type:`string`,default:`base`}},allowPositionals:!0}),[d,f]=u,p=l.force,m=l.preset,h=[`base`,`compiler`,`expo`,`hono`];async function g(n,r,i){if(e(r)&&!p){console.log(` skip ${i}`);return}await t(n,r),console.log(` write ${i}`)}async function _(t,n,i){if(e(n)&&!p){console.log(` skip ${i}`);return}await r(n,t,`utf8`),console.log(` write ${i}`)}function v(){console.log(`Usage:`),console.log(` bunx @padosoft/config init editor [--force]`),console.log(` bunx @padosoft/config init biome [--force]`),console.log(` bunx @padosoft/config init tsconfig [--preset base|compiler|expo|hono] [--force]`)}d!==`init`&&(v(),process.exit(1));const y=process.cwd();if(f===`editor`){let e=a(c,`../../src/editor`);await n(a(y,`.vscode`),{recursive:!0}),await g(a(e,`vscode/settings.json`),a(y,`.vscode/settings.json`),`.vscode/settings.json`),await n(a(y,`.zed`),{recursive:!0}),await g(a(e,`zed/settings.json`),a(y,`.zed/settings.json`),`.zed/settings.json`)}else f===`biome`?await _(`${JSON.stringify({$schema:`https://biomejs.dev/schemas/2.5.1/schema.json`,extends:[`@padosoft/config/tools/biome`]},null,` `)}\n`,a(y,`biome.json`),`biome.json`):f===`tsconfig`?(h.includes(m)||(console.error(`Unknown preset "${m}" — valid: ${h.join(`, `)}`),process.exit(1)),await _(`${JSON.stringify({extends:`@padosoft/config/typescript/${m}`},null,` `)}\n`,a(y,`tsconfig.json`),`tsconfig.json`)):(v(),process.exit(1));export{};
|
package/dist/compiler/tsdown.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"../exports-Cp7dWSTV.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};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/compiler/utils/exports.d.ts
|
|
4
|
-
declare const defaultCustomExports: Extract<NonNullable<ExportsOptions["customExports"]>, (...args: never) => unknown>;
|
|
5
|
-
//#endregion
|
|
1
|
+
import { t as defaultCustomExports } from "../../exports-FMOinUbl.mjs";
|
|
6
2
|
export { defaultCustomExports };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{t as e}from"../../exports-Cp7dWSTV.mjs";export{e as defaultCustomExports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { defaultCustomExports } from "
|
|
1
|
+
import { t as defaultCustomExports } from "../../exports-FMOinUbl.mjs";
|
|
2
2
|
export { defaultCustomExports };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"../../exports-Cp7dWSTV.mjs";export{e as 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 t};
|
package/package.json
CHANGED
|
@@ -1,57 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@padosoft/config",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"./
|
|
34
|
-
"default": "./dist/
|
|
35
|
-
"types": "./dist/
|
|
36
|
-
},
|
|
37
|
-
"./
|
|
38
|
-
"default": "./dist/
|
|
39
|
-
"types": "./dist/
|
|
40
|
-
},
|
|
41
|
-
"./
|
|
42
|
-
"default": "./dist/
|
|
43
|
-
"types": "./dist/
|
|
44
|
-
},
|
|
45
|
-
"./
|
|
46
|
-
"default": "./dist/
|
|
47
|
-
"types": "./dist/
|
|
48
|
-
},
|
|
49
|
-
"./
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"./
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@padosoft/config",
|
|
3
|
+
"description": "Shared TypeScript, Biome, and tsdown configurations for padosoft packages and apps",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"typescript",
|
|
6
|
+
"tsconfig",
|
|
7
|
+
"biome",
|
|
8
|
+
"tsdown",
|
|
9
|
+
"config",
|
|
10
|
+
"padosoft"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"version": "1.3.1",
|
|
14
|
+
"repository": {
|
|
15
|
+
"url": "git+https://github.com/padosoft/ts-support.git"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsdown",
|
|
23
|
+
"ts:check": "tsc --noEmit"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"src"
|
|
28
|
+
],
|
|
29
|
+
"bin": {
|
|
30
|
+
"padosoft-config": "./dist/cli/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
"exports": {
|
|
33
|
+
"./cli": {
|
|
34
|
+
"default": "./dist/cli/index.mjs",
|
|
35
|
+
"types": "./dist/cli/index.d.mts"
|
|
36
|
+
},
|
|
37
|
+
"./compiler/plugins/hono-zod": {
|
|
38
|
+
"default": "./dist/compiler/plugins/hono-zod.mjs",
|
|
39
|
+
"types": "./dist/compiler/plugins/hono-zod.d.mts"
|
|
40
|
+
},
|
|
41
|
+
"./compiler/tsdown": {
|
|
42
|
+
"default": "./dist/compiler/tsdown.mjs",
|
|
43
|
+
"types": "./dist/compiler/tsdown.d.mts"
|
|
44
|
+
},
|
|
45
|
+
"./compiler/utils": {
|
|
46
|
+
"default": "./dist/compiler/utils/index.mjs",
|
|
47
|
+
"types": "./dist/compiler/utils/index.d.mts"
|
|
48
|
+
},
|
|
49
|
+
"./compiler/utils/exports": {
|
|
50
|
+
"default": "./dist/compiler/utils/exports.mjs",
|
|
51
|
+
"types": "./dist/compiler/utils/exports.d.mts"
|
|
52
|
+
},
|
|
53
|
+
"./types/css": {
|
|
54
|
+
"default": "./dist/types/css.mjs",
|
|
55
|
+
"types": "./dist/types/css.d.mts"
|
|
56
|
+
},
|
|
57
|
+
"./types/expo-router": {
|
|
58
|
+
"default": "./dist/types/expo-router.mjs",
|
|
59
|
+
"types": "./dist/types/expo-router.d.mts"
|
|
60
|
+
},
|
|
61
|
+
"./types/i18next": {
|
|
62
|
+
"default": "./dist/types/i18next.mjs",
|
|
63
|
+
"types": "./dist/types/i18next.d.mts"
|
|
64
|
+
},
|
|
65
|
+
"./types/nativewind": {
|
|
66
|
+
"default": "./dist/types/nativewind.mjs",
|
|
67
|
+
"types": "./dist/types/nativewind.d.mts"
|
|
68
|
+
},
|
|
69
|
+
"./package.json": "./package.json",
|
|
70
|
+
"./typescript/base": "./src/typescript/base.json",
|
|
71
|
+
"./typescript/compiler": "./src/typescript/compiler.json",
|
|
72
|
+
"./typescript/expo": "./src/typescript/expo.json",
|
|
73
|
+
"./typescript/hono": "./src/typescript/hono.json",
|
|
74
|
+
"./tools/biome": "./src/tools/biome.json"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/cli/index.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { copyFile, mkdir, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { parseArgs } from "node:util";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
|
|
10
|
+
const { values, positionals } = parseArgs({
|
|
11
|
+
args: process.argv.slice(2),
|
|
12
|
+
options: {
|
|
13
|
+
force: { type: "boolean", short: "f", default: false },
|
|
14
|
+
preset: { type: "string", default: "base" },
|
|
15
|
+
},
|
|
16
|
+
allowPositionals: true,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const [command, subcommand] = positionals;
|
|
20
|
+
const force = values.force as boolean;
|
|
21
|
+
const preset = values.preset as string;
|
|
22
|
+
|
|
23
|
+
const TSCONFIG_PRESETS = ["base", "compiler", "expo", "hono"] as const;
|
|
24
|
+
type TsconfigPreset = (typeof TSCONFIG_PRESETS)[number];
|
|
25
|
+
|
|
26
|
+
async function copyIfNeeded(src: string, dest: string, label: string) {
|
|
27
|
+
if (existsSync(dest) && !force) {
|
|
28
|
+
console.log(` skip ${label}`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
await copyFile(src, dest);
|
|
32
|
+
console.log(` write ${label}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function writeIfNeeded(content: string, dest: string, label: string) {
|
|
36
|
+
if (existsSync(dest) && !force) {
|
|
37
|
+
console.log(` skip ${label}`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
await writeFile(dest, content, "utf8");
|
|
41
|
+
console.log(` write ${label}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function usage() {
|
|
45
|
+
console.log("Usage:");
|
|
46
|
+
console.log(" bunx @padosoft/config init editor [--force]");
|
|
47
|
+
console.log(" bunx @padosoft/config init biome [--force]");
|
|
48
|
+
console.log(
|
|
49
|
+
" bunx @padosoft/config init tsconfig [--preset base|compiler|expo|hono] [--force]",
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (command !== "init") {
|
|
54
|
+
usage();
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const cwd = process.cwd();
|
|
59
|
+
|
|
60
|
+
if (subcommand === "editor") {
|
|
61
|
+
const editorDir = join(__dirname, "../../src/editor");
|
|
62
|
+
|
|
63
|
+
await mkdir(join(cwd, ".vscode"), { recursive: true });
|
|
64
|
+
await copyIfNeeded(
|
|
65
|
+
join(editorDir, "vscode/settings.json"),
|
|
66
|
+
join(cwd, ".vscode/settings.json"),
|
|
67
|
+
".vscode/settings.json",
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
await mkdir(join(cwd, ".zed"), { recursive: true });
|
|
71
|
+
await copyIfNeeded(
|
|
72
|
+
join(editorDir, "zed/settings.json"),
|
|
73
|
+
join(cwd, ".zed/settings.json"),
|
|
74
|
+
".zed/settings.json",
|
|
75
|
+
);
|
|
76
|
+
} else if (subcommand === "biome") {
|
|
77
|
+
const config = {
|
|
78
|
+
$schema: "https://biomejs.dev/schemas/2.5.1/schema.json",
|
|
79
|
+
extends: ["@padosoft/config/tools/biome"],
|
|
80
|
+
};
|
|
81
|
+
await writeIfNeeded(
|
|
82
|
+
`${JSON.stringify(config, null, "\t")}\n`,
|
|
83
|
+
join(cwd, "biome.json"),
|
|
84
|
+
"biome.json",
|
|
85
|
+
);
|
|
86
|
+
} else if (subcommand === "tsconfig") {
|
|
87
|
+
if (!TSCONFIG_PRESETS.includes(preset as TsconfigPreset)) {
|
|
88
|
+
console.error(`Unknown preset "${preset}" — valid: ${TSCONFIG_PRESETS.join(", ")}`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
await writeIfNeeded(
|
|
92
|
+
`${JSON.stringify({ extends: `@padosoft/config/typescript/${preset}` }, null, "\t")}\n`,
|
|
93
|
+
join(cwd, "tsconfig.json"),
|
|
94
|
+
"tsconfig.json",
|
|
95
|
+
);
|
|
96
|
+
} else {
|
|
97
|
+
usage();
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
@@ -1,21 +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;
|
|
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;
|
package/src/compiler/tsdown.ts
CHANGED
|
@@ -1,33 +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
|
-
};
|
|
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
|
+
};
|
|
@@ -1,47 +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
|
-
};
|
|
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
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./exports.ts";
|
|
1
|
+
export * from "./exports.ts";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[javascript]": {
|
|
3
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
4
|
+
},
|
|
5
|
+
"[javascriptreact]": {
|
|
6
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
7
|
+
},
|
|
8
|
+
"[typescript]": {
|
|
9
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
10
|
+
},
|
|
11
|
+
"[typescriptreact]": {
|
|
12
|
+
"editor.defaultFormatter": "biomejs.biome"
|
|
13
|
+
},
|
|
14
|
+
"editor.codeActionsOnSave": {
|
|
15
|
+
"source.fixAll.biome": "explicit",
|
|
16
|
+
"source.organizeImports.biome": "explicit",
|
|
17
|
+
"source.sortMembers": "explicit"
|
|
18
|
+
},
|
|
19
|
+
"editor.defaultFormatter": "biomejs.biome",
|
|
20
|
+
"editor.formatOnSave": true,
|
|
21
|
+
"js/ts.preferences.autoImportSpecifierExcludeRegexes": [
|
|
22
|
+
"^react-native-reanimated/lib/*",
|
|
23
|
+
"^expo-router/build/*"
|
|
24
|
+
],
|
|
25
|
+
"js/ts.preferences.preferTypeOnlyAutoImports": true,
|
|
26
|
+
"js/ts.tsdk.path": "node_modules\\typescript\\lib",
|
|
27
|
+
"json.schemaDownload.trustedDomains": {
|
|
28
|
+
"https://schemastore.azurewebsites.net/": true,
|
|
29
|
+
"https://raw.githubusercontent.com/microsoft/vscode/": true,
|
|
30
|
+
"https://raw.githubusercontent.com/devcontainers/spec/": true,
|
|
31
|
+
"https://www.schemastore.org/": true,
|
|
32
|
+
"https://json.schemastore.org/": true,
|
|
33
|
+
"https://json-schema.org/": true,
|
|
34
|
+
"https://developer.microsoft.com/json-schemas/": true,
|
|
35
|
+
"https://raw.githubusercontent.com/": true,
|
|
36
|
+
"https://biomejs.dev": true,
|
|
37
|
+
"https://turbo.build": true,
|
|
38
|
+
"https://nitro.margelo.com": true,
|
|
39
|
+
"https://unpkg.com": true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"code_actions_on_format": {
|
|
3
|
+
"source.fixAll.biome": true,
|
|
4
|
+
"source.organizeImports.biome": true
|
|
5
|
+
},
|
|
6
|
+
"formatter": {
|
|
7
|
+
"language_server": {
|
|
8
|
+
"name": "biome"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"language_servers": ["biome", "..."],
|
|
12
|
+
"languages": {
|
|
13
|
+
"CSS": {
|
|
14
|
+
"formatter": {
|
|
15
|
+
"language_server": {
|
|
16
|
+
"name": "biome"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"GraphQL": {
|
|
21
|
+
"formatter": {
|
|
22
|
+
"language_server": {
|
|
23
|
+
"name": "biome"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"JavaScript": {
|
|
28
|
+
"formatter": {
|
|
29
|
+
"language_server": {
|
|
30
|
+
"name": "biome"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"JSON": {
|
|
35
|
+
"formatter": {
|
|
36
|
+
"language_server": {
|
|
37
|
+
"name": "biome"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"JSONC": {
|
|
42
|
+
"formatter": {
|
|
43
|
+
"language_server": {
|
|
44
|
+
"name": "biome"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"JSX": {
|
|
49
|
+
"formatter": {
|
|
50
|
+
"language_server": {
|
|
51
|
+
"name": "biome"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"TSX": {
|
|
56
|
+
"formatter": {
|
|
57
|
+
"language_server": {
|
|
58
|
+
"name": "biome"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"TypeScript": {
|
|
63
|
+
"formatter": {
|
|
64
|
+
"language_server": {
|
|
65
|
+
"name": "biome"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"lsp": {
|
|
71
|
+
"biome": {
|
|
72
|
+
"settings": {
|
|
73
|
+
"require_config_file": true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"telemetry": {
|
|
78
|
+
"diagnostics": false,
|
|
79
|
+
"metrics": false
|
|
80
|
+
}
|
|
81
|
+
}
|
package/src/tools/biome.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.1/schema.json",
|
|
3
3
|
"assist": {
|
|
4
4
|
"actions": {
|
|
5
5
|
"source": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"correctness": {
|
|
33
33
|
"noUnusedImports": "warn"
|
|
34
34
|
},
|
|
35
|
-
"
|
|
35
|
+
"preset": "recommended",
|
|
36
36
|
"style": {
|
|
37
37
|
"noInferrableTypes": "error",
|
|
38
38
|
"noParameterAssign": "error",
|
package/src/types/css.ts
CHANGED
|
@@ -1,9 +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
|
-
}
|
|
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
|
+
}
|
package/src/types/expo-router.ts
CHANGED
|
@@ -1,29 +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
|
-
> {}
|
|
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
|
+
> {}
|
package/src/types/i18next.ts
CHANGED
|
@@ -1,50 +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
|
-
}
|
|
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
|
+
}
|
package/src/types/nativewind.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="nativewind/types" />
|
|
1
|
+
/// <reference types="nativewind/types" />
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
[6n[m]0;C:\Users\PADO\.bun\bin\bun.exe[?25h[35m$[m [1m[97mtsdown
|
|
2
|
-
[m[34mℹ[m [34mtsdown v0.22.3[m powered by [38;2;255;126;23mrolldown v1.1.1
|
|
3
|
-
[m[34mℹ[m config file: [4mC:\Users\PADO\github\ts-support\packages
|
|
4
|
-
\config\tsdown.config.ts[24m [K
|
|
5
|
-
[34mℹ[m entry: [34msrc\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[m [34m
|
|
9
|
-
ℹ[m tsconfig: [34mtsconfig.json[m[K[34m
|
|
10
|
-
ℹ[m Build start[K[34m
|
|
11
|
-
ℹ[m Cleaning 21 files[K
|
|
12
|
-
[34mℹ[m dist\[1m[97mcompiler\utils\exports.mjs[m 0.44 kB │ gzip:
|
|
13
|
-
0.27 kB[K
|
|
14
|
-
[34mℹ[m dist\[1m[97mcompiler\tsdown.mjs[m 0.35 kB │ gzip:
|
|
15
|
-
0.25 kB[K[34m
|
|
16
|
-
ℹ[m dist\[1m[97mcompiler\plugins\hono-zod.mjs[m 0.24 kB │ gzip:
|
|
17
|
-
0.19 kB[K[34m
|
|
18
|
-
ℹ[m dist\[1m[97mcompiler\utils\index.mjs[m 0.09 kB │ gzip:
|
|
19
|
-
0.08 kB[K[34m
|
|
20
|
-
ℹ[m dist\[1m[97mtypes\css.mjs[m 0.01 kB │ gzip:
|
|
21
|
-
0.03 kB[K[34m
|
|
22
|
-
ℹ[m dist\[1m[97mtypes\expo-router.mjs[m 0.01 kB │ gzip:
|
|
23
|
-
0.03 kB[K[34m
|
|
24
|
-
ℹ[m dist\[1m[97mtypes\i18next.mjs[m 0.01 kB │ gzip:
|
|
25
|
-
0.03 kB[K[34m
|
|
26
|
-
ℹ[m dist\[1m[97mtypes\nativewind.mjs[m 0.01 kB │ gzip:
|
|
27
|
-
0.03 kB[K[34m
|
|
28
|
-
ℹ[m dist\[1m[92mtypes\i18next.d.mts[m 1.29 kB │ gzip:
|
|
29
|
-
0.62 kB[K[34m
|
|
30
|
-
ℹ[m dist\[1m[92mtypes\expo-router.d.mts[m 0.84 kB │ gzip:
|
|
31
|
-
0.32 kB[K[34m
|
|
32
|
-
ℹ[m dist\[1m[92mcompiler\utils\exports.d.mts[m 0.25 kB │ gzip:
|
|
33
|
-
0.19 kB[K[34m
|
|
34
|
-
ℹ[m dist\[1m[92mtypes\css.d.mts[m 0.23 kB │ gzip:
|
|
35
|
-
0.15 kB[K[34m
|
|
36
|
-
ℹ[m dist\[1m[92mcompiler\plugins\hono-zod.d.mts[m 0.20 kB │ gzip:
|
|
37
|
-
0.15 kB[K[34m
|
|
38
|
-
ℹ[m dist\[1m[92mcompiler\tsdown.d.mts[m 0.19 kB │ gzip:
|
|
39
|
-
0.15 kB[K[34m
|
|
40
|
-
ℹ[m dist\[1m[92mcompiler\utils\index.d.mts[m 0.09 kB │ gzip:
|
|
41
|
-
0.07 kB[K[34m
|
|
42
|
-
ℹ[m dist\[1m[92mtypes\nativewind.d.mts[m 0.01 kB │ gzip:
|
|
43
|
-
0.03 kB[K[34m
|
|
44
|
-
ℹ[m 16 files, total: 4.24 kB[K[32m
|
|
45
|
-
✔[m Build complete in [32m83ms[m[K
|
|
46
|
-
.json json[K
|
|
47
|
-
.json json[K
|
|
48
|
-
.json json[K
|
|
49
|
-
.json json[K
|
|
50
|
-
.json json[K
|
package/CHANGELOG.md
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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/tsconfig.json
DELETED
package/tsdown.config.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
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;
|