@jointhedots/gear 1.2.0 → 1.2.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.
Files changed (113) hide show
  1. package/esm/builder/build-app-bundle.d.ts +28 -0
  2. package/esm/builder/build-app-bundle.js +0 -1
  3. package/esm/builder/build-app-host.d.ts +28 -0
  4. package/esm/builder/build-app-host.js +0 -1
  5. package/esm/builder/build-application.d.ts +47 -0
  6. package/esm/builder/build-application.js +1 -2
  7. package/esm/builder/build-library.d.ts +20 -0
  8. package/esm/builder/build-library.js +1 -2
  9. package/esm/builder/build-target.d.ts +27 -0
  10. package/esm/builder/build-target.js +0 -1
  11. package/esm/builder/helpers/emit-bundle-manifest.d.ts +9 -0
  12. package/esm/builder/helpers/emit-bundle-manifest.js +1 -2
  13. package/esm/builder/helpers/emit-components-dts.d.ts +9 -0
  14. package/esm/builder/helpers/emit-components-dts.js +1 -2
  15. package/esm/builder/helpers/emit-esmodules.d.ts +61 -0
  16. package/esm/builder/helpers/emit-esmodules.js +5 -6
  17. package/esm/builder/helpers/emit-package-manifest.d.ts +9 -0
  18. package/esm/builder/helpers/emit-package-manifest.js +0 -1
  19. package/esm/builder/helpers/emit-static-assets.d.ts +14 -0
  20. package/esm/builder/helpers/emit-static-assets.js +1 -2
  21. package/esm/builder/helpers/emit-typescript-definition.d.ts +35 -0
  22. package/esm/builder/helpers/emit-typescript-definition.js +6 -7
  23. package/esm/builder/helpers/path-helpers.d.ts +9 -0
  24. package/esm/builder/helpers/path-helpers.js +0 -1
  25. package/esm/builder/helpers/task.d.ts +8 -0
  26. package/esm/builder/helpers/task.js +0 -1
  27. package/esm/cli.d.ts +2 -0
  28. package/esm/cli.js +1 -4
  29. package/esm/commands/init.d.ts +2 -0
  30. package/esm/commands/init.js +0 -1
  31. package/esm/commands/install.d.ts +5 -0
  32. package/esm/commands/install.js +2 -3
  33. package/esm/commands/make.d.ts +16 -0
  34. package/esm/commands/make.js +2 -3
  35. package/esm/commands/run.d.ts +8 -0
  36. package/esm/commands/run.js +6 -7
  37. package/esm/commands/serve.d.ts +9 -0
  38. package/esm/commands/serve.js +3 -4
  39. package/esm/core/commands/interface.d.ts +26 -0
  40. package/esm/core/commands/interface.js +21 -0
  41. package/esm/core/components/components.d.ts +73 -0
  42. package/esm/core/components/components.js +2 -0
  43. package/esm/core/components/helpers.d.ts +7 -0
  44. package/esm/core/components/helpers.js +68 -0
  45. package/esm/core/components/manifold.d.ts +77 -0
  46. package/esm/core/components/manifold.js +442 -0
  47. package/esm/core/components/mod.d.ts +4 -0
  48. package/esm/core/components/mod.js +4 -0
  49. package/esm/core/components/provider.d.ts +42 -0
  50. package/esm/core/components/provider.js +127 -0
  51. package/esm/core/logging/mod.d.ts +53 -0
  52. package/esm/core/logging/mod.js +142 -0
  53. package/esm/core/logging/trace.d.ts +51 -0
  54. package/esm/core/logging/trace.js +17 -0
  55. package/esm/core/mod-browser.d.ts +1 -0
  56. package/esm/core/mod-browser.js +1 -0
  57. package/esm/core/mod-node.d.ts +1 -0
  58. package/esm/core/mod-node.js +1 -0
  59. package/esm/core/mod.d.ts +5 -0
  60. package/esm/core/mod.js +5 -0
  61. package/esm/core/schema/helpers.d.ts +36 -0
  62. package/esm/core/schema/helpers.js +163 -0
  63. package/esm/core/schema/mod.d.ts +3 -0
  64. package/esm/core/schema/mod.js +3 -0
  65. package/esm/core/schema/schema.d.ts +376 -0
  66. package/esm/core/schema/schema.js +234 -0
  67. package/esm/core/schema/zod.d.ts +44 -0
  68. package/esm/core/schema/zod.js +127 -0
  69. package/esm/core/services/mod.d.ts +5 -0
  70. package/esm/core/services/mod.js +5 -0
  71. package/esm/core/services/service-accessor.d.ts +17 -0
  72. package/esm/core/services/service-accessor.js +20 -0
  73. package/esm/core/services/service-definitions.d.ts +37 -0
  74. package/esm/core/services/service-definitions.js +44 -0
  75. package/esm/core/services/service-points.d.ts +40 -0
  76. package/esm/core/services/service-points.js +164 -0
  77. package/esm/core/services/service-specification.d.ts +52 -0
  78. package/esm/core/services/service-specification.js +59 -0
  79. package/esm/core/services/settings.d.ts +29 -0
  80. package/esm/core/services/settings.js +123 -0
  81. package/esm/utils/file.d.ts +39 -0
  82. package/esm/utils/file.js +3 -4
  83. package/esm/utils/graph-ordering.d.ts +21 -0
  84. package/esm/utils/graph-ordering.js +0 -1
  85. package/esm/utils/normalized-name.d.ts +17 -0
  86. package/esm/utils/normalized-name.js +0 -1
  87. package/esm/workspace/component.d.ts +70 -0
  88. package/esm/workspace/component.js +0 -1
  89. package/esm/workspace/helpers/config-loader.d.ts +37 -0
  90. package/esm/workspace/helpers/config-loader.js +4 -5
  91. package/esm/workspace/helpers/create-manifests.d.ts +13 -0
  92. package/esm/workspace/helpers/create-manifests.js +0 -1
  93. package/esm/workspace/helpers/discover-workspace.d.ts +4 -0
  94. package/esm/workspace/helpers/discover-workspace.js +0 -1
  95. package/esm/workspace/helpers/lockfile.d.ts +5 -0
  96. package/esm/workspace/helpers/lockfile.js +0 -1
  97. package/esm/workspace/helpers/logger.d.ts +65 -0
  98. package/esm/workspace/helpers/logger.js +0 -1
  99. package/esm/workspace/helpers/package-npm.d.ts +1 -0
  100. package/esm/workspace/helpers/package-npm.js +0 -1
  101. package/esm/workspace/mod.d.ts +1 -0
  102. package/esm/workspace/mod.js +1 -0
  103. package/esm/workspace/packager.d.ts +5 -0
  104. package/esm/workspace/packager.js +1 -2
  105. package/esm/workspace/packagers/packager-standard.d.ts +7 -0
  106. package/esm/workspace/packagers/packager-standard.js +0 -1
  107. package/esm/workspace/storage.d.ts +59 -0
  108. package/esm/workspace/storage.js +4 -5
  109. package/esm/workspace/workspace.d.ts +161 -0
  110. package/esm/workspace/workspace.js +2 -3
  111. package/package.json +25 -18
  112. package/esm/commands/publish.js +0 -36
  113. package/esm/publish/publish_aws_s3.js +0 -67
