vbapm 0.6.3-alpha

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.
Files changed (167) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +246 -0
  3. package/lib/_commonjsHelpers-553b27b3.js +2 -0
  4. package/lib/_commonjsHelpers-553b27b3.js.map +1 -0
  5. package/lib/build-project-55e5df48.js +4 -0
  6. package/lib/build-project-55e5df48.js.map +1 -0
  7. package/lib/build-target-283e1e7d.js +10 -0
  8. package/lib/build-target-283e1e7d.js.map +1 -0
  9. package/lib/create-project-905598ca.js +11 -0
  10. package/lib/create-project-905598ca.js.map +1 -0
  11. package/lib/debug.js +2 -0
  12. package/lib/debug.js.map +1 -0
  13. package/lib/export-project-55168787.js +5 -0
  14. package/lib/export-project-55168787.js.map +1 -0
  15. package/lib/export-target-c9ddd2fa.js +5 -0
  16. package/lib/export-target-c9ddd2fa.js.map +1 -0
  17. package/lib/get-target-23b8cc04.js +12 -0
  18. package/lib/get-target-23b8cc04.js.map +1 -0
  19. package/lib/index-35cff1d5.js +38 -0
  20. package/lib/index-35cff1d5.js.map +1 -0
  21. package/lib/index-87f55e79.js +4 -0
  22. package/lib/index-87f55e79.js.map +1 -0
  23. package/lib/index-b49bd5b2.js +2 -0
  24. package/lib/index-b49bd5b2.js.map +1 -0
  25. package/lib/index-c97017db.js +2 -0
  26. package/lib/index-c97017db.js.map +1 -0
  27. package/lib/index-d9ba3ba0.js +6 -0
  28. package/lib/index-d9ba3ba0.js.map +1 -0
  29. package/lib/index-ffbba08f.js +3 -0
  30. package/lib/index-ffbba08f.js.map +1 -0
  31. package/lib/index.js +2 -0
  32. package/lib/index.js.map +1 -0
  33. package/lib/inherits-713f4554.js +2 -0
  34. package/lib/inherits-713f4554.js.map +1 -0
  35. package/lib/init-project-a62cb644.js +16 -0
  36. package/lib/init-project-a62cb644.js.map +1 -0
  37. package/lib/load-from-project-e6530a69.js +6 -0
  38. package/lib/load-from-project-e6530a69.js.map +1 -0
  39. package/lib/minimatch-3a1d1fa9.js +2 -0
  40. package/lib/minimatch-3a1d1fa9.js.map +1 -0
  41. package/lib/once-9eb67b4f.js +2 -0
  42. package/lib/once-9eb67b4f.js.map +1 -0
  43. package/lib/project-d43b4e0c.js +30 -0
  44. package/lib/project-d43b4e0c.js.map +1 -0
  45. package/lib/run-macro-f4aa7c14.js +2 -0
  46. package/lib/run-macro-f4aa7c14.js.map +1 -0
  47. package/lib/sat-solver-01d6409e.js +2 -0
  48. package/lib/sat-solver-01d6409e.js.map +1 -0
  49. package/lib/src/actions/build-project.d.ts +2 -0
  50. package/lib/src/actions/create-project.d.ts +8 -0
  51. package/lib/src/actions/export-project.d.ts +6 -0
  52. package/lib/src/actions/increment-version.d.ts +5 -0
  53. package/lib/src/actions/init-project.d.ts +9 -0
  54. package/lib/src/actions/run-macro.d.ts +8 -0
  55. package/lib/src/actions/test-project.d.ts +5 -0
  56. package/lib/src/addin.d.ts +36 -0
  57. package/lib/src/bin/vba-blocks-build.d.ts +2 -0
  58. package/lib/src/bin/vba-blocks-export.d.ts +2 -0
  59. package/lib/src/bin/vba-blocks-init.d.ts +2 -0
  60. package/lib/src/bin/vba-blocks-new.d.ts +2 -0
  61. package/lib/src/bin/vba-blocks-run.d.ts +2 -0
  62. package/lib/src/bin/vba-blocks-test.d.ts +2 -0
  63. package/lib/src/bin/vba-blocks-version.d.ts +2 -0
  64. package/lib/src/bin/vba-blocks.d.ts +2 -0
  65. package/lib/src/build/apply-changeset.d.ts +3 -0
  66. package/lib/src/build/build-graph.d.ts +18 -0
  67. package/lib/src/build/changeset.d.ts +14 -0
  68. package/lib/src/build/compare-build-graphs.d.ts +3 -0
  69. package/lib/src/build/component.d.ts +25 -0
  70. package/lib/src/build/index.d.ts +7 -0
  71. package/lib/src/build/load-from-export.d.ts +2 -0
  72. package/lib/src/build/load-from-project.d.ts +5 -0
  73. package/lib/src/build/stage-build-graph.d.ts +2 -0
  74. package/lib/src/build/transform-build-graph.d.ts +3 -0
  75. package/lib/src/build/transforms/editor-config.d.ts +3 -0
  76. package/lib/src/cache.d.ts +9 -0
  77. package/lib/src/config.d.ts +29 -0
  78. package/lib/src/debug.d.ts +2 -0
  79. package/lib/src/env.d.ts +21 -0
  80. package/lib/src/errors.d.ts +56 -0
  81. package/lib/src/index.d.ts +16 -0
  82. package/lib/src/installer.d.ts +3 -0
  83. package/lib/src/lockfile/index.d.ts +23 -0
  84. package/lib/src/lockfile/is-lockfile-valid.d.ts +10 -0
  85. package/lib/src/lockfile/lockfile.d.ts +26 -0
  86. package/lib/src/manifest/dependency.d.ts +25 -0
  87. package/lib/src/manifest/index.d.ts +34 -0
  88. package/lib/src/manifest/reference.d.ts +12 -0
  89. package/lib/src/manifest/source.d.ts +8 -0
  90. package/lib/src/manifest/target.d.ts +10 -0
  91. package/lib/src/manifest/version.d.ts +3 -0
  92. package/lib/src/messages.d.ts +22 -0
  93. package/lib/src/professional/sources/git-source.d.ts +7 -0
  94. package/lib/src/professional/workspace.d.ts +10 -0
  95. package/lib/src/project.d.ts +48 -0
  96. package/lib/src/reporter.d.ts +12 -0
  97. package/lib/src/resolve/dependency-graph.d.ts +4 -0
  98. package/lib/src/resolve/index.d.ts +6 -0
  99. package/lib/src/resolve/latest-solver.d.ts +8 -0
  100. package/lib/src/resolve/resolver.d.ts +23 -0
  101. package/lib/src/resolve/sat-solver.d.ts +7 -0
  102. package/lib/src/sources/index.d.ts +16 -0
  103. package/lib/src/sources/path-source.d.ts +7 -0
  104. package/lib/src/sources/registration.d.ts +17 -0
  105. package/lib/src/sources/registry-source.d.ts +32 -0
  106. package/lib/src/sources/source.d.ts +6 -0
  107. package/lib/src/targets/add-target.d.ts +8 -0
  108. package/lib/src/targets/build-target.d.ts +41 -0
  109. package/lib/src/targets/export-target.d.ts +15 -0
  110. package/lib/src/targets/get-target.d.ts +7 -0
  111. package/lib/src/targets/index.d.ts +3 -0
  112. package/lib/src/targets/project-info.d.ts +7 -0
  113. package/lib/src/targets/transform-target.d.ts +3 -0
  114. package/lib/src/targets/transforms/core-xml.d.ts +2 -0
  115. package/lib/src/targets/transforms/workbook-xml.d.ts +2 -0
  116. package/lib/src/utils/async-map.d.ts +4 -0
  117. package/lib/src/utils/download.d.ts +1 -0
  118. package/lib/src/utils/fs.d.ts +23 -0
  119. package/lib/src/utils/get-staging.d.ts +1 -0
  120. package/lib/src/utils/git.d.ts +4 -0
  121. package/lib/src/utils/github.d.ts +9 -0
  122. package/lib/src/utils/has.d.ts +1 -0
  123. package/lib/src/utils/hash.d.ts +8 -0
  124. package/lib/src/utils/interop.d.ts +1 -0
  125. package/lib/src/utils/is.d.ts +5 -0
  126. package/lib/src/utils/noop.d.ts +1 -0
  127. package/lib/src/utils/observable.d.ts +15 -0
  128. package/lib/src/utils/parallel.d.ts +6 -0
  129. package/lib/src/utils/path.d.ts +7 -0
  130. package/lib/src/utils/pipe.d.ts +5 -0
  131. package/lib/src/utils/run.d.ts +17 -0
  132. package/lib/src/utils/stdout-file.d.ts +3 -0
  133. package/lib/src/utils/text.d.ts +4 -0
  134. package/lib/src/utils/toml.d.ts +4 -0
  135. package/lib/src/utils/unique.d.ts +1 -0
  136. package/lib/src/utils/without.d.ts +1 -0
  137. package/lib/src/utils/xml.d.ts +10 -0
  138. package/lib/src/utils/zip.d.ts +17 -0
  139. package/lib/test-project-d4f237d1.js +2 -0
  140. package/lib/test-project-d4f237d1.js.map +1 -0
  141. package/lib/text-ba532b40.js +10 -0
  142. package/lib/text-ba532b40.js.map +1 -0
  143. package/lib/tmp-bc08ebcf.js +10 -0
  144. package/lib/tmp-bc08ebcf.js.map +1 -0
  145. package/lib/toml-patch.es-6bd2145d.js +4 -0
  146. package/lib/toml-patch.es-6bd2145d.js.map +1 -0
  147. package/lib/vba-blocks-build-a717fcdb.js +10 -0
  148. package/lib/vba-blocks-build-a717fcdb.js.map +1 -0
  149. package/lib/vba-blocks-export-7e2c75cc.js +8 -0
  150. package/lib/vba-blocks-export-7e2c75cc.js.map +1 -0
  151. package/lib/vba-blocks-init-54531020.js +17 -0
  152. package/lib/vba-blocks-init-54531020.js.map +1 -0
  153. package/lib/vba-blocks-new-3210d92c.js +18 -0
  154. package/lib/vba-blocks-new-3210d92c.js.map +1 -0
  155. package/lib/vba-blocks-run-ab9d4ad4.js +11 -0
  156. package/lib/vba-blocks-run-ab9d4ad4.js.map +1 -0
  157. package/lib/vba-blocks-test-da5dba90.js +16 -0
  158. package/lib/vba-blocks-test-da5dba90.js.map +1 -0
  159. package/lib/vba-blocks-version-e1b3c35a.js +9 -0
  160. package/lib/vba-blocks-version-e1b3c35a.js.map +1 -0
  161. package/lib/vba-blocks.js +43 -0
  162. package/lib/vba-blocks.js.map +1 -0
  163. package/lib/workbook-xml-69fff4ae.js +3 -0
  164. package/lib/workbook-xml-69fff4ae.js.map +1 -0
  165. package/package.json +116 -0
  166. package/run-scripts/run.applescript +78 -0
  167. package/run-scripts/run.ps1 +211 -0
