mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
59e8d5fb91
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | |---|---|---|---|---|---|---|---| | [@napi-rs/cli](https://napi.rs/) ([source](https://redirect.github.com/napi-rs/napi-rs)) | [`3.9.0` → `3.9.1`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/3.9.0/3.9.1) |  |  |  |  | pnpm.catalog.default | patch | | [napi](https://redirect.github.com/napi-rs/napi-rs) | `3.12.2` → `3.12.3` |  |  |  |  | workspace.dependencies | patch | | [napi-derive](https://redirect.github.com/napi-rs/napi-rs) | `3.6.3` → `3.6.4` |  |  |  |  | workspace.dependencies | patch | --- ### Release Notes <details> <summary>napi-rs/napi-rs (@​napi-rs/cli)</summary> ### [`v3.9.1`](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.9.0...@napi-rs/cli@3.9.1) [Compare Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.9.0...@napi-rs/cli@3.9.1) </details> --- ### Configuration 📅 **Schedule**: (in timezone Asia/Shanghai) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43MS4wIiwidXBkYXRlZEluVmVyIjoiNDQuNzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Cameron Clark <cameron.clark@hey.com>
118 lines
3.4 KiB
TypeScript
118 lines
3.4 KiB
TypeScript
/* auto-generated by NAPI-RS */
|
|
/* eslint-disable */
|
|
|
|
export interface Comment {
|
|
type: 'Line' | 'Block'
|
|
value: string
|
|
start: number
|
|
end: number
|
|
}
|
|
|
|
export interface ErrorLabel {
|
|
message: string | null
|
|
start: number
|
|
end: number
|
|
}
|
|
|
|
export interface OxcError {
|
|
severity: Severity
|
|
message: string
|
|
labels: Array<ErrorLabel>
|
|
helpMessage: string | null
|
|
codeframe: string | null
|
|
}
|
|
|
|
export declare const enum Severity {
|
|
Error = 'Error',
|
|
Warning = 'Warning',
|
|
Advice = 'Advice',
|
|
}
|
|
|
|
export interface SourceMap {
|
|
file?: string
|
|
mappings: string
|
|
names: Array<string>
|
|
sourceRoot?: string
|
|
sources: Array<string>
|
|
sourcesContent?: Array<string>
|
|
version: number
|
|
x_google_ignoreList?: Array<number>
|
|
}
|
|
|
|
/**
|
|
* Apply the Relay `graphql` tagged template transform asynchronously.
|
|
*
|
|
* This uses a worker-pool thread and can be slower than `transformSync` for a
|
|
* single small module.
|
|
*/
|
|
export declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): Promise<TransformResult>
|
|
|
|
/**
|
|
* Options for the Relay transform.
|
|
*
|
|
* `lang`, `sourceType`, and `sourcemap` configure the surrounding Oxc
|
|
* parse/codegen pipeline; the remaining fields mirror the options of
|
|
* `babel-plugin-relay` / `@swc/plugin-relay`.
|
|
*/
|
|
export interface TransformOptions {
|
|
/** Treat the source as `js`, `jsx`, `ts`, `tsx`, or `dts`. */
|
|
lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts'
|
|
/** Treat the source as script, module, CommonJS, or infer it from syntax. */
|
|
sourceType?: 'script' | 'module' | 'commonjs' | 'unambiguous'
|
|
/**
|
|
* Generate a source map.
|
|
*
|
|
* @default false
|
|
*/
|
|
sourcemap?: boolean
|
|
/**
|
|
* Directory `relay-compiler` emits all artifacts to (its
|
|
* `artifactDirectory` setting). When set, artifacts are imported via a
|
|
* relative path from the file being transformed to this directory; the
|
|
* path is computed lexically, so both must either be absolute or relative
|
|
* to the same base directory. When unset, artifacts are imported from the
|
|
* `__generated__` directory next to the file being transformed.
|
|
*/
|
|
artifactDirectory?: string
|
|
/**
|
|
* Artifact language, determining the imported file extension:
|
|
* `Name.graphql.ts` for `typescript`, `Name.graphql.js` otherwise.
|
|
*
|
|
* @default 'javascript'
|
|
*/
|
|
language?: 'typescript' | 'javascript' | 'flow'
|
|
/**
|
|
* Emit a hoisted default import per `graphql` tag instead of an inline
|
|
* `require()` call.
|
|
*
|
|
* Defaults to `true`, matching `babel-plugin-relay` since Relay v17.
|
|
* `@swc/plugin-relay` and Next.js default to `false`.
|
|
*
|
|
* @default true
|
|
*/
|
|
eagerEsModules?: boolean
|
|
}
|
|
|
|
/** Result returned by the Relay transform. */
|
|
export interface TransformResult {
|
|
/**
|
|
* Transformed code.
|
|
*
|
|
* This is empty when parsing, semantic analysis, option validation, or
|
|
* the Relay transform reports an error.
|
|
*/
|
|
code: string
|
|
/** Source map, populated when `sourcemap` is `true`. */
|
|
map?: SourceMap
|
|
/** Parse, semantic, option validation, and Relay transform diagnostics. */
|
|
errors: Array<OxcError>
|
|
}
|
|
|
|
/**
|
|
* Apply the Relay `graphql` tagged template transform synchronously.
|
|
*
|
|
* Only `graphql` tags are rewritten; TypeScript and JSX syntax are preserved
|
|
* untouched, so the output composes with any downstream toolchain.
|
|
*/
|
|
export declare function transformSync(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult
|