@@ -0,0 +1,123 @@
1
+ export var WriteMode;
2
+ (function (WriteMode) {
3
+ WriteMode[WriteMode["Default"] = 0] = "Default";
4
+ WriteMode[WriteMode["Reset"] = 1] = "Reset";
5
+ WriteMode[WriteMode["Temporary"] = 2] = "Temporary";
6
+ })(WriteMode || (WriteMode = {}));
7
+ export class AccountSettings {
8
+ name;
9
+ key = null;
10
+ stores = createSettingStores();
11
+ temporaries = createSettingStores();
12
+ settings = createSettingStores();
13
+ constructor(name) {
14
+ this.name = name;
15
+ this.key = `settings://${this.name}`;
16
+ try {
17
+ const bytes = localStorage.getItem(this.key);
18
+ this.restore(JSON.parse(bytes).stores);
19
+ }
20
+ catch (_) { }
21
+ try {
22
+ window.addEventListener("storage", (evt) => {
23
+ const { key, newValue } = evt;
24
+ if (key === this.key) {
25
+ try {
26
+ this.restore(JSON.parse(newValue).stores);
27
+ }
28
+ catch (_) { }
29
+ }
30
+ });
31
+ }
32
+ catch (e) {
33
+ console.error(e.message);
34
+ }
35
+ }
36
+ get(group, key) {
37
+ let data = this.settings[group][key];
38
+ if (!data) {
39
+ const bytes = this.temporaries[group][key] || this.stores[group][key];
40
+ if (bytes) {
41
+ data = JSON.parse(bytes);
42
+ this.settings[group][key] = data;
43
+ }
44
+ }
45
+ return data;
46
+ }
47
+ set(group, key, descriptor, mode = WriteMode.Default) {
48
+ const data = JSON.stringify(descriptor);
49
+ if (this.write(group, key, data, mode)) {
50
+ this.settings[group][key] = descriptor;
51
+ notifySettingsChange(this, group, key);
52
+ return true;
53
+ }
54
+ return false;
55
+ }
56
+ list(group) {
57
+ if (Object.keys(this.temporaries[group]).length > 0) {
58
+ return Object.keys(Object.assign({}, this.stores[group], this.temporaries[group]));
59
+ }
60
+ else {
61
+ return Object.keys(this.stores[group]);
62
+ }
63
+ }
64
+ read(key) {
65
+ return this.stores[key];
66
+ }
67
+ write(group, key, data, mode) {
68
+ if (mode !== WriteMode.Reset && this.temporaries[group][key] !== undefined) {
69
+ mode = WriteMode.Temporary;
70
+ }
71
+ if (mode === WriteMode.Temporary) {
72
+ if (this.temporaries[group][key] !== data) {
73
+ this.temporaries[group][key] = data;
74
+ this.settings[group][key] = null;
75
+ return true;
76
+ }
77
+ }
78
+ else if (this.stores[group][key] !== data) {
79
+ this.stores[group][key] = data;
80
+ this.settings[group][key] = null;
81
+ if (mode === WriteMode.Default) {
82
+ localStorage.setItem(this.key, JSON.stringify({ stores: this.stores }));
83
+ }
84
+ return true;
85
+ }
86
+ return false;
87
+ }
88
+ restore(stores) {
89
+ for (const group in stores) {
90
+ for (const key in stores[group]) {
91
+ if (this.write(group, key, stores[group][key], WriteMode.Reset)) {
92
+ notifySettingsChange(this, group, key);
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ const Settings_ChangeHandlers = new Set();
99
+ const Settings = new AccountSettings("default");
100
+ export function getSettings() {
101
+ return Settings;
102
+ }
103
+ export function listenSettings(handler) {
104
+ Settings_ChangeHandlers.add(handler);
105
+ return handler;
106
+ }
107
+ export function unlistenSettings(handler) {
108
+ Settings_ChangeHandlers.delete(handler);
109
+ }
110
+ function notifySettingsChange(settings, group, key) {
111
+ if (settings === Settings && settings.settings[group][key] !== undefined) {
112
+ for (const handler of Settings_ChangeHandlers) {
113
+ handler(group, key);
114
+ }
115
+ }
116
+ }
117
+ function createSettingStores() {
118
+ return {
119
+ service_points: {},
120
+ components: {},
121
+ shareds: {},
122
+ };
123
+ }
@@ -0,0 +1,39 @@
1
+ import Fs from "node:fs";
2
+ export declare const PackageRootDir: string;
3
+ export declare const file: {
4
+ exists(path: string): boolean;
5
+ copy: {
6
+ toFile(src: string, dest: string): string;
7
+ toDir(src: string, dest: string): string;
8
+ };
9
+ move: {
10
+ toFile(src: string, dest: string): string;
11
+ toDir(src: string, dest: string): string;
12
+ };
13
+ read: {
14
+ json(path: string): any;
15
+ text(path: string): string;
16
+ };
17
+ write: {
18
+ json(path: string, data: any): void;
19
+ text(path: string, data: string): void;
20
+ };
21
+ find: {
22
+ upperDir(base: string, subpath: string): string;
23
+ };
24
+ remove(path: string): void;
25
+ };
26
+ export declare const directory: {
27
+ exists(path: string): boolean;
28
+ filenames(path: string, recursive?: Boolean): string[];
29
+ copy(src: string, dest: string, filter?: (name: string, path: string, stats: Fs.Stats) => boolean): void;
30
+ make(path: string): void;
31
+ remove(path: string, onlyInner?: boolean): void;
32
+ clean(path: string): void;
33
+ };
34
+ export declare function make_relative_path(baseDir: string, ...path: string[]): string;
35
+ export declare function make_normalized_path(baseDir: string, ...path: string[]): string;
36
+ export declare function make_normalized_dirname(baseDir: string, ...path: string[]): string;
37
+ export declare function make_canonical_path(baseDir: string, ...path: string[]): string;
38
+ /** Resolve a file path with extension probing */
39
+ export declare function resolve_normalized_suffixed_path(baseDir: string, path: string, exts?: string[]): string | null;
package/esm/utils/file.js CHANGED
@@ -1,6 +1,6 @@
1
- import Path from "path";
2
- import Fs from "fs";
3
- import { fileURLToPath } from "url";
1
+ import Path from "node:path";
2
+ import Fs from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
4
  export const PackageRootDir = Path.resolve(fileURLToPath(import.meta.url), "../../..");
5
5
  export const file = {
6
6
  exists(path) {
@@ -212,4 +212,3 @@ export function resolve_normalized_suffixed_path(baseDir, path, exts = FILE_EXTE
212
212
  }
213
213
  return null;
214
214
  }
215
- //# sourceMappingURL=file.js.map
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Topological sort using Tarjan's algorithm.
3
+ * Returns nodes in dependency order (dependencies come first).
4
+ * Throws if a cycle is detected.
5
+ *
6
+ * @param nodes - Array of node identifiers
7
+ * @param edges - Function that returns outgoing edges (dependencies) for a node
8
+ * @returns Nodes in topological order
9
+ */
10
+ export declare function topologicalSort<T>(nodes: Iterable<T>, edges: (node: T) => Iterable<T>): T[];
11
+ /**
12
+ * Get topological order with cycle detection that returns cycle info instead of throwing.
13
+ *
14
+ * @param nodes - Array of node identifiers
15
+ * @param edges - Function that returns outgoing edges for a node
16
+ * @returns Object with ordered nodes and any detected cycles
17
+ */
18
+ export declare function getGraphOrder<T>(nodes: Iterable<T>, edges: (node: T) => Iterable<T>): {
19
+ order: T[];
20
+ cycles: T[][];
21
+ };
@@ -83,4 +83,3 @@ export function getGraphOrder(nodes, edges) {
83
83
  }
84
84
  return { order, cycles };
85
85
  }
86
- //# sourceMappingURL=graph-ordering.js.map
@@ -0,0 +1,17 @@
1
+ export declare enum NameStyle {
2
+ OBJECT = "object",
3
+ WEBC = "webc",
4
+ URN = "urn",
5
+ URL = "url",
6
+ DNS = "dns"
7
+ }
8
+ export type NameStyleConfig = {
9
+ namespace: string;
10
+ key: string;
11
+ };
12
+ export declare const NormalizedNameSeparators: Record<NameStyle, NameStyleConfig>;
13
+ export declare function detectNormalizedNameStyle(name: string): NameStyle;
14
+ export declare function isNormalizedName(name: string, expectedStyle?: NameStyle): boolean;
15
+ export declare function getNormalizedKeys(name: string, fromStyle?: NameStyle): string[];
16
+ export declare function makeNormalizedName(name: string, targetStyle: NameStyle, fromStyle?: NameStyle): string;
17
+ export declare function computeNameHashID(identity: string): string;
@@ -93,4 +93,3 @@ export function computeNameHashID(identity) {
93
93
  hasher.write(identity);
94
94
  return hasher.digest().toString("base64url");
95
95
  }
96
- //# sourceMappingURL=normalized-name.js.map
@@ -0,0 +1,70 @@
1
+ export type JSONSchema = any;
2
+ export type ResourceEntry<ResourceInterface = any> = ResourceLink<ResourceInterface> | {
3
+ type: ResourceLink<ResourceFactory<ResourceInterface>>;
4
+ data?: any;
5
+ };
6
+ export type ResourceFactory<ResourceInterface = any> = (data: any) => Promise<ResourceInterface>;
7
+ export type ResourceLink<ResourceInterface = any> = string;
8
+ export type ComponentID = string;
9
+ export type BundleID = ComponentID;
10
+ export type ComponentSpec = {
11
+ "view"?: {
12
+ properties: Record<string, JSONSchema>;
13
+ };
14
+ "component"?: {
15
+ services: string[];
16
+ attributes: Record<string, JSONSchema>;
17
+ };
18
+ [customSpec: string]: any;
19
+ };
20
+ export type ComponentManifest<Data extends any = unknown> = {
21
+ $id: string;
22
+ type?: string;
23
+ name?: string;
24
+ icon?: string;
25
+ title?: string;
26
+ tags?: string[];
27
+ keywords?: string[];
28
+ description?: string;
29
+ selectors?: string[];
30
+ specs?: Record<string, ComponentSpec>;
31
+ data?: Data;
32
+ resources?: Record<string, ResourceEntry>;
33
+ apis?: Record<string, ResourceEntry>;
34
+ };
35
+ /** Configuration for a distributed package */
36
+ export interface DistributedConfig {
37
+ /** Version specifier (e.g., "*", "^18.0.0") */
38
+ version?: string;
39
+ /** Interop type: 'esm' | 'cjs-default' | 'cjs-named' */
40
+ interop?: 'esm' | 'cjs-default' | 'cjs-named';
41
+ /** List of named exports to re-export (required for cjs-named interop) */
42
+ exports?: string[];
43
+ }
44
+ export type BundleManifest = ComponentManifest<{
45
+ alias?: string;
46
+ package?: string;
47
+ baseline?: string;
48
+ namespaces?: string[];
49
+ dependencies?: string[];
50
+ distribueds?: {
51
+ [packageName: string]: string | DistributedConfig;
52
+ };
53
+ exports?: {
54
+ [id: string]: string;
55
+ };
56
+ components?: ComponentPublication[];
57
+ }>;
58
+ export interface ComponentPublication {
59
+ id: ComponentID;
60
+ ref?: string;
61
+ type?: string;
62
+ title: string;
63
+ icon?: string;
64
+ description?: string;
65
+ services?: string[];
66
+ keywords?: string[];
67
+ tags?: string[];
68
+ }
69
+ export declare function checkComponentManifest(manif: ComponentManifest, path: string): Error;
70
+ export declare function makeComponentPublication(manif: ComponentManifest): ComponentPublication;
@@ -20,4 +20,3 @@ export function makeComponentPublication(manif) {
20
20
  tags: manif.tags,
21
21
  };
22
22
  }
23
- //# sourceMappingURL=component.js.map
@@ -0,0 +1,37 @@
1
+ /** Supported config file extensions in precedence order */
2
+ export declare const config_extensions: readonly [".json", ".yaml", ".yml", ".toml"];
3
+ export type ConfigExtension = typeof config_extensions[number];
4
+ /**
5
+ * Check whether a filename matches a config base name (e.g. "component", "application")
6
+ * in any supported format (json, yaml, yml, toml).
7
+ * Matches exact names like `component.json` and dotted prefixes like `foo.component.yaml`.
8
+ */
9
+ export declare function is_config_filename(fname: string, config_base: string): boolean;
10
+ /**
11
+ * Parse a config string based on its file extension.
12
+ */
13
+ export declare function parseConfigContent(text: string, ext: ConfigExtension): any;
14
+ /**
15
+ * Read and parse a config file. The format is determined by its extension.
16
+ * Returns `undefined` if the file doesn't exist or can't be parsed.
17
+ */
18
+ export declare function readConfigFile<T = any>(path: string): Promise<T | undefined>;
19
+ /**
20
+ * Read and parse a config file synchronously.
21
+ * Returns `undefined` if the file doesn't exist or can't be parsed.
22
+ */
23
+ export declare function readConfigFileSync<T = any>(path: string): T | undefined;
24
+ /**
25
+ * Find config files matching a base name (e.g. "bundle.component") in a directory.
26
+ * Returns all matching paths across supported extensions.
27
+ */
28
+ export declare function findConfigFile(dir: string, baseName: string, fnames?: string[]): string;
29
+ /**
30
+ * Read a singleton config file (exactly one format must exist).
31
+ * Throws if multiple formats are found for the same base name.
32
+ * Returns `undefined` if no matching file exists.
33
+ */
34
+ export declare function readSingletonConfigFile<T = any>(dir: string, baseName: string, fnames?: string[]): Promise<{
35
+ data: T;
36
+ path: string;
37
+ } | undefined>;
@@ -1,8 +1,8 @@
1
- import YAML from 'yaml';
2
- import TOML from 'toml';
3
- import Path from 'node:path';
1
+ import YAML from "yaml";
2
+ import TOML from "toml";
3
+ import Path from "node:path";
4
4
  import Fsp from "node:fs/promises";
5
- import Fs from 'node:fs';
5
+ import Fs from "node:fs";
6
6
  /** Supported config file extensions in precedence order */
7
7
  export const config_extensions = [".json", ".yaml", ".yml", ".toml"];
8
8
  /**
@@ -97,4 +97,3 @@ export async function readSingletonConfigFile(dir, baseName, fnames) {
97
97
  const data = await readConfigFile(path);
98
98
  return data !== undefined ? { data, path } : undefined;
99
99
  }
100
- //# sourceMappingURL=config-loader.js.map
@@ -0,0 +1,13 @@
1
+ import { type BundleManifest } from "../component.ts";
2
+ import type { Bundle, Library, PackageDescriptor } from "../workspace.ts";
3
+ export type ExportEntry = {
4
+ id: string;
5
+ exported?: string;
6
+ basename: string;
7
+ filename: string;
8
+ source: string;
9
+ };
10
+ export type ExportEntries = Record<string, ExportEntry>;
11
+ export declare function create_export_map(lib: Library, bun: Bundle): ExportEntries;
12
+ export declare function create_bundle_manifest(lib: Library, bun: Bundle): BundleManifest;
13
+ export declare function create_package_manifest(lib: Library, bun: Bundle, build_version?: string): PackageDescriptor;
@@ -111,4 +111,3 @@ export function create_package_manifest(lib, bun, build_version) {
111
111
  }
112
112
  return pkg_manif;
113
113
  }
114
- //# sourceMappingURL=create-manifests.js.map
@@ -0,0 +1,4 @@
1
+ import { Library, Workspace } from "../workspace.ts";
2
+ export declare function discover_component(lib: Library, fpath: string): Promise<boolean>;
3
+ export declare function discover_library_definitions(lib: Library, path: string, subdir?: boolean): Promise<void>;
4
+ export declare function discover_workspace(ws: Workspace): Promise<Workspace>;
@@ -276,4 +276,3 @@ export async function discover_workspace(ws) {
276
276
  show_constants(ws);
277
277
  return ws;
278
278
  }
279
- //# sourceMappingURL=discover-workspace.js.map
@@ -0,0 +1,5 @@
1
+ export type LockFileInfo = {
2
+ resolved_versions: Record<string, string>;
3
+ installed_locations: string[];
4
+ };
5
+ export declare function read_lockfile(dir: string): Promise<LockFileInfo | null>;
@@ -105,4 +105,3 @@ function parse_yarn_classic(text, resolved_versions, locations) {
105
105
  }
106
106
  }
107
107
  }
108
- //# sourceMappingURL=lockfile.js.map
@@ -0,0 +1,65 @@
1
+ export interface Message {
2
+ id: string;
3
+ text: string;
4
+ location?: Location | string;
5
+ notes?: Note[];
6
+ /**
7
+ * Optional user-specified data that is passed through unmodified. You can
8
+ * use this to stash the original error, for example.
9
+ */
10
+ detail?: any;
11
+ }
12
+ export interface Note {
13
+ title?: string;
14
+ text: string;
15
+ location?: Location | string;
16
+ }
17
+ export interface Location {
18
+ file: string;
19
+ namespace?: string;
20
+ /** 1-based */
21
+ line?: number;
22
+ /** 0-based, in bytes */
23
+ column?: number;
24
+ /** in bytes */
25
+ length?: number;
26
+ lineText?: string;
27
+ suggestion?: string;
28
+ }
29
+ export type LogKind = "error" | "warn" | "info" | "success" | "debug" | "trace";
30
+ export type LogMode = "normal" | "debug" | "verbose";
31
+ export interface LogEntry {
32
+ kind: LogKind;
33
+ message: Message;
34
+ timestamp: number;
35
+ }
36
+ export declare class Log {
37
+ readonly id: string;
38
+ private entries;
39
+ private logger;
40
+ constructor(id: string, logger: Logger);
41
+ put(kind: LogKind, message: string | Error | Message): void;
42
+ error(message: string | Error | Message): void;
43
+ warn(message: string | Error | Message): void;
44
+ info(message: string | Error | Message): void;
45
+ success(message: string | Error | Message): void;
46
+ debug(message: string | Error | Message): void;
47
+ trace(message: string | Error | Message): void;
48
+ private normalizeMessage;
49
+ getEntries(): readonly LogEntry[];
50
+ clear(): void;
51
+ }
52
+ export declare class Logger {
53
+ private loggers;
54
+ readonly mode: LogMode;
55
+ readonly silentKinds: Set<LogKind>;
56
+ constructor(mode?: LogMode);
57
+ get(id: string): Log;
58
+ has(id: string): boolean;
59
+ remove(id: string): boolean;
60
+ all(): IterableIterator<Log>;
61
+ clear(): void;
62
+ }
63
+ export declare function stringifyLocation(loc: Location | string | null | undefined): string;
64
+ export declare function stringifyLogEntry(loggerId: string, entry: LogEntry): string;
65
+ export declare function stringifyLogEntryPretty(loggerId: string, entry: LogEntry): string;
@@ -145,4 +145,3 @@ export function stringifyLogEntryPretty(loggerId, entry) {
145
145
  }
146
146
  return lines.join("\n");
147
147
  }
148
- //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ export declare function resolvePackageVersion(startDir: string): string | undefined;
@@ -18,4 +18,3 @@ export function resolvePackageVersion(startDir) {
18
18
  }
19
19
  return undefined;
20
20
  }
21
- //# sourceMappingURL=package-npm.js.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Bundle, Library } from "./workspace.ts";
2
+ export interface LibraryPackager {
3
+ discover_library(lib: Library): Promise<Bundle>;
4
+ }
5
+ export declare function LoadLibraryPackager(specifier: string): Promise<LibraryPackager>;
@@ -6,7 +6,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
6
6
  }
