@vitavision/config-ts 0.1.0
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/package.json +19 -0
- package/tsconfig.json +24 -0
- package/tsconfig.lib.json +9 -0
- package/tsdown.d.ts +4 -0
- package/tsdown.js +24 -0
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vitavision/config-ts",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared TypeScript compiler options and tsdown library preset for vitavision frontends.",
|
|
5
|
+
"license": "MIT OR Apache-2.0",
|
|
6
|
+
"repository": { "type": "git", "url": "git+https://github.com/VitalyVorobyev/lab-ui.git", "directory": "packages/config/ts" },
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"files": ["tsconfig.json", "tsconfig.lib.json", "tsdown.js", "tsdown.d.ts"],
|
|
10
|
+
"exports": {
|
|
11
|
+
"./tsconfig.json": "./tsconfig.json",
|
|
12
|
+
"./tsconfig.lib.json": "./tsconfig.lib.json",
|
|
13
|
+
"./tsdown": { "types": "./tsdown.d.ts", "default": "./tsdown.js" },
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": { "access": "public" },
|
|
17
|
+
"peerDependencies": { "typescript": "^6.0.3", "tsdown": "0.23.0" },
|
|
18
|
+
"peerDependenciesMeta": { "tsdown": { "optional": true } }
|
|
19
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
// The compiler options every vitavision frontend shares (PLAN §3, ADR-0002).
|
|
3
|
+
// An app extends this and adds its own `include`; a library extends tsconfig.lib.json.
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"jsx": "react-jsx",
|
|
10
|
+
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noUncheckedIndexedAccess": true,
|
|
13
|
+
"exactOptionalPropertyTypes": true,
|
|
14
|
+
"noUnusedLocals": true,
|
|
15
|
+
"noUnusedParameters": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"verbatimModuleSyntax": true,
|
|
20
|
+
"moduleDetection": "force",
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"noEmit": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
// A package in this monorepo. `@vitavision/source` makes a sibling package resolve to its
|
|
3
|
+
// `src/` (see each package's `exports`), so typechecking needs no prior build.
|
|
4
|
+
"extends": "./tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"customConditions": ["@vitavision/source"],
|
|
7
|
+
"declaration": true
|
|
8
|
+
}
|
|
9
|
+
}
|
package/tsdown.d.ts
ADDED
package/tsdown.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
/**
|
|
3
|
+
* The build every `@vitavision/*` library shares: one ESM entry, bundled declarations,
|
|
4
|
+
* dependencies and peers left external (tsdown's default).
|
|
5
|
+
*
|
|
6
|
+
* `styles.css` is not built: it is Tailwind v4 *source*, compiled by the consumer, and is
|
|
7
|
+
* exported straight from `src/` (which ships), so the workspace needs no build to use it.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @param {import("tsdown").UserConfig} [overrides] */
|
|
11
|
+
export function library(overrides = {}) {
|
|
12
|
+
/** @type {import("tsdown").UserConfig} */
|
|
13
|
+
const config = {
|
|
14
|
+
entry: ["src/index.ts"],
|
|
15
|
+
format: "esm",
|
|
16
|
+
platform: "neutral",
|
|
17
|
+
target: "es2022",
|
|
18
|
+
dts: true,
|
|
19
|
+
sourcemap: true,
|
|
20
|
+
clean: true,
|
|
21
|
+
...overrides,
|
|
22
|
+
};
|
|
23
|
+
return config;
|
|
24
|
+
}
|