@jointhedots/gear 1.2.0 → 1.2.3

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 (115) hide show
  1. package/esm/builder/build-app-bundle.d.ts +29 -0
  2. package/esm/builder/build-app-bundle.js +9 -6
  3. package/esm/builder/build-app-host.d.ts +28 -0
  4. package/esm/builder/build-app-host.js +20 -19
  5. package/esm/builder/build-application.d.ts +51 -0
  6. package/esm/builder/build-application.js +53 -74
  7. package/esm/builder/build-library.d.ts +21 -0
  8. package/esm/builder/build-library.js +13 -10
  9. package/esm/builder/build-target.d.ts +36 -0
  10. package/esm/builder/build-target.js +20 -12
  11. package/esm/builder/helpers/emit-artifact.d.ts +13 -0
  12. package/esm/builder/helpers/emit-artifact.js +40 -0
  13. package/esm/builder/helpers/emit-bundle-manifest.d.ts +19 -0
  14. package/esm/builder/helpers/emit-bundle-manifest.js +38 -16
  15. package/esm/builder/helpers/emit-components-dts.d.ts +9 -0
  16. package/esm/builder/helpers/emit-components-dts.js +1 -2
  17. package/esm/builder/helpers/emit-esmodules.d.ts +61 -0
  18. package/esm/builder/helpers/emit-esmodules.js +22 -23
  19. package/esm/builder/helpers/emit-package-manifest.d.ts +9 -0
  20. package/esm/builder/helpers/emit-package-manifest.js +1 -2
  21. package/esm/builder/helpers/emit-static-assets.d.ts +14 -0
  22. package/esm/builder/helpers/emit-static-assets.js +1 -2
  23. package/esm/builder/helpers/emit-typescript-definition.d.ts +35 -0
  24. package/esm/builder/helpers/emit-typescript-definition.js +7 -8
  25. package/esm/builder/helpers/path-helpers.d.ts +9 -0
  26. package/esm/builder/helpers/path-helpers.js +0 -1
  27. package/esm/builder/helpers/task.d.ts +8 -0
  28. package/esm/builder/helpers/task.js +0 -1
  29. package/esm/cli.d.ts +2 -0
  30. package/esm/cli.js +1 -4
  31. package/esm/commands/init.d.ts +2 -0
  32. package/esm/commands/init.js +0 -1
  33. package/esm/commands/install.d.ts +5 -0
  34. package/esm/commands/install.js +3 -4
  35. package/esm/commands/make.d.ts +17 -0
  36. package/esm/commands/make.js +12 -5
  37. package/esm/commands/run.d.ts +8 -0
  38. package/esm/commands/run.js +6 -7
  39. package/esm/commands/serve.d.ts +9 -0
  40. package/esm/commands/serve.js +11 -13
  41. package/esm/core/commands/interface.d.ts +26 -0
  42. package/esm/core/commands/interface.js +21 -0
  43. package/esm/core/components/components.d.ts +73 -0
  44. package/esm/core/components/components.js +2 -0
  45. package/esm/core/components/helpers.d.ts +7 -0
  46. package/esm/core/components/helpers.js +68 -0
  47. package/esm/core/components/manifold.d.ts +77 -0
  48. package/esm/core/components/manifold.js +442 -0
  49. package/esm/core/components/mod.d.ts +4 -0
  50. package/esm/core/components/mod.js +4 -0
  51. package/esm/core/components/provider.d.ts +42 -0
  52. package/esm/core/components/provider.js +127 -0
  53. package/esm/core/logging/mod.d.ts +53 -0
  54. package/esm/core/logging/mod.js +142 -0
  55. package/esm/core/logging/trace.d.ts +51 -0
  56. package/esm/core/logging/trace.js +17 -0
  57. package/esm/core/mod-browser.d.ts +1 -0
  58. package/esm/core/mod-browser.js +1 -0
  59. package/esm/core/mod-node.d.ts +1 -0
  60. package/esm/core/mod-node.js +1 -0
  61. package/esm/core/mod.d.ts +5 -0
  62. package/esm/core/mod.js +5 -0
  63. package/esm/core/schema/helpers.d.ts +36 -0
  64. package/esm/core/schema/helpers.js +163 -0
  65. package/esm/core/schema/mod.d.ts +3 -0
  66. package/esm/core/schema/mod.js +3 -0
  67. package/esm/core/schema/schema.d.ts +376 -0
  68. package/esm/core/schema/schema.js +234 -0
  69. package/esm/core/schema/zod.d.ts +44 -0
  70. package/esm/core/schema/zod.js +127 -0
  71. package/esm/core/services/mod.d.ts +5 -0
  72. package/esm/core/services/mod.js +5 -0
  73. package/esm/core/services/service-accessor.d.ts +17 -0
  74. package/esm/core/services/service-accessor.js +20 -0
  75. package/esm/core/services/service-definitions.d.ts +37 -0
  76. package/esm/core/services/service-definitions.js +44 -0
  77. package/esm/core/services/service-points.d.ts +40 -0
  78. package/esm/core/services/service-points.js +164 -0
  79. package/esm/core/services/service-specification.d.ts +52 -0
  80. package/esm/core/services/service-specification.js +59 -0
  81. package/esm/core/services/settings.d.ts +29 -0
  82. package/esm/core/services/settings.js +123 -0
  83. package/esm/utils/file.d.ts +39 -0
  84. package/esm/utils/file.js +3 -4
  85. package/esm/utils/graph-ordering.d.ts +21 -0
  86. package/esm/utils/graph-ordering.js +0 -1
  87. package/esm/utils/normalized-name.d.ts +17 -0
  88. package/esm/utils/normalized-name.js +0 -1
  89. package/esm/workspace/component.d.ts +70 -0
  90. package/esm/workspace/component.js +0 -1
  91. package/esm/workspace/helpers/config-loader.d.ts +37 -0
  92. package/esm/workspace/helpers/config-loader.js +4 -5
  93. package/esm/workspace/helpers/create-manifests.d.ts +13 -0
  94. package/esm/workspace/helpers/create-manifests.js +3 -4
  95. package/esm/workspace/helpers/discover-workspace.d.ts +4 -0
  96. package/esm/workspace/helpers/discover-workspace.js +19 -30
  97. package/esm/workspace/helpers/lockfile.d.ts +5 -0
  98. package/esm/workspace/helpers/lockfile.js +13 -14
  99. package/esm/workspace/helpers/logger.d.ts +65 -0
  100. package/esm/workspace/helpers/logger.js +1 -2
  101. package/esm/workspace/helpers/package-npm.d.ts +1 -0
  102. package/esm/workspace/helpers/package-npm.js +0 -1
  103. package/esm/workspace/mod.d.ts +1 -0
  104. package/esm/workspace/mod.js +1 -0
  105. package/esm/workspace/packager.d.ts +5 -0
  106. package/esm/workspace/packager.js +1 -2
  107. package/esm/workspace/packagers/packager-standard.d.ts +7 -0
  108. package/esm/workspace/packagers/packager-standard.js +3 -4
  109. package/esm/workspace/storage.d.ts +59 -0
  110. package/esm/workspace/storage.js +4 -5
  111. package/esm/workspace/workspace.d.ts +165 -0
  112. package/esm/workspace/workspace.js +27 -16
  113. package/package.json +74 -66
  114. package/esm/commands/publish.js +0 -36
  115. package/esm/publish/publish_aws_s3.js +0 -67