@@ -0,0 +1,2 @@
1
+ import { BuildOptions } from "../targets/build-target";
2
+ export declare function buildProject(options?: BuildOptions): Promise<string>;
@@ -0,0 +1,8 @@
1
+ export interface CreateOptions {
2
+ name: string;
3
+ target?: string;
4
+ from?: string;
5
+ pkg: boolean;
6
+ git: boolean;
7
+ }
8
+ export declare function createProject(options: CreateOptions): Promise<void>;
@@ -0,0 +1,6 @@
1
+ export interface ExportOptions {
2
+ target?: string;
3
+ completed?: string;
4
+ addin?: string;
5
+ }
6
+ export declare function exportProject(options?: ExportOptions): Promise<void>;
@@ -0,0 +1,5 @@
1
+ interface IncrementVersionOptions {
2
+ preid?: string;
3
+ }
4
+ export declare function incrementVersion(increment: string, options?: IncrementVersionOptions): Promise<string>;
5
+ export {};
@@ -0,0 +1,9 @@
1
+ export interface InitOptions {
2
+ name?: string;
3
+ dir?: string;
4
+ target?: string;
5
+ from?: string;
6
+ pkg: boolean;
7
+ git: boolean;
8
+ }
9
+ export declare function initProject(options: InitOptions): Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { RunResult } from "../utils/run";
2
+ export interface RunOptions {
3
+ target?: string;
4
+ file?: string;
5
+ macro: string;
6
+ args: string[];
7
+ }
8
+ export declare function runMacro(options: RunOptions): Promise<RunResult>;
@@ -0,0 +1,5 @@
1
+ export interface TestOptions {
2
+ target?: string;
3
+ args: string[];
4
+ }
5
+ export declare function testProject(options: TestOptions): Promise<void>;
@@ -0,0 +1,36 @@
1
+ import { ImportGraph } from "./build/build-graph";
2
+ import { Target } from "./manifest/target";
3
+ import { Project } from "./project";
4
+ export type Application = "excel";
5
+ export type Addin = string;
6
+ export interface AddinOptions {
7
+ addin?: string;
8
+ staging?: boolean;
9
+ }
10
+ export declare const extensions: {
11
+ [application: string]: string[];
12
+ };
13
+ export declare const addins: {
14
+ [application: string]: string;
15
+ };
16
+ /**
17
+ * Import graph of src and references into given target
18
+ */
19
+ export declare function importGraph(project: Project, target: Target, graph: ImportGraph, file: string, options?: AddinOptions): Promise<void>;
20
+ /**
21
+ * Export src and references from given target
22
+ */
23
+ export declare function exportTo(project: Project, target: Target, staging: string, options?: AddinOptions): Promise<void>;
24
+ /**
25
+ * Create a new document at the given path
26
+ */
27
+ export declare function createDocument(project: Project, target: Target, options?: AddinOptions): Promise<string>;
28
+ /**
29
+ * Get application, addin, and file for given target
30
+ */
31
+ export declare function getTargetInfo(project: Project, target: Target, options?: AddinOptions): {
32
+ application: Application;
33
+ addin: Addin;
34
+ file: string;
35
+ };
36
+ export declare function extensionToApplication(extension: string): Application;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Args } from "mri";
2
+ export default function (args: Args): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { CliError } from "../errors";
2
+ export declare function handleError(err: Error | CliError | any, _promise?: Promise<any>): void;
@@ -0,0 +1,3 @@
1
+ import { Project } from "../project";
2
+ import { Changeset } from "./changeset";
3
+ export declare function applyChangeset(project: Project, changeset: Changeset): Promise<void>;
@@ -0,0 +1,18 @@
1
+ import { Reference } from "../manifest/reference";
2
+ import { Source } from "../manifest/source";
3
+ import { Component } from "./component";
4
+ export interface FromDependences {
5
+ components: Map<Component, string>;
6
+ references: Map<Reference, string>;
7
+ }
8
+ export interface BuildGraph {
9
+ name: string;
10
+ components: Component[];
11
+ references: Reference[];
12
+ fromDependencies: FromDependences;
13
+ }
14
+ export interface ImportGraph {
15
+ name: string;
16
+ components: Source[];
17
+ references: Reference[];
18
+ }
@@ -0,0 +1,14 @@
1
+ import { Reference } from "../manifest/reference";
2
+ import { Component } from "./component";
3
+ export interface Changeset {
4
+ components: {
5
+ added: Component[];
6
+ changed: Component[];
7
+ removed: Component[];
8
+ };
9
+ references: {
10
+ added: Reference[];
11
+ changed: Reference[];
12
+ removed: Reference[];
13
+ };
14
+ }
@@ -0,0 +1,3 @@
1
+ import { BuildGraph } from "./build-graph";
2
+ import { Changeset } from "./changeset";
3
+ export declare function compareBuildGraphs(before: BuildGraph, after: BuildGraph): Changeset;
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ export type ComponentType = "module" | "class" | "form" | "document";
3
+ export interface ComponentDetails {
4
+ path?: string;
5
+ binary?: Buffer;
6
+ }
7
+ export declare class Component {
8
+ type: ComponentType;
9
+ code: string;
10
+ details: ComponentDetails;
11
+ constructor(type: ComponentType, code: Buffer | string, details?: ComponentDetails);
12
+ get name(): string;
13
+ get binaryPath(): string | undefined;
14
+ get filename(): string;
15
+ static load(path: string, details?: {
16
+ binary_path?: string;
17
+ }): Promise<Component>;
18
+ }
19
+ export declare const extensionToType: {
20
+ [extension: string]: ComponentType;
21
+ };
22
+ export declare const typeToExtension: {
23
+ [type: string]: string;
24
+ };
25
+ export declare function byComponentName(a: Component, b: Component): number;
@@ -0,0 +1,7 @@
1
+ export { applyChangeset } from "./apply-changeset";
2
+ export { compareBuildGraphs } from "./compare-build-graphs";
3
+ export { Component } from "./component";
4
+ export { loadFromExport } from "./load-from-export";
5
+ export { loadFromProject } from "./load-from-project";
6
+ export { stageBuildGraph } from "./stage-build-graph";
7
+ export { toCompiled, toSrc } from "./transform-build-graph";
@@ -0,0 +1,2 @@
1
+ import { BuildGraph } from "./build-graph";
2
+ export declare function loadFromExport(staging: string): Promise<BuildGraph>;
@@ -0,0 +1,5 @@
1
+ import { Manifest } from "../manifest";
2
+ import { Project } from "../project";
3
+ import { BuildOptions } from "../targets/build-target";
4
+ import { BuildGraph } from "./build-graph";
5
+ export declare function loadFromProject(project: Project, dependencies: Manifest[], options?: BuildOptions): Promise<BuildGraph>;
@@ -0,0 +1,2 @@
1
+ import { BuildGraph, ImportGraph } from "./build-graph";
2
+ export declare function stageBuildGraph(graph: BuildGraph, staging: string): Promise<ImportGraph>;
@@ -0,0 +1,3 @@
1
+ import { BuildGraph } from "./build-graph";
2
+ export declare const toCompiled: (input: BuildGraph) => Promise<BuildGraph>;
3
+ export declare const toSrc: (input: BuildGraph) => Promise<BuildGraph>;
@@ -0,0 +1,3 @@
1
+ import { BuildGraph } from "../build-graph";
2
+ export declare function toCompiled(graph: BuildGraph): Promise<BuildGraph>;
3
+ export declare function toSrc(graph: BuildGraph): Promise<BuildGraph>;
@@ -0,0 +1,9 @@
1
+ import Conf from "conf";
2
+ export declare class Cache extends Conf {
3
+ constructor(cwd?: string);
4
+ get latest_version(): string | undefined;
5
+ set latest_version(version: string | undefined);
6
+ get latest_version_checked(): number | undefined;
7
+ set latest_version_checked(timestamp: number | undefined);
8
+ }
9
+ export declare const cache: Cache;
@@ -0,0 +1,29 @@
1
+ import { Sources } from "./sources";
2
+ export type Registry = {} | {
3
+ [name: string]: {
4
+ index: string;
5
+ packages: string;
6
+ };
7
+ };
8
+ export interface Flags {
9
+ }
10
+ export interface Config {
11
+ registry: Registry;
12
+ flags: Flags;
13
+ sources: Sources;
14
+ }
15
+ export interface ConfigValue {
16
+ registry?: Registry;
17
+ flags?: Flags;
18
+ }
19
+ /**
20
+ * Load config, from local, user, and environment values
21
+ *
22
+ * - env:config/config.toml (user)
23
+ * - Search for .vba-blocks/config.toml up from cwd (local)
24
+ * - Load VBA_BLOCKS_* from environment (override)
25
+ */
26
+ export declare function loadConfig(): Promise<Config>;
27
+ export declare function readConfig(dir: string): Promise<ConfigValue | undefined>;
28
+ export declare function findConfig(dir: string): Promise<string | undefined>;
29
+ export declare function loadConfigFromEnv(): ConfigValue;
@@ -0,0 +1,2 @@
1
+ import debug from "debug";
2
+ export default debug;
@@ -0,0 +1,21 @@
1
+ import { Reporter } from "./reporter";
2
+ export interface Env {
3
+ isWindows: boolean;
4
+ cwd: string;
5
+ values: any;
6
+ data: string;
7
+ config: string;
8
+ cache: string;
9
+ log: string;
10
+ temp: string;
11
+ addins: string;
12
+ scripts: string;
13
+ registry: string;
14
+ packages: string;
15
+ sources: string;
16
+ staging: string;
17
+ reporter: Reporter;
18
+ debug: (id: string) => (...values: any[]) => void;
19
+ silent: boolean;
20
+ }
21
+ export declare const env: Env;
@@ -0,0 +1,56 @@
1
+ export declare class CliError extends Error {
2
+ code: ErrorCode;
3
+ underlying?: Error;
4
+ constructor(code: ErrorCode, message: string, underlying?: Error);
5
+ }
6
+ export declare function isCliError(error: Error | CliError): error is CliError;
7
+ export declare enum ErrorCode {
8
+ Unknown = "unknown",
9
+ UnknownCommand = "unknown-command",
10
+ ManifestNotFound = "manifest-not-found",
11
+ ManifestInvalid = "manifest-invalid",
12
+ SourceUnsupported = "source-unsupported",
13
+ SourceMisconfiguredRegistry = "source-misconfigured-registry",
14
+ SourceNoneMatching = "source-none-matching",
15
+ SourceDownloadFailed = "source-download-failed",
16
+ SourceUnrecognizedType = "source-unrecognized-type",
17
+ DependencyNotFound = "dependency-not-found",
18
+ DependencyInvalidChecksum = "dependency-invalid-checksum",
19
+ DependencyPathNotFound = "dependency-path-not-found",
20
+ DependencyUnknownSource = "dependency-unknown-source",
21
+ BuildInvalid = "build-invalid",
22
+ LockfileWriteFailed = "lockfile-write-failed",
23
+ TargetNoMatching = "target-no-matching",
24
+ TargetNoDefault = "target-no-default",
25
+ TargetNotFound = "target-not-found",
26
+ TargetIsOpen = "target-is-open",
27
+ TargetCreateFailed = "target-create-failed",
28
+ TargetImportFailed = "target-import-failed",
29
+ TargetRestoreFailed = "target-restore-failed",
30
+ TargetAddNoType = "target-add-no-type",
31
+ TargetAlreadyDefined = "target-already-defined",
32
+ ResolveFailed = "resolve-failed",
33
+ ComponentUnrecognized = "component-unrecognized",
34
+ ComponentInvalidNoName = "component-invalid-no-name",
35
+ RunScriptNotFound = "run-script-not-found",
36
+ NewNameRequired = "new-name-required",
37
+ NewTargetRequired = "new-target-required",
38
+ NewDirExists = "new-dir-exists",
39
+ FromNotFound = "from-not-found",
40
+ InitAlreadyInitialized = "init-already-initialized",
41
+ InitNameRequired = "init-name-required",
42
+ InitTargetRequired = "init-target-required",
43
+ ExportNoTarget = "export-no-target",
44
+ ExportNoMatching = "export-no-matching",
45
+ ExportTargetNotFound = "export-target-not-found",
46
+ AddinUnsupportedType = "addin-unsupported-type",
47
+ RunMissingFile = "run-missing-file",
48
+ RunMissingMacro = "run-missing-macro",
49
+ RegistryCloneFailed = "registry-clone-failed",
50
+ InvalidVersion = "invalid-version"
51
+ }
52
+ export declare function manifestOk(value: any, message: string): void;
53
+ export declare function cleanError(error: string | Error): {
54
+ message: string;
55
+ stack: string;
56
+ };
@@ -0,0 +1,16 @@
1
+ export { buildProject } from "./actions/build-project";
2
+ export { createProject } from "./actions/create-project";
3
+ export { exportProject } from "./actions/export-project";
4
+ export { initProject } from "./actions/init-project";
5
+ export { runMacro } from "./actions/run-macro";
6
+ export { testProject } from "./actions/test-project";
7
+ export { addins } from "./addin";
8
+ export { loadConfig } from "./config";
9
+ export { env } from "./env";
10
+ export { parseManifest } from "./manifest";
11
+ export { loadWorkspace } from "./professional/workspace";
12
+ export { fetchDependencies, loadProject } from "./project";
13
+ export { default as resolveDependencies } from "./resolve";
14
+ export { fetch as fetchDependency, resolve as resolveDependency } from "./sources";
15
+ export { checksum } from "./utils/fs";
16
+ export { run } from "./utils/run";
@@ -0,0 +1,3 @@
1
+ export declare function updateVersion(): string | undefined;
2
+ export declare function updateAvailable(): boolean;
3
+ export declare function checkForUpdate(): Promise<boolean>;
@@ -0,0 +1,23 @@
1
+ import { Project } from "../project.js";
2
+ import { Lockfile } from "./lockfile";
3
+ export { default as isLockfileValid } from "./is-lockfile-valid";
4
+ /**
5
+ * Read lockfile at given dir (if present)
6
+ * (for invalid lockfile, errors are ignored and treated as no lockfile)
7
+ */
8
+ export declare function readLockfile(dir: string): Promise<Lockfile | null>;
9
+ /**
10
+ * Write lockfile for project to given dir
11
+ *
12
+ * @throws LockfileWriteFailed
13
+ */
14
+ export declare function writeLockfile(dir: string, project: Project): Promise<void>;
15
+ /**
16
+ * Convert project to lockfile toml, alphabetized and with trailing commas
17
+ * (should be suitable for VCS)
18
+ */
19
+ export declare function toToml(project: Project, dir: string): string;
20
+ /**
21
+ * Load lockfile from toml (including "hydrating" dependencies from packages)
22
+ */
23
+ export declare function fromToml(toml: string, dir: string): Promise<Lockfile>;
@@ -0,0 +1,10 @@
1
+ import { Workspace } from "../professional/workspace";
2
+ import { Lockfile } from "./lockfile";
3
+ /**
4
+ * ## Is lockfile valid?
5
+ *
6
+ * - [ ] Lockfile version has not changed
7
+ * - [ ] Workspace root manifest has not changed
8
+ * - [ ] Workspace members have not changed
9
+ */
10
+ export default function isLockfileValid(lockfile: Lockfile, workspace: Workspace): Promise<boolean>;
@@ -0,0 +1,26 @@
1
+ import { Dependency } from "../manifest/dependency";
2
+ import { DependencyGraph } from "../resolve/dependency-graph";
3
+ export interface MinimalSnapshot {
4
+ name: string;
5
+ dependencies: Dependency[];
6
+ }
7
+ export declare const LOCKFILE_VERSION = "1";
8
+ /**
9
+ * ## Lockfile
10
+ *
11
+ * Save resolved dependency graph and workspace information
12
+ * for precisely rebuilding dependency graph if the workspace hasn't changed
13
+ *
14
+ * Version the lockfile separately from vba-blocks to allow the lockfile format to change over time,
15
+ * while staying isolated from the more-frequent changes to the vba-blocks version.
16
+ */
17
+ export interface Lockfile {
18
+ metadata?: {
19
+ version: string;
20
+ };
21
+ workspace: {
22
+ root: MinimalSnapshot;
23
+ members: MinimalSnapshot[];
24
+ };
25
+ packages: DependencyGraph;
26
+ }
@@ -0,0 +1,25 @@
1
+ import { Version } from "./version";
2
+ export interface DependencyDetails {
3
+ name: string;
4
+ version?: Version;
5
+ }
6
+ export interface RegistryDependency extends DependencyDetails {
7
+ registry: string;
8
+ version: Version;
9
+ }
10
+ export interface PathDependency extends DependencyDetails {
11
+ path: string;
12
+ }
13
+ export interface GitDependency extends DependencyDetails {
14
+ git: string;
15
+ tag?: string;
16
+ branch?: string;
17
+ rev?: string;
18
+ }
19
+ export type Dependency = RegistryDependency | PathDependency | GitDependency;
20
+ export declare function parseDependencies(value: any, dir: string): Dependency[];
21
+ export declare function parseDependency(name: string, value: Version | any, dir: string): Dependency;
22
+ export declare function isRegistryDependency(dependency: Dependency): dependency is RegistryDependency;
23
+ export declare function isPathDependency(dependency: Dependency): dependency is PathDependency;
24
+ export declare function isGitDependency(dependency: Dependency): dependency is GitDependency;
25
+ export declare function formatDependencies(dependencies: Dependency[], dir: string): object;
@@ -0,0 +1,34 @@
1
+ import { Dependency } from "./dependency";
2
+ import { Reference } from "./reference";
3
+ import { Source } from "./source";
4
+ import { Target } from "./target";
5
+ import { Version } from "./version";
6
+ /**
7
+ * Snapshot is the minimal manifest needed to support both Manifest
8
+ * and info loaded during dependency resolution
9
+ */
10
+ export interface Snapshot {
11
+ name: string;
12
+ version: Version;
13
+ dependencies: Dependency[];
14
+ }
15
+ export type ManifestType = "package" | "project";
16
+ export interface Metadata {
17
+ authors?: string[];
18
+ publish?: boolean;
19
+ [name: string]: any;
20
+ }
21
+ export interface Manifest extends Snapshot {
22
+ type: ManifestType;
23
+ metadata: Metadata;
24
+ src: Source[];
25
+ references: Reference[];
26
+ devSrc: Source[];
27
+ devDependencies: Dependency[];
28
+ devReferences: Reference[];
29
+ target?: Target;
30
+ }
31
+ export declare function parseManifest(value: any, dir: string): Manifest;
32
+ export declare function loadManifest(dir: string): Promise<Manifest>;
33
+ export declare function writeManifest(manifest: Manifest, dir: string): Promise<void>;
34
+ export declare function formatManifest(manifest: Manifest, dir: string): object;
@@ -0,0 +1,12 @@
1
+ export interface ReferenceDetails {
2
+ dependency?: string;
3
+ }
4
+ export interface Reference {
5
+ name: string;
6
+ guid: string;
7
+ major: number;
8
+ minor: number;
9
+ }
10
+ export declare function parseReferences(value: any): Reference[];
11
+ export declare function parseReference(name: string, value: any): Reference;
12
+ export declare function formatReferences(references: Reference[]): object;
@@ -0,0 +1,8 @@
1
+ export interface Source {
2
+ name: string;
3
+ path: string;
4
+ binary?: string;
5
+ }
6
+ export declare function parseSrc(value: any, dir: string): Source[];
7
+ export declare function parseSource(name: string, value: string | any, dir: string): Source;
8
+ export declare function formatSrc(src: Source[], dir: string): object;
@@ -0,0 +1,10 @@
1
+ export type TargetType = "xlsx" | "xlsm" | "xlam";
2
+ export interface Target {
3
+ name: string;
4
+ type: TargetType;
5
+ path: string;
6
+ filename: string;
7
+ }
8
+ export declare function parseTarget(value: any, pkgName: string, dir: string): Target;
9
+ export declare function isSupportedTargetType(type: string): type is TargetType;
10
+ export declare function formatTarget(target: Target, defaultName: string, dir: string): string | object;
@@ -0,0 +1,3 @@
1
+ export type Version = string;
2
+ export declare const DEFAULT_VERSION = "UNVERSIONED";
3
+ export declare function isValid(value: string): value is Version;
@@ -0,0 +1,22 @@
1
+ export declare enum Message {
2
+ UpdateAvailable = "update-available",
3
+ BuildProjectLoading = "build-project-loading",
4
+ BuildTargetBuilding = "build-target-building",
5
+ BuildLockfileWriting = "build-lockfile-writing",
6
+ ExportProjectLoading = "export-project-loading",
7
+ ExportToStaging = "export-to-staging",
8
+ ExportToProject = "export-to-project",
9
+ ProjectUpdating = "project-updating",
10
+ DependenciesResolving = "dependencies-resolving",
11
+ DependenciesFetching = "dependencies-fetching",
12
+ ExportLoading = "export-loading",
13
+ PatchApplyChanges = "patch-apply-changes",
14
+ PatchAddSrc = "patch-add-src",
15
+ PatchRemoveSrc = "patch-remove-src",
16
+ PatchAddDependency = "patch-add-dependency",
17
+ PatchRemoveDependency = "patch-remove-dependency",
18
+ PatchAddReference = "patch-add-reference",
19
+ PatchRemoveReference = "patch-remove-reference",
20
+ RegistrySourceLocalOnly = "registry-source-local-only",
21
+ RegistrySourceSkipPull = "registry-source-skip-pull"
22
+ }
@@ -0,0 +1,7 @@
1
+ import { Dependency } from "../../manifest/dependency";
2
+ import { Registration } from "../../sources/registration";
3
+ import { Source } from "../../sources/source";
4
+ export declare class GitSource implements Source {
5
+ resolve(_dependency: Dependency): Registration[];
6
+ fetch(_registration: Registration): string;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { Manifest } from "../manifest";
2
+ export interface Workspace {
3
+ paths: {
4
+ root: string;
5
+ members: string[];
6
+ };
7
+ root: Manifest;
8
+ members: Manifest[];
9
+ }
10
+ export declare function loadWorkspace(manifest: Manifest, dir: string): Promise<Workspace>;
@@ -0,0 +1,48 @@
1
+ import { Config } from "./config";
2
+ import { Manifest } from "./manifest";
3
+ import { Workspace } from "./professional/workspace";
4
+ import { DependencyGraph } from "./resolve/dependency-graph";
5
+ export interface Project {
6
+ manifest: Manifest;
7
+ workspace: Workspace;
8
+ packages: DependencyGraph;
9
+ config: Config;
10
+ paths: {
11
+ root: string;
12
+ dir: string;
13
+ build: string;
14
+ backup: string;
15
+ staging: string;
16
+ };
17
+ hasDirtyLockfile: boolean;
18
+ }
19
+ /**
20
+ * Load project from given directory / cwd
21
+ *
22
+ * 1. Load manifest in dir
23
+ * 2. Load workspace from manifest
24
+ * 3. Load lockfile
25
+ * 4. Resolve dependencies
26
+ */
27
+ export declare function loadProject(dir?: string): Promise<Project>;
28
+ export interface FetchProject {
29
+ manifest: Manifest;
30
+ packages: DependencyGraph;
31
+ config: Config;
32
+ }
33
+ /**
34
+ * Fetch all dependencies for project
35
+ * (based on already resolved project.packages)
36
+ *
37
+ * After sources complete fetches, manifests are loaded and returned for each package
38
+ */
39
+ export declare function fetchDependencies(project: FetchProject): Promise<Manifest[]>;
40
+ export interface ProjectOptions {
41
+ type?: "project" | "package";
42
+ }
43
+ /**
44
+ * Initialize new project
45
+ *
46
+ * Minimum requirements: name and dir
47
+ */
48
+ export declare function initProject(name: string, dir: string, options?: ProjectOptions): Promise<Project>;