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.
- package/LICENSE +21 -0
- package/README.md +246 -0
- package/lib/_commonjsHelpers-553b27b3.js +2 -0
- package/lib/_commonjsHelpers-553b27b3.js.map +1 -0
- package/lib/build-project-55e5df48.js +4 -0
- package/lib/build-project-55e5df48.js.map +1 -0
- package/lib/build-target-283e1e7d.js +10 -0
- package/lib/build-target-283e1e7d.js.map +1 -0
- package/lib/create-project-905598ca.js +11 -0
- package/lib/create-project-905598ca.js.map +1 -0
- package/lib/debug.js +2 -0
- package/lib/debug.js.map +1 -0
- package/lib/export-project-55168787.js +5 -0
- package/lib/export-project-55168787.js.map +1 -0
- package/lib/export-target-c9ddd2fa.js +5 -0
- package/lib/export-target-c9ddd2fa.js.map +1 -0
- package/lib/get-target-23b8cc04.js +12 -0
- package/lib/get-target-23b8cc04.js.map +1 -0
- package/lib/index-35cff1d5.js +38 -0
- package/lib/index-35cff1d5.js.map +1 -0
- package/lib/index-87f55e79.js +4 -0
- package/lib/index-87f55e79.js.map +1 -0
- package/lib/index-b49bd5b2.js +2 -0
- package/lib/index-b49bd5b2.js.map +1 -0
- package/lib/index-c97017db.js +2 -0
- package/lib/index-c97017db.js.map +1 -0
- package/lib/index-d9ba3ba0.js +6 -0
- package/lib/index-d9ba3ba0.js.map +1 -0
- package/lib/index-ffbba08f.js +3 -0
- package/lib/index-ffbba08f.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/inherits-713f4554.js +2 -0
- package/lib/inherits-713f4554.js.map +1 -0
- package/lib/init-project-a62cb644.js +16 -0
- package/lib/init-project-a62cb644.js.map +1 -0
- package/lib/load-from-project-e6530a69.js +6 -0
- package/lib/load-from-project-e6530a69.js.map +1 -0
- package/lib/minimatch-3a1d1fa9.js +2 -0
- package/lib/minimatch-3a1d1fa9.js.map +1 -0
- package/lib/once-9eb67b4f.js +2 -0
- package/lib/once-9eb67b4f.js.map +1 -0
- package/lib/project-d43b4e0c.js +30 -0
- package/lib/project-d43b4e0c.js.map +1 -0
- package/lib/run-macro-f4aa7c14.js +2 -0
- package/lib/run-macro-f4aa7c14.js.map +1 -0
- package/lib/sat-solver-01d6409e.js +2 -0
- package/lib/sat-solver-01d6409e.js.map +1 -0
- package/lib/src/actions/build-project.d.ts +2 -0
- package/lib/src/actions/create-project.d.ts +8 -0
- package/lib/src/actions/export-project.d.ts +6 -0
- package/lib/src/actions/increment-version.d.ts +5 -0
- package/lib/src/actions/init-project.d.ts +9 -0
- package/lib/src/actions/run-macro.d.ts +8 -0
- package/lib/src/actions/test-project.d.ts +5 -0
- package/lib/src/addin.d.ts +36 -0
- package/lib/src/bin/vba-blocks-build.d.ts +2 -0
- package/lib/src/bin/vba-blocks-export.d.ts +2 -0
- package/lib/src/bin/vba-blocks-init.d.ts +2 -0
- package/lib/src/bin/vba-blocks-new.d.ts +2 -0
- package/lib/src/bin/vba-blocks-run.d.ts +2 -0
- package/lib/src/bin/vba-blocks-test.d.ts +2 -0
- package/lib/src/bin/vba-blocks-version.d.ts +2 -0
- package/lib/src/bin/vba-blocks.d.ts +2 -0
- package/lib/src/build/apply-changeset.d.ts +3 -0
- package/lib/src/build/build-graph.d.ts +18 -0
- package/lib/src/build/changeset.d.ts +14 -0
- package/lib/src/build/compare-build-graphs.d.ts +3 -0
- package/lib/src/build/component.d.ts +25 -0
- package/lib/src/build/index.d.ts +7 -0
- package/lib/src/build/load-from-export.d.ts +2 -0
- package/lib/src/build/load-from-project.d.ts +5 -0
- package/lib/src/build/stage-build-graph.d.ts +2 -0
- package/lib/src/build/transform-build-graph.d.ts +3 -0
- package/lib/src/build/transforms/editor-config.d.ts +3 -0
- package/lib/src/cache.d.ts +9 -0
- package/lib/src/config.d.ts +29 -0
- package/lib/src/debug.d.ts +2 -0
- package/lib/src/env.d.ts +21 -0
- package/lib/src/errors.d.ts +56 -0
- package/lib/src/index.d.ts +16 -0
- package/lib/src/installer.d.ts +3 -0
- package/lib/src/lockfile/index.d.ts +23 -0
- package/lib/src/lockfile/is-lockfile-valid.d.ts +10 -0
- package/lib/src/lockfile/lockfile.d.ts +26 -0
- package/lib/src/manifest/dependency.d.ts +25 -0
- package/lib/src/manifest/index.d.ts +34 -0
- package/lib/src/manifest/reference.d.ts +12 -0
- package/lib/src/manifest/source.d.ts +8 -0
- package/lib/src/manifest/target.d.ts +10 -0
- package/lib/src/manifest/version.d.ts +3 -0
- package/lib/src/messages.d.ts +22 -0
- package/lib/src/professional/sources/git-source.d.ts +7 -0
- package/lib/src/professional/workspace.d.ts +10 -0
- package/lib/src/project.d.ts +48 -0
- package/lib/src/reporter.d.ts +12 -0
- package/lib/src/resolve/dependency-graph.d.ts +4 -0
- package/lib/src/resolve/index.d.ts +6 -0
- package/lib/src/resolve/latest-solver.d.ts +8 -0
- package/lib/src/resolve/resolver.d.ts +23 -0
- package/lib/src/resolve/sat-solver.d.ts +7 -0
- package/lib/src/sources/index.d.ts +16 -0
- package/lib/src/sources/path-source.d.ts +7 -0
- package/lib/src/sources/registration.d.ts +17 -0
- package/lib/src/sources/registry-source.d.ts +32 -0
- package/lib/src/sources/source.d.ts +6 -0
- package/lib/src/targets/add-target.d.ts +8 -0
- package/lib/src/targets/build-target.d.ts +41 -0
- package/lib/src/targets/export-target.d.ts +15 -0
- package/lib/src/targets/get-target.d.ts +7 -0
- package/lib/src/targets/index.d.ts +3 -0
- package/lib/src/targets/project-info.d.ts +7 -0
- package/lib/src/targets/transform-target.d.ts +3 -0
- package/lib/src/targets/transforms/core-xml.d.ts +2 -0
- package/lib/src/targets/transforms/workbook-xml.d.ts +2 -0
- package/lib/src/utils/async-map.d.ts +4 -0
- package/lib/src/utils/download.d.ts +1 -0
- package/lib/src/utils/fs.d.ts +23 -0
- package/lib/src/utils/get-staging.d.ts +1 -0
- package/lib/src/utils/git.d.ts +4 -0
- package/lib/src/utils/github.d.ts +9 -0
- package/lib/src/utils/has.d.ts +1 -0
- package/lib/src/utils/hash.d.ts +8 -0
- package/lib/src/utils/interop.d.ts +1 -0
- package/lib/src/utils/is.d.ts +5 -0
- package/lib/src/utils/noop.d.ts +1 -0
- package/lib/src/utils/observable.d.ts +15 -0
- package/lib/src/utils/parallel.d.ts +6 -0
- package/lib/src/utils/path.d.ts +7 -0
- package/lib/src/utils/pipe.d.ts +5 -0
- package/lib/src/utils/run.d.ts +17 -0
- package/lib/src/utils/stdout-file.d.ts +3 -0
- package/lib/src/utils/text.d.ts +4 -0
- package/lib/src/utils/toml.d.ts +4 -0
- package/lib/src/utils/unique.d.ts +1 -0
- package/lib/src/utils/without.d.ts +1 -0
- package/lib/src/utils/xml.d.ts +10 -0
- package/lib/src/utils/zip.d.ts +17 -0
- package/lib/test-project-d4f237d1.js +2 -0
- package/lib/test-project-d4f237d1.js.map +1 -0
- package/lib/text-ba532b40.js +10 -0
- package/lib/text-ba532b40.js.map +1 -0
- package/lib/tmp-bc08ebcf.js +10 -0
- package/lib/tmp-bc08ebcf.js.map +1 -0
- package/lib/toml-patch.es-6bd2145d.js +4 -0
- package/lib/toml-patch.es-6bd2145d.js.map +1 -0
- package/lib/vba-blocks-build-a717fcdb.js +10 -0
- package/lib/vba-blocks-build-a717fcdb.js.map +1 -0
- package/lib/vba-blocks-export-7e2c75cc.js +8 -0
- package/lib/vba-blocks-export-7e2c75cc.js.map +1 -0
- package/lib/vba-blocks-init-54531020.js +17 -0
- package/lib/vba-blocks-init-54531020.js.map +1 -0
- package/lib/vba-blocks-new-3210d92c.js +18 -0
- package/lib/vba-blocks-new-3210d92c.js.map +1 -0
- package/lib/vba-blocks-run-ab9d4ad4.js +11 -0
- package/lib/vba-blocks-run-ab9d4ad4.js.map +1 -0
- package/lib/vba-blocks-test-da5dba90.js +16 -0
- package/lib/vba-blocks-test-da5dba90.js.map +1 -0
- package/lib/vba-blocks-version-e1b3c35a.js +9 -0
- package/lib/vba-blocks-version-e1b3c35a.js.map +1 -0
- package/lib/vba-blocks.js +43 -0
- package/lib/vba-blocks.js.map +1 -0
- package/lib/workbook-xml-69fff4ae.js +3 -0
- package/lib/workbook-xml-69fff4ae.js.map +1 -0
- package/package.json +116 -0
- package/run-scripts/run.applescript +78 -0
- package/run-scripts/run.ps1 +211 -0
|
@@ -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,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,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,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,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;
|
package/lib/src/env.d.ts
ADDED
|
@@ -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,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,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>;
|