@@ -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
+ readonly logger: Logger;
39
+ private entries;
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;
@@ -1,8 +1,8 @@
1
1
  import Process from "node:process";
2
2
  export class Log {
3
3
  id;
4
- entries = [];
5
4
  logger;
5
+ entries = [];
6
6
  constructor(id, logger) {
7
7
  this.id = id;
8
8
  this.logger = logger;
@@ -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;
@@ -10,7 +10,7 @@ export class DefaultLibraryPackager {
10
10
  setup_library_bundle(lib);
11
11
  // Collect library declaration
12
12
  await discover_library_definitions(lib, lib.path);
13
- return lib.bundle;
13
+ return lib.master;
14
14
  }
15
15
  }
16
16
  export function setup_library_bundle(lib) {
@@ -18,8 +18,8 @@ export function setup_library_bundle(lib) {
18
18
  const manif = make_library_bundle_manifest(lib);
19
19
  let bun = lib.get_bundle(manif.$id);
20
20
  if (!bun) {
21
- bun = new Bundle(manif, lib.path, ws, lib);
22
- lib.bundle = bun;
21
+ bun = new Bundle(manif, lib.path, lib, lib);
22
+ lib.master = bun;
23
23
  lib.shelve.push(bun);
24
24
  lib.log.info(`+ 📦 bundle: ${bun.id} 🐣`);
25
25
  return bun;
@@ -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
@@ -0,0 +1,165 @@
1
+ import { type BundleID, type BundleManifest, type ComponentManifest, type DistributedConfig } from "./component.ts";
2
+ import type { WebAppManifest } from "web-app-manifest";
3
+ import { Logger, Log } from "./helpers/logger.ts";
4
+ import type { PackageDepsInfo } from "./helpers/lockfile.ts";
5
+ export type FileID = string;
6
+ export type ModuleID = string;
7
+ export type ExportID = string;
8
+ export type AssetsEntry = string | {
9
+ from: string;
10
+ to: string;
11
+ };
12
+ export type WebviewEntry = {
13
+ title?: string;
14
+ entry: ModuleID;
15
+ favicon?: string;
16
+ };
17
+ export type ComponentSelection = {
18
+ selectors?: string[];
19
+ };
20
+ export interface AppDescriptorBase<Manifest = never> {
21
+ type: string;
22
+ name: string;
23
+ icon?: string;
24
+ title?: string;
25
+ description?: string;
26
+ webviews?: Record<string, WebviewEntry>;
27
+ modules?: Record<string, ModuleID>;
28
+ assets?: AssetsEntry[];
29
+ components?: ComponentSelection;
30
+ manifest?: Manifest;
31
+ }
32
+ export type ChromeAppManifest = chrome.runtime.ManifestV3;
33
+ export interface ComposableAppDescriptor extends AppDescriptorBase {
34
+ type: "composable";
35
+ }
36
+ export interface ChromeAppDescriptor extends AppDescriptorBase<ChromeAppManifest> {
37
+ type: "chrome";
38
+ }
39
+ export interface WebAppDescriptor extends AppDescriptorBase<WebAppManifest> {
40
+ type: "web";
41
+ }
42
+ export type AppDescriptor = ChromeAppDescriptor | WebAppDescriptor | ComposableAppDescriptor;
43
+ export type AppEntry = {
44
+ descriptor: AppDescriptor;
45
+ library: Library;
46
+ baseDir: string;
47
+ path: string;
48
+ };
49
+ export type DeclarationDescriptor = BundleManifest["data"] & {
50
+ packager?: string;
51
+ selectors?: string[];
52
+ assets?: AssetsEntry[];
53
+ exports?: {
54
+ [path: string]: PackageExport;
55
+ };
56
+ };
57
+ export type PackageExport = string | {
58
+ import?: string;
59
+ require?: string;
60
+ default?: string;
61
+ types?: string;
62
+ };
63
+ export interface PackageDescriptor {
64
+ name: string;
65
+ version: string;
66
+ module?: string;
67
+ description?: string;
68
+ dots?: boolean;
69
+ singleton?: boolean;
70
+ bin?: {
71
+ [commandName: string]: string;
72
+ };
73
+ scripts?: {
74
+ [scriptName: string]: string;
75
+ };
76
+ main?: string;
77
+ types?: string;
78
+ exports?: {
79
+ [path: string]: PackageExport;
80
+ };
81
+ dependencies?: {
82
+ [packageName: string]: string;
83
+ };
84
+ devDependencies?: {
85
+ [packageName: string]: string;
86
+ };
87
+ peerDependencies?: {
88
+ [packageName: string]: string;
89
+ };
90
+ optionalDependencies?: {
91
+ [packageName: string]: string;
92
+ };
93
+ [metadata: string]: any;
94
+ }
95
+ export declare abstract class WorkspaceItem {
96
+ readonly workspace: Workspace;
97
+ readonly log: Log;
98
+ constructor(workspace: Workspace, loggerId: string);
99
+ make_file_id(prefix: string, id: string): string;
100
+ abstract resolve_entry_path(entryId: string, baseDir: string): string;
101
+ }
102
+ export declare class Library extends WorkspaceItem {
103
+ readonly name: string;
104
+ readonly path: FileID;
105
+ readonly descriptor: PackageDescriptor;
106
+ readonly workspace: Workspace;
107
+ master: Bundle;
108
+ declarations: Map<string, DeclarationDescriptor>;
109
+ applications: Map<string, AppDescriptor>;
110
+ externals: Record<string, string>;
111
+ deps: PackageDepsInfo;
112
+ search_directories: FileID[];
113
+ constants: Constants;
114
+ shelve: Bundle[];
115
+ constructor(name: string, path: FileID, descriptor: PackageDescriptor, workspace: Workspace);
116
+ get_id(): string;
117
+ get_bundle(id: string): Bundle;
118
+ resolve_entry_path(entryId: string, baseDir: string): string;
119
+ }
120
+ export declare class Bundle extends WorkspaceItem {
121
+ manifest: BundleManifest;
122
+ readonly path: string;
123
+ readonly library: Library;
124
+ readonly source: Library;
125
+ alias: string;
126
+ components: Map<string, ComponentManifest>;
127
+ distribueds: {
128
+ [packageName: string]: string | DistributedConfig;
129
+ };
130
+ configured: boolean;
131
+ constructor(manifest: BundleManifest, path: string, library: Library, source?: Library);
132
+ get id(): BundleID;
133
+ get dependencies(): string[];
134
+ get exports(): {
135
+ [id: string]: string;
136
+ };
137
+ resolve_export(ref: string): string;
138
+ resolve_entry_path(entryId: string, baseDir: string): string;
139
+ }
140
+ export type Constants = {
141
+ [key: string]: string | number;
142
+ };
143
+ export type OpenWorkspaceOptions = {
144
+ workspace_path: string;
145
+ devmode: boolean;
146
+ ignored_directory?: string;
147
+ };
148
+ export declare class Workspace {
149
+ readonly name: string;
150
+ readonly version: string;
151
+ readonly path: string;
152
+ readonly devmode: boolean;
153
+ readonly debugmode: boolean;
154
+ libraries: Library[];
155
+ constants: Constants;
156
+ ignored_directories: Set<string>;
157
+ readonly logger: Logger;
158
+ readonly log: Log;
159
+ constructor(name: string, version: string, path: string, devmode: boolean, debugmode?: boolean);
160
+ get_bundle(id: string): Bundle;
161
+ get_library(name: string): Library;
162
+ get_application(name: string): AppEntry;
163
+ }
164
+ export declare function open_workspace(options: OpenWorkspaceOptions): Promise<Workspace>;
165
+ export declare function matchComponentSelection(components: ComponentSelection, selectors: string[]): boolean;
@@ -4,7 +4,7 @@ import Process from "node:process";
4
4
  import DotEnv from "dotenv";
5
5
  import { readJsonFile } from "./storage.js";
6
6
  import {} from "./component.js";
7
- import { computeNameHashID, makeNormalizedName, NameStyle } from "../utils/normalized-name.js";
7
+ import { computeNameHashID } from "../utils/normalized-name.js";
8
8
  import { make_normalized_path } from "../utils/file.js";
9
9
  import { Logger, Log } from "./helpers/logger.js";
10
10
  import { discover_workspace } from "./helpers/discover-workspace.js";
@@ -16,6 +16,12 @@ export class WorkspaceItem {
16
16
  this.workspace = workspace;
17
17
  this.log = workspace.logger.get(loggerId);
18
18
  }
19
+ make_file_id(prefix, id) {
20
+ const base = this.workspace.debugmode
21
+ ? id.replace(/[^a-zA-Z0-9]+/g, "_")
22
+ : computeNameHashID(id);
23
+ return base ? prefix + "." + base : prefix;
24
+ }
19
25
  }
20
26
  // Une librairie represente des plans de construction avec un ensemble de code source
21
27
  export class Library extends WorkspaceItem {
@@ -23,11 +29,11 @@ export class Library extends WorkspaceItem {
23
29
  path;
24
30
  descriptor;
25
31
  workspace;
26
- bundle = null;
32
+ master = null;
27
33
  declarations = new Map();
28
34
  applications = new Map();
29
35
  externals = {};
30
- resolved_versions = {};
36
+ deps;
31
37
  search_directories = [];
32
38
  constants = {};
33
39
  shelve = [];
@@ -54,11 +60,6 @@ export class Library extends WorkspaceItem {
54
60
  }
55
61
  return null;
56
62
  }
57
- make_file_id(prefix, id) {
58
- const devmode = true;
59
- const base = devmode ? makeNormalizedName(id, NameStyle.OBJECT) : computeNameHashID(id);
60
- return base ? prefix + "." + base : prefix;
61
- }
62
63
  resolve_entry_path(entryId, baseDir) {
63
64
  const fpath = make_normalized_path(Path.resolve(baseDir, entryId));
64
65
  if (entryId.startsWith("."))
@@ -78,17 +79,17 @@ export class Library extends WorkspaceItem {
78
79
  export class Bundle extends WorkspaceItem {
79
80
  manifest;
80
81
  path;
81
- workspace;
82
+ library;
82
83
  source;
83
84
  alias;
84
85
  components = new Map();
85
86
  distribueds = {};
86
87
  configured = false;
87
- constructor(manifest, path, workspace, source = null) {
88
- super(workspace, `bundle:${manifest.$id}`);
88
+ constructor(manifest, path, library, source = null) {
89
+ super(library.workspace, `bundle:${manifest.$id}`);
89
90
  this.manifest = manifest;
90
91
  this.path = path;
91
- this.workspace = workspace;
92
+ this.library = library;
92
93
  this.source = source;
93
94
  this.configured = (source === null);
94
95
  }
@@ -108,6 +109,15 @@ export class Bundle extends WorkspaceItem {
108
109
  }
109
110
  return this.exports?.[ref];
110
111
  }
112
+ resolve_entry_path(entryId, baseDir) {
113
+ const fpath = make_normalized_path(Path.resolve(baseDir, entryId));
114
+ if (entryId.startsWith("."))
115
+ return fpath;
116
+ if (this.source) {
117
+ return this.source.resolve_entry_path(entryId, baseDir);
118
+ }
119
+ return null;
120
+ }
111
121
  }
112
122
  // Workspace est l'objet a travers lequel on connecte tous les elements
113
123
  export class Workspace {
@@ -115,22 +125,24 @@ export class Workspace {
115
125
  version;
116
126
  path;
117
127
  devmode;
128
+ debugmode;
118
129
  libraries = [];
119
130
  constants = {};
120
131
  ignored_directories = new Set();
121
132
  logger = new Logger();
122
133
  log;
123
- constructor(name, version, path, devmode) {
134
+ constructor(name, version, path, devmode, debugmode = false) {
124
135
  this.name = name;
125
136
  this.version = version;
126
137
  this.path = path;
127
138
  this.devmode = devmode;
139
+ this.debugmode = debugmode;
128
140
  this.log = this.logger.get(`workspace:${name}`);
129
141
  }
130
142
  get_bundle(id) {
131
143
  for (const lib of this.libraries) {
132
- if (lib.bundle.id === id)
133
- return lib.bundle;
144
+ if (lib.master.id === id)
145
+ return lib.master;
134
146
  }
135
147
  for (const lib of this.libraries) {
136
148
  const bun = lib.get_bundle(id);
@@ -225,4 +237,3 @@ export function matchComponentSelection(components, selectors) {
225
237
  return true;
226
238
  }
227
239
  }
228
- //# sourceMappingURL=workspace.js.map
package/package.json CHANGED
@@ -1,67 +1,75 @@
1
- {
2
- "name": "@jointhedots/gear",
3
- "version": "1.2.0",
4
- "type": "module",
5
- "packageManager": "pnpm@10.30.3",
6
- "bin": {
7
- "jointhedots-gear": "esm/cli.js"
8
- },
9
- "exports": {
10
- "./workspace": "./esm/workspace.js"
11
- },
12
- "files": [
13
- "esm",
14
- "browser-modules",
15
- "schemas",
16
- "!**/*.map"
17
- ],
18
- "scripts": {
19
- "watch": "tsc -w",
20
- "build": "tsc",
21
- ":serve": "node --enable-source-maps --watch-path=esm esm/cli serve --app playground:agent --devmode --port 3001 --ws ../jointhedots-core/packages/jointhedots-agent",
22
- ":build:core": "node --enable-source-maps --watch-path=esm esm/cli make --buns jointhedots.core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
23
- ":build:ui": "node --enable-source-maps --watch-path=esm esm/cli make --buns jointhedots.ui --ws ../jointhedots-core/packages/jointhedots-ui",
24
- ":build:cortex": "node --enable-source-maps --watch-path=esm esm/cli make --buns @jointhedots/cortex --devmode --ws ../jointhedots-core/packages/jointhedots-cortex",
25
- ":build:libs": "node --enable-source-maps --watch-path=esm esm/cli make --libs @jointhedots/core,@jointhedots/ui --devmode --ws ../jointhedots-core",
26
- ":build:lib:core": "node --enable-source-maps --watch-path=esm esm/cli make --libs @jointhedots/core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
27
- ":build:lib:ui": "node --enable-source-maps --watch-path=esm esm/cli make --libs @jointhedots/ui --devmode --ws ../jointhedots-core/packages/jointhedots-ui",
28
- ":build:app": "node --enable-source-maps --watch-path=esm esm/cli make --apps playground:ui --ws ../jointhedots-core",
29
- "serve:mono": "node --enable-source-maps --watch-path=esm esm/cli serve --app playground:ui --devmode --port 3002 --ws ../jointhedots-core",
30
- "serve:host": "node --enable-source-maps --watch-path=esm esm/cli serve --app playground:ui:host --devmode --port 3002 --ws ../jointhedots-core",
31
- "serve:sfe": "node --enable-source-maps --watch-path=esm esm/cli serve --app sfe-demo --devmode --ws ../sf-explorer-app",
32
- "serve:demo": "node --enable-source-maps --watch-path=esm esm/cli serve --app sfe-demo --devmode --ws ../sf-explorer-demo",
33
- "make:sfe": "node --enable-source-maps --watch-path=esm esm/cli make --libs @sf-explorer/app --devmode --ws ../sf-explorer-app",
34
- "prepublishOnly": "node scripts/prepublish.mjs"
35
- },
36
- "dependencies": {
37
- "@aws-sdk/client-s3": "^3.968.0",
38
- "@jspm/core": "^2.1.0",
39
- "@tailwindcss/postcss": "~4.1.3",
40
- "@typescript/native-preview": "^7.0.0-dev.20260310.1",
41
- "dotenv": "~17.2.3",
42
- "esbuild": "~0.27.2",
43
- "esbuild-sass-plugin": "~3.6.0",
44
- "express": "~5.2.1",
45
- "mime": "~4.1.0",
46
- "node-watch": "~0.7.4",
47
- "postcss": "~8.5.6",
48
- "sass": "~1.97.2",
49
- "semver": "~7.7.3",
50
- "sharp": "~0.34.5",
51
- "toml": "^3.0.0",
52
- "typescript": "~5.9.3",
53
- "yaml": "^2.8.2",
54
- "yargs": "~18.0.0"
55
- },
56
- "devDependencies": {
57
- "@polycuber/script.cli": "~1.0.5",
58
- "@types/chrome": "~0.1.33",
59
- "@types/node": "~22.7.4",
60
- "@types/semver": "~7.7.1",
61
- "@types/web-app-manifest": "~1.0.9",
62
- "@types/yargs": "~17.0.35"
63
- },
64
- "bundleDependencies": [
65
- "@jspm/core"
66
- ]
1
+ {
2
+ "name": "@jointhedots/gear",
3
+ "version": "1.2.3",
4
+ "type": "module",
5
+ "packageManager": "pnpm@10.30.3",
6
+ "bin": {
7
+ "jointhedots-gear": "esm/cli.js"
8
+ },
9
+ "exports": {
10
+ "./workspace": "./esm/workspace/mod.js",
11
+ "./core": {
12
+ "browser": "./esm/core/mod-browser.js",
13
+ "node": "./esm/core/mod-node.js",
14
+ "deno": "./src/core/mod.ts",
15
+ "default": "./esm/core/mod.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "esm",
20
+ "browser-modules",
21
+ "schemas",
22
+ "!**/*.map"
23
+ ],
24
+ "scripts": {
25
+ "watch": "tsc -w --sourceMap",
26
+ "build": "tsc",
27
+ ":serve": "deno --allow-all --watch=src src/cli.ts serve --app playground:agent --devmode --port 3001 --ws ../jointhedots-core/packages/jointhedots-agent",
28
+ ":build:core": "deno --allow-all --watch=src src/cli.ts make --buns jointhedots.core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
29
+ ":build:ui": "deno --allow-all --watch=src src/cli.ts make --buns jointhedots.ui --ws ../jointhedots-core/packages/jointhedots-ui",
30
+ ":build:cortex": "deno --allow-all --watch=src src/cli.ts make --buns @jointhedots/cortex --devmode --ws ../jointhedots-core/packages/jointhedots-cortex",
31
+ ":build:libs": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/core,@jointhedots/ui --devmode --ws ../jointhedots-core",
32
+ ":build:lib:core": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
33
+ ":build:lib:ui": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/ui --devmode --ws ../jointhedots-core/packages/jointhedots-ui",
34
+ ":build:app": "deno --allow-all --watch=src src/cli.ts make --apps playground:ui --ws ../jointhedots-core",
35
+ "serve:mono": "deno --allow-all --watch=src src/cli.ts serve --app playground:ui --devmode --port 3002 --ws ../jointhedots-core",
36
+ "serve:host": "deno --allow-all --watch=src src/cli.ts serve --app playground:ui:host --devmode --port 3002 --ws ../jointhedots-core",
37
+ "serve:sfe": "deno --allow-all --watch=src src/cli.ts serve --app sfe-webapp --devmode --ws ../sf-explorer-app",
38
+ "serve:demo": "deno --allow-all --watch=src src/cli.ts serve --app sfe-demo --devmode --ws ../sf-explorer-demo",
39
+ "make:sfe": "deno --allow-all --watch=src src/cli.ts make --libs @sf-explorer/app --devmode --ws ../sf-explorer-app",
40
+ "prepublishOnly": "node scripts/prepublish.mjs"
41
+ },
42
+ "dependencies": {
43
+ "@jspm/core": "^2.1.0",
44
+ "@tailwindcss/postcss": "~4.1.3",
45
+ "@typescript/native-preview": "^7.0.0-dev.20260310.1",
46
+ "dotenv": "~17.2.3",
47
+ "esbuild": "~0.27.2",
48
+ "esbuild-sass-plugin": "~3.6.0",
49
+ "express": "~5.2.1",
50
+ "json-schema": "^0.4.0",
51
+ "mime": "~4.1.0",
52
+ "postcss": "~8.5.6",
53
+ "sass": "~1.97.2",
54
+ "semver": "~7.7.3",
55
+ "sharp": "~0.34.5",
56
+ "toml": "^3.0.0",
57
+ "typescript": "~5.9.3",
58
+ "vscode-uri": "^3.1.0",
59
+ "yaml": "^2.8.2",
60
+ "yargs": "~18.0.0",
61
+ "zod": "^4.3.6"
62
+ },
63
+ "devDependencies": {
64
+ "@polycuber/script.cli": "~1.0.5",
65
+ "@types/chrome": "~0.1.33",
66
+ "@types/node": "~22.7.4",
67
+ "@types/semver": "~7.7.1",
68
+ "@types/web-app-manifest": "~1.0.9",
69
+ "@types/yargs": "~17.0.35"
70
+ },
71
+ "bundleDependencies": [
72
+ "@deno/esbuild-plugin",
73
+ "@jspm/core"
74
+ ]
67
75
  }