project-auto-wizard 0.13.0 → 0.13.1
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/README.md +1 -1
- package/package.json +3 -1
- package/payload/scripts/version_manager.py +94 -19
- package/payload/version.yml.template +1 -0
- package/src/commands/doctor.js +9 -50
- package/src/commands/dry-run.js +5 -4
- package/src/commands/full.js +11 -8
- package/src/commands/install-settings.js +51 -0
- package/src/commands/interactive.js +16 -18
- package/src/commands/purge.js +8 -21
- package/src/commands/status.js +3 -12
- package/src/commands/uninstall.js +10 -55
- package/src/core/copy/app-files.js +28 -0
- package/src/core/copy/workflows.js +63 -84
- package/src/core/detect.js +49 -3
- package/src/core/flutter-doctor.js +49 -0
- package/src/core/flutter-hooks.js +29 -0
- package/src/core/removal-exec.js +67 -0
- package/src/core/types.js +23 -0
- package/src/index.js +19 -24
package/src/index.js
CHANGED
|
@@ -8,13 +8,12 @@ import { readFileSync, existsSync } from "node:fs";
|
|
|
8
8
|
import { createInterface } from "node:readline/promises";
|
|
9
9
|
import { parseArgs, parsePathsCsv, CliError } from "./cli/args.js";
|
|
10
10
|
import { HELP_TEXT } from "./cli/help.js";
|
|
11
|
-
import {
|
|
12
|
-
import { DEFAULT_DEPLOY_STYLE, isDeployStyle, hasServerDeployWorkflows, fallbackStyleTypes, effectiveDeployStyle } from "./core/deploy-style.js";
|
|
11
|
+
import { fallbackStyleTypes } from "./core/deploy-style.js";
|
|
13
12
|
import { resolveFlutterOptions } from "./core/flutter-options.js";
|
|
14
13
|
import { inferInstalledStores } from "./core/installed-stores.js";
|
|
15
14
|
import { PATHS } from "./core/paths.js";
|
|
16
15
|
import { resolvePayloadRoot, assertPayload, readTemplateVersion } from "./core/assets.js";
|
|
17
|
-
import { detectTypes,
|
|
16
|
+
import { detectTypes, detectDefaultBranch, detectRepoName, makeResolvers, detectMarkers } from "./core/detect-fs.js";
|
|
18
17
|
import { parseExisting } from "./core/version-yml.js";
|
|
19
18
|
import { resolveReleaseOptions } from "./core/release-options.js";
|
|
20
19
|
import { runBreakingCheck } from "./core/breaking-check.js";
|
|
@@ -29,6 +28,7 @@ import { runUninstall, runUninstallFlow } from "./commands/uninstall.js";
|
|
|
29
28
|
import * as prompts from "./ui/prompts.js";
|
|
30
29
|
import { isPromptAbort } from "./ui/readline-engine.js";
|
|
31
30
|
import { runInteractive } from "./commands/interactive.js";
|
|
31
|
+
import { resolveDeployStyle, resolveVersion, resolveVersionCode, buildInstallContext } from "./commands/install-settings.js";
|
|
32
32
|
import { initLogger, closeLogger, currentLogPath, hasLegacyMdLogs, log } from "./core/logger.js";
|
|
33
33
|
import { runStatus, printStatus } from "./commands/status.js";
|
|
34
34
|
import { runDoctor, printDoctorReport } from "./commands/doctor.js";
|
|
@@ -286,9 +286,11 @@ async function runInner(argv, {
|
|
|
286
286
|
// version: 기존 version.yml 최우선(SSoT — 재실행 시 덮어쓰기 방지) → CLI 지정 → 파일 감지
|
|
287
287
|
// 비대화형이므로 폴백 안내는 CLI 문구(--project-version)를 그대로 쓴다.
|
|
288
288
|
// 경로 확정 뒤에 감지해야 모노레포 하위 폴더의 버전·빌드 번호를 읽는다.
|
|
289
|
-
const version = (
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
const version = resolveVersion({
|
|
290
|
+
cwd, existing, explicit: opts.version,
|
|
291
|
+
types, paths, warn: (m) => { detectWarnings.push(m); console.error(m); },
|
|
292
|
+
});
|
|
293
|
+
const versionCode = resolveVersionCode({ cwd, existing, types, paths });
|
|
292
294
|
|
|
293
295
|
// 브랜치 구성 (--main-branch/--develop-branch → version.yml 저장값 → 감지 default → main/develop)
|
|
294
296
|
// 이전 버전이 저장한 감지 실패 값("(unknown)" 등)은 저장값으로 인정하지 않는다 — 그대로 두면 재실행해도 복구되지 않는다.
|
|
@@ -331,37 +333,30 @@ async function runInner(argv, {
|
|
|
331
333
|
existing,
|
|
332
334
|
});
|
|
333
335
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
+
// 고른 배포 방식 — 플래그 → 저장값 → 기본값. 실제 설치되는 방식으로의 정리는 컨텍스트 조립에서 한다.
|
|
337
|
+
const chosenDeployStyle = resolveDeployStyle({ payload, types, explicit: opts.deployStyle, existing });
|
|
338
|
+
|
|
339
|
+
const context = buildInstallContext({
|
|
340
|
+
payload, existing, templateVersion: readTemplateVersion(), types, deployStyle: chosenDeployStyle,
|
|
341
|
+
flutterOptions,
|
|
342
|
+
// 옵션: CLI 플래그 최우선 → version.yml 저장 옵션 → 기본값 (대화형과 같은 규칙)
|
|
343
|
+
releaseOptions: resolveReleaseOptions({ semverAuto: opts.includeSemverAuto, copilotAi: opts.includeCopilotAi }, existing),
|
|
344
|
+
mode: opts.mode, force: opts.force, version, versionCode, branch,
|
|
336
345
|
branches,
|
|
337
346
|
paths,
|
|
338
|
-
// 옵션: CLI 플래그 최우선 → version.yml 저장 옵션 → 기본값 (대화형과 같은 규칙)
|
|
339
|
-
...resolveReleaseOptions({ semverAuto: opts.includeSemverAuto, copilotAi: opts.includeCopilotAi }, existing),
|
|
340
347
|
repoName,
|
|
341
348
|
// @wizard ask/auto 토큰 값을 계산하는 resolver
|
|
342
349
|
resolvers: makeResolvers(cwd, repoName, paths, flutterOptions),
|
|
343
350
|
now, today,
|
|
344
351
|
// 설치 로그용 부가 문맥 — 설치 동작 자체는 바꾸지 않는다.
|
|
345
352
|
markers: detectMarkers(cwd, types), detectWarnings,
|
|
346
|
-
// 서버 배포 워크플로우가 없는 타입은 배포 방식이 설치에 영향이 없으므로 기록하지 않는다(null).
|
|
347
|
-
deployStyle: !hasServerDeployWorkflows(payload, types) ? null : opts.deployStyle
|
|
348
|
-
|| (isDeployStyle(existing?.options?.deployStyle) ? existing.options.deployStyle : DEFAULT_DEPLOY_STYLE),
|
|
349
|
-
previousTemplateVersion: existing?.templateVersion || "",
|
|
350
|
-
envMode: flutterOptions.envMode,
|
|
351
|
-
flutterStore: flutterOptions.stores,
|
|
352
|
-
androidDeployMode: flutterOptions.androidDeployMode,
|
|
353
|
-
iosDeployMode: flutterOptions.iosDeployMode,
|
|
354
353
|
});
|
|
355
354
|
|
|
356
|
-
context.templateVersion = readTemplateVersion();
|
|
357
|
-
|
|
358
355
|
// 무중단(nginx·traefik) 워크플로우가 없는 타입은 단일 서버 배포로 설치한다 — 조용히 넘어가지 않게 알린다.
|
|
359
|
-
const fallbackTypes = fallbackStyleTypes(payload, types,
|
|
356
|
+
const fallbackTypes = fallbackStyleTypes(payload, types, chosenDeployStyle);
|
|
360
357
|
if (fallbackTypes.length) {
|
|
361
|
-
console.error(`⚠️ ${fallbackTypes.join(", ")}에는 ${
|
|
358
|
+
console.error(`⚠️ ${fallbackTypes.join(", ")}에는 ${chosenDeployStyle} 무중단 배포 워크플로우가 없어 단일 서버 배포(simple)로 설치합니다.`);
|
|
362
359
|
}
|
|
363
|
-
// 안내는 고른 값으로 하되, 기록은 실제로 설치되는 방식으로 한다.
|
|
364
|
-
context.deployStyle = effectiveDeployStyle(payload, types, context.deployStyle);
|
|
365
360
|
|
|
366
361
|
// 비대화형 축약 배너 (1줄, 로그 오염 최소)
|
|
367
362
|
printBannerCompact({ version: context.templateVersion, mode: opts.mode });
|