This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch changes-3.4.0rc3
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit e113a21553d5f9e2bcda43b3554d2f2a5353f628
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Nov 4 22:19:24 2026 +0530
[v3-4-test] Document how to create a TypeScript SDK project (#76374)
(#76449)
The guide only said to install the SDK in "your TypeScript project", with
no way to create one. The SDK is ESM-only and the Dag file uses top-level
await, so a default npm project fails to compile, and airflow-ts-pack does not
type check, so the compile-time checks on task inputs only happen if users know
to run tsc.
(cherry picked from commit 6e6e0f7ae9b2dfa2f1da00092b84a64c8bc5fc0a)
Co-authored-by: Pierre Jeambrun <[email protected]>
---
.../language-sdks/typescript.rst | 42 +++++++++++++++++++---
1 file changed, 37 insertions(+), 5 deletions(-)
diff --git
a/airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst
b/airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst
index 1f730af4a84..d07fffcf9fc 100644
--- a/airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst
+++ b/airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst
@@ -60,12 +60,43 @@ Prerequisites
* The ``apache-airflow-task-sdk`` package, installed with Airflow, provides
:class:`~airflow.sdk.coordinators.node.NodeCoordinator`, which runs the
TypeScript code. No other Python
package is needed.
-* In your TypeScript project, install the SDK, and ``esbuild`` to build the
bundle:
+* A TypeScript project with the SDK installed (see
:ref:`typescript-sdk/create-project`).
- .. code-block:: bash
+.. _typescript-sdk/create-project:
- npm install @apache-airflow/ts-sdk
- npm install --save-dev esbuild
+Create a project
+----------------
+
+There is no project template, so start from an empty npm project. The SDK is
ESM-only and the Dag file uses
+top-level ``await``, so the project has to be an ES module. Install the SDK,
``esbuild`` to build the bundle,
+and TypeScript to type check the Dag:
+
+.. code-block:: bash
+
+ mkdir my-dags && cd my-dags
+ npm init -y
+ npm pkg set type=module
+ npm install @apache-airflow/ts-sdk
+ npm install --save-dev esbuild typescript @types/node
+
+Add a ``tsconfig.json`` that resolves modules the way Node.js does:
+
+.. code-block:: json
+
+ {
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "strict": true,
+ "noEmit": true,
+ "types": ["node"]
+ },
+ "include": ["src"]
+ }
+
+``airflow-ts-pack`` builds the bundle without type checking it, so a Dag with
a type error still builds. Run
+``npx tsc`` before building to catch mistakes such as a misspelled task input.
.. _typescript-sdk/quick-start:
@@ -92,10 +123,11 @@ Declare a Dag in ``src/main.ts``:
await new Bundle(dag).serve();
-Build it into a single file:
+Type check it, then build it into a single file:
.. code-block:: bash
+ npx tsc
npx airflow-ts-pack src/main.ts --outdir dist
Make sure ``dist/bundle.min.mjs`` is in a Dag bundle, for example the default
``dags-folder`` bundle, which