From b64680feef600cb0d2d5c4c29dc0581d473b77fc Mon Sep 17 00:00:00 2001 From: Lubos Date: Wed, 21 Jan 2026 04:27:45 +0800 Subject: [PATCH] refactor: move shared utility types into a separate package --- packages/codegen-core/package.json | 1 + packages/codegen-core/src/log.ts | 13 +- packages/codegen-core/tsdown.config.ts | 1 + packages/openapi-python/.gitignore | 14 ++ packages/openapi-python/LICENSE.md | 21 +++ packages/openapi-python/README.md | 5 + packages/openapi-python/package.json | 99 +++++++++++ .../src/__tests__/index.test.ts | 156 ++++++++++++++++++ packages/openapi-python/src/cli.ts | 120 ++++++++++++++ packages/openapi-python/src/config/types.d.ts | 71 ++++++++ packages/openapi-python/src/index.ts | 120 ++++++++++++++ packages/openapi-python/src/run.ts | 5 + packages/openapi-python/tsconfig.base.json | 20 +++ packages/openapi-python/tsconfig.json | 10 ++ packages/openapi-python/tsdown.config.ts | 26 +++ packages/openapi-python/turbo.json | 10 ++ packages/openapi-python/vitest.config.ts | 16 ++ packages/openapi-ts/.gitignore | 2 - packages/openapi-ts/package.json | 1 + packages/openapi-ts/src/config/init.ts | 2 +- .../src/config/output/source/types.d.ts | 2 +- .../openapi-ts/src/config/output/types.d.ts | 2 +- packages/openapi-ts/src/generate.ts | 3 +- packages/openapi-ts/src/index.ts | 2 +- packages/openapi-ts/src/ir/intents.ts | 3 +- .../types/json-schema-draft-2020-12.d.ts | 3 +- .../src/plugins/zod/resolvers/types.d.ts | 2 +- packages/openapi-ts/src/ts-dsl/base.ts | 12 -- .../openapi-ts/src/ts-dsl/decl/pattern.ts | 2 +- packages/openapi-ts/src/ts-dsl/layout/doc.ts | 2 +- packages/openapi-ts/src/ts-dsl/layout/hint.ts | 2 +- packages/openapi-ts/src/ts-dsl/layout/note.ts | 2 +- .../openapi-ts/src/ts-dsl/mixins/pattern.ts | 2 +- .../openapi-ts/src/ts-dsl/utils/context.ts | 3 +- .../openapi-ts/src/ts-dsl/utils/render.ts | 2 +- packages/openapi-ts/src/types/config.d.ts | 3 +- .../openapi-ts/src/utils/naming/types.d.ts | 2 +- packages/openapi-ts/tsconfig.base.json | 10 +- packages/openapi-ts/tsdown.config.ts | 1 + packages/types/package.json | 10 ++ .../types/utils.d.ts => types/src/index.ts} | 0 packages/types/tsconfig.json | 12 ++ pnpm-lock.yaml | 99 +++++++++-- tsconfig.base.json | 7 + 44 files changed, 835 insertions(+), 66 deletions(-) create mode 100644 packages/openapi-python/.gitignore create mode 100644 packages/openapi-python/LICENSE.md create mode 100644 packages/openapi-python/README.md create mode 100644 packages/openapi-python/package.json create mode 100644 packages/openapi-python/src/__tests__/index.test.ts create mode 100644 packages/openapi-python/src/cli.ts create mode 100644 packages/openapi-python/src/config/types.d.ts create mode 100644 packages/openapi-python/src/index.ts create mode 100644 packages/openapi-python/src/run.ts create mode 100644 packages/openapi-python/tsconfig.base.json create mode 100644 packages/openapi-python/tsconfig.json create mode 100644 packages/openapi-python/tsdown.config.ts create mode 100644 packages/openapi-python/turbo.json create mode 100644 packages/openapi-python/vitest.config.ts create mode 100644 packages/types/package.json rename packages/{openapi-ts/src/types/utils.d.ts => types/src/index.ts} (100%) create mode 100644 packages/types/tsconfig.json create mode 100644 tsconfig.base.json diff --git a/packages/codegen-core/package.json b/packages/codegen-core/package.json index cae9962b0..68366ca12 100644 --- a/packages/codegen-core/package.json +++ b/packages/codegen-core/package.json @@ -69,6 +69,7 @@ }, "devDependencies": { "@config/vite-base": "workspace:*", + "@hey-api/types": "workspace:*", "eslint": "9.39.1", "prettier": "3.4.2", "typescript": "5.9.3" diff --git a/packages/codegen-core/src/log.ts b/packages/codegen-core/src/log.ts index 95073f33f..cf4a3cd75 100644 --- a/packages/codegen-core/src/log.ts +++ b/packages/codegen-core/src/log.ts @@ -1,21 +1,10 @@ +import type { MaybeArray, MaybeFunc } from '@hey-api/types'; import colors from 'ansi-colors'; // @ts-expect-error import colorSupport from 'color-support'; colors.enabled = colorSupport().hasBasic; -/** - * Accepts a value or a readonly array of values of type T. - */ -export type MaybeArray = T | ReadonlyArray; - -/** - * Accepts a value or a function returning a value. - */ -export type MaybeFunc) => any> = - | T - | ReturnType; - const DEBUG_NAMESPACE = 'heyapi'; const NO_WARNINGS = /^(1|true|yes|on)$/i.test( diff --git a/packages/codegen-core/tsdown.config.ts b/packages/codegen-core/tsdown.config.ts index 0fb3c6b05..05c940aac 100644 --- a/packages/codegen-core/tsdown.config.ts +++ b/packages/codegen-core/tsdown.config.ts @@ -19,6 +19,7 @@ export default defineConfig({ entry: ['src/index.ts'], format: ['cjs', 'esm'], minify: false, + noExternal: ['@hey-api/types'], shims: false, sourcemap: true, treeshake: true, diff --git a/packages/openapi-python/.gitignore b/packages/openapi-python/.gitignore new file mode 100644 index 000000000..b9ebff088 --- /dev/null +++ b/packages/openapi-python/.gitignore @@ -0,0 +1,14 @@ +.DS_Store +.idea +.tsdown +.tmp +junit.xml +logs +node_modules +npm-debug.log* +temp + +*.iml +dist +coverage +.env diff --git a/packages/openapi-python/LICENSE.md b/packages/openapi-python/LICENSE.md new file mode 100644 index 000000000..6acd8004b --- /dev/null +++ b/packages/openapi-python/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Hey API + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/openapi-python/README.md b/packages/openapi-python/README.md new file mode 100644 index 000000000..9d7753901 --- /dev/null +++ b/packages/openapi-python/README.md @@ -0,0 +1,5 @@ +
+

OpenAPI Python

+
+ +Coming soon. diff --git a/packages/openapi-python/package.json b/packages/openapi-python/package.json new file mode 100644 index 000000000..cad8209f8 --- /dev/null +++ b/packages/openapi-python/package.json @@ -0,0 +1,99 @@ +{ + "name": "@hey-api/openapi-python", + "version": "0.0.1", + "private": true, + "description": "🐍 OpenAPI to Python codegen.", + "homepage": "https://heyapi.dev/", + "repository": { + "type": "git", + "url": "git+https://github.com/hey-api/openapi-ts.git" + }, + "bugs": { + "url": "https://github.com/hey-api/openapi-ts/issues" + }, + "license": "MIT", + "author": { + "email": "lubos@heyapi.dev", + "name": "Hey API", + "url": "https://heyapi.dev" + }, + "funding": "https://github.com/sponsors/hey-api", + "keywords": [ + "codegen", + "generator", + "http", + "javascript", + "json", + "node", + "openapi", + "python", + "rest", + "swagger", + "typescript", + "yaml" + ], + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.mts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "bin": { + "openapi-python": "./bin/run.js" + }, + "files": [ + "bin", + "dist", + "LICENSE.md", + "README.md" + ], + "scripts": { + "build": "tsdown && pnpm check-exports", + "check-exports": "attw --pack . --profile node16", + "dev": "tsdown --watch", + "prepublishOnly": "pnpm build", + "test:coverage": "vitest run --coverage", + "test:update": "vitest watch --update", + "test:watch": "vitest watch", + "test": "vitest run", + "typecheck": "tsc --noEmit" + }, + "engines": { + "node": ">=20.19.0" + }, + "dependencies": { + "@hey-api/codegen-core": "workspace:^0.5.2", + "@hey-api/json-schema-ref-parser": "1.2.2", + "ansi-colors": "4.1.3", + "c12": "3.3.3", + "color-support": "1.1.3", + "commander": "14.0.2", + "open": "11.0.0", + "semver": "7.7.3" + }, + "peerDependencies": { + "typescript": ">=5.5.3" + }, + "devDependencies": { + "@config/vite-base": "workspace:*", + "@hey-api/types": "workspace:*", + "@types/cross-spawn": "6.0.6", + "@types/semver": "7.7.1", + "cross-spawn": "7.0.6", + "eslint": "9.39.1", + "prettier": "3.4.2", + "typescript": "5.9.3", + "yaml": "2.8.2" + } +} diff --git a/packages/openapi-python/src/__tests__/index.test.ts b/packages/openapi-python/src/__tests__/index.test.ts new file mode 100644 index 000000000..7ed8101a6 --- /dev/null +++ b/packages/openapi-python/src/__tests__/index.test.ts @@ -0,0 +1,156 @@ +import { describe, expect, it } from 'vitest'; + +// import { createClient } from '~/index'; + +// type Config = Parameters[0]; + +describe('createClient', () => { + it('works', () => { + expect(true).toBe(true); + }); + // it('1 config, 1 input, 1 output', async () => { + // const config: Config = { + // dryRun: true, + // input: { + // info: { title: 'foo', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // logs: { + // level: 'silent', + // }, + // output: 'output', + // plugins: ['@hey-api/typescript'], + // }; + + // const results = await createClient(config); + // expect(results).toHaveLength(1); + // }); + + // it('1 config, 2 inputs, 1 output', async () => { + // const config: Config = { + // dryRun: true, + // input: [ + // { + // info: { title: 'foo', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // { + // info: { title: 'bar', version: '1.0.0' }, + // openapi: '3.0.0', + // paths: {}, + // }, + // ], + // logs: { + // level: 'silent', + // }, + // output: 'output', + // plugins: ['@hey-api/typescript'], + // }; + + // const results = await createClient(config); + // expect(results).toHaveLength(1); + // }); + + // it('1 config, 2 inputs, 2 outputs', async () => { + // const config: Config = { + // dryRun: true, + // input: [ + // { + // info: { title: 'foo', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // { + // info: { title: 'bar', version: '1.0.0' }, + // openapi: '3.0.0', + // paths: {}, + // }, + // ], + // logs: { + // level: 'silent', + // }, + // output: ['output', 'output2'], + // plugins: ['@hey-api/typescript'], + // }; + + // const results = await createClient(config); + // expect(results).toHaveLength(2); + // }); + + // it('2 configs, 1 input, 1 output', async () => { + // const config: Config = [ + // { + // dryRun: true, + // input: { + // info: { title: 'foo', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // logs: { + // level: 'silent', + // }, + // output: 'output', + // plugins: ['@hey-api/typescript'], + // }, + // { + // dryRun: true, + // input: { + // info: { title: 'bar', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // logs: { + // level: 'silent', + // }, + // output: 'output2', + // plugins: ['@hey-api/typescript'], + // }, + // ]; + + // const results = await createClient(config); + // expect(results).toHaveLength(2); + // }); + + // it('2 configs, 2 inputs, 2 outputs', async () => { + // const config: Config = [ + // { + // dryRun: true, + // input: [ + // { + // info: { title: 'foo', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // { + // info: { title: 'bar', version: '1.0.0' }, + // openapi: '3.0.0', + // paths: {}, + // }, + // ], + // logs: { + // level: 'silent', + // }, + // output: ['output', 'output2'], + // plugins: ['@hey-api/typescript'], + // }, + // { + // dryRun: true, + // input: [ + // { + // info: { title: 'baz', version: '1.0.0' }, + // openapi: '3.0.0', + // }, + // { + // info: { title: 'qux', version: '1.0.0' }, + // openapi: '3.0.0', + // paths: {}, + // }, + // ], + // logs: { + // level: 'silent', + // }, + // output: ['output3', 'output4'], + // plugins: ['@hey-api/typescript'], + // }, + // ]; + + // const results = await createClient(config); + // expect(results).toHaveLength(4); + // }); +}); diff --git a/packages/openapi-python/src/cli.ts b/packages/openapi-python/src/cli.ts new file mode 100644 index 000000000..dec41bd98 --- /dev/null +++ b/packages/openapi-python/src/cli.ts @@ -0,0 +1,120 @@ +import type { OptionValues } from 'commander'; +import { Command } from 'commander'; + +// import { createClient } from '~/index'; +import pkg from '../package.json' assert { type: 'json' }; + +const stringToBoolean = ( + value: string | undefined, +): boolean | string | undefined => { + if (value === 'true') return true; + if (value === 'false') return false; + return value; +}; + +const processParams = ( + obj: OptionValues, + booleanKeys: ReadonlyArray, +): OptionValues => { + for (const key of booleanKeys) { + const value = obj[key]; + if (typeof value === 'string') { + const parsedValue = stringToBoolean(value); + delete obj[key]; + obj[key] = parsedValue; + } + } + return obj; +}; + +export const runCli = async (): Promise => { + const params = new Command() + .name(Object.keys(pkg.bin)[0]!) + .usage('[options]') + .version(pkg.version) + .option('-c, --client ', 'HTTP client to generate') + .option('-d, --debug', 'Set log level to debug') + .option('--dry-run [value]', 'Skip writing files to disk?') + .option('-f, --file [value]', 'Path to the config file') + .option( + '-i, --input ', + 'OpenAPI specification (path, url, or string content)', + ) + .option('-l, --logs [value]', 'Logs folder') + .option('-o, --output ', 'Output folder') + .option('-p, --plugins [value...]', "List of plugins you'd like to use") + .option('-s, --silent', 'Set log level to silent') + .option( + '--no-log-file', + 'Disable writing a log file. Works like --silent but without suppressing console output', + ) + .option( + '-w, --watch [value]', + 'Regenerate the client when the input file changes?', + ) + .parse(process.argv) + .opts(); + + let userConfig: Record; + + try { + userConfig = processParams(params, ['dryRun', 'logFile']); + + if (userConfig.file) { + userConfig.configFile = userConfig.file; + delete userConfig.file; + } + + if (params.plugins === true) { + userConfig.plugins = []; + } else if (params.plugins) { + userConfig.plugins = params.plugins; + } else if (userConfig.client) { + userConfig.plugins = ['@hey-api/sdk']; + } + + if (userConfig.client) { + (userConfig.plugins as Array).push(userConfig.client as string); + delete userConfig.client; + } + + userConfig.logs = userConfig.logs + ? { + path: userConfig.logs, + } + : {}; + + if (userConfig.debug) { + (userConfig.logs as Record).level = 'debug'; + delete userConfig.debug; + } else if (userConfig.silent) { + (userConfig.logs as Record).level = 'silent'; + delete userConfig.silent; + } + + (userConfig.logs as Record).file = userConfig.logFile; + delete userConfig.logFile; + + if (typeof params.watch === 'string') { + userConfig.watch = Number.parseInt(params.watch, 10); + } + + if (!Object.keys(userConfig.logs as Record).length) { + delete userConfig.logs; + } + + // const context = await createClient( + // userConfig as unknown as Required>[0], + // ); + // if ( + // !context[0]?.config.input.some( + // (input) => input.watch && input.watch.enabled, + // ) + // ) { + // process.exit(0); + // } + process.exit(0); + } catch { + process.exit(1); + } +}; diff --git a/packages/openapi-python/src/config/types.d.ts b/packages/openapi-python/src/config/types.d.ts new file mode 100644 index 000000000..6692ab0b2 --- /dev/null +++ b/packages/openapi-python/src/config/types.d.ts @@ -0,0 +1,71 @@ +// import { MaybeArray } from "@hey-api/types"; + +export interface UserConfig { + /** + * Path to the config file. Set this value if you don't use the default + * config file name, or it's not located in the project root. + */ + configFile?: string; + /** + * Skip writing files to disk? + * + * @default false + */ + dryRun?: boolean; + /** + * Path to the OpenAPI specification. This can be: + * - path + * - URL + * - API registry shorthand + * + * Both JSON and YAML file formats are supported. You can also pass the parsed + * object directly if you're fetching the file yourself. + * + * Alternatively, you can define a configuration object with more options. + * + * If you define an array, we will generate a single output from multiple + * inputs. If you define an array of outputs with the same length, we will + * generate multiple outputs, one for each input. + */ + // input: MaybeArray['path']>; + /** + * Show an interactive error reporting tool when the program crashes? You + * generally want to keep this disabled (default). + * + * @default false + */ + interactive?: boolean; + /** + * The relative location of the logs folder. + * + * @default process.cwd() + */ + // logs?: string | Logs; + /** + * Path to the output folder. + * + * If you define an array of outputs with the same length as inputs, we will + * generate multiple outputs, one for each input. + */ + // output: MaybeArray; + /** + * Customize how the input is parsed and transformed before it's passed to + * plugins. + */ + // parser?: UserParser; + /** + * Plugins generate artifacts from `input`. By default, we generate SDK + * functions and TypeScript interfaces. If you manually define `plugins`, + * you need to include the default plugins if you wish to use them. + * + * @default ['@hey-api/sdk'] + */ + // plugins?: ReadonlyArray< + // | PluginNames + // | { + // [K in PluginNames]: PluginConfigMap[K]['config'] & { + // name: K; + // }; + // }[PluginNames] + // >; +} diff --git a/packages/openapi-python/src/index.ts b/packages/openapi-python/src/index.ts new file mode 100644 index 000000000..70ca11977 --- /dev/null +++ b/packages/openapi-python/src/index.ts @@ -0,0 +1,120 @@ +// OVERRIDES +// hard-coded here because build process doesn't pick up overrides from separate files +import '@hey-api/codegen-core'; + +declare module '@hey-api/codegen-core' { + interface ProjectRenderMeta { + /** + * If specified, this will be the file extension used when importing + * other modules. By default, we don't add a file extension and let the + * runtime resolve it. + * + * @default null + */ + importFileExtension?: (string & {}) | null; + } + + interface SymbolMeta { + category?: + | 'client' + | 'external' + | 'hook' + | 'schema' + | 'sdk' + | 'transform' + | 'type' + | 'utility' + | (string & {}); + /** + * Path to the resource this symbol represents. + */ + path?: ReadonlyArray; + /** + * Name of the plugin that registered this symbol. + */ + pluginName?: string; + resource?: + | 'client' + | 'definition' + | 'operation' + | 'webhook' + | (string & {}); + resourceId?: string; + role?: + | 'data' + | 'error' + | 'errors' + | 'options' + | 'response' + | 'responses' + | (string & {}); + /** + * Tags associated with this symbol. + */ + tags?: ReadonlyArray; + tool?: + | 'angular' + | 'arktype' + | 'fastify' + | 'json-schema' + | 'sdk' + | 'typescript' + | 'valibot' + | 'zod' + | (string & {}); + variant?: 'container' | (string & {}); + } +} +// END OVERRIDES + +import type { LazyOrAsync, MaybeArray } from '@hey-api/types'; +import colors from 'ansi-colors'; +// @ts-expect-error +import colorSupport from 'color-support'; + +import type { UserConfig } from '~/config/types'; + +colors.enabled = colorSupport().hasBasic; + +// export { createClient } from '~/generate'; + +/** + * Type helper for openapi-ts.config.ts, returns {@link MaybeArray} object(s) + */ +export const defineConfig = async >( + config: LazyOrAsync, +): Promise => (typeof config === 'function' ? await config() : config); + +// export { defaultPaginationKeywords } from '~/config/parser'; +// export { defaultPlugins } from '~/config/plugins'; +// export type { IR } from '~/ir/types'; +// export { OperationPath, OperationStrategy } from '~/openApi/shared/locations'; +// export type { +// OpenApi, +// OpenApiMetaObject, +// OpenApiOperationObject, +// OpenApiParameterObject, +// OpenApiRequestBodyObject, +// OpenApiResponseObject, +// OpenApiSchemaObject, +// } from '~/openApi/types'; +// export type { DefinePlugin, Plugin } from '~/plugins'; +// export type { AngularClient } from '~/plugins/@hey-api/client-angular'; +// export type { AxiosClient } from '~/plugins/@hey-api/client-axios'; +// export { +// clientDefaultConfig, +// clientDefaultMeta, +// } from '~/plugins/@hey-api/client-core/config'; +// export { clientPluginHandler } from '~/plugins/@hey-api/client-core/plugin'; +// export type { Client } from '~/plugins/@hey-api/client-core/types'; +// export type { FetchClient } from '~/plugins/@hey-api/client-fetch'; +// export type { NextClient } from '~/plugins/@hey-api/client-next'; +// export type { NuxtClient } from '~/plugins/@hey-api/client-nuxt'; +// export type { OfetchClient } from '~/plugins/@hey-api/client-ofetch'; +// export type { ExpressionTransformer } from '~/plugins/@hey-api/transformers/expressions'; +// export type { TypeTransformer } from '~/plugins/@hey-api/transformers/types'; +// export { definePluginConfig } from '~/plugins/shared/utils/config'; +// export * from '~/ts-dsl'; +// export type { UserConfig } from '~/types/config'; +// export { utils } from '~/utils/exports'; +// export { Logger } from '~/utils/logger'; diff --git a/packages/openapi-python/src/run.ts b/packages/openapi-python/src/run.ts new file mode 100644 index 000000000..addde85a1 --- /dev/null +++ b/packages/openapi-python/src/run.ts @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +import { runCli } from '~/cli'; + +runCli(); diff --git a/packages/openapi-python/tsconfig.base.json b/packages/openapi-python/tsconfig.base.json new file mode 100644 index 000000000..47e5da443 --- /dev/null +++ b/packages/openapi-python/tsconfig.base.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "declaration": true, + "esModuleInterop": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "noImplicitOverride": true, + "noImplicitReturns": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "paths": { + "~/*": ["src/*"] + }, + "strict": true, + "target": "ES2022", + "useUnknownInCatchVariables": false + } +} diff --git a/packages/openapi-python/tsconfig.json b/packages/openapi-python/tsconfig.json new file mode 100644 index 000000000..5278417b6 --- /dev/null +++ b/packages/openapi-python/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "declaration": false, + "esModuleInterop": true, + "resolveJsonModule": true, + "skipLibCheck": true + }, + "exclude": ["test/generated/**"] +} diff --git a/packages/openapi-python/tsdown.config.ts b/packages/openapi-python/tsdown.config.ts new file mode 100644 index 000000000..1c58531da --- /dev/null +++ b/packages/openapi-python/tsdown.config.ts @@ -0,0 +1,26 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + banner(ctx) { + /** + * fix dynamic require in ESM + * @link https://github.com/hey-api/openapi-ts/issues/1079 + */ + if (ctx.format === 'esm') { + return { + js: `import { createRequire } from 'module'; const require = createRequire(import.${'meta'}.url);`, + }; + } + + return; + }, + clean: true, + dts: true, + entry: ['./src/{index,run}.ts'], + format: ['cjs', 'esm'], + minify: false, + noExternal: ['@hey-api/types'], + shims: false, + sourcemap: true, + treeshake: true, +}); diff --git a/packages/openapi-python/turbo.json b/packages/openapi-python/turbo.json new file mode 100644 index 000000000..517c67fc2 --- /dev/null +++ b/packages/openapi-python/turbo.json @@ -0,0 +1,10 @@ +{ + "$schema": "../../node_modules/turbo/schema.json", + "extends": ["//"], + "tasks": { + "build": { + "dependsOn": ["^build"], + "outputs": ["dist/**"] + } + } +} diff --git a/packages/openapi-python/vitest.config.ts b/packages/openapi-python/vitest.config.ts new file mode 100644 index 000000000..a159b4568 --- /dev/null +++ b/packages/openapi-python/vitest.config.ts @@ -0,0 +1,16 @@ +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import { createVitestConfig } from '@config/vite-base'; + +const rootDir = fileURLToPath(new URL('./', import.meta.url)); + +export default createVitestConfig(rootDir, { + resolve: { + alias: [ + // Support imports like `~/foo` and `~` -> maps to /src + { find: /^~\/(.*)/, replacement: path.resolve(rootDir, 'src/$1') }, + { find: '~', replacement: path.resolve(rootDir, 'src') }, + ], + }, +}); diff --git a/packages/openapi-ts/.gitignore b/packages/openapi-ts/.gitignore index 71dbc8c3c..b9ebff088 100644 --- a/packages/openapi-ts/.gitignore +++ b/packages/openapi-ts/.gitignore @@ -7,8 +7,6 @@ logs node_modules npm-debug.log* temp -yarn-debug.log* -yarn-error.log* *.iml dist diff --git a/packages/openapi-ts/package.json b/packages/openapi-ts/package.json index e97be02da..b4a79f915 100644 --- a/packages/openapi-ts/package.json +++ b/packages/openapi-ts/package.json @@ -110,6 +110,7 @@ "@angular/platform-browser-dynamic": "19.2.17", "@angular/router": "19.2.17", "@config/vite-base": "workspace:*", + "@hey-api/types": "workspace:*", "@types/bun": "1.3.5", "@types/cross-spawn": "6.0.6", "@types/semver": "7.7.1", diff --git a/packages/openapi-ts/src/config/init.ts b/packages/openapi-ts/src/config/init.ts index 0fd2df3c9..22ad45d8e 100644 --- a/packages/openapi-ts/src/config/init.ts +++ b/packages/openapi-ts/src/config/init.ts @@ -1,10 +1,10 @@ import path from 'node:path'; +import type { ArrayOnly } from '@hey-api/types'; import colors from 'ansi-colors'; import { ConfigError } from '~/error'; import type { Config, UserConfig } from '~/types/config'; -import type { ArrayOnly } from '~/types/utils'; import type { Logger } from '~/utils/logger'; import { getInput } from './input'; diff --git a/packages/openapi-ts/src/config/output/source/types.d.ts b/packages/openapi-ts/src/config/output/source/types.d.ts index 7d927a673..6e5580f30 100644 --- a/packages/openapi-ts/src/config/output/source/types.d.ts +++ b/packages/openapi-ts/src/config/output/source/types.d.ts @@ -1,4 +1,4 @@ -import type { MaybePromise } from '~/types/utils'; +import type { MaybePromise } from '@hey-api/types'; import type { FeatureToggle } from '../../shared'; diff --git a/packages/openapi-ts/src/config/output/types.d.ts b/packages/openapi-ts/src/config/output/types.d.ts index 84cd72525..0fb86aad4 100644 --- a/packages/openapi-ts/src/config/output/types.d.ts +++ b/packages/openapi-ts/src/config/output/types.d.ts @@ -2,9 +2,9 @@ import type { NameConflictResolver, RenderContext, } from '@hey-api/codegen-core'; +import type { MaybeArray, MaybeFunc } from '@hey-api/types'; import type ts from 'typescript'; -import type { MaybeArray, MaybeFunc } from '~/types/utils'; import type { Casing, NameTransformer } from '~/utils/naming'; import type { NamingOptions } from '../shared'; diff --git a/packages/openapi-ts/src/generate.ts b/packages/openapi-ts/src/generate.ts index 5793ebd83..0f39ba1fc 100644 --- a/packages/openapi-ts/src/generate.ts +++ b/packages/openapi-ts/src/generate.ts @@ -1,3 +1,5 @@ +import type { LazyOrAsync, MaybeArray } from '@hey-api/types'; + import { checkNodeVersion } from '~/config/engine'; import type { Configs } from '~/config/init'; import { initConfigs } from '~/config/init'; @@ -13,7 +15,6 @@ import { } from '~/error'; import type { Context } from '~/ir/context'; import type { UserConfig } from '~/types/config'; -import type { LazyOrAsync, MaybeArray } from '~/types/utils'; import { printCliIntro } from '~/utils/cli'; import { Logger } from '~/utils/logger'; diff --git a/packages/openapi-ts/src/index.ts b/packages/openapi-ts/src/index.ts index a8e71406f..1e571e126 100644 --- a/packages/openapi-ts/src/index.ts +++ b/packages/openapi-ts/src/index.ts @@ -67,12 +67,12 @@ declare module '@hey-api/codegen-core' { } // END OVERRIDES +import type { LazyOrAsync, MaybeArray } from '@hey-api/types'; import colors from 'ansi-colors'; // @ts-expect-error import colorSupport from 'color-support'; import type { UserConfig } from '~/types/config'; -import type { LazyOrAsync, MaybeArray } from '~/types/utils'; colors.enabled = colorSupport().hasBasic; diff --git a/packages/openapi-ts/src/ir/intents.ts b/packages/openapi-ts/src/ir/intents.ts index 060d4f00a..0e37e241b 100644 --- a/packages/openapi-ts/src/ir/intents.ts +++ b/packages/openapi-ts/src/ir/intents.ts @@ -1,5 +1,6 @@ +import type { MaybePromise } from '@hey-api/types'; + import type { CodeSampleObject } from '~/openApi/shared/types'; -import type { MaybePromise } from '~/types/utils'; import type { IR } from './types'; diff --git a/packages/openapi-ts/src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts b/packages/openapi-ts/src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts index fe47ba9fe..faa55b9f9 100644 --- a/packages/openapi-ts/src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts +++ b/packages/openapi-ts/src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts @@ -1,6 +1,7 @@ +import type { MaybeArray } from '@hey-api/types'; + import type { EnumExtensions } from '~/openApi/shared/types'; -import type { MaybeArray } from '../../../types/utils'; import type { SpecificationExtensions } from './spec'; import type { OpenApiSchemaExtensions } from './spec-extensions'; diff --git a/packages/openapi-ts/src/plugins/zod/resolvers/types.d.ts b/packages/openapi-ts/src/plugins/zod/resolvers/types.d.ts index 9df1926ec..fd5dd2e39 100644 --- a/packages/openapi-ts/src/plugins/zod/resolvers/types.d.ts +++ b/packages/openapi-ts/src/plugins/zod/resolvers/types.d.ts @@ -1,4 +1,5 @@ import type { Refs, Symbol } from '@hey-api/codegen-core'; +import type { MaybeArray } from '@hey-api/types'; import type ts from 'typescript'; import type { IR } from '~/ir/types'; @@ -9,7 +10,6 @@ import type { } from '~/plugins/shared/utils/coerce'; import type { GetIntegerLimit } from '~/plugins/shared/utils/formats'; import type { $, DollarTsDsl, TsDsl } from '~/ts-dsl'; -import type { MaybeArray } from '~/types/utils'; import type { Chain } from '../shared/chain'; import type { Ast, PluginState } from '../shared/types'; diff --git a/packages/openapi-ts/src/ts-dsl/base.ts b/packages/openapi-ts/src/ts-dsl/base.ts index d0dbd5eb2..fb7f8fe12 100644 --- a/packages/openapi-ts/src/ts-dsl/base.ts +++ b/packages/openapi-ts/src/ts-dsl/base.ts @@ -24,18 +24,6 @@ import ts from 'typescript'; import type { AccessOptions } from './utils/context'; -/** - * Accepts a value or a readonly array of values of type T. - */ -export type MaybeArray = T | ReadonlyArray; - -/** - * Accepts a value or a function returning a value. - */ -export type MaybeFunc) => any> = - | T - | ReturnType; - export abstract class TsDsl implements Node { // eslint-disable-next-line @typescript-eslint/no-unused-vars analyze(_: AnalysisContext): void {} diff --git a/packages/openapi-ts/src/ts-dsl/decl/pattern.ts b/packages/openapi-ts/src/ts-dsl/decl/pattern.ts index 7358a684f..beb9c24e4 100644 --- a/packages/openapi-ts/src/ts-dsl/decl/pattern.ts +++ b/packages/openapi-ts/src/ts-dsl/decl/pattern.ts @@ -1,7 +1,7 @@ import type { AnalysisContext } from '@hey-api/codegen-core'; +import type { MaybeArray } from '@hey-api/types'; import ts from 'typescript'; -import type { MaybeArray } from '../base'; import { TsDsl } from '../base'; import { IdTsDsl } from '../expr/id'; import { TokenTsDsl } from '../token'; diff --git a/packages/openapi-ts/src/ts-dsl/layout/doc.ts b/packages/openapi-ts/src/ts-dsl/layout/doc.ts index ce99f6100..bcce52468 100644 --- a/packages/openapi-ts/src/ts-dsl/layout/doc.ts +++ b/packages/openapi-ts/src/ts-dsl/layout/doc.ts @@ -1,7 +1,7 @@ import type { AnalysisContext } from '@hey-api/codegen-core'; +import type { MaybeArray } from '@hey-api/types'; import ts from 'typescript'; -import type { MaybeArray } from '../base'; import { TsDsl } from '../base'; import { IdTsDsl } from '../expr/id'; import type { TsDslContext } from '../utils/context'; diff --git a/packages/openapi-ts/src/ts-dsl/layout/hint.ts b/packages/openapi-ts/src/ts-dsl/layout/hint.ts index 0288ed4ec..574558cca 100644 --- a/packages/openapi-ts/src/ts-dsl/layout/hint.ts +++ b/packages/openapi-ts/src/ts-dsl/layout/hint.ts @@ -1,7 +1,7 @@ import type { AnalysisContext } from '@hey-api/codegen-core'; +import type { MaybeArray } from '@hey-api/types'; import ts from 'typescript'; -import type { MaybeArray } from '../base'; import { TsDsl } from '../base'; import { IdTsDsl } from '../expr/id'; import type { TsDslContext } from '../utils/context'; diff --git a/packages/openapi-ts/src/ts-dsl/layout/note.ts b/packages/openapi-ts/src/ts-dsl/layout/note.ts index 8d9414313..b021c2f4c 100644 --- a/packages/openapi-ts/src/ts-dsl/layout/note.ts +++ b/packages/openapi-ts/src/ts-dsl/layout/note.ts @@ -1,7 +1,7 @@ import type { AnalysisContext } from '@hey-api/codegen-core'; +import type { MaybeArray } from '@hey-api/types'; import ts from 'typescript'; -import type { MaybeArray } from '../base'; import { TsDsl } from '../base'; import { IdTsDsl } from '../expr/id'; import type { TsDslContext } from '../utils/context'; diff --git a/packages/openapi-ts/src/ts-dsl/mixins/pattern.ts b/packages/openapi-ts/src/ts-dsl/mixins/pattern.ts index b4a35e0aa..37c8a2116 100644 --- a/packages/openapi-ts/src/ts-dsl/mixins/pattern.ts +++ b/packages/openapi-ts/src/ts-dsl/mixins/pattern.ts @@ -1,7 +1,7 @@ import type { AnalysisContext, Node } from '@hey-api/codegen-core'; +import type { MaybeArray } from '@hey-api/types'; import type ts from 'typescript'; -import type { MaybeArray } from '../base'; import { PatternTsDsl } from '../decl/pattern'; import type { BaseCtor, MixinCtor } from './types'; diff --git a/packages/openapi-ts/src/ts-dsl/utils/context.ts b/packages/openapi-ts/src/ts-dsl/utils/context.ts index 6eda65772..0f8ca708c 100644 --- a/packages/openapi-ts/src/ts-dsl/utils/context.ts +++ b/packages/openapi-ts/src/ts-dsl/utils/context.ts @@ -1,11 +1,12 @@ import type { BindingKind, NodeScope, Symbol } from '@hey-api/codegen-core'; import { isSymbol } from '@hey-api/codegen-core'; +import type { MaybeFunc } from '@hey-api/types'; import type ts from 'typescript'; import type { DollarTsDsl } from '~/ts-dsl'; import { $, TypeScriptRenderer } from '~/ts-dsl'; -import type { MaybeFunc, TsDsl } from '../base'; +import type { TsDsl } from '../base'; import type { CallArgs } from '../expr/call'; export type NodeChain = ReadonlyArray; diff --git a/packages/openapi-ts/src/ts-dsl/utils/render.ts b/packages/openapi-ts/src/ts-dsl/utils/render.ts index 549643efe..fb12c48ff 100644 --- a/packages/openapi-ts/src/ts-dsl/utils/render.ts +++ b/packages/openapi-ts/src/ts-dsl/utils/render.ts @@ -1,10 +1,10 @@ import type { RenderContext, Renderer } from '@hey-api/codegen-core'; +import type { MaybeArray, MaybeFunc } from '@hey-api/types'; import ts from 'typescript'; import type { TsDsl } from '~/ts-dsl'; import { $ } from '~/ts-dsl'; -import type { MaybeArray, MaybeFunc } from '../base'; import type { ModuleExport, ModuleImport, diff --git a/packages/openapi-ts/src/types/config.d.ts b/packages/openapi-ts/src/types/config.d.ts index bb5a87050..791c13141 100644 --- a/packages/openapi-ts/src/types/config.d.ts +++ b/packages/openapi-ts/src/types/config.d.ts @@ -1,3 +1,5 @@ +import type { MaybeArray } from '@hey-api/types'; + import type { Output, UserOutput } from '~/config/output'; import type { Plugin } from '~/plugins'; import type { PluginConfigMap } from '~/plugins/config'; @@ -6,7 +8,6 @@ import type { PluginNames } from '~/plugins/types'; import type { Input, UserInput, Watch } from './input'; import type { Logs } from './logs'; import type { Parser, UserParser } from './parser'; -import type { MaybeArray } from './utils'; export interface UserConfig { /** diff --git a/packages/openapi-ts/src/utils/naming/types.d.ts b/packages/openapi-ts/src/utils/naming/types.d.ts index 1971666cb..77a4b27fb 100644 --- a/packages/openapi-ts/src/utils/naming/types.d.ts +++ b/packages/openapi-ts/src/utils/naming/types.d.ts @@ -1,4 +1,4 @@ -import type { MaybeFunc } from '~/types/utils'; +import type { MaybeFunc } from '@hey-api/types'; /** * Available casing strategies. diff --git a/packages/openapi-ts/tsconfig.base.json b/packages/openapi-ts/tsconfig.base.json index 43a2b88eb..47e5da443 100644 --- a/packages/openapi-ts/tsconfig.base.json +++ b/packages/openapi-ts/tsconfig.base.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "./", "declaration": true, "esModuleInterop": true, "module": "ESNext", @@ -9,12 +10,11 @@ "noUncheckedIndexedAccess": true, "noUnusedLocals": true, "noUnusedParameters": true, - "strict": true, - "target": "ES2022", - "useUnknownInCatchVariables": false, - "baseUrl": "./", "paths": { "~/*": ["src/*"] - } + }, + "strict": true, + "target": "ES2022", + "useUnknownInCatchVariables": false } } diff --git a/packages/openapi-ts/tsdown.config.ts b/packages/openapi-ts/tsdown.config.ts index 877843eeb..106f47fd1 100644 --- a/packages/openapi-ts/tsdown.config.ts +++ b/packages/openapi-ts/tsdown.config.ts @@ -32,6 +32,7 @@ export default defineConfig({ entry: ['./src/{index,internal,run}.ts'], format: ['cjs', 'esm'], minify: false, + noExternal: ['@hey-api/types'], onSuccess: async () => { // Copy client files to dist folder for runtime access const pluginNames = [ diff --git a/packages/types/package.json b/packages/types/package.json new file mode 100644 index 000000000..64beb885a --- /dev/null +++ b/packages/types/package.json @@ -0,0 +1,10 @@ +{ + "name": "@hey-api/types", + "private": true, + "description": "Shared utility types.", + "type": "module", + "types": "./src/index.ts", + "files": [ + "src" + ] +} diff --git a/packages/openapi-ts/src/types/utils.d.ts b/packages/types/src/index.ts similarity index 100% rename from packages/openapi-ts/src/types/utils.d.ts rename to packages/types/src/index.ts diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json new file mode 100644 index 000000000..a9379fbb1 --- /dev/null +++ b/packages/types/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "skipLibCheck": true, + "strict": true, + "target": "ESNext" + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d82dd523..6c75cb5af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1254,6 +1254,9 @@ importers: '@config/vite-base': specifier: workspace:* version: link:../config-vite-base + '@hey-api/types': + specifier: workspace:* + version: link:../types eslint: specifier: 9.39.1 version: 9.39.1(jiti@2.6.1) @@ -1326,6 +1329,61 @@ importers: specifier: 7.1.2 version: 7.1.2(@types/node@22.10.5)(jiti@2.6.1)(less@4.2.2)(sass@1.85.0)(terser@5.43.1)(yaml@2.8.2) + packages/openapi-python: + dependencies: + '@hey-api/codegen-core': + specifier: workspace:^0.5.2 + version: link:../codegen-core + '@hey-api/json-schema-ref-parser': + specifier: 1.2.2 + version: 1.2.2 + ansi-colors: + specifier: 4.1.3 + version: 4.1.3 + c12: + specifier: 3.3.3 + version: 3.3.3(magicast@0.3.5) + color-support: + specifier: 1.1.3 + version: 1.1.3 + commander: + specifier: 14.0.2 + version: 14.0.2 + open: + specifier: 11.0.0 + version: 11.0.0 + semver: + specifier: 7.7.3 + version: 7.7.3 + devDependencies: + '@config/vite-base': + specifier: workspace:* + version: link:../config-vite-base + '@hey-api/types': + specifier: workspace:* + version: link:../types + '@types/cross-spawn': + specifier: 6.0.6 + version: 6.0.6 + '@types/semver': + specifier: 7.7.1 + version: 7.7.1 + cross-spawn: + specifier: 7.0.6 + version: 7.0.6 + eslint: + specifier: 9.39.1 + version: 9.39.1(jiti@2.6.1) + prettier: + specifier: 3.4.2 + version: 3.4.2 + typescript: + specifier: 5.9.3 + version: 5.9.3 + yaml: + specifier: 2.8.2 + version: 2.8.2 + packages/openapi-ts: dependencies: '@hey-api/codegen-core': @@ -1377,6 +1435,9 @@ importers: '@config/vite-base': specifier: workspace:* version: link:../config-vite-base + '@hey-api/types': + specifier: workspace:* + version: link:../types '@types/bun': specifier: 1.3.5 version: 1.3.5 @@ -1588,6 +1649,8 @@ importers: specifier: 4.1.12 version: 4.1.12 + packages/types: {} + packages/vite-plugin: devDependencies: '@hey-api/openapi-ts': @@ -14592,7 +14655,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) - '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0))(webpack@5.98.0(esbuild@0.25.0)) + '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)))(webpack@5.98.0(esbuild@0.25.0)) '@angular-devkit/core': 19.2.0(chokidar@4.0.3) '@angular/build': 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/platform-server@19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))))(@angular/ssr@19.2.15(5c03da8199d2fcdf9ff93b70f9349edd))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.6.1)(karma@6.4.4)(less@4.2.2)(postcss@8.5.2)(tailwindcss@3.4.14(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(terser@5.39.0)(typescript@5.8.3)(yaml@2.8.2) '@angular/compiler-cli': 19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(typescript@5.8.3) @@ -14643,8 +14706,8 @@ snapshots: tslib: 2.8.1 typescript: 5.8.3 webpack: 5.98.0(esbuild@0.25.0) - webpack-dev-middleware: 7.4.2(webpack@5.98.0) - webpack-dev-server: 5.2.0(webpack@5.98.0) + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) + webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) webpack-merge: 6.0.1 webpack-subresource-integrity: 5.1.0(webpack@5.98.0) optionalDependencies: @@ -14680,7 +14743,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) - '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0))(webpack@5.98.0(esbuild@0.25.0)) + '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)))(webpack@5.98.0(esbuild@0.25.0)) '@angular-devkit/core': 19.2.0(chokidar@4.0.3) '@angular/build': 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/platform-server@19.2.0(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))(@angular/platform-browser@19.2.0(@angular/animations@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(@angular/common@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))(rxjs@7.8.2))(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1))))(@angular/ssr@19.2.15(5c03da8199d2fcdf9ff93b70f9349edd))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.6.1)(karma@6.4.4)(less@4.2.2)(postcss@8.5.2)(tailwindcss@3.4.14(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(terser@5.39.0)(typescript@5.8.3)(yaml@2.8.2) '@angular/compiler-cli': 19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.2)(zone.js@0.15.1)))(typescript@5.8.3) @@ -14731,8 +14794,8 @@ snapshots: tslib: 2.8.1 typescript: 5.8.3 webpack: 5.98.0(esbuild@0.25.0) - webpack-dev-middleware: 7.4.2(webpack@5.98.0) - webpack-dev-server: 5.2.0(webpack@5.98.0) + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) + webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) webpack-merge: 6.0.1 webpack-subresource-integrity: 5.1.0(webpack@5.98.0) optionalDependencies: @@ -14819,7 +14882,7 @@ snapshots: tslib: 2.8.1 typescript: 5.8.3 webpack: 5.98.0(esbuild@0.25.4) - webpack-dev-middleware: 7.4.2(webpack@5.98.0) + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) webpack-dev-server: 5.2.2(webpack@5.98.0) webpack-merge: 6.0.1 webpack-subresource-integrity: 5.1.0(webpack@5.98.0) @@ -14907,7 +14970,7 @@ snapshots: tslib: 2.8.1 typescript: 5.9.3 webpack: 5.98.0(esbuild@0.25.4) - webpack-dev-middleware: 7.4.2(webpack@5.98.0) + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) webpack-dev-server: 5.2.2(webpack@5.98.0) webpack-merge: 6.0.1 webpack-subresource-integrity: 5.1.0(webpack@5.98.0) @@ -14939,12 +15002,12 @@ snapshots: - webpack-cli - yaml - '@angular-devkit/build-webpack@0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0))(webpack@5.98.0(esbuild@0.25.0))': + '@angular-devkit/build-webpack@0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)))(webpack@5.98.0(esbuild@0.25.0))': dependencies: '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) rxjs: 7.8.1 webpack: 5.98.0(esbuild@0.25.0) - webpack-dev-server: 5.2.0(webpack@5.98.0) + webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) transitivePeerDependencies: - chokidar @@ -23729,7 +23792,7 @@ snapshots: eslint: 9.17.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.17.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.17.0(jiti@2.6.1)) eslint-plugin-react: 7.37.5(eslint@9.17.0(jiti@2.6.1)) eslint-plugin-react-hooks: 5.2.0(eslint@9.17.0(jiti@2.6.1)) @@ -23767,7 +23830,7 @@ snapshots: tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.17.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)) transitivePeerDependencies: - supports-color @@ -23782,7 +23845,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.17.0(jiti@2.6.1)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.29.1(eslint@9.17.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)))(eslint@9.17.0(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -23940,7 +24003,7 @@ snapshots: natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.1.2 - semver: 7.7.2 + semver: 7.7.3 vue-eslint-parser: 9.4.3(eslint@9.39.1(jiti@2.6.1)) xml-name-validator: 4.0.0 transitivePeerDependencies: @@ -31066,7 +31129,7 @@ snapshots: webidl-conversions@7.0.0: {} - webpack-dev-middleware@7.4.2(webpack@5.98.0): + webpack-dev-middleware@7.4.2(webpack@5.98.0(esbuild@0.25.0)): dependencies: colorette: 2.0.20 memfs: 4.38.2 @@ -31077,7 +31140,7 @@ snapshots: optionalDependencies: webpack: 5.98.0(esbuild@0.25.0) - webpack-dev-server@5.2.0(webpack@5.98.0): + webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -31104,7 +31167,7 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 7.4.2(webpack@5.98.0) + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) ws: 8.18.3 optionalDependencies: webpack: 5.98.0(esbuild@0.25.0) @@ -31142,7 +31205,7 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 7.4.2(webpack@5.98.0) + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) ws: 8.18.3 optionalDependencies: webpack: 5.98.0(esbuild@0.25.0) diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 000000000..f6dac9845 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "skipLibCheck": true, + "strict": true + } +} -- 2.51.2