@incremental/turbopack 0.0.0-stage → 0.1.0

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 CHANGED
@@ -1,3 +1,62 @@
1
- # Temporary Holding Version
1
+ # @frontal-labs/incremental-turbopack
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Turbopack app adapter, drafted in `spec/adapters/turbopack.md`. It is the honest version: entries are tasks, their declared inputs are recorded, and no module graph is claimed. An app is skipped when nothing in the repository changed. The inputs are every file under the repository root, except `node_modules`, `.git`, `.next`, `.incremental` and `.toolchain`, plus the lockfile and the `next` version in the context.
4
+
5
+ Run: `incremental-turbopack run [--base REF] [--json] [--all] [--store DIR] [--root DIR] [--timeout MS]`. Exit codes match the TypeScript adapter: 0 advanced and all pass, 1 advanced with a failed build, 2 usage, 4 engine or setup error, 7 ran but not advanced.
6
+
7
+ ## Open questions and their answers
8
+
9
+ Checked against `next@16.4.2` (pinned), its `dist/docs` and its CLI help.
10
+
11
+ 1. **Does Turbopack expose the module graph?** Partly. `next build --analyze --output` (or `next analyze --output --snapshot NAME`) writes analyzer data, and `next analyze export --snapshot NAME` streams it as JSON Lines (`schema_version: 1`, module records with `path` and sync, async and traced dependencies). The docs mark export as available from v16.4. It is not used here, for three reasons:
12
+ - It is a bundle graph of the emitted client and server bundles. It does not list files the build reads without bundling them, such as files that only the type check reads (the log shows `Running TypeScript`). Not tested here, but it is the reason it cannot be the read set.
13
+ - The route records carry coverage flags (`entries` and `groups`) that are `unknown` when the data is missing. An `unknown` coverage cannot be trusted as complete.
14
+ - It needs a second analyzer build, and the docs still ask for feedback on it.
15
+ Revisit when the export covers the read set exactly and the coverage flags are always `exact`. Then the graph becomes a second capability and the adapter can claim the graph.
16
+ 2. **Is there a public, stable record of the modules read?** No. Turbopack has `--internal-trace`, which is internal. Nothing else lists the files a build read.
17
+ 3. **Can `next build` run offline?** Yes, in a fixture with `node_modules` installed. The build compiles, type checks and prerenders with no network access, with `NEXT_TELEMETRY_DISABLED=1`. Two requirements found on the way:
18
+ - Turbopack resolves `next` from the app's own `node_modules` inside the workspace root. A `node_modules` symlinked from outside the repo fails with "Could not find the Next.js package". The tests copy `node_modules` instead.
19
+ - The first build rewrites the app's `tsconfig.json` (it adds `plugins`, `include` and `allowJs`, among others). The rewrite changes the worktree, so the run is not advanced (exit 7). Commit the rewritten file once. The tests use a `tsconfig.json` that the build leaves unchanged.
20
+
21
+ ## Task
22
+
23
+ Each directory with a `package.json` that depends on `next` is one task. The id is its repo-relative path, `.` for the root (`discoverApps`, `src/project.ts`). The build is `next build --turbopack` in that directory, using the app's own `next` package (`nextPackage`).
24
+
25
+ ## Declared inputs (not observed)
26
+
27
+ Recorded with kind `declared` and a SHA-256 taken before the build. Absent files are not recorded.
28
+
29
+ - `next.config.{js,mjs,cjs,ts,mts,cts}` in the app directory.
30
+ - `tsconfig.json` and `package.json` in the app directory. The root `package.json` when the app is not the root.
31
+ - `.env`, `.env.local`, `.env.production`, `.env.production.local` in the app directory. These are build-time env files.
32
+ - The lockfile at the repo root (`package-lock.json`, `pnpm-lock.yaml` or `yarn.lock`).
33
+
34
+ Context: lockfile, root `tsconfig.json`, hash of all `package.json` files, `runner: next@<version>`, Node version, `fmt: 1`, `caps: {probes: false, dirs: false, env: false}`, and `graph: false`.
35
+
36
+ ## Real versus declared
37
+
38
+ - **Real:** the outcome (exit status of `next build --turbopack`), the duration, and the worktree and HEAD state checked by the git change source.
39
+ - **Declared:** every input above. They are a list of files the build is known to depend on, not a list of files it read.
40
+ - **Module graph:** not recorded. Every file in the repository is an input, so a change to `app/page.tsx` selects the app, and so does a change to any other file in the repository. That is a superset of the real dependencies, so it is sound but reruns more than necessary.
41
+
42
+ ## Capabilities and dirty runs
43
+
44
+ - `graph: false`. No module graph is recorded.
45
+ - `caps.probes`, `caps.dirs` and `caps.env` are false. Environment reads at build time (for example `NEXT_PUBLIC_*`) are not observed. Use the env adapter's allowlist to make them declared.
46
+ - Inputs are every file under the repository root, minus the skipped directories and minus the directories of the other apps (an app does not import from another app's directory: this is an assumption, not checked). Shared code under `libs/` and the root files are inputs for every app, so an edit there reruns every app. Inputs are hashed before and after each build. The build may write files: `next-env.d.ts` is excluded because its content follows the `next` version, and any other file the build changes makes the observation dirty, because the build did not read the state it recorded.
47
+ - Tracked environment: `NEXT_*` variables and `NODE_ENV`, recorded as env inputs. Other variables are not observed.
48
+ - Not observed: variables outside the tracked set, files outside the repository root, and the `.next` build cache, which can change how a build behaves without changing any input. A build with an unobserved cache can therefore produce a different result for the same inputs.
49
+ - Build outputs (`.next`) are not stored . Remote build caches are not consulted. A `next build` that hits a cache is still recorded as a pass, and the cache is not trusted as proof.
50
+
51
+ ## Gaps
52
+
53
+ - The app must ignore `.next` and `next-env.d.ts` in git. Otherwise the build dirties the worktree and the run is never advanced.
54
+ - A build killed mid-run can leave `.next/lock`. The next build then fails with "A previous build that didn't exit cleanly", which is reported as fail.
55
+ - Inputs are hashed before the build. A file changed during the build is not caught except by the worktree check at the end of the run.
56
+ - Dynamic imports, runtime-chosen targets and files the build reads outside the app are not observed.
57
+ - Apps must all resolve the same `next` version. The context names one runner.
58
+ - Runs are sequential. Each app is one `next build`.
59
+
60
+ ## Tests
61
+
62
+ `npm test` in this directory (builds the binding, then runs `node --test`). The integration tests use a scratch repo with one app at `apps/web` and a non-app package. They cover discovery, the first run advancing, a declared-input edit invalidating the app, a failed build reported as fail with exit 1, and an uncommitted change exiting 7. Each build takes tens of seconds, so the suite is slow.
@@ -0,0 +1,5 @@
1
+ export { buildApp, envHashes, repoInputs, discoverApps, nextPackage, relPath, taskOf, } from "./project.js";
2
+ export type { BuildResult, DeclaredInput } from "./project.js";
3
+ export { contextFor, excludedFor, parseArgs, runAdapter, UsageError } from "./run.js";
4
+ export type { AppRun, RunOptions, RunReport } from "./run.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtF,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ // @incremental/turbopack: the Turbopack app adapter (spec/adapters/turbopack.md).
2
+ export { buildApp, envHashes, repoInputs, discoverApps, nextPackage, relPath, taskOf, } from "./project.js";
3
+ export { contextFor, excludedFor, parseArgs, runAdapter, UsageError } from "./run.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const NEXT_CONFIGS: string[];
2
+ export declare const ENV_FILES: string[];
3
+ export declare const LOCKFILES: string[];
4
+ export interface DeclaredInput {
5
+ kind: "declared";
6
+ path: string;
7
+ hash: string;
8
+ }
9
+ export declare function sha256(data: Buffer | string): string;
10
+ export declare function relPath(root: string, abs: string): string;
11
+ export declare function taskOf(root: string, dirAbs: string): string;
12
+ export declare function discoverApps(root: string): string[];
13
+ export declare function allPackageJsons(root: string): string[];
14
+ export declare function nextPackage(appAbs: string): {
15
+ dir: string;
16
+ version: string;
17
+ };
18
+ export declare const GENERATED: Set<string>;
19
+ export declare function repoInputs(root: string, excluded?: ReadonlySet<string>): DeclaredInput[];
20
+ export declare const TRACKED_ENV: (name: string) => boolean;
21
+ export declare function envHashes(env: NodeJS.ProcessEnv): Record<string, string>;
22
+ export interface BuildResult {
23
+ outcome: "pass" | "fail" | "error";
24
+ durationMs: number;
25
+ problem: string | null;
26
+ }
27
+ export declare function buildApp(appAbs: string, nextDir: string, timeoutMs: number): BuildResult;
28
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sources":["../../src/project.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,UAOxB,CAAC;AAEF,eAAO,MAAM,SAAS,UAAqE,CAAC;AAC5F,eAAO,MAAM,SAAS,UAAuD,CAAC;AAE9E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAGD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAiBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAanD;AAGD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBtD;AAID,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAI5E;AAID,eAAO,MAAM,SAAS,aAA6B,CAAC;AAQpD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,WAAW,CAAC,MAAM,CAAa,GACxC,aAAa,EAAE,CAgBjB;AAID,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,OACM,CAAC;AAElD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxE;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAKD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,CAoBxF"}
@@ -0,0 +1,153 @@
1
+ // One Next.js app as a task (spec/adapters/turbopack.md). The task id is the
2
+ // repo-relative path of the app directory, "." for the root (PLAN D-2). The
3
+ // task is `next build --turbopack` run in that directory with the app's own
4
+ // `next`. No module graph is recorded: the declared inputs below are the only
5
+ // inputs, and every observation is dirty (PLAN 11.1, rule 4).
6
+ import { spawnSync } from "node:child_process";
7
+ import { createHash } from "node:crypto";
8
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
9
+ import { createRequire } from "node:module";
10
+ import path from "node:path";
11
+ // Directories the input walk never enters. node_modules is covered by the
12
+ // lockfile in the context. dist is not skipped: a dependent app reads its
13
+ // workspace dependency's build output. .next is the app's own build output.
14
+ const SKIP_DIRS = new Set(["node_modules", ".git", ".next", ".incremental", ".toolchain"]);
15
+ export const NEXT_CONFIGS = [
16
+ "next.config.js",
17
+ "next.config.mjs",
18
+ "next.config.cjs",
19
+ "next.config.ts",
20
+ "next.config.mts",
21
+ "next.config.cts",
22
+ ];
23
+ // Env files `next build` reads in production mode (from the app directory).
24
+ export const ENV_FILES = [".env", ".env.local", ".env.production", ".env.production.local"];
25
+ export const LOCKFILES = ["package-lock.json", "pnpm-lock.yaml", "yarn.lock"];
26
+ export function sha256(data) {
27
+ return createHash("sha256").update(data).digest("hex");
28
+ }
29
+ export function relPath(root, abs) {
30
+ return path.relative(root, abs).split(path.sep).join("/");
31
+ }
32
+ // The task id of an app directory: repo-relative, "." for the root.
33
+ export function taskOf(root, dirAbs) {
34
+ return relPath(root, dirAbs) || ".";
35
+ }
36
+ function readJson(file) {
37
+ return JSON.parse(readFileSync(file, "utf8"));
38
+ }
39
+ function dependsOnNext(pkgFile) {
40
+ const pkg = readJson(pkgFile);
41
+ const deps = {
42
+ ...pkg.dependencies,
43
+ ...pkg.devDependencies,
44
+ };
45
+ return "next" in deps;
46
+ }
47
+ // Repo-relative task ids of every directory with a package.json that depends on
48
+ // next, sorted. Walks the repo; symbolic links are not followed.
49
+ export function discoverApps(root) {
50
+ const out = [];
51
+ const visit = (dir) => {
52
+ const pkg = path.join(dir, "package.json");
53
+ if (existsSync(pkg) && dependsOnNext(pkg))
54
+ out.push(taskOf(root, dir));
55
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
56
+ if (!entry.isSymbolicLink() && entry.isDirectory() && !SKIP_DIRS.has(entry.name)) {
57
+ visit(path.join(dir, entry.name));
58
+ }
59
+ }
60
+ };
61
+ visit(root);
62
+ return out.sort();
63
+ }
64
+ // Repo-relative paths of every package.json under root, sorted (context hash).
65
+ export function allPackageJsons(root) {
66
+ const out = [];
67
+ const visit = (dir) => {
68
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
69
+ if (!entry.isSymbolicLink()) {
70
+ const abs = path.join(dir, entry.name);
71
+ if (entry.isDirectory()) {
72
+ if (!SKIP_DIRS.has(entry.name))
73
+ visit(abs);
74
+ }
75
+ else if (entry.isFile() && entry.name === "package.json") {
76
+ out.push(relPath(root, abs));
77
+ }
78
+ }
79
+ }
80
+ };
81
+ visit(root);
82
+ return out.sort();
83
+ }
84
+ // The `next` package the app resolves, from its own node_modules. Throws when
85
+ // the app does not have next installed.
86
+ export function nextPackage(appAbs) {
87
+ const req = createRequire(path.join(appAbs, "package.json"));
88
+ const file = req.resolve("next/package.json");
89
+ return { dir: path.dirname(file), version: readJson(file).version ?? "unknown" };
90
+ }
91
+ // Files `next build` writes itself. Their content is fixed by the Next version in
92
+ // the context, so they are not inputs (recording them would make the first build dirty).
93
+ export const GENERATED = new Set(["next-env.d.ts"]);
94
+ // Every file under root that a build of one app can read, hashed now
95
+ // (spec/adapters/turbopack.md). `next build` reads source modules anywhere in the
96
+ // repository, and no module graph is recorded, so the inputs are the repository
97
+ // minus SKIP_DIRS and minus `excluded`: the directories of the other apps. An app
98
+ // is a leaf: it does not import from another app's directory (see README).
99
+ // Paths are repo-relative and sorted. Symbolic links are not followed.
100
+ export function repoInputs(root, excluded = new Set()) {
101
+ const out = [];
102
+ const visit = (dir) => {
103
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
104
+ if (!entry.isSymbolicLink()) {
105
+ const abs = path.join(dir, entry.name);
106
+ if (entry.isDirectory()) {
107
+ if (!SKIP_DIRS.has(entry.name) && !excluded.has(relPath(root, abs)))
108
+ visit(abs);
109
+ }
110
+ else if (entry.isFile() && !GENERATED.has(entry.name)) {
111
+ out.push({ kind: "declared", path: relPath(root, abs), hash: sha256(readFileSync(abs)) });
112
+ }
113
+ }
114
+ }
115
+ };
116
+ visit(root);
117
+ return out.sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
118
+ }
119
+ // The environment a build reads that the adapter records: NEXT_* variables and
120
+ // NODE_ENV, as hashes. Other variables are not observed (stated in the README).
121
+ export const TRACKED_ENV = (name) => name.startsWith("NEXT_") || name === "NODE_ENV";
122
+ export function envHashes(env) {
123
+ const out = {};
124
+ for (const name of Object.keys(env).sort()) {
125
+ const value = env[name];
126
+ if (TRACKED_ENV(name) && value !== undefined)
127
+ out[name] = sha256(value);
128
+ }
129
+ return out;
130
+ }
131
+ // Runs `next build --turbopack` in the app directory with the app's own next
132
+ // binary. Telemetry is off. Exit 0 is pass; exit 1 is fail (Next exits 1 for a
133
+ // failed compile, type check or prerender); anything else, or a timeout, is error.
134
+ export function buildApp(appAbs, nextDir, timeoutMs) {
135
+ const started = Date.now();
136
+ const r = spawnSync(process.execPath, [path.join(nextDir, "dist", "bin", "next"), "build", "--turbopack"], {
137
+ cwd: appAbs,
138
+ encoding: "utf8",
139
+ timeout: timeoutMs,
140
+ maxBuffer: 256 * 1024 * 1024,
141
+ env: { ...process.env, NEXT_TELEMETRY_DISABLED: "1" },
142
+ });
143
+ const durationMs = Date.now() - started;
144
+ if (r.error !== undefined || r.signal !== null) {
145
+ return { outcome: "error", durationMs, problem: r.error?.message ?? `killed by ${r.signal}` };
146
+ }
147
+ if (r.status === 0)
148
+ return { outcome: "pass", durationMs, problem: null };
149
+ if (r.status === 1)
150
+ return { outcome: "fail", durationMs, problem: "next build failed (exit 1)" };
151
+ return { outcome: "error", durationMs, problem: `next build exited ${r.status}` };
152
+ }
153
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sources":["../../src/project.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,8DAA8D;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,i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Aa,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAChG,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1E,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;IAClG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;AACpF,CAAC"}
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ import { type Change, type Context, type Fallback, type Outcome, type Plan } from "@incremental/client";
3
+ export interface RunOptions {
4
+ root: string;
5
+ store: string;
6
+ base?: string;
7
+ all: boolean;
8
+ timeoutMs: number;
9
+ }
10
+ export interface AppRun {
11
+ task: string;
12
+ outcome: Outcome;
13
+ durationMs: number;
14
+ problem: string | null;
15
+ }
16
+ export interface RunReport {
17
+ mode: "run" | "all";
18
+ root: string;
19
+ stored: string | null;
20
+ base: string | null;
21
+ head: string;
22
+ headEnd: string;
23
+ dirty: boolean;
24
+ changes: Change[];
25
+ plan: Plan | null;
26
+ fallback: Fallback | null;
27
+ selected: string[];
28
+ discovered: string[];
29
+ results: AppRun[];
30
+ observed: number;
31
+ advanced: boolean;
32
+ notAdvanced: string[];
33
+ exit: number;
34
+ }
35
+ export declare class UsageError extends Error {
36
+ constructor(message: string);
37
+ }
38
+ export declare function excludedFor(task: string, apps: readonly string[]): Set<string>;
39
+ export declare function contextFor(root: string, runner: string): Context;
40
+ export declare function runAdapter(opts: RunOptions): Promise<RunReport>;
41
+ interface ParsedArgs {
42
+ opts: RunOptions;
43
+ json: boolean;
44
+ }
45
+ export declare function parseArgs(argv: string[]): ParsedArgs;
46
+ export declare function main(argv: string[]): Prom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