create-airframe-dag 1.0.1 → 1.0.2
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 +1 -1
- package/src/commands/init.js +13 -3
- package/src/ui/display.js +4 -6
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -6,7 +6,13 @@ import {
|
|
|
6
6
|
getExistingProjects,
|
|
7
7
|
} from "../lib/env.js"
|
|
8
8
|
import { initGitRepo } from "../lib/git.js"
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
showWelcome,
|
|
11
|
+
printBanner,
|
|
12
|
+
logWorkingDir,
|
|
13
|
+
displayTemplates,
|
|
14
|
+
showCompletion,
|
|
15
|
+
} from "../ui/display.js"
|
|
10
16
|
import {
|
|
11
17
|
createSpinner,
|
|
12
18
|
askForProjectDetails,
|
|
@@ -15,21 +21,25 @@ import {
|
|
|
15
21
|
import { log } from "@clack/prompts"
|
|
16
22
|
import chalk from "chalk"
|
|
17
23
|
import readline from "node:readline"
|
|
24
|
+
import path from "node:path"
|
|
18
25
|
|
|
19
26
|
export async function initCommand({ airflowPath } = {}) {
|
|
20
27
|
const baseDir = airflowPath ? String(airflowPath) : process.cwd()
|
|
21
28
|
|
|
22
|
-
await
|
|
29
|
+
await printBanner()
|
|
30
|
+
await showWelcome()
|
|
23
31
|
|
|
24
32
|
// Step 0: Check for dags directory
|
|
25
33
|
if (!checkDagsDirectory(baseDir)) {
|
|
26
34
|
log.error(`No "dags" directory found in path: ${baseDir}`)
|
|
27
35
|
log.warn(
|
|
28
|
-
"Please run `airframe
|
|
36
|
+
"Please run `npx create-airframe-dag@latest` from your airflow environment directory.",
|
|
29
37
|
)
|
|
30
38
|
process.exit(1)
|
|
31
39
|
}
|
|
32
40
|
|
|
41
|
+
logWorkingDir(path.join(baseDir, "dags"))
|
|
42
|
+
|
|
33
43
|
const s = createSpinner()
|
|
34
44
|
|
|
35
45
|
// Step 1: Fetch Templates
|
package/src/ui/display.js
CHANGED
|
@@ -16,18 +16,16 @@ export function printBanner() {
|
|
|
16
16
|
)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function showWelcome(
|
|
20
|
-
printBanner()
|
|
19
|
+
export function showWelcome() {
|
|
21
20
|
intro(chalk.bold.cyanBright("The blueprint for scalable Airflow DAGs"))
|
|
22
21
|
|
|
23
22
|
// Explicit note about Airflow support
|
|
24
23
|
log.info(chalk.dim("Supports Apache Airflow 2.0 (2.8 or higher)"))
|
|
25
|
-
logWorkingDir(workingDir)
|
|
26
24
|
log.warn(chalk.dim("Press CTRL+C to exit the Airframe CLI.\n"))
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
export function logWorkingDir(dir = process.cwd()) {
|
|
30
|
-
log.
|
|
28
|
+
log.info(
|
|
31
29
|
`You are about to initialize an Airframe project in this directory:\n${chalk.dim(dir)}`,
|
|
32
30
|
)
|
|
33
31
|
}
|
|
@@ -36,12 +34,12 @@ export function showCompletion({ targetDir }) {
|
|
|
36
34
|
outro(chalk.green.bold(`Airframe project initialized.`))
|
|
37
35
|
|
|
38
36
|
console.log(
|
|
39
|
-
chalk.bold.
|
|
37
|
+
chalk.bold.blueBright(
|
|
40
38
|
`Project directory: ${chalk.underline(targetDir)}\n`,
|
|
41
39
|
),
|
|
42
40
|
)
|
|
43
41
|
|
|
44
|
-
console.log(chalk.bold.
|
|
42
|
+
console.log(chalk.bold.cyanBright("Happy Orchestrating!"))
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
export function printHelp() {
|