7
7
  return path;
8
8
  };
9
- import ChildProcess from "child_process";
9
+ import ChildProcess from "node:child_process";
10
10
  function parseSpecifier(specifier) {
11
11
  let raw = specifier.startsWith("npm:") ? specifier.slice(4) : specifier;
12
12
  let exportName;
@@ -50,4 +50,3 @@ export async function LoadLibraryPackager(specifier) {
50
50
  return resolveExport(mod, exportName);
51
51
  }
52
52
  }
53
- //# sourceMappingURL=packager.js.map
@@ -0,0 +1,7 @@
1
+ import { Bundle, Library } from "../workspace.ts";
2
+ import { type LibraryPackager } from "../packager.ts";
3
+ export declare class DefaultLibraryPackager implements LibraryPackager {
4
+ discover_library(lib: Library): Promise<Bundle>;
5
+ }
6
+ export declare function setup_library_bundle(lib: Library): Bundle;
7
+ export declare function collect_declarations_field(lib: Library, key: string, value: any): any;
@@ -61,4 +61,3 @@ function make_library_bundle_manifest(lib) {
61
61
  }
62
62
  };
63
63
  }
64
- //# sourceMappingURL=packager-standard.js.map
@@ -0,0 +1,59 @@
1
+ export type StorageChanges = {
2
+ added: string[];
3
+ updated: string[];
4
+ changed: boolean;
5
+ };
6
+ export interface IStorageTransaction {
7
+ commitContent(contentData: Uint8Array | string, contentType?: string): string;
8
+ commitFile(key: string, contentData: Uint8Array | string, contentType?: string): any;
9
+ accept(): Promise<StorageChanges>;
10
+ }
11
+ export interface IStorageZone {
12
+ clean(): any;
13
+ edit(scratch?: boolean): IStorageTransaction;
14
+ branch(path: string): IStorageZone;
15
+ getBaseDirFS(): string;
16
+ }
17
+ export declare class SourceEventEmitter {
18
+ clients: any[];
19
+ sendEventsToAll(type: string, data: any): void;
20
+ route(): (req: any, res: any) => void;
21
+ }
22
+ export declare function createContentCID(data: Uint8Array | string): string;
23
+ export declare function createContentKey(contentData: Uint8Array | string, contentType?: string): string;
24
+ export type FileCache = Map<string, string>;
25
+ export declare class StorageTransaction implements IStorageTransaction {
26
+ private baseDir;
27
+ private scratch;
28
+ private root;
29
+ private pending;
30
+ constructor(baseDir: string, scratch: boolean, root: StorageFiles);
31
+ commitContent(contentData: Uint8Array | string, contentType?: string): string;
32
+ commitFile(key: string, contentData: Uint8Array | string, contentType?: string): void;
33
+ accept(): Promise<StorageChanges>;
34
+ }
35
+ export declare class SubStorageFiles implements IStorageZone {
36
+ readonly root: StorageFiles;
37
+ readonly baseDir: string;
38
+ constructor(root: StorageFiles, baseDir: string);
39
+ getBaseDirFS(): string;
40
+ clean(): void;
41
+ edit(scratch?: boolean): IStorageTransaction;
42
+ branch(path: string): IStorageZone;
43
+ }
44
+ export declare class StorageFiles implements IStorageZone {
45
+ name: string;
46
+ readonly baseDir: string;
47
+ cache: FileCache;
48
+ on_changes: SourceEventEmitter;
49
+ constructor(name: string, baseDir: string);
50
+ getBaseDirFS(): string;
51
+ clean(): void;
52
+ edit(scratch?: boolean): IStorageTransaction;
53
+ branch(path: string): IStorageZone;
54
+ route(): (req: any, res: any) => void;
55
+ }
56
+ export declare function copyToStorageStream(storage: IStorageTransaction, key: string, path: string, contentType?: string): void;
57
+ export declare function removeFile(path: string): void;
58
+ export declare function removeDirectory(path: string): void;
59
+ export declare function readJsonFile<T = any>(path: string): Promise<T>;
@@ -1,8 +1,8 @@
1
1
  import Fsp from "node:fs/promises";
2
- import Fs from 'node:fs';
3
- import Crypto from 'node:crypto';
4
- import Path from 'node:path';
5
- import MIME from 'mime';
2
+ import Fs from "node:fs";
3
+ import Crypto from "node:crypto";
4
+ import Path from "node:path";
5
+ import MIME from "mime";
6
6
  import { directory } from "../utils/file.js";
7
7
  export class SourceEventEmitter {
8
8
  clients = [];
@@ -174,4 +174,3 @@ export async function readJsonFile(path) {
174
174
  return undefined;
175
175
  }
176
176
  }
177
- //# sourceMappingURL=storage.js.map