shivaam commented on code in PR #69295:
URL: https://github.com/apache/airflow/pull/69295#discussion_r3569483974


##########
ts-sdk/src/cli/pack.ts:
##########
@@ -0,0 +1,218 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// airflow-ts-pack: bundle a TypeScript entrypoint into the single-file
+// artifact NodeCoordinator consumes — `bundle.mjs` with the airflow
+// metadata embedded as a leading `//# airflowMetadata=<base64>` comment.
+//
+// Mirrors airflow-go-pack: build first, then run the built bundle with
+// --airflow-metadata so the manifest comes from the bundle's own task
+// registry and schema version, never from a hand-written sidecar.
+
+import { execFileSync } from "node:child_process";
+import { readFileSync, rmSync, writeFileSync } from "node:fs";
+import path from "node:path";
+
+import {
+  AIRFLOW_METADATA_FLAG,
+  AIRFLOW_METADATA_SENTINEL,
+  type BundleManifest,
+} from "../coordinator/runtime.js";
+
+const AIRFLOW_BUNDLE_METADATA_VERSION = "1.0";
+const BUNDLE_FILENAME = "bundle.mjs";
+// bundle.mjs is written only after validation, so failures leave no partial 
artifact.
+const STAGING_FILENAME = "bundle.pack-staging.mjs";
+const MANIFEST_TIMEOUT_MS = 60_000;
+const MANIFEST_MAX_BUFFER = 64 << 20;

Review Comment:
   const MANIFEST_MAX_BUFFER_BYTES = 64 * 1024 * 1024;



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to